├── .gitignore ├── CODEOWNERS ├── CODE_OF_CONDUCT.md ├── CONTRIBUTING.md ├── LICENSE ├── README.md ├── amplify.yml ├── metadata.yml ├── resources ├── policies │ └── .gitkeep └── templates │ ├── .gitkeep │ ├── pipeline.yaml │ └── sam-template-chapter-5.yaml └── workshop ├── buildspec.yml ├── config.toml ├── content └── _index.en.md ├── layouts └── partials │ ├── site-footer.html │ └── site-navigation.html └── static ├── css └── theme-aws.css └── images └── aws-logo.png /.gitignore: -------------------------------------------------------------------------------- 1 | .DS_Store 2 | workshop/themes/* 3 | /.idea/ 4 | /aws-serverless-cicd-workshop.iml -------------------------------------------------------------------------------- /CODEOWNERS: -------------------------------------------------------------------------------- 1 | # This is a comment. 2 | # Each line is a file pattern followed by one or more owners. 3 | 4 | # These owners will be the default owners for everything in 5 | # the repo. Unless a later match takes precedence, 6 | # Owners will be requested for review when someone opens a PR. 7 | 8 | * @brianz @ferdingler 9 | -------------------------------------------------------------------------------- /CODE_OF_CONDUCT.md: -------------------------------------------------------------------------------- 1 | ## Code of Conduct 2 | This project has adopted the [Amazon Open Source Code of Conduct](https://aws.github.io/code-of-conduct). 3 | For more information see the [Code of Conduct FAQ](https://aws.github.io/code-of-conduct-faq) or contact 4 | opensource-codeofconduct@amazon.com with any additional questions or comments. 5 | -------------------------------------------------------------------------------- /CONTRIBUTING.md: -------------------------------------------------------------------------------- 1 | # Contributing Guidelines 2 | 3 | Thank you for your interest in contributing to our project. Whether it's a bug report, new feature, correction, or additional 4 | documentation, we greatly value feedback and contributions from our community. 5 | 6 | Please read through this document before submitting any issues or pull requests to ensure we have all the necessary 7 | information to effectively respond to your bug report or contribution. 8 | 9 | 10 | ## Reporting Bugs/Feature Requests 11 | 12 | We welcome you to use the GitHub issue tracker to report bugs or suggest features. 13 | 14 | When filing an issue, please check existing open, or recently closed, issues to make sure somebody else hasn't already 15 | reported the issue. Please try to include as much information as you can. Details like these are incredibly useful: 16 | 17 | * A reproducible test case or series of steps 18 | * The version of our code being used 19 | * Any modifications you've made relevant to the bug 20 | * Anything unusual about your environment or deployment 21 | 22 | ## Contributing via Pull Requests 23 | Contributions via pull requests are much appreciated. Before sending us a pull request, please ensure that you are working against the latest source on the `dev` branch. 24 | 25 | ### Run project locally 26 | The static website is built using Hugo and to run it locally you need to install the [Hugo CLI](https://gohugo.io/getting-started/installing/). 27 | 28 | 1. Clone this repository. 29 | 2. Download the Learn theme by running `git clone https://github.com/matcornic/hugo-theme-learn.git workshop/themes/learn` from within the root of the project. 30 | 3. Run `hugo serve` from within the _workshop_ folder. 31 | 32 | Please keep in mind the following before sending a pull request. 33 | 34 | - You check existing open, and recently merged, pull requests to make sure someone else hasn't addressed the problem already. 35 | - You open an issue to discuss any significant work - we would hate for your time to be wasted. 36 | 37 | To send us a pull request, please: 38 | 39 | 1. Fork the repository. 40 | 2. Modify the source; please focus on the specific change you are contributing. If you also reformat all the code, it will be hard for us to focus on your change. 41 | 3. Ensure you test locally using Hugo CLI. 42 | 4. Commit to your fork using clear commit messages. 43 | 5. Send us a pull request, answering any default questions in the pull request interface. 44 | 6. Pay attention to any automated CI failures reported in the pull request, and stay involved in the conversation. 45 | 46 | GitHub provides additional document on [forking a repository](https://help.github.com/articles/fork-a-repo/) and 47 | [creating a pull request](https://help.github.com/articles/creating-a-pull-request/). 48 | 49 | 50 | ## Finding contributions to work on 51 | Looking at the existing issues is a great way to find something to contribute on. As our projects, by default, use the default GitHub issue labels (enhancement/bug/duplicate/help wanted/invalid/question/wontfix), looking at any 'help wanted' issues is a great place to start. 52 | 53 | 54 | ## Code of Conduct 55 | This project has adopted the [Amazon Open Source Code of Conduct](https://aws.github.io/code-of-conduct). 56 | For more information see the [Code of Conduct FAQ](https://aws.github.io/code-of-conduct-faq) or contact 57 | opensource-codeofconduct@amazon.com with any additional questions or comments. 58 | 59 | 60 | ## Security issue notifications 61 | If you discover a potential security issue in this project we ask that you notify AWS/Amazon Security via our [vulnerability reporting page](http://aws.amazon.com/security/vulnerability-reporting/). Please do **not** create a public github issue. 62 | 63 | 64 | ## Licensing 65 | 66 | See the [LICENSE](LICENSE) file for our project's licensing. We will ask you to confirm the licensing of your contribution. 67 | 68 | We may ask you to sign a [Contributor License Agreement (CLA)](http://en.wikipedia.org/wiki/Contributor_License_Agreement) for larger changes. 69 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | Copyright 2020 Amazon.com, Inc. or its affiliates. All Rights Reserved. 2 | 3 | Permission is hereby granted, free of charge, to any person obtaining a copy of 4 | this software and associated documentation files (the "Software"), to deal in 5 | the Software without restriction, including without limitation the rights to 6 | use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of 7 | the Software, and to permit persons to whom the Software is furnished to do so. 8 | 9 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 10 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS 11 | FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR 12 | COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER 13 | IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN 14 | CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 15 | 16 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # CI/CD for Serverless Applications Workshop 2 | 3 |

This repository is archived an no longer maintained!

4 | 5 | The serverless CI/CD content has been moved to: 6 | 7 | **[The Complete AWS SAM Workshop](https://catalog.workshops.aws/complete-aws-sam/)** 8 | 9 | Keep an eye on [The Complete AWS SAM Workshop](https://catalog.workshops.aws/complete-aws-sam/) 10 | workshop as we continue to add modules for different CI/CD provides as well as new modules about 11 | other features of SAM. 12 | 13 | Contributions, issues and pull requests are no longer accepted to this repository. We continue to 14 | work on a mechanism to accept feedback for the new workshop. 15 | -------------------------------------------------------------------------------- /amplify.yml: -------------------------------------------------------------------------------- 1 | version: 0.1 2 | frontend: 3 | phases: 4 | build: 5 | commands: 6 | - git clone --depth=1 https://github.com/theNewDynamic/gohugo-theme-ananke.git workshop/themes/ananke 7 | - hugo --source workshop --destination ../public --quiet 8 | artifacts: 9 | baseDirectory: /public 10 | files: 11 | - '**/*' 12 | -------------------------------------------------------------------------------- /metadata.yml: -------------------------------------------------------------------------------- 1 | #name - DNS-friendly name for the workshop. This will be used when generating the hosting URL (ie. https://my-first-workshop.workshops.aws/) 2 | name: ci-cd-for-serverless-apps 3 | #title - The title of your workshop 4 | title: CI/CD for Serverless Applications 5 | #description - A short description that will be displayed in search results 6 | description: In this workshop, you will learn how to start a new Serverless application from scratch using the AWS Serverless Application Model (AWS SAM) and how to fully automate builds and deployments by building a continous delivery pipeline using AWS CodeCommit, AWS CodeBuild and AWS CodePipeline. You will also learn how to test a Serverless application locally using the SAM CLI. 7 | #categories - Refer to official AWS categories covered by the workshop content here 8 | categories: 9 | - Serverless 10 | - Lambda 11 | - Continous Delivery 12 | - Automation 13 | - SAM 14 | #services - Refer to the official AWS service names covered by the workshop content here 15 | services: 16 | - API Gateway 17 | - Lambda 18 | - CodePipeline 19 | - CodeCommit 20 | - CodeBuild 21 | - CloudFormation 22 | #level - Approximate skill level needed for this workshop 23 | level: 300 24 | #duration - Estimated duration in minutes 25 | duration: 120 26 | #cost - Cost in USD. If the content is offered without cost, enter 0 27 | cost: 0 28 | #author - Amazon alias of the primary author of the content 29 | author: zambb 30 | #audience - Names of the personas associated with this workshop 31 | audience: 32 | - Developer 33 | -------------------------------------------------------------------------------- /resources/policies/.gitkeep: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aws-samples/aws-serverless-cicd-workshop/2e7de1f655407f348d93c0b3f5391b2de67f8f91/resources/policies/.gitkeep -------------------------------------------------------------------------------- /resources/templates/.gitkeep: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aws-samples/aws-serverless-cicd-workshop/2e7de1f655407f348d93c0b3f5391b2de67f8f91/resources/templates/.gitkeep -------------------------------------------------------------------------------- /resources/templates/pipeline.yaml: -------------------------------------------------------------------------------- 1 | AWSTemplateFormatVersion: '2010-09-09' 2 | Description: >- 3 | Pipeline for a Serverless SAM application 4 | 5 | Metadata: 6 | AWS::CloudFormation::Interface: 7 | ParameterGroups: 8 | - 9 | Label: 10 | default: "Source Code Configuration" 11 | Parameters: 12 | - SourceCodeProvider 13 | - CodeCommitRepoName 14 | - CodeCommitBranch 15 | - 16 | Label: 17 | default: "Build Configuration" 18 | Parameters: 19 | - ComputeType 20 | - EnvironmentType 21 | - 22 | Label: 23 | default: "Deploy Configuration" 24 | Parameters: 25 | - DeployStackName 26 | - DeployParameterOverrides 27 | 28 | Outputs: 29 | ArtifactsBucketArn: 30 | Value: !GetAtt Artifacts.Arn 31 | ArtifactsBucketName: 32 | Value: !Ref Artifacts 33 | PipelineName: 34 | Value: !Ref Pipeline 35 | PipelineVersion: 36 | Value: !GetAtt Pipeline.Version 37 | 38 | Parameters: 39 | ComputeType: 40 | AllowedValues: 41 | - BUILD_GENERAL1_SMALL 42 | - BUILD_GENERAL1_MEDIUM 43 | - BUILD_GENERAL1_LARGE 44 | Default: BUILD_GENERAL1_SMALL 45 | Description: AWS CodeBuild project compute type. 46 | Type: String 47 | EnvironmentType: 48 | AllowedValues: 49 | - LINUX_CONTAINER 50 | - WINDOWS_CONTAINER 51 | Default: LINUX_CONTAINER 52 | Description: Environment type used by AWS CodeBuild. See the documentation for details (https://docs.aws.amazon.com/codebuild/latest/userguide/create-project.html#create-project-cli). 53 | Type: String 54 | SourceCodeProvider: 55 | Type: String 56 | Description: Location of your source code repository 57 | Default: CodeCommit 58 | AllowedValues: 59 | - CodeCommit 60 | CodeCommitRepoName: 61 | Type: String 62 | Description: CodeCommit repository name, only specify if you chose CodeCommit in SourceCodeProvider 63 | Default: 'sam-app' 64 | CodeCommitBranch: 65 | Type: String 66 | Description: CodeCommit repository branch name, only specify if you chose CodeCommit in SourceCodeProvider. 67 | Default: master 68 | DeployParameterOverrides: 69 | Description: Parameter overrides for the deploy stage 70 | Type: String 71 | Default: '{}' 72 | DeployStackName: 73 | Description: The stack name for the deploy stage 74 | Type: String 75 | Default: 'sam-app' 76 | 77 | Conditions: 78 | UseCodeCommit: 79 | !Equals [!Ref SourceCodeProvider, 'CodeCommit'] 80 | 81 | Rules: 82 | ValidateCodeCommit: 83 | RuleCondition: !Equals [!Ref SourceCodeProvider, 'CodeCommit'] 84 | Assertions: 85 | - Assert: !Not [!Equals [!Ref CodeCommitRepoName, '']] 86 | AssertDescription: "CodeCommitRepoName must be specified when SourceCodeProvider is CodeCommit" 87 | - Assert: !Not [!Equals [!Ref CodeCommitBranch, '']] 88 | AssertDescription: "CodeCommitBranch must be specified when SourceCodeProvider is CodeCommit" 89 | 90 | Resources: 91 | Artifacts: 92 | Type: AWS::S3::Bucket 93 | Properties: 94 | LifecycleConfiguration: 95 | Rules: 96 | - ExpirationInDays: 30 97 | Status: Enabled 98 | 99 | Pipeline: 100 | Type: AWS::CodePipeline::Pipeline 101 | Properties: 102 | ArtifactStore: 103 | Location: !Ref Artifacts 104 | Type: S3 105 | RoleArn: !GetAtt PipelineRole.Arn 106 | Stages: 107 | - Name: Source 108 | Actions: 109 | - !If 110 | - UseCodeCommit 111 | - Name: CodeCommitSource 112 | ActionTypeId: 113 | Category: Source 114 | Owner: AWS 115 | Provider: CodeCommit 116 | Version: "1" 117 | Configuration: 118 | RepositoryName: !Ref CodeCommitRepoName 119 | BranchName: !Ref CodeCommitBranch 120 | OutputArtifacts: 121 | - Name: SourceArtifact 122 | - !Ref AWS::NoValue 123 | 124 | - Name: Build 125 | Actions: 126 | - Name: Build 127 | ActionTypeId: 128 | Category: Build 129 | Owner: AWS 130 | Provider: CodeBuild 131 | Version: "1" 132 | Configuration: 133 | ProjectName: !Ref BuildProject 134 | InputArtifacts: 135 | - Name: SourceArtifact 136 | OutputArtifacts: 137 | - Name: BuildArtifact 138 | 139 | - Name: Dev 140 | Actions: 141 | - Name: CreateChangeSet 142 | ActionTypeId: 143 | Category: Deploy 144 | Owner: AWS 145 | Provider: CloudFormation 146 | Version: '1' 147 | InputArtifacts: 148 | - Name: BuildArtifact 149 | Configuration: 150 | ActionMode: CHANGE_SET_REPLACE 151 | Capabilities: CAPABILITY_IAM,CAPABILITY_AUTO_EXPAND 152 | ParameterOverrides: !Ref DeployParameterOverrides 153 | RoleArn: !GetAtt DeploymentRole.Arn 154 | StackName: !Ref DeployStackName 155 | TemplatePath: "BuildArtifact::packaged.yaml" 156 | ChangeSetName: !Sub a-${DeployStackName}-Deploy 157 | RunOrder: 1 158 | - Name: ExecuteChangeSet 159 | ActionTypeId: 160 | Category: Deploy 161 | Owner: AWS 162 | Provider: CloudFormation 163 | Version: '1' 164 | Configuration: 165 | ActionMode: CHANGE_SET_EXECUTE 166 | StackName: !Ref DeployStackName 167 | ChangeSetName: !Sub a-${DeployStackName}-Deploy 168 | RunOrder: 2 169 | PipelineRole: 170 | Type: AWS::IAM::Role 171 | Properties: 172 | Description: !Sub "Used by CodePipeline. Created by CloudFormation ${AWS::StackId}" 173 | AssumeRolePolicyDocument: 174 | Version: "2012-10-17" 175 | Statement: 176 | - Effect: Allow 177 | Principal: 178 | Service: 179 | - "codepipeline.amazonaws.com" 180 | Action: 181 | - "sts:AssumeRole" 182 | Policies: 183 | - PolicyName: s3-access 184 | PolicyDocument: 185 | Version: "2012-10-17" 186 | Statement: 187 | - Effect: Allow 188 | Action: 189 | - "s3:DeleteObject" 190 | - "s3:GetObject" 191 | - "s3:GetObjectVersion" 192 | - "s3:PutObject" 193 | Resource: 194 | - !Sub arn:${AWS::Partition}:s3:::${Artifacts}/* 195 | - Effect: Allow 196 | Action: 197 | - "s3:ListBucket" 198 | - "s3:GetBucketPolicy" 199 | Resource: 200 | - !Sub arn:${AWS::Partition}:s3:::${Artifacts} 201 | - PolicyName: codebuild-access 202 | PolicyDocument: 203 | Version: "2012-10-17" 204 | Statement: 205 | - Effect: Allow 206 | Action: 207 | - "codebuild:StartBuild" 208 | - "codebuild:BatchGetBuilds" 209 | Resource: 210 | - !GetAtt BuildProject.Arn 211 | 212 | - PolicyName: deploy-cloudformation-access 213 | PolicyDocument: 214 | Version: "2012-10-17" 215 | Statement: 216 | - Effect: Allow 217 | Action: 218 | - "cloudformation:DescribeStacks" 219 | - "cloudformation:CreateChangeSet" 220 | - "cloudformation:ExecuteChangeSet" 221 | - "cloudformation:DescribeChangeSet" 222 | - "cloudformation:DeleteChangeSet" 223 | Resource: 224 | - !Sub arn:${AWS::Partition}:cloudformation:${AWS::Region}:${AWS::AccountId}:stack/${DeployStackName}/* 225 | 226 | - PolicyName: deploy-iam-access 227 | PolicyDocument: 228 | Version: "2012-10-17" 229 | Statement: 230 | - Effect: Allow 231 | Action: 232 | - "iam:PassRole" 233 | Resource: 234 | - !GetAtt DeploymentRole.Arn 235 | 236 | - !If 237 | - UseCodeCommit 238 | - PolicyName: codecommit-access 239 | PolicyDocument: 240 | Version: "2012-10-17" 241 | Statement: 242 | - Effect: Allow 243 | Action: 244 | - "codecommit:ListBranches" 245 | - "codecommit:GetBranch" 246 | - "codecommit:GetCommit" 247 | - "codecommit:GetUploadArchiveStatus" 248 | - "codecommit:GitPull" 249 | - "codecommit:UploadArchive" 250 | - "codecommit:CancelUploadArchive" 251 | Resource: 252 | - !Sub arn:${AWS::Partition}:codecommit:${AWS::Region}:${AWS::AccountId}:${CodeCommitRepoName} 253 | - !Ref AWS::NoValue 254 | BuildProject: 255 | Type: AWS::CodeBuild::Project 256 | Properties: 257 | ServiceRole: !GetAtt BuildProjectRole.Arn 258 | Source: 259 | Type: CODEPIPELINE 260 | Artifacts: 261 | Type: CODEPIPELINE 262 | Environment: 263 | ComputeType: !Ref ComputeType 264 | Image: 'aws/codebuild/amazonlinux2-x86_64-standard:1.0' 265 | Type: !Ref EnvironmentType 266 | EnvironmentVariables: 267 | - Name: PACKAGE_BUCKET 268 | Value: !Ref Artifacts 269 | 270 | CodeBuildPolicy: 271 | Type: AWS::IAM::Policy 272 | Properties: 273 | PolicyName: !Sub codebuild-access-${AWS::StackName} 274 | Roles: 275 | - !Ref BuildProjectRole 276 | PolicyDocument: 277 | Version: '2012-10-17' 278 | Statement: 279 | - Action: 280 | - logs:CreateLogGroup 281 | - logs:CreateLogStream 282 | - logs:PutLogEvents 283 | Effect: Allow 284 | Resource: 285 | - !Sub arn:${AWS::Partition}:logs:${AWS::Region}:${AWS::AccountId}:log-group:/aws/codebuild/* 286 | - Action: 287 | - s3:PutObject 288 | - s3:GetObject 289 | - s3:GetObjectVersion 290 | Effect: Allow 291 | Resource: 292 | - !Sub arn:${AWS::Partition}:s3:::${Artifacts}/* 293 | - Action: 294 | - s3:ListBucket 295 | Effect: Allow 296 | Resource: 297 | - !Sub arn:${AWS::Partition}:s3:::${Artifacts} 298 | BuildProjectRole: 299 | Type: AWS::IAM::Role 300 | Properties: 301 | Description: !Sub "Used in CodeBuild project. Created by stack ${AWS::StackId}" 302 | AssumeRolePolicyDocument: 303 | Statement: 304 | - Action: 305 | - sts:AssumeRole 306 | Effect: Allow 307 | Principal: 308 | Service: 309 | - codebuild.amazonaws.com 310 | Version: '2012-10-17' 311 | Path: /service-role/ 312 | 313 | DeploymentRole: 314 | Type: AWS::IAM::Role 315 | Properties: 316 | Description: !Sub "Used by CloudFormation. Created by stack ${AWS::StackId}" 317 | AssumeRolePolicyDocument: 318 | Version: "2012-10-17" 319 | Statement: 320 | - Effect: Allow 321 | Principal: 322 | Service: 323 | - "cloudformation.amazonaws.com" 324 | Action: 325 | - "sts:AssumeRole" 326 | ManagedPolicyArns: 327 | - arn:aws:iam::aws:policy/AdministratorAccess -------------------------------------------------------------------------------- /resources/templates/sam-template-chapter-5.yaml: -------------------------------------------------------------------------------- 1 | AWSTemplateFormatVersion: '2010-09-09' 2 | Transform: AWS::Serverless-2016-10-31 3 | Description: > 4 | sam-app 5 | 6 | Sample SAM Template for sam-app 7 | 8 | Globals: 9 | Function: 10 | Timeout: 3 11 | 12 | Resources: 13 | HelloWorldFunction: 14 | Type: AWS::Serverless::Function 15 | Properties: 16 | CodeUri: hello-world/ 17 | Handler: app.lambdaHandler 18 | Runtime: nodejs16.x 19 | AutoPublishAlias: live 20 | DeploymentPreference: 21 | Type: Canary10Percent5Minutes 22 | Alarms: 23 | - !Ref CanaryErrorsAlarm 24 | Events: 25 | HelloWorld: 26 | Type: Api 27 | Properties: 28 | Path: /hello 29 | Method: get 30 | 31 | CanaryErrorsAlarm: 32 | Type: AWS::CloudWatch::Alarm 33 | Properties: 34 | AlarmDescription: Lambda function canary errors 35 | ComparisonOperator: GreaterThanThreshold 36 | EvaluationPeriods: 2 37 | MetricName: Errors 38 | Namespace: AWS/Lambda 39 | Period: 60 40 | Statistic: Sum 41 | Threshold: 0 42 | Dimensions: 43 | - Name: Resource 44 | Value: !Sub "${HelloWorldFunction}:live" 45 | - Name: FunctionName 46 | Value: !Ref HelloWorldFunction 47 | - Name: ExecutedVersion 48 | Value: !GetAtt HelloWorldFunction.Version.Version 49 | 50 | Outputs: 51 | # ServerlessRestApi is an implicit API created out of Events key under Serverless::Function 52 | # Find out more about other implicit resources you can reference within SAM 53 | # https://github.com/awslabs/serverless-application-model/blob/master/docs/internals/generated_resources.rst#api 54 | HelloWorldApi: 55 | Description: "API Gateway endpoint URL for Prod stage for Hello World function" 56 | Value: !Sub "https://${ServerlessRestApi}.execute-api.${AWS::Region}.amazonaws.com/Prod/hello/" 57 | HelloWorldFunction: 58 | Description: "Hello World Lambda Function ARN" 59 | Value: !GetAtt HelloWorldFunction.Arn 60 | HelloWorldFunctionIamRole: 61 | Description: "Implicit IAM Role created for Hello World function" 62 | Value: !GetAtt HelloWorldFunctionRole.Arn 63 | -------------------------------------------------------------------------------- /workshop/buildspec.yml: -------------------------------------------------------------------------------- 1 | version: 0.2 2 | phases: 3 | install: 4 | runtime-versions: 5 | golang: 1.12 6 | nodejs: 10 7 | commands: 8 | - echo Entered the install phase... 9 | - apt-get -qq update && apt-get -qq install curl 10 | - apt-get -qq install asciidoctor 11 | - curl -s -L https://github.com/gohugoio/hugo/releases/download/v0.55.6/hugo_0.55.6_Linux-64bit.deb -o hugo.deb 12 | - dpkg -i hugo.deb 13 | finally: 14 | - echo Installation done 15 | build: 16 | commands: 17 | - echo Entered the build phase ... 18 | - echo Build started on `date` 19 | - cd $CODEBUILD_SRC_DIR/workshop/themes 20 | - git clone https://github.com/matcornic/hugo-theme-learn.git learn 21 | - cd ../ 22 | - hugo --quiet 23 | finally: 24 | - echo Building the HTML files finished 25 | artifacts: 26 | files: 27 | - "**/*" 28 | base-directory: $CODEBUILD_SRC_DIR/workshop/public/ 29 | discard-paths: no -------------------------------------------------------------------------------- /workshop/config.toml: -------------------------------------------------------------------------------- 1 | title = "CI/CD for Serverless Applications" 2 | baseURL = "https://cicd.serverlessworkshops.io" 3 | languageCode = "en-us" 4 | 5 | theme = "ananke" 6 | 7 | DefaultContentLanguage = "en" 8 | SectionPagesMenu = "main" 9 | 10 | [params] 11 | author = "Brian Zambrano " 12 | favicon = "https://a0.awsstatic.com/libra-css/images/site/fav/favicon.ico" -------------------------------------------------------------------------------- /workshop/content/_index.en.md: -------------------------------------------------------------------------------- 1 | --- 2 | title: CI/CD for Serverless Applications 3 | omit_header_text: true 4 | type: post 5 | --- 6 | 7 | ![AWS](/images/aws-logo.png) 8 | 9 | This workshop has moved! The serverless CI/CD content is now included in: 10 | 11 | # [The Complete AWS SAM Workshop](https://catalog.workshops.aws/complete-aws-sam/) 12 | 13 | We have updated the CI/CD modules to include steps to setup CI/CD using both 14 | [AWS CodePipeline](https://catalog.workshops.aws/complete-aws-sam/en-US/module-4-cicd/module-4-cicd-codepipeline) 15 | and [GitHub 16 | Actions](https://catalog.workshops.aws/complete-aws-sam/en-US/module-4-cicd/module-4-cicd-gh). 17 | 18 | Keep an eye on [The Complete AWS SAM Workshop](https://catalog.workshops.aws/complete-aws-sam/) 19 | workshop as we continue to add modules for different CI/CD provides as well as new modules about 20 | other features of SAM. -------------------------------------------------------------------------------- /workshop/layouts/partials/site-footer.html: -------------------------------------------------------------------------------- 1 | 2 | -------------------------------------------------------------------------------- /workshop/layouts/partials/site-navigation.html: -------------------------------------------------------------------------------- 1 | 2 | -------------------------------------------------------------------------------- /workshop/static/css/theme-aws.css: -------------------------------------------------------------------------------- 1 | 2 | :root{ 3 | 4 | --MAIN-TEXT-color:#232F3E; /* Color of text by default */ 5 | --MAIN-TITLES-TEXT-color: #161E2D; /* Color of titles h2-h3-h4-h5 */ 6 | --MAIN-LINK-color:#95b0ff; /* Color of links */ 7 | --MAIN-LINK-HOVER-color:#527FFF; /* Color of hovered links */ 8 | --MAIN-ANCHOR-color: #95b0ff; /* color of anchors on titles */ 9 | 10 | --MENU-HEADER-BG-color:#161E2D; /* Background color of menu header */ 11 | --MENU-HEADER-BORDER-color:#161E2D; /*Color of menu header border */ 12 | 13 | --MENU-SEARCH-BG-color:#202c3c; /* Search field background color (by default borders + icons) */ 14 | --MENU-SEARCH-BOX-color: #4d6584; /* Override search field border color */ 15 | --MENU-SEARCH-BOX-ICONS-color: #4d6584; /* Override search field icons color */ 16 | 17 | --MENU-SECTIONS-ACTIVE-BG-color:#232F3E; /* Background color of the active section and its childs */ 18 | --MENU-SECTIONS-BG-color:#161E2D; /* Background color of other sections */ 19 | --MENU-SECTIONS-TEXT-color: #FF9900; /*Color of pre text */ 20 | --MENU-SECTIONS-LINK-color: #ccc; /* Color of links in menu */ 21 | --MENU-SECTIONS-LINK-HOVER-color: #e6e6e6; /* Color of links in menu, when hovered */ 22 | --MENU-SECTION-ACTIVE-CATEGORY-color: #232F3E; /* Color of active category text */ 23 | --MENU-SECTION-ACTIVE-CATEGORY-BG-color: #FF9900; /* Color of background for the active category (only) */ 24 | --MENU-SECTION-ACTIVE-CATEGORY-TEXT-color: #fff; /* Color of pre text when selected */ 25 | 26 | --MENU-VISITED-color: #527FFF; /* Color of 'page visited' icons in menu */ 27 | --MENU-SECTION-HR-color: #20272b; /* Color of
separator in menu */ 28 | 29 | } 30 | 31 | @font-face { 32 | font-family: 'Amazon Ember'; 33 | src: url("https://fonts.workshops.aws/webfonts/AmazonEmber_W_Lt.eot"); 34 | src: url("https://fonts.workshops.aws/webfonts/AmazonEmber_W_Lt.eot?#iefix") format("embedded-opentype"), url("https://fonts.workshops.aws/webfonts/AmazonEmber_W_Lt.woff2") format("woff2"), url("https://fonts.workshops.aws/webfonts/AmazonEmber_W_Lt.woff") format("woff"); 35 | font-style: normal; 36 | font-weight: 200; 37 | } 38 | 39 | @font-face { 40 | font-family: 'Amazon Ember'; 41 | src: url("https://fonts.workshops.aws/webfonts/AmazonEmber_W_Bd.eot"); 42 | /* src: url("../webfonts/AmazonEmber_W_Bd.eot"); */ 43 | /* src: url("../webfonts/AmazonEmber_W_Bd.eot?#iefix") format("embedded-opentype"), url("../webfonts/AmazonEmber_W_Bd.woff2") format("woff2"), url("../webfonts/AmazonEmber_Bd_Lt.woff") format("woff"); */ 44 | font-style: bold; 45 | font-weight: 300; 46 | } 47 | 48 | body { 49 | font-family: "Amazon Ember", "Work Sans", "Helvetica", "Tahoma", "Geneva", "Arial", sans-serif; 50 | color: var(--MAIN-TEXT-color) !important; 51 | } 52 | 53 | textarea:focus, input[type="email"]:focus, input[type="number"]:focus, input[type="password"]:focus, input[type="search"]:focus, input[type="tel"]:focus, input[type="text"]:focus, input[type="url"]:focus, input[type="color"]:focus, input[type="date"]:focus, input[type="datetime"]:focus, input[type="datetime-local"]:focus, input[type="month"]:focus, input[type="time"]:focus, input[type="week"]:focus, select[multiple=multiple]:focus { 54 | border-color: none; 55 | box-shadow: none; 56 | } 57 | 58 | h2, h3, h4, h5, h6 { 59 | font-family: "Amazon Ember", "Work Sans", "Helvetica", "Tahoma", "Geneva", "Arial", sans-serif; 60 | color: var(--MAIN-TITLES-TEXT-color) !important; 61 | font-weight: 300; 62 | } 63 | 64 | h1 { 65 | font-family: "Amazon Ember", "Novacento Sans Wide", "Helvetica", "Tahoma", "Geneva", "Arial", sans-serif; 66 | } 67 | 68 | #chapter h1 { 69 | margin-top: 0; 70 | } 71 | 72 | #chapter h3 { 73 | margin-top: 0; 74 | } 75 | 76 | a { 77 | color: var(--MAIN-LINK-color); 78 | } 79 | 80 | .anchor { 81 | color: var(--MAIN-ANCHOR-color); 82 | } 83 | 84 | a:hover { 85 | color: var(--MAIN-LINK-HOVER-color); 86 | } 87 | 88 | #sidebar ul li.visited > a .read-icon { 89 | color: var(--MENU-VISITED-color); 90 | } 91 | 92 | #sidebar #footer { 93 | padding-top: 20px !important; 94 | } 95 | 96 | #sidebar #footer h2.github-title { 97 | font-size: 20px; 98 | color: #fd9827 !important; 99 | margin: 10px 0px 5px; 100 | padding: 0px; 101 | font-weight: normal !important; 102 | margin-top: 10px; 103 | padding-top: 30px; 104 | border-top: 1px dotted #384657; 105 | } 106 | 107 | #sidebar #footer h3.github-title { 108 | font-size: 14px; 109 | margin: 10px 0px 5px; 110 | padding: 0px; 111 | text-transform: uppercase; 112 | letter-spacing: .15px; 113 | } 114 | 115 | #sidebar #footer h5.copyright, #sidebar #footer p.build-number { 116 | color: var(--MENU-SECTIONS-LINK-color) !important; 117 | font-size: 10px; 118 | letter-spacing: .15px; 119 | line-height: 150% !important; 120 | font-weight: 300; 121 | } 122 | 123 | #body a.highlight:after { 124 | display: block; 125 | content: ""; 126 | height: 1px; 127 | width: 0%; 128 | -webkit-transition: width 0.5s ease; 129 | -moz-transition: width 0.5s ease; 130 | -ms-transition: width 0.5s ease; 131 | transition: width 0.5s ease; 132 | background-color: var(--MAIN-LINK-HOVER-color); 133 | } 134 | #sidebar { 135 | background-color: var(--MENU-SECTIONS-BG-color); 136 | } 137 | #sidebar #header-wrapper { 138 | background: var(--MENU-HEADER-BG-color); 139 | color: var(--MENU-SEARCH-BOX-color); 140 | border-color: var(--MENU-HEADER-BORDER-color); 141 | } 142 | #sidebar .searchbox { 143 | border-color: var(--MENU-SEARCH-BOX-color); 144 | background: var(--MENU-SEARCH-BG-color); 145 | } 146 | #sidebar ul.topics > li.parent, #sidebar ul.topics > li.active { 147 | background: var(--MENU-SECTIONS-ACTIVE-BG-color); 148 | } 149 | #sidebar .searchbox * { 150 | color: var(--MENU-SEARCH-BOX-ICONS-color); 151 | } 152 | 153 | #sidebar a { 154 | color: var(--MENU-SECTIONS-LINK-color); 155 | } 156 | 157 | #sidebar a b { 158 | color: var(--MENU-SECTIONS-TEXT-color); 159 | } 160 | 161 | #sidebar a:hover { 162 | color: var(--MENU-SECTIONS-LINK-HOVER-color); 163 | } 164 | 165 | #sidebar ul li.active > a { 166 | background: var(--MENU-SECTION-ACTIVE-CATEGORY-BG-color); 167 | color: var(--MENU-SECTION-ACTIVE-CATEGORY-color) !important; 168 | } 169 | 170 | #sidebar ul.topics > li > a b { 171 | color: var(--MENU-SECTION-ACTIVE-CATEGORY-TEXT-color) !important; 172 | opacity: 1; 173 | } 174 | 175 | #sidebar hr { 176 | border-color: var(--MENU-SECTION-HR-color); 177 | } 178 | 179 | #sidebar #shortcuts h3 { 180 | font-family: "Amazon Eber", "Novacento Sans Wide", "Helvetica", "Tahoma", "Geneva", "Arial", sans-serif; 181 | color: white !important; 182 | margin-top:1rem; 183 | padding-left: 1rem; 184 | } 185 | 186 | #navigation a.nav-prev, #navigation a.nav-next { 187 | color: #f19e39 !important; 188 | } 189 | 190 | #navigation a.nav-prev:hover, #navigation a.nav-next:hover { 191 | color: #e07d04 !important; 192 | } 193 | 194 | div.notices p:first-child:before { 195 | position: absolute; 196 | top: 2px; 197 | color: #fff; 198 | font-family: 'Font Awesome\ 5 Free'; 199 | content: #F06A; 200 | font-weight: 900; /* Fix version 5.0.9 */ 201 | left: 10px; 202 | } 203 | 204 | .ui-state-default, .ui-widget-content .ui-state-default, .ui-widget-header .ui-state-default, .ui-button, html .ui-button.ui-state-disabled:hover, html .ui-button.ui-state-disabled:active { 205 | border: 1px solid #dddddd; 206 | font-weight: normal; 207 | color: #454545; 208 | } 209 | 210 | .ui-state-active, .ui-widget-content .ui-state-active, .ui-widget-header .ui-state-active, a.ui-button:active, .ui-button:active, .ui-button.ui-state-active:hover { 211 | border: 1px solid var(--MENU-HEADER-BG-color); 212 | background: var(--MENU-HEADER-BG-color); 213 | font-weight: normal; 214 | color: #fff; 215 | } 216 | 217 | .ui-widget.ui-widget-content { 218 | border: 1px solid #eeeeee; 219 | } 220 | 221 | .ui-widget-header { 222 | border: 1px solid #eeeeee; 223 | } 224 | 225 | .hljs { 226 | background-color: none; 227 | } 228 | 229 | pre { 230 | background-color: var(--MENU-SECTIONS-BG-color) !important; 231 | } 232 | 233 | div.notices.info p { 234 | border-top: 30px solid #fd9827; 235 | background: #FFF2DB; 236 | } 237 | 238 | .btn { 239 | display: inline-block !important; 240 | padding: 6px 12px !important; 241 | margin-bottom: 0 !important; 242 | font-size: 14px !important; 243 | font-weight: normal !important; 244 | line-height: 1.42857143 !important; 245 | text-align: center !important; 246 | white-space: nowrap !important; 247 | vertical-align: middle !important; 248 | -ms-touch-action: manipulation !important; 249 | touch-action: manipulation !important; 250 | cursor: pointer !important; 251 | -webkit-user-select: none !important; 252 | -moz-user-select: none !important; 253 | -ms-user-select: none !important; 254 | user-select: none !important; 255 | background-image: none !important; 256 | border: 1px solid transparent !important; 257 | border-radius: 4px !important; 258 | -webkit-transition: all 0.15s !important; 259 | -moz-transition: all 0.15s !important; 260 | transition: all 0.15s !important; 261 | } 262 | .btn:focus { 263 | /*outline: thin dotted; 264 | outline: 5px auto -webkit-focus-ring-color; 265 | outline-offset: -2px;*/ 266 | outline: none !important; 267 | } 268 | .btn:hover, 269 | .btn:focus { 270 | color: #2b2b2b !important; 271 | text-decoration: none !important; 272 | } 273 | 274 | .btn-default { 275 | color: #fff !important; 276 | background-color: #527FFF !important; 277 | border-color: #527FFF !important; 278 | } 279 | .btn-default:hover, 280 | .btn-default:focus, 281 | .btn-default:active { 282 | color: #fff !important; 283 | background-color: #95b0ff !important; 284 | border-color: #95b0ff !important; 285 | } 286 | .btn-default:active { 287 | background-image: none !important; 288 | } 289 | 290 | #aws-logo { 291 | margin-top: 15px; 292 | margin-bottom: 25px; 293 | } -------------------------------------------------------------------------------- /workshop/static/images/aws-logo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aws-samples/aws-serverless-cicd-workshop/2e7de1f655407f348d93c0b3f5391b2de67f8f91/workshop/static/images/aws-logo.png --------------------------------------------------------------------------------