Run Script (IaC)

Trigger CloudFormation Template

Trigger the CloudFormation Template by running bin/deploy script:

bin/deploy

Here are the inputs required to launch CloudFormation templates:

  • S3 Bucket: Enter S3 Bucket for storing your CloudFormation templates and scripts. This bucket must be in the same region where you wish to launch all the AWS resources created by this example.
  • CloudFormation Stack Name: Enter CloudFormation Stack Name to create stacks
  • GitHubUser: Enter your GitHub Username
  • GitHubToken: Enter your GitHub Token for authentication (https://github.com/settings/tokens)

Sit back and observe the progress of the CloudFormation execution until all the resources are created for you. Note that there will be multiple CloudFormation stacks that will be run. In the CloudFormation dashboard, ensure that the Deployment Pipeline CloudFormation is created.

Once the Deployment Pipeline is created, it will be executed and during the Deployment Stage, the ECS and Loadbalancer are created with a different set of CloudFormation stack. This is indicated in the figure below.

Note: Code-change will be seen flowing through the CodePipeline and will be blocked at the approval stage. Please approve the stage for the commit to go thru’ across both the blue and green services until all the stages are marked green.

codepipeline

After the above CloudFormation execution is completed, you can collect the DNS URL of Load Balancer using either ways:
(a) Check the LoadBalancer CloudFormation template output and select the ServiceUrl
OR
(b) Go to EC2 Dashboard -> Select LoadBalancer from left -> Go to the Load Balancer Description tab and access the URL to see the ECS Sample App as shown below:

ELB DNS URL

The output should show as the below:

ELB URL