[英]Aws secrets manager
我嘗試在 AWS cloudformation 中編寫托管 lambdarotation 屬性,以在每 X 天后輪換我的憑據,但部署失敗並顯示以下錯誤 - “轉換 AWS::SecretsManager-2020-07-23 失敗:PostgreSQLSingleUser 不是受支持的輪換引擎類型。”
在文檔中,它說支持上述旋轉類型。 Hostedlambdarotation 屬性
有沒有人遇到過類似的問題? 我正在使用 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
}
}
}
}
}
也許自您上次嘗試以來它已更新? 我只是在 yaml 中使用了或多或少相同的語法,它剛剛在 CFN 中成功部署。
AuroraSecretRotationSchedule:
Type: AWS::SecretsManager::RotationSchedule
DependsOn:
- SecretAuroraClusterAttachment
- AuroraDBInstance
Properties:
HostedRotationLambda:
RotationType: PostgreSQLSingleUser
RotationLambdaName: "PGMasterSecretRotationLambda"
SecretId: !Ref AuroraMasterSecret
RotationRules:
AutomaticallyAfterDays: 30
有趣的是,如果不是因為你的問題,我永遠不會得到它——我之前指定了 MasterSecretArn 參數,這導致了錯誤。 免責聲明:我尚未測試此 lambda 是否真的有效,只是它部署時沒有錯誤。
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.