From a4e02db17c346898fe1e8333230459a076db7f94 Mon Sep 17 00:00:00 2001 From: Gaurav Narasimhan Date: Sun, 2 Dec 2018 18:22:29 -0800 Subject: [PATCH 1/9] . --- LICENSE | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/LICENSE b/LICENSE index f2ffa9a..4253094 100644 --- a/LICENSE +++ b/LICENSE @@ -1,4 +1,4 @@ -MIT License +MIT License. Copyright (c) 2017 Stelligent From e93b7e4568eb8d1573f4c73fd05bc6f821a05f33 Mon Sep 17 00:00:00 2001 From: Gaurav Narasimhan Date: Sun, 2 Dec 2018 18:54:33 -0800 Subject: [PATCH 2/9] 1 --- html/index.html | 52 ++++++++++++++++++++++++------------------------- 1 file changed, 26 insertions(+), 26 deletions(-) diff --git a/html/index.html b/html/index.html index d218c39..b1d53b2 100755 --- a/html/index.html +++ b/html/index.html @@ -8,29 +8,29 @@ - DevOps Essentials on AWS + GN DevOps Essentials on AWS - + - + - + - + - + @@ -50,9 +50,9 @@

DevOps Essentials on AWS

-
    +
      -
    • +
    • Introduction
        @@ -63,7 +63,7 @@

        DevOps Essentials on AWS

        -
      • +
      • Training Intro
        • @@ -163,7 +163,7 @@

          DevOps Essentials on AWS

        • -
        • +
        • Section 1 DevOps
            @@ -194,7 +194,7 @@

            DevOps Essentials on AWS

        • -
        • +
        • Section 2 Static Website
            @@ -235,10 +235,10 @@

            DevOps Essentials on AWS

            -
          • +
          • Section 3 Deploying to EC2 -
              + -
            • +
            • Section 4 Deploying with OpsWorks
                @@ -294,7 +294,7 @@

                DevOps Essentials on AWS

            • -
            • +
            • Section 5 Deploying w/ Elastic Beanstalk
                @@ -322,7 +322,7 @@

                DevOps Essentials on AWS

            • -
            • +
            • Section 6 Deploying with ECS
                @@ -350,7 +350,7 @@

                DevOps Essentials on AWS

            • -
            • +
            • Section 7 Deploying a Serverless application
                @@ -383,7 +383,7 @@

                DevOps Essentials on AWS

            • -
            • +
            • Section 8 Using AWS CodeStar
                @@ -421,7 +421,7 @@

                DevOps Essentials on AWS

            • -
            • +
            • Summary Course Summary
                @@ -439,7 +439,7 @@

                DevOps Essentials on AWS

                - +
                @@ -448,7 +448,7 @@

                DevOps Essentials on AWS

                - +
                @@ -472,7 +472,7 @@

                Learning Objectives

              • Create a deployment pipeline for this course's web application using AWS CodeStar.
              • Describe an ideal DevOps state for a software application/service and team.
              -
+ @@ -483,7 +483,7 @@

Learning Objectives

Video Website

+ @@ -491,9 +491,9 @@

Video Website

Public GitHub Repository

+ - +
@@ -513,4 +513,4 @@

Public GitHub Repository

- \ No newline at end of file + From cedb9b165bb2b5be4aaa721942eebff60e6ac8eb Mon Sep 17 00:00:00 2001 From: Gaurav Narasimhan Date: Mon, 3 Dec 2018 07:50:27 -0800 Subject: [PATCH 3/9] 1 --- html/index.html | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/html/index.html b/html/index.html index b1d53b2..b389d27 100755 --- a/html/index.html +++ b/html/index.html @@ -8,7 +8,7 @@ - GN DevOps Essentials on AWS + GN1 DevOps Essentials on AWS From 745615855dc8646f624d8dfefae0e782fc862ac6 Mon Sep 17 00:00:00 2001 From: Gaurav Narasimhan Date: Mon, 3 Dec 2018 12:01:05 -0800 Subject: [PATCH 4/9] 1 --- html/index.html | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/html/index.html b/html/index.html index b389d27..4537bef 100755 --- a/html/index.html +++ b/html/index.html @@ -8,7 +8,7 @@ - GN1 DevOps Essentials on AWS + GN10 DevOps Essentials on AWS From 6b12084424b3fa3459587fc2f525328573b58354 Mon Sep 17 00:00:00 2001 From: Gaurav Narasimhan Date: Mon, 3 Dec 2018 12:30:03 -0800 Subject: [PATCH 5/9] 1 --- html/index.html | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/html/index.html b/html/index.html index 4537bef..a53ee41 100755 --- a/html/index.html +++ b/html/index.html @@ -8,7 +8,7 @@ - GN10 DevOps Essentials on AWS + GN11 DevOps Essentials on AWS From 5e9ac867d3bfe0e96ba6196c2edef74a6fc2d27d Mon Sep 17 00:00:00 2001 From: Gaurav Narasimhan Date: Mon, 3 Dec 2018 18:19:11 -0800 Subject: [PATCH 6/9] 1 --- html/index.html | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/html/index.html b/html/index.html index a53ee41..b63a82d 100755 --- a/html/index.html +++ b/html/index.html @@ -8,7 +8,7 @@ - GN11 DevOps Essentials on AWS + GN01 DevOps Essentials on AWS From 6de75b80efeff230b4a3d62487be9e436a3f7623 Mon Sep 17 00:00:00 2001 From: Gaurav Narasimhan Date: Mon, 3 Dec 2018 18:53:59 -0800 Subject: [PATCH 7/9] 2 --- html/index.html | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/html/index.html b/html/index.html index b63a82d..da8629c 100755 --- a/html/index.html +++ b/html/index.html @@ -8,7 +8,7 @@ - GN01 DevOps Essentials on AWS + GN12 DevOps Essentials on AWS From 7dc177d6b8178411cee3a24e3cf313263acce0ec Mon Sep 17 00:00:00 2001 From: Gaurav Narasimhan Date: Sun, 9 Dec 2018 14:59:46 -0800 Subject: [PATCH 8/9] 1 --- .../devops-essential-yml-template.yaml | 217 ++++++++++++++++++ 1 file changed, 217 insertions(+) create mode 100644 cloud formation template/devops-essential-yml-template.yaml diff --git a/cloud formation template/devops-essential-yml-template.yaml b/cloud formation template/devops-essential-yml-template.yaml new file mode 100644 index 0000000..f15e952 --- /dev/null +++ b/cloud formation template/devops-essential-yml-template.yaml @@ -0,0 +1,217 @@ +--- +AWSTemplateFormatVersion: '2010-09-09' +Description: Pipeline using CodePipeline and CodeBuild for continuous delivery of a single-page application to S3 +Parameters: + SiteBucketName: + Type: String + Description: Name of bucket to create to host the website + GitHubUser: + Type: String + Description: GitHub User + Default: "stelligent" + GitHubRepo: + Type: String + Description: GitHub Repo to pull from. Only the Name. not the URL + Default: "devops-essentials" + GitHubBranch: + Type: String + Description: GitHub Branch + Default: "master" + GitHubToken: + NoEcho: true + Type: String + Description: Secret. It might look something like 9b189a1654643522561f7b3ebd44a1531a4287af OAuthToken with access to Repo. Go to https://github.com/settings/tokens + BuildType: + Type: String + Default: "LINUX_CONTAINER" + Description: The build container type to use for building the app + BuildComputeType: + Type: String + Default: "BUILD_GENERAL1_SMALL" + Description: The build compute type to use for building the app + BuildImage: + Type: String + Default: "aws/codebuild/ubuntu-base:14.04" + Description: The build image to use for building the app +Metadata: + AWS::CloudFormation::Interface: + ParameterGroups: + - Label: + default: "Site Configuration" + Parameters: + - SiteBucketName + - Label: + default: "GitHub Configuration" + Parameters: + - GitHubToken + - GitHubUser + - GitHubRepo + - GitHubBranch + - Label: + default: "Build Configuration" + Parameters: + - BuildType + - BuildComputeType + - BuildImage + ParameterLabels: + SiteBucketName: + default: Name of S3 Bucket to create for website hosting + GitHubToken: + default: GitHub OAuth2 Token + GitHubUser: + default: GitHub User/Org Name + GitHubRepo: + default: GitHub Repository Name + GitHubBranch: + default: GitHub Branch Name + BuildType: + default: CodeBuild type + BuildComputeType: + default: CodeBuild instance type + BuildImage: + default: CodeBuild image +Resources: + CodeBuildRole: + Type: AWS::IAM::Role + Properties: + AssumeRolePolicyDocument: + Statement: + - Effect: Allow + Principal: + Service: + - codebuild.amazonaws.com + Action: + - sts:AssumeRole + Path: "/" + Policies: + - PolicyName: codebuild-service + PolicyDocument: + Statement: + - Effect: Allow + Action: "*" + Resource: "*" + Version: '2012-10-17' + CodePipelineRole: + Type: AWS::IAM::Role + Properties: + AssumeRolePolicyDocument: + Statement: + - Effect: Allow + Principal: + Service: + - codepipeline.amazonaws.com + Action: + - sts:AssumeRole + Path: "/" + Policies: + - PolicyName: codepipeline-service + PolicyDocument: + Statement: + - Action: + - codebuild:* + Resource: "*" + Effect: Allow + - Action: + - s3:GetObject + - s3:GetObjectVersion + - s3:GetBucketVersioning + Resource: "*" + Effect: Allow + - Action: + - s3:PutObject + Resource: + - arn:aws:s3:::codepipeline* + Effect: Allow + - Action: + - s3:* + - cloudformation:* + - iam:PassRole + Resource: "*" + Effect: Allow + Version: '2012-10-17' + SiteBucket: + Type: AWS::S3::Bucket + DeletionPolicy: Delete + Properties: + AccessControl: PublicRead + BucketName: !Ref SiteBucketName + WebsiteConfiguration: + IndexDocument: index.html + PipelineBucket: + Type: AWS::S3::Bucket + DeletionPolicy: Delete + CodeBuildDeploySite: + Type: AWS::CodeBuild::Project + DependsOn: CodeBuildRole + Properties: + Name: !Sub ${AWS::StackName}-DeploySite + Description: Deploy site to S3 + ServiceRole: !GetAtt CodeBuildRole.Arn + Artifacts: + Type: CODEPIPELINE + Environment: + Type: !Ref BuildType + ComputeType: !Ref BuildComputeType + Image: !Sub ${BuildImage} + Source: + Type: CODEPIPELINE + BuildSpec: !Sub | + version: 0.1 + phases: + post_build: + commands: + - aws s3 cp --recursive --acl public-read ./samples s3://${SiteBucketName}/samples + - aws s3 cp --recursive --acl public-read ./html s3://${SiteBucketName}/ + artifacts: + type: zip + files: + - ./html/index.html + TimeoutInMinutes: 10 + Pipeline: + Type: AWS::CodePipeline::Pipeline + Properties: + RoleArn: !GetAtt CodePipelineRole.Arn + Stages: + - Name: Source + Actions: + - InputArtifacts: [] + Name: Source + ActionTypeId: + Category: Source + Owner: ThirdParty + Version: '1' + Provider: GitHub + OutputArtifacts: + - Name: SourceArtifacts + Configuration: + Owner: !Ref GitHubUser + Repo: !Ref GitHubRepo + Branch: !Ref GitHubBranch + OAuthToken: !Ref GitHubToken + RunOrder: 1 + - Name: Deploy + Actions: + - Name: Artifact + ActionTypeId: + Category: Build + Owner: AWS + Version: '1' + Provider: CodeBuild + InputArtifacts: + - Name: SourceArtifacts + OutputArtifacts: + - Name: DeploymentArtifacts + Configuration: + ProjectName: !Ref CodeBuildDeploySite + RunOrder: 1 + ArtifactStore: + Type: S3 + Location: !Ref PipelineBucket +Outputs: + PipelineUrl: + Value: !Sub https://console.aws.amazon.com/codepipeline/home?region=${AWS::Region}#/view/${Pipeline} + Description: CodePipeline URL + SiteUrl: + Value: !GetAtt [SiteBucket, WebsiteURL] + Description: S3 Website URL + From 6c1f8ceab2b6409d4190d36de6b579c24aad5ad8 Mon Sep 17 00:00:00 2001 From: Gaurav Narasimhan Date: Sun, 9 Dec 2018 15:04:00 -0800 Subject: [PATCH 9/9] 1 --- .../devops-essential-yml-template.yaml | 217 ++++++++++++++++++ 1 file changed, 217 insertions(+) create mode 100644 html/cloud formation template/devops-essential-yml-template.yaml diff --git a/html/cloud formation template/devops-essential-yml-template.yaml b/html/cloud formation template/devops-essential-yml-template.yaml new file mode 100644 index 0000000..f15e952 --- /dev/null +++ b/html/cloud formation template/devops-essential-yml-template.yaml @@ -0,0 +1,217 @@ +--- +AWSTemplateFormatVersion: '2010-09-09' +Description: Pipeline using CodePipeline and CodeBuild for continuous delivery of a single-page application to S3 +Parameters: + SiteBucketName: + Type: String + Description: Name of bucket to create to host the website + GitHubUser: + Type: String + Description: GitHub User + Default: "stelligent" + GitHubRepo: + Type: String + Description: GitHub Repo to pull from. Only the Name. not the URL + Default: "devops-essentials" + GitHubBranch: + Type: String + Description: GitHub Branch + Default: "master" + GitHubToken: + NoEcho: true + Type: String + Description: Secret. It might look something like 9b189a1654643522561f7b3ebd44a1531a4287af OAuthToken with access to Repo. Go to https://github.com/settings/tokens + BuildType: + Type: String + Default: "LINUX_CONTAINER" + Description: The build container type to use for building the app + BuildComputeType: + Type: String + Default: "BUILD_GENERAL1_SMALL" + Description: The build compute type to use for building the app + BuildImage: + Type: String + Default: "aws/codebuild/ubuntu-base:14.04" + Description: The build image to use for building the app +Metadata: + AWS::CloudFormation::Interface: + ParameterGroups: + - Label: + default: "Site Configuration" + Parameters: + - SiteBucketName + - Label: + default: "GitHub Configuration" + Parameters: + - GitHubToken + - GitHubUser + - GitHubRepo + - GitHubBranch + - Label: + default: "Build Configuration" + Parameters: + - BuildType + - BuildComputeType + - BuildImage + ParameterLabels: + SiteBucketName: + default: Name of S3 Bucket to create for website hosting + GitHubToken: + default: GitHub OAuth2 Token + GitHubUser: + default: GitHub User/Org Name + GitHubRepo: + default: GitHub Repository Name + GitHubBranch: + default: GitHub Branch Name + BuildType: + default: CodeBuild type + BuildComputeType: + default: CodeBuild instance type + BuildImage: + default: CodeBuild image +Resources: + CodeBuildRole: + Type: AWS::IAM::Role + Properties: + AssumeRolePolicyDocument: + Statement: + - Effect: Allow + Principal: + Service: + - codebuild.amazonaws.com + Action: + - sts:AssumeRole + Path: "/" + Policies: + - PolicyName: codebuild-service + PolicyDocument: + Statement: + - Effect: Allow + Action: "*" + Resource: "*" + Version: '2012-10-17' + CodePipelineRole: + Type: AWS::IAM::Role + Properties: + AssumeRolePolicyDocument: + Statement: + - Effect: Allow + Principal: + Service: + - codepipeline.amazonaws.com + Action: + - sts:AssumeRole + Path: "/" + Policies: + - PolicyName: codepipeline-service + PolicyDocument: + Statement: + - Action: + - codebuild:* + Resource: "*" + Effect: Allow + - Action: + - s3:GetObject + - s3:GetObjectVersion + - s3:GetBucketVersioning + Resource: "*" + Effect: Allow + - Action: + - s3:PutObject + Resource: + - arn:aws:s3:::codepipeline* + Effect: Allow + - Action: + - s3:* + - cloudformation:* + - iam:PassRole + Resource: "*" + Effect: Allow + Version: '2012-10-17' + SiteBucket: + Type: AWS::S3::Bucket + DeletionPolicy: Delete + Properties: + AccessControl: PublicRead + BucketName: !Ref SiteBucketName + WebsiteConfiguration: + IndexDocument: index.html + PipelineBucket: + Type: AWS::S3::Bucket + DeletionPolicy: Delete + CodeBuildDeploySite: + Type: AWS::CodeBuild::Project + DependsOn: CodeBuildRole + Properties: + Name: !Sub ${AWS::StackName}-DeploySite + Description: Deploy site to S3 + ServiceRole: !GetAtt CodeBuildRole.Arn + Artifacts: + Type: CODEPIPELINE + Environment: + Type: !Ref BuildType + ComputeType: !Ref BuildComputeType + Image: !Sub ${BuildImage} + Source: + Type: CODEPIPELINE + BuildSpec: !Sub | + version: 0.1 + phases: + post_build: + commands: + - aws s3 cp --recursive --acl public-read ./samples s3://${SiteBucketName}/samples + - aws s3 cp --recursive --acl public-read ./html s3://${SiteBucketName}/ + artifacts: + type: zip + files: + - ./html/index.html + TimeoutInMinutes: 10 + Pipeline: + Type: AWS::CodePipeline::Pipeline + Properties: + RoleArn: !GetAtt CodePipelineRole.Arn + Stages: + - Name: Source + Actions: + - InputArtifacts: [] + Name: Source + ActionTypeId: + Category: Source + Owner: ThirdParty + Version: '1' + Provider: GitHub + OutputArtifacts: + - Name: SourceArtifacts + Configuration: + Owner: !Ref GitHubUser + Repo: !Ref GitHubRepo + Branch: !Ref GitHubBranch + OAuthToken: !Ref GitHubToken + RunOrder: 1 + - Name: Deploy + Actions: + - Name: Artifact + ActionTypeId: + Category: Build + Owner: AWS + Version: '1' + Provider: CodeBuild + InputArtifacts: + - Name: SourceArtifacts + OutputArtifacts: + - Name: DeploymentArtifacts + Configuration: + ProjectName: !Ref CodeBuildDeploySite + RunOrder: 1 + ArtifactStore: + Type: S3 + Location: !Ref PipelineBucket +Outputs: + PipelineUrl: + Value: !Sub https://console.aws.amazon.com/codepipeline/home?region=${AWS::Region}#/view/${Pipeline} + Description: CodePipeline URL + SiteUrl: + Value: !GetAtt [SiteBucket, WebsiteURL] + Description: S3 Website URL +