我正在尝试将当前位于可用性组或镜像会话中的数据库设置为单用户模式。但我收到以下错误:
The operation cannot be performed on database "DATABASE_NAME" because it is involved in a database mirroring session or an availability group. Some operations are not allowed on a database that is participating in a database mirroring session or in an availability group.ALTER DATABASE statement failed.
Run Code Online (Sandbox Code Playgroud) 是否有任何可能的方法可以更新 AWS Secret Manager 中的键/值,而无需检索当前值然后更新它们?
我找到的当前解决方案首先从机密管理器中检索值:
original_secret = client.get_secret_value(SecretId="my_first_secret")
Run Code Online (Sandbox Code Playgroud)
然后对它们进行更新并运行 update-secret 命令:
updated_secret = original_secret.update({"UPDATE_KEY": "update_value"})
client.update_secret(SecretId="my_secret_name", SecretString=json.dumps(updated_secret))
Run Code Online (Sandbox Code Playgroud)
但我不想检索秘密值。首选语言是 python。
我正在尝试运行 invoke-commandpowershell script in a powershell file在remote computer. 我正在使用credentials for a user with Administrator privilege. 该命令需要由 执行running powershell as an administrator。我尝试使用 powershell 脚本调用的应用程序存在许可问题,因此我无法更改管理员凭据,但需要使用该特定用户本身运行。我尝试-RunAsAdministrator在 Invoke-Command 末尾使用,但出现错误:
Invoke-Command : Parameter set cannot be resolved using the specified named parameters.
$command = {
cd Folder
C:\Folder\build.ps1
}
Invoke-Command -ComputerName $RemoteSystemIP -ScriptBlock $command -credential $Credentials1 -ErrorAction Stop -AsJob
Run Code Online (Sandbox Code Playgroud)
我试图将其作为后台作业执行,这就是我添加参数的原因-AsJob。
已经好几天了,我还没有找到解决方案。
我使用此 cloudformation 模板为 ECS 集群创建容量提供程序,并在 ecs 容量提供程序中指定自动缩放组:
"ECSCapacityProvider": {
"Type": "AWS::ECS::CapacityProvider",
"Properties": {
"AutoScalingGroupProvider": {
"AutoScalingGroupArn": {
"Ref": "AutoScalingGroup"
}
}
},
"DependsOn": "AutoScalingGroup"
},
"DRCluster": {
"Type": "AWS::ECS::Cluster",
"Properties": {
"ClusterName": {
"Ref": "WindowsECSCluster"
},
"CapacityProviders": "ECSCapacityProvider",
"Tags": [
{
"Key": "environment",
"Value": "dr"
}
]
},
"DependsOn": "ECSCapacityProvider"
}
Run Code Online (Sandbox Code Playgroud)
但是在创建堆栈时,它导致了以下错误:
Model validation failed (#/CapacityProviders: expected type: JSONArray, found: String)
Run Code Online (Sandbox Code Playgroud)
我找不到容量提供商的适当文档。我使用它将 Auto Scaling 组附加到集群,我希望这是正确的方法。我是云信息的新手,非常感谢任何帮助。
amazon-web-services amazon-ecs aws-cloudformation autoscaling