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 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 + 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 + diff --git a/html/index.html b/html/index.html index d218c39..da8629c 100755 --- a/html/index.html +++ b/html/index.html @@ -8,29 +8,29 @@ - DevOps Essentials on AWS + GN12 DevOps Essentials on AWS - + - + - + - + - + @@ -50,9 +50,9 @@

DevOps Essentials on AWS

-
+ @@ -483,7 +483,7 @@

Learning Objectives

Video Website

http://devopsessentialsaws.com/

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

Video Website

Public GitHub Repository

https://github.com/stelligent/devops-essentials/

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

Public GitHub Repository

- \ No newline at end of file +