diff --git a/3-1-CodeStar-EC2.md b/3-1-CodeStar-EC2.md index 4b5a0ed..fca0f75 100644 --- a/3-1-CodeStar-EC2.md +++ b/3-1-CodeStar-EC2.md @@ -79,8 +79,8 @@ Also you will need a **Text editor** such as [Sublime](www.sublimetext.com/3) or | 214953911892 | vpc-c53a98a2 | subnet-f74bd3be | subnet-6ec3ac09 | ![Edit EC2 Options](/images/3-1-ec2-static-site/5_editec2options.png) -3.9.2. On the *Review project details* page, observe the AWS tools that will be utilisied and connected by CodeStar. In this case, you should see that: -* CodeCommit is being for Source Control Management +3.9.2. On the *Review project details* page, observe the AWS tools that will be utilised and connected by CodeStar. In this case, you should see that: +* CodeCommit is being used for Source Control Management * CodeDeploy is being used for Application Deployment, and * CloudWatch is being used for Monitoring @@ -115,8 +115,18 @@ Also you will need a **Text editor** such as [Sublime](www.sublimetext.com/3) or 4.1. Open your web browser and paste in the following URL, https://s3-ap-southeast-2.amazonaws.com/devopsgirls1/index.html 4.2. Click on the new tab, then right click anywhere on the webpage and select *Save as...* 4.3. Change the filename to be index.html and save it in the webpage directory of your cloned git project repository on your workstation. For example, sallytran/webpage/index.html -![Save index.html file](/images/3-1-ec2-static-site/11_saveindex.png) - +![Save index.html file](/images/3-1-ec2-static-site/11_saveindex.png) +4.4 In a similar manner, save https://s3-ap-southeast-2.amazonaws.com/devopsgirls1/DevOpsGirls.png and https://s3-ap-southeast-2.amazonaws.com/devopsgirls1/Thumbs-Up.svg. Make sure you don't change their names. +4.5 Create an `index_files` subdirectory and move DevOpsGirls.png and Thumbs-Up.svg into it. `index_files` should be at the same level as `index.html`, i.e. you should end up with this file structure: +``` + └── webpage + ├── index.html + ├── index_files + │   ├── DevOpsGirls.png + │   └── Thumbs-Up.svg + ├── (other things...) +``` + ### 5. Push changes to CodeCommit Repo 5.1. In your command terminal, navigate to the home (root) directory of your CodeCommit repository on your workstation. For example: `cd C:\sallytran` diff --git a/3-2-docker-ecs-static-site.md b/3-2-docker-ecs-static-site.md index 37020a2..0f3922c 100644 --- a/3-2-docker-ecs-static-site.md +++ b/3-2-docker-ecs-static-site.md @@ -4,9 +4,9 @@ ● Learn about Containers technologies and understand their appeal to developers and how to deploy, host and scale containers using AWS tools. -● Use Cloudformation to create the prerequisite resources required by ECS . This includes -creating a Cluster , a Service , Tasks (using Cloudformation) -● This module will go over creating a Docker container (using resources from S3 ), +● Use Cloudformation to create the prerequisite resources required by ECS. This includes +creating a Cluster, a Service, and Tasks (using Cloudformation) +● This module will go over creating a Docker container (using resources from S3), uploading it to a Registry. ● Modify the pipeline created above to also deploy the site to the ECR cluster. ● Recognize the convenience and power of containers & appreciate the benefits of using @@ -19,19 +19,19 @@ this approach. ## 2.- Deploy a static website using a Docker container on AWS ECS -In this module you will deploy a static website using a [Docker container](https://www.docker.com/what-container) on Amazon Elastic Container Service ([Amazon ECS](https://aws.amazon.com/ecs/)). The main aim of this configuration is that you can use it to run Docker applications on a scalable cluster that allows you, for instance, to run the applications easily by eliminating the need for you to install, operate, and scale your own cluster management infrastructure or to scale your containers up or down to meet your application's capacity requirement. +In this module you will deploy a static website using a [Docker container](https://www.docker.com/what-container) on Amazon Elastic Container Service ([Amazon ECS](https://aws.amazon.com/ecs/)). The main advantage of this method is that you can use it to run Docker applications on a scalable cluster that allows you, for instance, to run the applications easily by eliminating the need for you to install, operate, and scale your own cluster management infrastructure or to scale your containers up or down to meet your application's capacity requirement. If you are imagining how it could be, it should look like this: ![ECS_Docker_Container_Diagram](https://github.com/DevOps-Girls/devopsgirls-bootcamp3/blob/master/images/3-2-docker-ecs-static-site/ECS_Docker_Container.png?raw=true) -### 2.1 Introduction to the Dockerfile definiton +### 2.1 Introduction to the Dockerfile definition Docker can build images automatically by reading the instructions from a Dockerfile. A Dockerfile is a text document that contains all the commands a user could call on the command line to assemble an image. Using **docker build** users can create an automated build that executes several command-line instructions in succession. *For further information about Dockerfile please visit [this link](https://docs.docker.com/engine/reference/builder/). -2.1.1 In this exercise you will use a *Dockerfile* that it has already the necessaries steps that the container definition needs and also is ready to be use it in the [CloudFormation](https://aws.amazon.com/cloudformation/) template that will create all the infrastructure for you, as the container definition, the task definition, the service and the cluster configuration. +2.1.1 In this exercise you will use a *Dockerfile* that already has the required steps for our container definition and also is ready to be used in the [CloudFormation](https://aws.amazon.com/cloudformation/) template that will create all the infrastructure for you, such as the container definition, the task definition, the service and the cluster configuration. The *Dockerfile* for this exercise looks like this: @@ -43,30 +43,30 @@ COPY ./index.html /usr/local/apache2/htdocs/index.html ### 2.2 Creating the Elastic Container Service (ECS) using a Cloudformation template -As we mention in the previous step, you will create the whole infrastructure using the AWS Cloudformation service which allows you to use a simple text file to model and provision, in an automated and secure manner, all the resources needed for your applications. -Also, in the template is included a docker container definition that contain a web server to include an HTML static web page. This web page is going to be the first check point of the exercise, since after that in the next part you will configure a **Codepipeline** to deploy a new release of the web page. +As we mentioned in the previous step, you will create the whole infrastructure using the AWS Cloudformation service which allows you to use a simple text file to model and provision, in an automated and secure manner, all the resources needed for your applications. +Also, in the template is included a docker container definition that contain a web server to include an HTML static web page. This web page is going to be the first check point of the exercise, since in the next part you will configure a **Codepipeline** to deploy a new release of the web page. -2.2.0 Right click on the the following [link](https://raw.githubusercontent.com/DevOps-Girls/devopsgirls-bootcamp3/master/templates/module2-ecs-static-site.yaml) and save the *module2-ecs-static-site.yaml* in your local machine / computer / laptop. +2.2.0 Right click on the the following [link](https://raw.githubusercontent.com/DevOps-Girls/devopsgirls-bootcamp3/master/templates/module2-ecs-static-site.yaml) and save the *module2-ecs-static-site.yaml* on your local machine / computer / laptop. -2.2.1 Login with your credential to the AWS account, you have to do the same steps of the Module 1: +2.2.1 Login with your credential to the AWS account, you have to do the same steps as in Module 1: 2.2.1.1 Open a web browser and go to https://xxxxxx.signin.aws.amazon.com/console. Log in using your supplied account credentials. -2.2.1.2 Ensure you are in the right AWS region. On the top-right side, make sure you select Sydney. +2.2.1.2 Ensure you are in the right AWS region: on the top-right side, make sure you select Sydney. -2.2.2 Once you have successfully logged in, under the AWS services search field, search for *Cloudformation*, and click on the **Cloudformation** auto drop down element. +2.2.1.3 Once you have successfully logged in, under the AWS services search field, search for *Cloudformation*, and click on the **Cloudformation** auto drop down element. 2.2.2 In the screen's upper left corner click on the blue button 'Create Stack'. ![3-2-2-2-create-cf-stack](https://github.com/DevOps-Girls/devopsgirls-bootcamp3/blob/master/images/3-2-docker-ecs-static-site/3-2-2-2-create-cf-stack.png?raw=true) -2.2.3 In the **Select Template** page, under the section *Choose a template* provide Cloudformation template that you have already downloaded in the step 2.2.0 (*module2-ecs-static-site.yaml*) +2.2.3 In the **Select Template** page, under the section *Choose a template* provide the Cloudformation template that you have already downloaded in step 2.2.0 (*module2-ecs-static-site.yaml*). Then click Next. ![3-2-2-3-select-template](https://github.com/DevOps-Girls/devopsgirls-bootcamp3/blob/master/images/3-2-docker-ecs-static-site/3-2-2-3-select-template.png?raw=true) -2.2.4 Under the **Specify Details** page, in the *Stack name* field enter your first name, and last name without a space following the **-cf-ecs** string, and leave the rest of the information with the default values. +2.2.4 Under the **Specify Details** page, in the *Stack name* field enter your first name and last name without a space, followed by the **-cf-ecs** string. Under *Parameters* > *SharedParentStack*, enter "DevOpsGirlsVPC". Leave the rest of the information with the default values. Then click Next. ![3-2-2-4-specify-datails](https://github.com/DevOps-Girls/devopsgirls-bootcamp3/blob/master/images/3-2-docker-ecs-static-site/3-2-2-4-specify-datails.png?raw=true) @@ -83,8 +83,8 @@ Also, in the template is included a docker container definition that contain a w Once you have completed the tags section, leave the remain information with the default values, and click next. -2.2.6 In the **review** page check out if everything is good according with the instructions, in the case that you need to modify something click in the previous button, or if everything is **ok** click in the create button to create the ECS cluster using the Cloudformation template. -Also, at the end of the page you have to **check** the box about *"I acknowledge that AWS CloudFormation might create IAM resources."* +2.2.6 In the **review** page check out if everything is good according to the instructions, in the case that you need to modify something click the Previous button, or if everything is **ok** click the Create button to create the ECS cluster using the Cloudformation template. +Also, at the end of the page you have to **check** the box *"I acknowledge that AWS CloudFormation might create IAM resources."* ![3-2-2-6-review.png](https://github.com/DevOps-Girls/devopsgirls-bootcamp3/blob/master/images/3-2-docker-ecs-static-site/3-2-2-6-review.png?raw=true) @@ -97,12 +97,12 @@ Also, at the end of the page you have to **check** the box about *"I acknowledge ![3-2-2-9-Stack_Created](https://github.com/DevOps-Girls/devopsgirls-bootcamp3/blob/master/images/3-2-docker-ecs-static-site/3-2-2-9-Stack_Created.png?raw=true) -2.2.9 Another important steps when the stack is ready is to check the resources or elements that it has created. To do that, go to the **Resources** tab and you will be able to know all about the resources that have been created using the **Cloudformation template** in the new **Stack** +2.2.9 Another important step when the stack is ready is to check the resources or elements that it has created. To do that, go to the **Resources** tab and you will see all the resources that have been created using the **Cloudformation template** in the new **Stack** ![3-2-2-10-Resources_Created](https://github.com/DevOps-Girls/devopsgirls-bootcamp3/blob/master/images/3-2-docker-ecs-static-site/3-2-2-10-Resources_Created.png?raw=true) -2.2.10 Another way to do that (and maybe a more userfriendly way) is check the template in the **designer** application and it will show you a diagram with all the resources that have been created. To do it, check the Stack Name box that you want to review, and in the **Actions button** choose the *View/Edit template in Designer*: +2.2.10 Another way to do that (and maybe a more user-friendly way) is check the template in the **designer** application and it will show you a diagram with all the resources that have been created. To do it, check the Stack Name box that you want to review, and in the **Actions button** choose the *View/Edit template in Designer*: ![3-2-2-10-b-Resources_Created](https://github.com/DevOps-Girls/devopsgirls-bootcamp3/blob/master/images/3-2-docker-ecs-static-site/3-2-2-10-b-Resources_Created.png?raw=true) @@ -117,70 +117,70 @@ In this case the diagram looks like this: ![3-2-2-10-c-Resources_Created](https://github.com/DevOps-Girls/devopsgirls-bootcamp3/blob/master/images/3-2-docker-ecs-static-site/3-2-2-10-cf-template-diagram.png?raw=true) -2.2.12 Now is the time to check the ECS that has being created in the stack using the Cloudformation template. To do that, under the AWS services search field, search for *Elastic Container Service*, and click on the *Elastic Container Service* auto drop down element. +2.2.12 Now is the time to check the ECS that has being created in the stack using the Cloudformation template. To do that, under the AWS services search field, search for *ECS*, and click on the *Elastic Container Service* auto drop down element. ![3-2-2-11-a-Searching_ECS_Cluster](https://github.com/DevOps-Girls/devopsgirls-bootcamp3/blob/master/images/3-2-docker-ecs-static-site/3-2-2-11-a-Searching_ECS_Cluster.png?raw=true) -2.2.13 In the **Cluster** page your will be able to see your cluster that contain the name of the stack following a random sequence number +2.2.13 In the **Cluster** page your will be able to see your cluster that contain the name of the stack followed by a random sequence number ![3-2-2-11-ECS_Cluster](https://github.com/DevOps-Girls/devopsgirls-bootcamp3/blob/master/images/3-2-docker-ecs-static-site/3-2-2-11-ECS_Cluster.png?raw=true) -2.2.14 Click on the *cluster name* and you will be redirect to the cluster details configuration page. Here you can see information, for instance, about the number of the containers that are configured in the cluster, as well as, the status of cluster, service and task(s). +2.2.14 Click on the *cluster name* and you will be redirected to the cluster details configuration page. Here you can see information, for instance, about the number of containers configured in the cluster, as well as the status of the cluster, service(s) and task(s). (A service allows you to run and maintain tasks (containers) in a cluster.) ![3-2-2-11-ECS_Service](https://github.com/DevOps-Girls/devopsgirls-bootcamp3/blob/master/images/3-2-docker-ecs-static-site/3-2-2-11-ECS_Service.png?raw=true) 2.2.15 Click on your *Service Name* and the **Service** page will show up. Here you can see more information about the service configuration. -In this moment your aim is find the place where you can get the IP or URL of the container that contain the web server, which, in turn, contain the static web page. +Now you need to find the IP or URL of the container running the web server, which, in turn, contain the static web page. ![3-2-2-11-ECS_Service_Task](https://github.com/DevOps-Girls/devopsgirls-bootcamp3/blob/master/images/3-2-docker-ecs-static-site/3-2-2-11-ECS_Service_Task.png?raw=true) 2.2.16 Under the **Tasks** tab, click on the task that is associated to your service in the **Task** column. -Now you are almost there ;)!, remeber that you are looking for the web server information that is configured in a container, so in the bottom of the page you will find a container called **simple-app** and it will give you the information that you are looking for. +Now you are almost there ;) ! The container we deployed using the Cloudformation template is called **simple-app**, so look for this in the **Containers** section at the bottom of the page. ![3-2-2-11-ECS_Service_Task_Container](https://github.com/DevOps-Girls/devopsgirls-bootcamp3/blob/master/images/3-2-docker-ecs-static-site/3-2-2-11-ECS_Service_Task_Container.png?raw=true) -2.2.17 In the **Task** page, under the **Container** section click over the **simple-app**, you will see all the details about the container, and also the one that you are looking for that correspond to the value providing in the **External Link** information. +2.2.17 Expand the **simple-app** line to reveal all the details about the container. The URL you need is under **External Link**. ![3-2-2-12-ECS_Task_Container_info](https://github.com/DevOps-Girls/devopsgirls-bootcamp3/blob/master/images/3-2-docker-ecs-static-site/3-2-2-12-ECS_Task_Container_info.png?raw=true) - -2.2.18 Click on the **External Link** information and congratulation! :) you will see the static web page that you have built using the Cloudformation. +2.2.18 Click on the **External Link** information and congratulations ! :) you will see the static web page that you have built using the Cloudformation template. ![3-2-2-13-Container_web](https://github.com/DevOps-Girls/devopsgirls-bootcamp3/blob/master/images/3-2-docker-ecs-static-site/3-2-2-13-Container_web.png?raw=true) ### 2.3 Creating the AWS CodePipeline, Continuous integration and Continuous Delivery service. -Now is time to create the AWS CodePipleline that is a continuous integration and continuous delivery service for fast and reliable application and infrastructure updates. You can use CodePipeline to fully model and automate your software release processes. +Now it's time to create the AWS CodePipleline for continuous integration and continuous delivery of your application. You can use CodePipeline to fully model and automate your software release processes. -2.3.0 Download from the [DevopsGirls' public S3 bucket](https://s3.console.aws.amazon.com/s3/buckets/devopsgirls1) the following files: +2.3.0 Download `Dockerfile` and `buildspec.yml` from [DevopsGirls' public S3 bucket](https://s3.console.aws.amazon.com/s3/buckets/devopsgirls1): ![3-2-3-0-Update-CodeCommit-Repository](https://github.com/DevOps-Girls/devopsgirls-bootcamp3/blob/master/images/3-2-docker-ecs-static-site/3-2-3-0-Update-CodeCommit-Repository.PNG?raw=true) -And push them in your **CodeCommit** repository that you have created in the [Module 1](https://github.com/DevOps-Girls/devopsgirls-bootcamp3/blob/master/3-1-CodeStar-EC2.md). To do that follow the steps described in the section [5. Push changes to CodeCommit Repo](https://github.com/DevOps-Girls/devopsgirls-bootcamp3/blob/master/3-1-CodeStar-EC2.md#5-push-changes-to-codecommit-repo) +And push them to the **CodeCommit** repository that you have created in [Module 1](https://github.com/DevOps-Girls/devopsgirls-bootcamp3/blob/master/3-1-CodeStar-EC2.md). To do that, follow the steps described in section [5. Push changes to CodeCommit Repo](https://github.com/DevOps-Girls/devopsgirls-bootcamp3/blob/master/3-1-CodeStar-EC2.md#5-push-changes-to-codecommit-repo) -2.3.1 Under the AWS services search field, search for codestar, and click on the **CodePipeline** auto drop down element +2.3.1 Under the AWS services search field, search for codepipeline, and click on the **CodePipeline** auto drop down element -2.3.2 Click on the **Create Pipeline** button. In the **Step 1:Name** in the **Pipeline name** field, provide the name following the structure as *your First Name*, *Your Last Name* following *-Pipeline* string. +2.3.2 Click on the **Create Pipeline** button. In the **Step 1:Name** fill in **Pipeline name** with *your First Name*, *Your Last Name* followed by *-Pipeline*. If there's already one with this name, append *-Pipeline2* instead. ![3-2-3-2-CodePipeline_Creation.png](https://github.com/DevOps-Girls/devopsgirls-bootcamp3/blob/master/images/3-2-docker-ecs-static-site/3-2-3-2-CodePipeline_Creation.png?raw=true) -2.3.3 In the **Step 2:Source**, under the **Source Provider** choose *AWS CodeCommit* and in the **Repository** field provide the repository that you have used in the [Module 1](https://github.com/DevOps-Girls/devopsgirls-bootcamp3/blob/master/3-1-CodeStar-EC2.md) (keep in mind that for documentation purpose we are using in the screenshot a different one) and leave the remain information with the default values. +2.3.3 In the **Step 2:Source**, under the **Source Provider** choose *AWS CodeCommit* and in the **Repository** field provide the repository that you have used in [Module 1](https://github.com/DevOps-Girls/devopsgirls-bootcamp3/blob/master/3-1-CodeStar-EC2.md), branch "master. Leave the remaining information as default. ![3-2-3-3-CodePipeline_Creation_Source](https://github.com/DevOps-Girls/devopsgirls-bootcamp3/blob/master/images/3-2-docker-ecs-static-site/3-2-3-3-CodePipeline_Creation_Source.png?raw=true) -2.3.4 Under the **Step 3: Build** choose *AWS CodeBuild* as a **Build provider** and in the **Configure your project** section choose *Create a new build project* providing the following the structure as *your First Name*, *Your Last Name* following *-CodeBuild* string. -The next data that you need to provide on the section **Environment: How to build** is the one that appears in the screenshot. Also, in the **AWS CodeBuild service role** section you have to choose the rol that was created in the stack with the Cloudformation template (you can double check it in the point **2.2.9** and is the value that appears in the column **Logical ID** *Module2CodeBuildRole*). -In the next section **VPC**, you have to specified the VPC, the private subnets asociated in the cloudformation creation also the *Security group* (if you have any doubt about how to get those information double check it wuit the facilitator's team) +2.3.4 Under the **Step 3: Build** choose *AWS CodeBuild* as a **Build provider** and in the **Configure your project** section choose *Create a new build project* and name it *your First Name*, *Your Last Name* followed by *-CodeBuild*. +Fill the sections **Environment: How to build** and **Cache** as per the screenshot. +For **AWS CodeBuild service role**, choose the build role that was created in our ECS Cloudformation stack (you can review the stacks's resources as in **2.2.9**, it's the value of the **Logical ID** *Module2CodeBuildRole*). +In the next section **VPC**, you have to specify the VPC, the private subnets associated in the cloudformation creation also the Security group (if you have any doubt about how to get those information double check it with one of the coaches). And finally in the **Advanced** section, you have to create four *Environment variables*: |Name|Value|Type| |---|---|---| -|IMAGE_REPO_NAME|*The name of your ECR (ECS repository)*|Plaintext| +|IMAGE_REPO_NAME|*The name of your ECR repository (**Logical ID** ECRRepository)*|Plaintext| |IMAGE_TAG|*latest*|Plaintext| |AWS_ACCOUNT_ID|*The IdNumber associated to your account*|Plaintext| -|AWS_DEFAULT_REGION|*The region where you are working on*|Plaintext| +|AWS_DEFAULT_REGION|*The region where you are working in ("ap-southeast-2" for Sydney)*|Plaintext| Once you have provided the above information you can click on **Save build project** button and click **Next**. @@ -188,29 +188,29 @@ Once you have provided the above information you can click on **Save build proje ![3-2-3-4-b-CodePipeline_Creation_Build](https://github.com/DevOps-Girls/devopsgirls-bootcamp3/blob/master/images/3-2-docker-ecs-static-site/3-2-3-4-b-CodePipeline_Creation_Build.png?raw=true) ![3-2-3-4-c-CodePipeline_Creation_Build](https://github.com/DevOps-Girls/devopsgirls-bootcamp3/blob/master/images/3-2-docker-ecs-static-site/3-2-3-4-c-CodePipeline_Creation_Build.png?raw=true) -2.3.5 In the **Step 4: Deploy** page provide the information acording your *ECS* Cluster configuration and the **Image file name** must be *imagedefinitions.json* +2.3.5 In the **Step 4: Deploy** page provide the information according your *ECS* Cluster configuration as per the screenshot. The **Image file name** must be *imagedefinitions.json* ![3-2-3-5-CodePipeline_Creation_Deploy](https://github.com/DevOps-Girls/devopsgirls-bootcamp3/blob/master/images/3-2-docker-ecs-static-site/3-2-3-5-CodePipeline_Creation_Deploy.png?raw=true) -2.3.6 Under the final configuration step **AWS Service Role** in the *Role name* file you have to provide the one that was created in the stack with the Cloudformation template (you can double check it in the point **2.2.9** and is the value that appears in the column **Logical ID** *Module2CodePipelineRole*) +2.3.6 Under the final configuration step **AWS Service Role** in the *Role name* field you have to provide the pipeline role that was created in our ECS Cloudformation template (**Logical ID** *Module2CodePipelineRole*). ![3-2-3-6-CodePipeline_Creation_ServiceRole](https://github.com/DevOps-Girls/devopsgirls-bootcamp3/blob/master/images/3-2-docker-ecs-static-site/3-2-3-6-CodePipeline_Creation_ServiceRole.png?raw=true) -2.3.7 Now is the turn to double check your configuration and if everything looks as expected click on the **Create pipeline** button. +2.3.7 Now is the time to double check your configuration, and if everything looks as expected, click on the **Create pipeline** button. ![3-2-3-7-CodePipeline_Creation_Review](https://github.com/DevOps-Girls/devopsgirls-bootcamp3/blob/master/images/3-2-docker-ecs-static-site/3-2-3-7-CodePipeline_Creation_Review.png?raw=true) -2.3.8 Now you will see the CodePipeline that you have just created and is going to deploy a new release of the **simple-app** Docker container that contain the web server with the static web page. +2.3.8 Now the CodePipeline that you have just created will connect to the CodeCommit repo specified and automatically start deploying a new release of the **simple-app** Docker container that runs the web server with the static web page. ![3-2-3-8-a-CodePipeline_Running](https://github.com/DevOps-Girls/devopsgirls-bootcamp3/blob/master/images/3-2-docker-ecs-static-site/3-2-3-8-a-CodePipeline_Running.png?raw=true) -You just need to wait for the process to be completed (it could take about 10 min) and once is ready, check again the IP of your web server and a new web page should be deployed ;). +You will need to wait for the pipeline to go through all three stages (it could take about 10 min) and once it's ready, connect to the IP of your web server again and a new web page should be deployed ;). ![3-2-3-8-b-CodePipeline_Completed](https://github.com/DevOps-Girls/devopsgirls-bootcamp3/blob/master/images/3-2-docker-ecs-static-site/3-2-3-8-b-CodePipeline_Completed.png?raw=true) -And CONGRATULATIONS again, you have deployed a new release using AWS CodePipeline +CONGRATULATIONS, you have deployed a new release using AWS CodePipeline ! ![3-2-3-8-b-CodePipeline_Completed](https://github.com/DevOps-Girls/devopsgirls-bootcamp3/blob/master/images/3-2-docker-ecs-static-site/3-2-3-8-c-CodePipeline_NewDepoyment.png?raw=true) diff --git a/3-3-serverless-static-site.md b/3-3-serverless-static-site.md index e6d86a8..e13bc6f 100644 --- a/3-3-serverless-static-site.md +++ b/3-3-serverless-static-site.md @@ -9,7 +9,7 @@ - When you use EC2 instances, or containers, you have to make some decisions on capacity when you are provisioning. You also have to pay for that capacity, and manage and operate those resources. For example in case of EC2, you have to keep the OS and software configured and kepts up to date. -- What is Serverless? Do not think of the word literally, as there are servers under the hood. You dont manage those servers, and do not have to take decisions on the capacity you might need. Also when you dont use the capacity, you dont pay anything for it. +- What is Serverless? Do not think of the word literally, as there are servers under the hood. You don't manage those servers, and do not have to take decisions on the capacity you might need. Also when you don't use the capacity, you don't pay anything for it. - In our case of hosting a static website, we do not perform any dynamic computation. We store some files, and the computing capacity is used to handle web requests and serve the static pages. @@ -63,20 +63,30 @@ Click on the "Properties" tab, and click on "Static Website Hosting" ![Configure Bucket](https://github.com/DevOps-Girls/devopsgirls-bootcamp3/blob/master/images/3-3-serverless-static-site/3-3-7-configure-s3-bucket.png?raw=true) ### 3.) Configure bucket to host a website -Choose "Use this bucket to host a website", enter "index.html" in the "Index Dcoument" text box, and click "Save". +Choose "Use this bucket to host a website", enter "index.html" in the "Index document" text box, and click "Save". ![Configure Bucket](https://github.com/DevOps-Girls/devopsgirls-bootcamp3/blob/master/images/3-3-serverless-static-site/3-3-8-configure-s3-bucket.png?raw=true) ## Copy the static website files to S3 bucket and make them public ### 1.) Copy the static files to S3 bucket -Change working directory to website_files, and copy the files to the S3 bucket created above. +If you have not yet done so, clone the DevOps-Girls/devopsgirls-bootcamp3 repo and change working directory to website_files: + +``` +$ git clone git@github.com:DevOps-Girls/devopsgirls-bootcamp3.git +$ cd devopsgirls-bootcamp3/website_files +``` + +Copy the files to the S3 bucket created above. If you have the AWS CLI client: ``` -$ cd website_files $ aws s3 sync . s3://`yourname-devopsgirls-site` ``` +If not, got to `https://s3.console.aws.amazon.com/s3/buckets/yourname-devopsgirls-site` and upload the files via the AWS console (keep all the defaults): + +![Upload Files](images/3-3-serverless-static-site/3-3-8-upload-files.png?raw=true) + ### 2.) Confirm files have been uploaded Navigate to the S3 bucket in the AWS console, and confirm all the files in the website_files directory are listed there. @@ -148,7 +158,7 @@ Note down the public URL of the S3 bucket and click on URL ![CodeBuild IAM Policy](https://github.com/DevOps-Girls/devopsgirls-bootcamp3/blob/master/images/3-3-serverless-static-site/3-3-19-modify-codebuild-iam-policy.png?raw=true) -### 11.) Leave the field "Request conditions" at its defailt, and click on "Review policy" +### 11.) Leave the field "Request conditions" at its default, and click on "Review policy" ![CodeBuild IAM Policy](https://github.com/DevOps-Girls/devopsgirls-bootcamp3/blob/master/images/3-3-serverless-static-site/3-3-20-modify-codebuild-iam-policy.png?raw=true) @@ -164,7 +174,7 @@ Note down the public URL of the S3 bucket and click on URL ![Run CodeBuild Project](https://github.com/DevOps-Girls/devopsgirls-bootcamp3/blob/master/images/3-3-serverless-static-site/3-3-23-run-codebuild-project.png?raw=true) -### 15.) In the "Start new build" page, leave the default values for "Project name", "Source provider", "Repository" and "Git clone depth". For "Branch" choose `master`, and leave "Source version" at the default value populated for your branch. Click on "Start Build" +### 15.) In the "Start new build" page, leave the default values for "Project name", "Source provider", "Repository" and "Git clone depth". For "Branch" choose `master`, and leave "Source version" at the default value populated for your branch. Under "Hide advanced options", reduce the timeout to 10 min. Click on "Start Build" ![Run CodeBuild Project](https://github.com/DevOps-Girls/devopsgirls-bootcamp3/blob/master/images/3-3-serverless-static-site/3-3-24-run-codebuild-project.png?raw=true) @@ -174,4 +184,4 @@ Note down the public URL of the S3 bucket and click on URL ### 17.) Go to the public URL of your S3 bucket, and you should see your web site. -### 18.) Your website is now set to be continuously deployed. If you make a modification to your website files, and push it to your CodeCommit repository, you should see a new run of your CodeBuild project which should successfully deploy the change to S3. \ No newline at end of file +### 18.) Your website is now set to be continuously deployed. If you make a modification to your website files, and push it to your CodeCommit repository, you should see a new run of your CodeBuild project which should successfully deploy the change to S3. diff --git a/images/3-3-serverless-static-site/3-3-8-upload-files.png b/images/3-3-serverless-static-site/3-3-8-upload-files.png new file mode 100644 index 0000000..134f190 Binary files /dev/null and b/images/3-3-serverless-static-site/3-3-8-upload-files.png differ diff --git a/templates/module2-ecs-static-site.yaml b/templates/module2-ecs-static-site.yaml index 135a272..54082a6 100644 --- a/templates/module2-ecs-static-site.yaml +++ b/templates/module2-ecs-static-site.yaml @@ -1,6 +1,6 @@ --- AWSTemplateFormatVersion: '2010-09-09' -Description: Setup for DevOpsGirsl Bootcamp 3, Module 2. ECS cluster in public subnet + CI setup +Description: Setup for DevOpsGirls Bootcamp 3, Module 2. ECS cluster in public subnet + CI setup Parameters: SharedParentStack: Description: 'The shared parent stack that has the VPC bits'