繁体   English   中英

Aws 机密管理器

[英]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.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM