Created
August 24, 2020 09:28
-
-
Save allanchua101/ce8303adae345c3edc3e0fc100e9c1c8 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
AWSTemplateFormatVersion: "2010-09-09" | |
Description: > | |
CloudFormation template used for provisioning SAM artifact storage for environments | |
that require rapid expiration of build artifacts. | |
Parameters: | |
AppName: | |
Type: String | |
Description: "Name of application." | |
AllowedPattern: ".+" | |
Default: "ninja-buckets" | |
Environment: | |
Type: String | |
Description: "Environment code of deployment (dev, uat, prod)" | |
AllowedPattern: ".+" | |
AllowedValues: | |
- "dev" | |
- "uat" | |
- "prod" | |
Resources: | |
SamArtifactStorage: | |
Type: AWS::S3::Bucket | |
Properties: | |
BucketName: !Join ["-", [!Ref AppName, !Ref Environment, "sam-artifacts"]] | |
LifecycleConfiguration: | |
Rules: | |
- Id: DeleteDevArtifactsAfterOneDay | |
Status: "Enabled" | |
ExpirationInDays: 1 | |
BucketEncryption: | |
ServerSideEncryptionConfiguration: | |
- ServerSideEncryptionByDefault: | |
SSEAlgorithm: AES256 | |
Tags: | |
- Key: "ENVIRONMENT" | |
Value: !Ref Environment | |
- Key: "APP" | |
Value: !Ref AppName |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment