Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use Node12 and assign Instance Profile to Beanstalk Env #12

Open
wants to merge 29 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
29 commits
Select commit Hold shift + click to select a range
bb18264
change from stelligent to PauLDuvall
PaulDuvall Jul 17, 2020
8f9ffce
update EB solution to use Node 12
PaulDuvall Jul 17, 2020
5b6e803
no quotes in EB solution
PaulDuvall Jul 17, 2020
aba551c
add InstanceProfile and Role
PaulDuvall Jul 17, 2020
919bfaf
change OptionName to ServiceRole
PaulDuvall Jul 17, 2020
3fb8fb5
remove Rolenane
PaulDuvall Jul 17, 2020
566ebed
Merge branch 'master' into master
PaulDuvall Jul 17, 2020
a88a5c7
delete non-failed stacks
PaulDuvall Jul 17, 2020
ceaef60
add Deletion and Update Policy on S3 bucket
PaulDuvall Jul 17, 2020
a047cd7
update OpsWorks URL in samples README
PaulDuvall Jul 17, 2020
d026f21
update remainder of Launch Stack URLs in samples README
PaulDuvall Jul 17, 2020
005195c
update remainder of Launch Stack URLs in samples README
PaulDuvall Jul 17, 2020
7562c19
provide README instructions for running Beanstalk stack
PaulDuvall Jul 17, 2020
271df90
provide README instructions for running Beanstalk stack
PaulDuvall Jul 17, 2020
5e01a8d
add tmp-doea dir
PaulDuvall Jul 17, 2020
2c90c25
use dir
PaulDuvall Jul 17, 2020
a30ff04
remove devops-essentials from path
PaulDuvall Jul 17, 2020
0543639
change location of zip file for CodeCommit
PaulDuvall Jul 17, 2020
f0f1b6c
create zip from current beanstalk dir
PaulDuvall Jul 17, 2020
e918abc
add PIPELINE_BUCKET env var, latest build image, replace S3 bucket na…
PaulDuvall Aug 21, 2020
820844e
add update-taskcat.sh to replace S3 token
PaulDuvall Aug 21, 2020
2655531
remove -j option
PaulDuvall Aug 21, 2020
b50d696
change to v5.2.0
PaulDuvall Aug 21, 2020
24ce4f1
run ec2 cfn test
PaulDuvall Aug 21, 2020
2ed7a09
change ec2 pipeline param value to String
PaulDuvall Aug 21, 2020
f8d0714
retain S3 bucket
PaulDuvall Aug 21, 2020
59613d1
disable lint
PaulDuvall Sep 7, 2020
e3a8adb
change default branch to main
PaulDuvall Mar 31, 2021
bcb2de7
change default branch to main
PaulDuvall Mar 31, 2021
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
24 changes: 12 additions & 12 deletions .taskcat.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
project:
name: deoa
name: doea
regions:
- us-east-1
tests:
Expand All @@ -8,18 +8,18 @@ tests:
# GitHubToken: '{{resolve:secretsmanager:github/personal-access-token:SecretString}}'
# SiteBucketName: delete-pmd-static-1021
# template: ./samples/static/pipeline.yml
# ec2:
# parameters:
# EmailAddress: fake-email@fake-fake-fake-email.com
# KeyName: paul-duvall-demo-us-east-1
# CodeCommitS3Bucket: deoa-wkshop-abcd
# CodeCommitS3Key: deoa-ec2-examples.zip
# template: ./samples/ec2/pipeline.yml
ec2:
parameters:
EmailAddress: fake-email@fake-fake-fake-email.com
KeyName: '{{resolve:secretsmanager:ec2/keyname:SecretString}}'
CodeCommitS3Bucket: S3_BUCKET_TOKEN
CodeCommitS3Key: doea-ec2-examples.zip
template: ./samples/ec2/pipeline.yml
beanstalk:
parameters:
EmailAddress: fake-email@fake-fake-fake-email.com
S3Bucket: deoa-wkshop-abcd
S3Key: deoa-beanstalk-examples.zip
CodeCommitS3Bucket: deoa-wkshop-abcd
CodeCommitS3Key: deoa-beanstalk-examples.zip
S3Bucket: S3_BUCKET_TOKEN
S3Key: doea-beanstalk-examples.zip
CodeCommitS3Bucket: S3_BUCKET_TOKEN
CodeCommitS3Key: doea-beanstalk-examples.zip
template: ./samples/beanstalk/pipeline.yml
22 changes: 11 additions & 11 deletions buildspec-setup.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,21 +5,21 @@ phases:
python: 3.7
commands:
- python --version
pre_build:
commands:
- >-
ls -las
- chmod +x *.sh
- ./update-taskcat.sh $PIPELINE_BUCKET
build:
commands:
- echo In buildspec-setup.yml Build started on `date`
- >-
aws s3api list-buckets --query 'Buckets[?starts_with(Name,
`deoa-wkshop-abcd`) == `true`].[Name]' --output text | xargs -I {} aws s3 rb s3://{} --force
- 'sleep 10'
- 'aws s3 mb s3://deoa-wkshop-abcd'
- 'aws s3 sync . s3://deoa-wkshop-abcd'
- cd samples/ec2
- zip deoa-ec2-examples.zip *.*
- 'aws s3 sync . s3://deoa-wkshop-abcd'
- cd ../beanstalk
- zip deoa-beanstalk-examples.zip *.*
- 'aws s3 sync . s3://deoa-wkshop-abcd'
zip -r doea-ec2-examples.zip ./samples/ec2 -x '*.git*'
- >-
zip -r doea-beanstalk-examples.zip ./samples/beanstalk -x '*.git*'
- >-
aws s3 sync . s3://$PIPELINE_BUCKET
post_build:
commands:
- echo In buildspec-setup.yml Build completed on `date`
Expand Down
4 changes: 2 additions & 2 deletions buildspec.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,8 @@ phases:
build:
commands:
- echo Build phase started on `date`
# - taskcat test run
- taskcat test run --no-delete
# - taskcat test run --no-delete
- taskcat test run -k --lint-disable
post_build:
commands:
- echo Build completed on `date`
Expand Down
2 changes: 1 addition & 1 deletion html/beanstalk-cloudformation.html
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ <h4 class="bg-info secondary-header">Parameters</h4>
RepositoryBranch:
Description: The name of the branch for the CodeCommit repo
Type: String
Default: master
Default: main
AllowedPattern: "[\\x20-\\x7E]*"
ConstraintDescription: Can contain only ASCII characters.
S3Bucket:
Expand Down
2 changes: 1 addition & 1 deletion html/ec2-cloudformation.html
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ <h4 class="bg-info secondary-header">Parameters</h4>
RepositoryBranch:
Description: The name of the branch for the CodeCommit repo
Type: String
Default: master
Default: main
AllowedPattern: "[\\x20-\\x7E]*"
ConstraintDescription: Can contain only ASCII characters.
TagKey:
Expand Down
2 changes: 1 addition & 1 deletion html/ecs-cloudformation.html
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ <h4 class="bg-info secondary-header">Parameters</h4>
<code class="language-html" data-lang="html"> RepositoryBranch:
Description: The name of the branch for the CodeCommit repo
Type: String
Default: master
Default: main
AllowedPattern: "[\\x20-\\x7E]*"
ConstraintDescription: Can contain only ASCII characters.
EmailAddress:
Expand Down
2 changes: 1 addition & 1 deletion launch-taskcat.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,4 @@
# sudo chmod +x *.sh
# ./launch-taskcat.sh

aws cloudformation create-stack --stack-name taskcat-deoa --capabilities CAPABILITY_NAMED_IAM --disable-rollback --template-body file://pipeline-taskcat.yml
aws cloudformation create-stack --stack-name taskcat-doea --capabilities CAPABILITY_NAMED_IAM --disable-rollback --template-body file://pipeline-taskcat.yml
13 changes: 9 additions & 4 deletions pipeline-taskcat.yml
Original file line number Diff line number Diff line change
Expand Up @@ -144,7 +144,12 @@ Resources:
Environment:
Type: LINUX_CONTAINER
ComputeType: BUILD_GENERAL1_SMALL
Image: "aws/codebuild/amazonlinux2-x86_64-standard:1.0"
Image: "aws/codebuild/amazonlinux2-x86_64-standard:3.0"
EnvironmentVariables:
- Name: PIPELINE_BUCKET
Type: PLAINTEXT
Value:
Fn::Sub: ${PipelineBucket}
Source:
Type: GITHUB
Location: !Sub https://github.com/${GitHubUser}/${GitHubRepo}.git
Expand All @@ -162,7 +167,7 @@ Resources:
Environment:
Type: LINUX_CONTAINER
ComputeType: BUILD_GENERAL1_SMALL
Image: "aws/codebuild/amazonlinux2-x86_64-standard:1.0"
Image: "aws/codebuild/amazonlinux2-x86_64-standard:3.0"
Source:
Type: GITHUB
Location: !Sub https://github.com/${GitHubUser}/${GitHubRepo}.git
Expand All @@ -180,7 +185,7 @@ Resources:
Environment:
Type: LINUX_CONTAINER
ComputeType: BUILD_GENERAL1_SMALL
Image: "aws/codebuild/amazonlinux2-x86_64-standard:1.0"
Image: "aws/codebuild/amazonlinux2-x86_64-standard:3.0"
Source:
Type: CODEPIPELINE
TimeoutInMinutes: 60
Expand All @@ -196,7 +201,7 @@ Resources:
Environment:
Type: LINUX_CONTAINER
ComputeType: BUILD_GENERAL1_SMALL
Image: "aws/codebuild/amazonlinux2-x86_64-standard:1.0"
Image: "aws/codebuild/amazonlinux2-x86_64-standard:3.0"
Source:
Type: CODEPIPELINE
BuildSpec: !Sub |
Expand Down
11 changes: 5 additions & 6 deletions samples/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,12 +8,11 @@ Solution | Launch Template | README
------------ | ------------- | -------------
**Static** | [![Launch Static Website Stack with CloudFormation](https://s3.amazonaws.com/cloudformation-examples/cloudformation-launch-stack.png)](https://us-east-1.console.aws.amazon.com/cloudformation/home?region=us-east-1#/stacks/create/template?stackName=devops-essentials-static&templateURL=https://s3.amazonaws.com/www.devopsessentialsaws.com/samples/static/pipeline.yml) | [README](./static)
**EC2** | [![Launch EC2 Stack with CloudFormation](https://s3.amazonaws.com/cloudformation-examples/cloudformation-launch-stack.png)](https://us-east-1.console.aws.amazon.com/cloudformation/home?region=us-east-1#/stacks/create/template?stackName=devops-essentials-ec2&templateURL=https://s3.amazonaws.com/www.devopsessentialsaws.com/samples/ec2/pipeline.yml) | [README](./ec2)
**OpsWorks** | [![Launch OpsWorks Stack with CloudFormation](https://s3.amazonaws.com/cloudformation-examples/cloudformation-launch-stack.png)](https://console.aws.amazon.com/cloudformation/home?region=us-east-1#cstack=sn%7Edevops-essentials-opsworks%7Cturl%7Ehttps://s3.amazonaws.com/www.devopsessentialsaws.com/samples/opsworks/pipeline.yml) | [README](./opsworks)
**Elastic Beanstalk** | [![Launch Elastic Beanstalk Stack with CloudFormation](https://s3.amazonaws.com/cloudformation-examples/cloudformation-launch-stack.png)](https://console.aws.amazon.com/cloudformation/home?region=us-east-1#cstack=sn%7Edevops-essentials-beanstalk%7Cturl%7Ehttps://s3.amazonaws.com/www.devopsessentialsaws.com/samples/beanstalk/pipeline.yml) | [README](./beanstalk)
**ECS** | [![Launch ECS Stack with CloudFormation](https://s3.amazonaws.com/cloudformation-examples/cloudformation-launch-stack.png)](https://console.aws.amazon.com/cloudformation/home?region=us-east-1#cstack=sn%7Edevops-essentials-ecs%7Cturl%7Ehttps://s3.amazonaws.com/www.devopsessentialsaws.com/samples/ecs/pipeline.yml) | [README](./ecs)
**Serverless** | [![Launch Serverless Stack with CloudFormation](https://s3.amazonaws.com/cloudformation-examples/cloudformation-launch-stack.png)](https://console.aws.amazon.com/cloudformation/home?region=us-east-1#cstack=sn%7Edevops-essentials-serverless%7Cturl%7Ehttps://s3.amazonaws.com/www.devopsessentialsaws.com/samples/serverless/pipeline.yml) | [README](./serverless)
**Alexa** | [![Launch Serverless Stack for Alexa with CloudFormation](https://s3.amazonaws.com/cloudformation-examples/cloudformation-launch-stack.png)](https://console.aws.amazon.com/cloudformation/home?region=us-east-1#cstack=sn%7Edevops-essentials-alexa%7Cturl%7Ehttps://s3.amazonaws.com/www.devopsessentialsaws.com/samples/serverless/alexa/pipeline.yml) | [README](./serverless/alexa)

**OpsWorks** | [![Launch OpsWorks Stack with CloudFormation](https://s3.amazonaws.com/cloudformation-examples/cloudformation-launch-stack.png)](https://us-east-1.console.aws.amazon.com/cloudformation/home?region=us-east-1#/stacks/create/template?stackName=devops-essentials-opsworks&templateURL=https://s3.amazonaws.com/www.devopsessentialsaws.com/samples/opsworks/pipeline.yml) | [README](./opsworks)
**Elastic Beanstalk** | [![Launch Elastic Beanstalk Stack with CloudFormation](https://s3.amazonaws.com/cloudformation-examples/cloudformation-launch-stack.png)](https://us-east-1.console.aws.amazon.com/cloudformation/home?region=us-east-1#/stacks/create/template?stackName=devops-essentials-beanstalk&templateURL=https://s3.amazonaws.com/www.devopsessentialsaws.com/samples/beanstalk/pipeline.yml) | [README](./beanstalk)
**ECS** | [![Launch ECS Stack with CloudFormation](https://s3.amazonaws.com/cloudformation-examples/cloudformation-launch-stack.png)](https://us-east-1.console.aws.amazon.com/cloudformation/home?region=us-east-1#/stacks/create/template?stackName=devops-essentials-ecs&templateURL=https://s3.amazonaws.com/www.devopsessentialsaws.com/samples/ecs/pipeline.yml) | [README](./ecs)
**Serverless** | [![Launch Serverless Stack with CloudFormation](https://s3.amazonaws.com/cloudformation-examples/cloudformation-launch-stack.png)](https://us-east-1.console.aws.amazon.com/cloudformation/home?region=us-east-1#/stacks/create/template?stackName=devops-essentials-serverless&templateURL=https://s3.amazonaws.com/www.devopsessentialsaws.com/samples/serverless/pipeline.yml) | [README](./serverless)
**Alexa** | [![Launch Serverless Stack for Alexa with CloudFormation](https://s3.amazonaws.com/cloudformation-examples/cloudformation-launch-stack.png)](https://us-east-1.console.aws.amazon.com/cloudformation/home?region=us-east-1#/stacks/create/template?stackName=devops-essentials-alexa&templateURL=https://s3.amazonaws.com/www.devopsessentialsaws.com/samples/serverless/alexa/pipeline.yml) | [README](./serverless/alexa)
# Changes

1. Go to [Find a Color](http://htmlcolorcodes.com/)
Expand Down
33 changes: 18 additions & 15 deletions samples/beanstalk/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,32 +4,35 @@ AWS Elastic Beanstalk Examples.
# Overview
This repo is a demonstration of Continuous Delivery of a static website to Elastic Beanstalk via CodePipeline, CodeCommit, CodeBuild, and Elastic Beanstalk. Ensure you've configured the [Prerequisites](https://github.com/stelligent/devops-essentials/wiki/Prerequisites) before launching the stack below.

# Upload html.zip file

1. Download [html.zip](https://github.com/stelligent/devops-essentials/blob/master/samples/beanstalk/html.zip) from GitHub
1. Create a new S3 bucket and make note of the unique bucketname name you created

# Launch Stack

From your [AWS Cloud9](https://github.com/paulduvall/aws-compliance-workshop/wiki/0.2#setup-aws-cloud9) terminal, type the following to setup your directory structure:

```
sudo rm -rf ~/environment/tmp-doea
cd ~/environment
aws s3 mb s3://doea-eb-$(aws sts get-caller-identity --output text --query 'Account')
aws s3 mb s3://doea-eb-sitebucket-$(aws sts get-caller-identity --output text --query 'Account')
git clone https://github.com/PaulDuvall/devops-essentials.git tmp-doea
cd tmp-doea/samples/beanstalk
zip -r doea-eb-samples.zip . -x '*.git*'
aws s3 sync ~/environment/tmp-doea/samples/beanstalk/ s3://doea-eb-$(aws sts get-caller-identity --output text --query 'Account')
aws s3 sync ~/environment/tmp-doea/samples/beanstalk s3://doea-eb-sitebucket-$(aws sts get-caller-identity --output text --query 'Account')
```

## Launch the CloudFormation stack from the CLI

# Configure Solution
From your Cloud9 terminal, type the following:

## Before Launching the Stack
```
aws cloudformation create-stack --stack-name doea-beanstalk --capabilities CAPABILITY_NAMED_IAM --disable-rollback --template-body file:///home/ec2-user/environment/tmp-doea/samples/beanstalk/pipeline.yml --parameters ParameterKey=EmailAddress,ParameterValue=fake-email@fake-fake-fake-email.com ParameterKey=CodeCommitS3Bucket,ParameterValue=doea-eb-$(aws sts get-caller-identity --output text --query 'Account') ParameterKey=CodeCommitS3Key,ParameterValue=doea-eb-samples.zip ParameterKey=S3Bucket,ParameterValue=doea-eb-sitebucket-$(aws sts get-caller-identity --output text --query 'Account')
```

[![Launch CFN stack](https://s3.amazonaws.com/www.devopsessentialsaws.com/img/deploy-to-aws.png)](https://console.aws.amazon.com/cloudformation/home?region=us-east-1#cstack=sn%7Edevops-essentials-beanstalk%7Cturl%7Ehttps://s3.amazonaws.com/www.devopsessentialsaws.com/samples/beanstalk/pipeline.yml)
1. When launching the stack, enter the name of the S3 Bucket you created in the `S3Bucket` CloudFormation parameter

## After Launching the Stack
1. Once the CloudFormation stack is successful, select the checkbox next to the stack and click the **Outputs** tab.
1. From Outputs, click on the **PipelineUrl** output. The Source action will be in a failed state.
1. From the CodePipeline Source action, click on the CodeCommit provider and copy the **git clone** statement provided by CodeCommit
1. Paste the command in your Terminal
1. From [this](../beanstalk) folder, copy all of its *contents* to your locally cloned Git repo
1. From your Terminal, type `git add .`
1. From your Terminal, type `git commit -am "add new files"`
1. From your Terminal, type `git push`
1. Go back to your pipeline in CodePipeline and see the changes flow through the pipeline
1. Once the pipeline is complete, go to your CloudFormation Outputs and click on the **SiteUrl** Output

# Resources
Expand Down
36 changes: 32 additions & 4 deletions samples/beanstalk/pipeline.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ Parameters:
RepositoryBranch:
Description: The name of the branch for the CodeCommit repo
Type: String
Default: master
Default: main
AllowedPattern: "[\\x20-\\x7E]*"
ConstraintDescription: Can contain only ASCII characters.
CodeCommitS3Bucket:
Expand All @@ -26,15 +26,15 @@ Parameters:
AllowedPattern: "[\\x20-\\x7E]*"
ConstraintDescription: Can contain only ASCII characters.
S3Key:
Description: S3 Bucket that hosts the application code
Description: Zip file that contains application code
Type: String
Default: html.zip
AllowedPattern: "[\\x20-\\x7E]*"
ConstraintDescription: Can contain only ASCII characters.
MySolutionStackName:
Description: Name of the current solution stack name. See https://docs.aws.amazon.com/elasticbeanstalk/latest/dg/concepts.platforms.html
Type: String
Default: "64bit Amazon Linux 2018.03 v4.14.1 running Node.js"
Default: 64bit Amazon Linux 2 v5.2.0 running Node.js 12
ConstraintDescription: Can contain only ASCII characters.
Metadata:
AWS::CloudFormation::Interface:
Expand Down Expand Up @@ -122,6 +122,33 @@ Resources:
Ref: nodeConfigurationTemplate
VersionLabel:
Ref: nodeApplicationVersion
OptionSettings:
- Namespace: 'aws:autoscaling:launchconfiguration'
OptionName: IamInstanceProfile
Value: !Ref InstanceProfile
- Namespace: 'aws:elasticbeanstalk:environment'
OptionName: ServiceRole
Value: !Ref InstanceProfileRole
InstanceProfileRole:
Type: AWS::IAM::Role
Properties:
AssumeRolePolicyDocument:
Version: "2012-10-17"
Statement:
-
Effect: "Allow"
Principal:
Service:
- "ec2.amazonaws.com"
Action:
- "sts:AssumeRole"
ManagedPolicyArns:
- "arn:aws:iam::aws:policy/AWSElasticBeanstalkWorkerTier"
InstanceProfile:
Type: "AWS::IAM::InstanceProfile"
Properties:
Roles:
- !Ref 'InstanceProfileRole'
CodePipelineRole:
Type: AWS::IAM::Role
Properties:
Expand Down Expand Up @@ -189,7 +216,8 @@ Resources:
Version: '2012-10-17'
ArtifactBucket:
Type: AWS::S3::Bucket
DeletionPolicy: Delete
DeletionPolicy: Retain
UpdateReplacePolicy: Retain
CodePipelineStack:
Type: AWS::CodePipeline::Pipeline
DependsOn:
Expand Down
2 changes: 1 addition & 1 deletion samples/beanstalk/public/beanstalk-cloudformation.html
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ <h4 class="bg-info secondary-header">Parameters</h4>
RepositoryBranch:
Description: The name of the branch for the CodeCommit repo
Type: String
Default: master
Default: main
AllowedPattern: "[\\x20-\\x7E]*"
ConstraintDescription: Can contain only ASCII characters.
S3Bucket:
Expand Down
2 changes: 1 addition & 1 deletion samples/beanstalk/public/ec2-cloudformation.html
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ <h4 class="bg-info secondary-header">Parameters</h4>
"RepositoryBranch":{
"Description":"The name of the branch for the CodeCommit repo",
"Type":"String",
"Default":"master",
"Default":"main",
"AllowedPattern":"[\\x20-\\x7E]*",
"ConstraintDescription":"Can contain only ASCII characters."
},
Expand Down
2 changes: 1 addition & 1 deletion samples/ec2/html/beanstalk-cloudformation.html
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ <h4 class="bg-info secondary-header">Parameters</h4>
RepositoryBranch:
Description: The name of the branch for the CodeCommit repo
Type: String
Default: master
Default: main
AllowedPattern: "[\\x20-\\x7E]*"
ConstraintDescription: Can contain only ASCII characters.
S3Bucket:
Expand Down
2 changes: 1 addition & 1 deletion samples/ec2/html/ecs-cloudformation.html
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ <h4 class="bg-info secondary-header">Parameters</h4>
"RepositoryBranch":{
"Description":"The name of the branch for the CodeCommit repo",
"Type":"String",
"Default":"master",
"Default":"main",
"AllowedPattern":"[\\x20-\\x7E]*",
"ConstraintDescription":"Can contain only ASCII characters."
},
Expand Down
2 changes: 1 addition & 1 deletion samples/ec2/html/opsworks-cloudformation.html
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ <h4 class="bg-info secondary-header">Parameters</h4>
"RepositoryBranch":{
"Description":"The name of the branch for the CodeCommit repo",
"Type":"String",
"Default":"master",
"Default":"main",
"AllowedPattern":"[\\x20-\\x7E]*",
"ConstraintDescription":"Can contain only ASCII characters."
}
Expand Down
2 changes: 1 addition & 1 deletion samples/ec2/html/serverless-cloudformation.html
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ <h4 class="bg-info secondary-header">Parameters</h4>
"RepositoryBranch":{
"Description":"The name of the branch for the CodeCommit repo",
"Type":"String",
"Default":"master",
"Default":"main",
"AllowedPattern":"[\\x20-\\x7E]*",
"ConstraintDescription":"Can contain only ASCII characters."
},
Expand Down
7 changes: 4 additions & 3 deletions samples/ec2/pipeline.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ Parameters:
RepositoryBranch:
Description: The name of the branch for the CodeCommit repo
Type: String
Default: master
Default: main
AllowedPattern: "[\\x20-\\x7E]*"
ConstraintDescription: Can contain only ASCII characters.
TagKey:
Expand All @@ -27,7 +27,7 @@ Parameters:
KeyName:
Description: Name of an existing Amazon EC2 key pair to enable SSH access to the
instances.
Type: AWS::EC2::KeyPair::KeyName
Type: String
CodeCommitS3Bucket:
Description: S3 bucket that holds zip of source code for CodeCommit Repo
Type: String
Expand Down Expand Up @@ -85,7 +85,8 @@ Resources:
pipeline: "$.detail.pipeline"
ArtifactBucket:
Type: AWS::S3::Bucket
DeletionPolicy: Delete
DeletionPolicy: Retain
UpdateReplacePolicy: Retain
CodeBuildRole:
Type: AWS::IAM::Role
Properties:
Expand Down
2 changes: 1 addition & 1 deletion samples/ecs/pipeline.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ Parameters:
RepositoryBranch:
Description: The name of the branch for the CodeCommit repo
Type: String
Default: master
Default: main
AllowedPattern: "[\\x20-\\x7E]*"
ConstraintDescription: Can contain only ASCII characters.
EmailAddress:
Expand Down
2 changes: 1 addition & 1 deletion samples/ecs/templates/deployment-pipeline.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ Parameters:
RepositoryBranch:
Description: The name of the branch for the CodeCommit repo
Type: String
Default: master
Default: main
AllowedPattern: "[\\x20-\\x7E]*"
ConstraintDescription: Can contain only ASCII characters.
EmailAddress:
Expand Down