Skip to content

Commit

Permalink
Adding parameter to configure DB backup retention period
Browse files Browse the repository at this point in the history
  • Loading branch information
andreaswittig committed Jan 31, 2024
1 parent 8cde658 commit c0ae644
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -37,4 +37,4 @@ jobs:
VAPID_PUBLIC_KEY=$(aws ssm get-parameter --name /mastodon/prod/vapid_public_key --with-decryption --query Parameter.Value --output text)
ALERTING_HTTPS_ENDPOINT=$(aws ssm get-parameter --name /mastodon/prod/alerting_https_endpoint --with-decryption --query Parameter.Value --output text)
aws cloudformation package --template-file mastodon.yaml --s3-bucket cloudformation-widdix-mastodon --output-template-file packaged.yml
aws cloudformation deploy --template-file packaged.yml --stack-name cloudonaut-mastodon --capabilities CAPABILITY_IAM --parameter-overrides "DomainName=${DOMAIN_NAME}" "SecretKeyBase=${SECRET_KEY_BASE}" "OtpSecret=${OTP_SECRET}" "VapidPrivateKey=${VAPID_PRIVATE_KEY}" "VapidPublicKey=${VAPID_PUBLIC_KEY}" "AlertingHttpsEndpoint=${ALERTING_HTTPS_ENDPOINT}" "Spot=true" "DatabaseAllocatedStorage=10" "ContainerInsights=disabled"
aws cloudformation deploy --template-file packaged.yml --stack-name cloudonaut-mastodon --capabilities CAPABILITY_IAM --parameter-overrides "DomainName=${DOMAIN_NAME}" "SecretKeyBase=${SECRET_KEY_BASE}" "OtpSecret=${OTP_SECRET}" "VapidPrivateKey=${VAPID_PRIVATE_KEY}" "VapidPublicKey=${VAPID_PUBLIC_KEY}" "AlertingHttpsEndpoint=${ALERTING_HTTPS_ENDPOINT}" "Spot=true" "DatabaseAllocatedStorage=10" "ContainerInsights=disabled DatabaseBackupRetentionPeriod=14"
6 changes: 5 additions & 1 deletion mastodon.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,10 @@ Parameters:
Type: String
Default: enabled
AllowedValues: [enabled, disabled]
DatabaseBackupRetentionPeriod:
Description: 'Number of days to keep automated snapshots'
Type: Number
Default: 30
Resources:
Alerting:
Type: 'AWS::CloudFormation::Stack'
Expand Down Expand Up @@ -134,7 +138,7 @@ Resources:
DBAllocatedStorage: !Ref DatabaseAllocatedStorage
DBInstanceClass: 'db.t4g.micro'
DBName: 'mastodon'
DBBackupRetentionPeriod: '30'
DBBackupRetentionPeriod: !Ref DatabaseBackupRetentionPeriod
DBMasterUsername: 'mastodon'
DBMultiAZ: 'false'
EngineVersion: '14.5'
Expand Down

0 comments on commit c0ae644

Please sign in to comment.