【发布时间】:2020-11-25 17:50:03
【问题描述】:
我尝试在 AWS cloudformation 中编写托管 lambdarotation 属性,以在每 X 天后轮换我的凭据,但部署失败并显示以下错误 - “转换 AWS::SecretsManager-2020-07-23 失败:PostgreSQLSingleUser 不是受支持的轮换引擎类型。”
在文档中它说支持上述旋转类型。 Hostedlambdarotation property
有人遇到过类似的问题吗?我正在使用 postgresql,因此想使用上述轮换策略。
任何帮助将不胜感激!
编辑:示例代码
{
"Transform": "AWS::SecretsManager-2020-07-23",
"Resources": {
"Test": {
"Type": "AWS::SecretsManager::Secret",
"Properties": {
"Name": "Test",
"Description": "Secrets for db connectivity",
"SecretString": "{\"username\":\"test\",\"password\":\"test\",\"engine\":\"postgres\",\"host\":\"test.rds.amazonaws.com\",\"port\":\"5432\",\"dbname\":\"test\"}"
}
},
"TestAttachment": {
"Type": "AWS::SecretsManager::SecretTargetAttachment",
"Properties": {
"SecretId": {
"Ref": "Test"
},
"TargetId": "arn:aws:rds:test",
"TargetType": "AWS::RDS::DBInstance"
}
},
"TestSecretRotationSchedule": {
"Type": "AWS::SecretsManager::RotationSchedule",
"Properties": {
"SecretId": {
"Ref": "Test"
},
"HostedRotationLambda": {
"RotationType": "PostgreSQLSingleUser",
"RotationLambdaName": "SecretsManagerRotation",
"VpcSecurityGroupIds": "sg-testid",
"VpcSubnetIds": {
"Fn::Join": [
",",
[
"subnet-test01",
"subnet-test02"
]
]
}
},
"RotationRules": {
"AutomaticallyAfterDays": 45
}
}
}
}
}
【问题讨论】:
-
嗨!请您显示模板的相关部分吗?
-
好的,可以理解。你能分享一些伪代码吗?例如。看起来您正在使用自定义转换,因此最好了解其中的一些细节,以及模板如何挂在一起 - 否则很难知道可能出了什么问题。
-
@PMah 添加了示例代码!
-
我想如果我是你,我会向 AWS 提出这个问题,如果你有他们的支持包的话。在我看来一切都是正确的......
-
@Shweta 您在哪个地区发布此模板?
标签: amazon-web-services aws-lambda amazon-cloudformation amazon-rds aws-secrets-manager