diff --git a/copilot/todo-app/addons/db.yml b/copilot/todo-app/addons/db.yml index 7460bba..72acd39 100644 --- a/copilot/todo-app/addons/db.yml +++ b/copilot/todo-app/addons/db.yml @@ -248,27 +248,3 @@ Outputs: PostgresData: # injected as POSTGRES_DATA environment variable by Copilot. Description: "The JSON secret that holds the database username and password. Fields are 'host', 'dbname', 'username', 'password'" Value: !Ref AuroraSecret - - AuroraDBCluster: - Description: "Cluster Reference for Credential Rotation" - Value: !Ref AuroraDBCluster - Export: - Name: AuroraDBCluster - - RotationSecurityGroup: - Description: "The Credential Rotation Security Group" - Value: !Ref RotationSecurityGroup - Export: - Name: RotationSecurityGroup - - SecretAuroraClusterAttachment: - Description: "The Credential Attachment to the Cluster" - Value: !Ref SecretAuroraClusterAttachment - Export: - Name: SecretAuroraClusterAttachment - - AuroraSecret: - Description: "The secret credential to pass to rotation stack" - Value: !Ref AuroraSecret - Export: - Name: AuroraSecret diff --git a/rotation.yml b/rotation.yml index 641a0d8..ed5d99c 100644 --- a/rotation.yml +++ b/rotation.yml @@ -2,7 +2,7 @@ AWSTemplateFormatVersion: 2010-09-09 Transform: - "AWS::Serverless-2016-10-31" - + Parameters: App: Type: String @@ -16,37 +16,37 @@ Parameters: Resources: SecretRotationTemplate: - Type: AWS::Serverless::Application - Properties: - Location: - ApplicationId: arn:aws:serverlessrepo:us-east-1:297356227824:applications/SecretsManagerRDSPostgreSQLRotationSingleUser - SemanticVersion: 1.1.60 - Parameters: - endpoint: !Sub https://secretsmanager.${AWS::Region}.amazonaws.com - functionName: !Sub ${AWS::StackName}-func - vpcSecurityGroupIds: !ImportValue RotationSecurityGroup - vpcSubnetIds: - Fn::Join: - - "," - - - !Select [ - 0, - !Split [ - ",", - { "Fn::ImportValue": !Sub "${App}-${Env}-PrivateSubnets" }, - ], - ] - - !Select [ - 1, - !Split [ - ",", - { "Fn::ImportValue": !Sub "${App}-${Env}-PrivateSubnets" }, - ], - ] - + Type: AWS::Serverless::Application + Properties: + Location: + ApplicationId: arn:aws:serverlessrepo:us-east-1:297356227824:applications/SecretsManagerRDSPostgreSQLRotationSingleUser + SemanticVersion: 1.1.60 + Parameters: + endpoint: !Sub https://secretsmanager.${AWS::Region}.amazonaws.com + functionName: !Sub ${AWS::StackName}-func + vpcSecurityGroupIds: !Ref RotationSecurityGroup + vpcSubnetIds: + Fn::Join: + - "," + - - !Select [ + 0, + !Split [ + ",", + { "Fn::ImportValue": !Sub "${App}-${Env}-PrivateSubnets" }, + ], + ] + - !Select [ + 1, + !Split [ + ",", + { "Fn::ImportValue": !Sub "${App}-${Env}-PrivateSubnets" }, + ], + ] + SecretRotationSchedule: - Type: AWS::SecretsManager::RotationSchedule - Properties: - SecretId: !ImportValue AuroraSecret - RotationLambdaARN: !GetAtt SecretRotationTemplate.Outputs.RotationLambdaARN - RotationRules: - AutomaticallyAfterDays: 30 \ No newline at end of file + Type: AWS::SecretsManager::RotationSchedule + Properties: + SecretId: !Ref AuroraSecret + RotationLambdaARN: !GetAtt SecretRotationTemplate.Outputs.RotationLambdaARN + RotationRules: + AutomaticallyAfterDays: 30