amazon-web-services - AWS secret 管理器

我尝试在 AWS cloudformation 中编写 Hostedlambdarotation 属性,以便每 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
        }
      }
    }
  }
}

最佳答案

也许自您上次尝试以来它已更新?我只是在 yaml 中使用了或多或少相同的语法,并且它刚刚在 CFN 中成功部署。

    AuroraSecretRotationSchedule:
      Type: AWS::SecretsManager::RotationSchedule
      DependsOn:
        - SecretAuroraClusterAttachment
        - AuroraDBInstance
      Properties:
        HostedRotationLambda:
          RotationType: PostgreSQLSingleUser
          RotationLambdaName: "PGMasterSecretRotationLambda"
        SecretId: !Ref AuroraMasterSecret
        RotationRules:
          AutomaticallyAfterDays: 30

有趣的是,如果不是你的问题,我永远不会得到它——我之前指定了 MasterSecretArn 参数,这导致了错误。免责声明:我还没有测试这个 lambda 是否真的有效,只是它部署时没有错误。

关于amazon-web-services - AWS secret 管理器,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/63267097/

相关文章:

postgresql - Postgres JSONB 检索非常慢

python-3.x - XGboost 目标 : Is there a way to do Mul

java - 数组是复合数据类型,但是如何呢?

java - Springboots 允许保存重复文件

reactjs - 我需要将浏览器路由器一分为二

reactjs - 确定派发返回值的类型

php - 文件上传按钮在翻转卡上不起作用

docker - SMTP 未配置,请检查您的 grafana.ini 配置文件的 [smtp] 部

css - Angular ngx-bootstrap - 如何制作一个又大又宽的模态

postgresql - 使用 Aurora postgres serverless 在 AWS R