【发布时间】:2019-12-14 23:05:04
【问题描述】:
AWS 为 some supported RDS engines 提供完全配置且随时可用的轮换支持,包括 Amazon Aurora(也是无服务器?)
我正在尝试使用AWS::SecretsManager::RotationSchedule 在我的 CloudFormation 模板中设置密码轮换(请注意,这不是一个功能齐全的模板,只是一个说明):
DBCluster:
Type: AWS::RDS::DBCluster
Properties:
Engine : aurora
EngineMode : serverless
EngineVersion : 5.6.10a
Secret:
Type: AWS::SecretsManager::Secret
Properties:
GenerateSecretString:
SecretStringTemplate: '{"username": "admin"}'
GenerateStringKey: password
PasswordLength: 20
ExcludeCharacters: '"@/\'
SecretTargetAttachment:
Type: AWS::SecretsManager::SecretTargetAttachment
Properties:
SecretId: !Ref Secret
TargetId: !Ref DBCluster
TargetType: AWS::RDS::DBCluster
SecretRotation:
Type: AWS::SecretsManager::RotationSchedule
Properties:
SecretId: !Ref UserAdminSecret
RotationLambdaARN: <ARN_GET_FROM_SERVERLESS_APPLICATION_REPOSITORY>
RotationRules:
AutomaticallyAfterDays: 1
但 AWS Lambda 轮换函数失败并显示以下消息:
"数据库引擎必须设置为 'mysql' 才能使用此轮换 lambda": KeyError
AWS 提供的 AWS Lambda 轮换功能似乎不支持 Aurora Serverless。
有没有使用existing Lambda rotation templates 设置 Aurora Serverless 密钥轮换的简单方法?
有任何示例可用于为 Aurora Serverless 编写我自己的轮换函数吗?
PS:这个问题和Creating an Aurora Serverless Cluster from cloudformation?有点关系
【问题讨论】:
标签: amazon-web-services amazon-cloudformation amazon-rds aws-secrets-manager aws-aurora-serverless