13 | {{end}}
14 |
15 |
21 |
22 | {{ partial "footer.html" . }}
--------------------------------------------------------------------------------
/workshop/themes/learn/exampleSite/content/shortcodes/siteparam.en.md:
--------------------------------------------------------------------------------
1 | ---
2 | title: Site param
3 | description : "Get value of site params variables in your page."
4 | ---
5 |
6 | `siteparam` shortcode is used to help you print values of site params.
7 |
8 | For instance, in this current site, the `editURL` variable is used in `config.toml`
9 |
10 | ```toml
11 | [params]
12 | editURL = "https://github.com/matcornic/hugo-theme-learn/edit/master/exampleSite/content/"
13 | ```
14 |
15 | Use the `siteparam` shortcode to display its value.
16 |
17 | ```
18 | `editURL` Value : {{%/* siteparam "editURL" */%}}
19 | ```
20 |
21 | is displayed as
22 |
23 | `editURL` Value : {{% siteparam "editURL" %}}
--------------------------------------------------------------------------------
/workshop/content/030_application/_index.en.md:
--------------------------------------------------------------------------------
1 | +++
2 | title = "Sample Application Structure"
3 | chapter = true
4 | weight = 30
5 | +++
6 |
7 | # Creating a Sample Application
8 |
9 | In this section we'll create our first Serverless application using AWS SAM CLI `sam init` command. The Cloud9 environment we just created already comes up with AWS CLI, AWS SAM CLI and other dependencies installed to our usage.
10 |
11 | {{% notice note %}}
12 | The idea behind this whole module is to create and package an initial application containing a boilerplate code with meaningful content and information that our development teams will use as a starting point for each new Serverless application they start from scratch.
13 | {{% /notice %}}
--------------------------------------------------------------------------------
/workshop/content/_index.en.md:
--------------------------------------------------------------------------------
1 | +++
2 | title = "AWS Serverless Application Catalog Workshop"
3 | chapter = true
4 | weight = 1
5 | +++
6 |
7 | # Serverless Application Catalog Workshop
8 |
9 | Welcome! In this workshop, we will explore some of the ways you can implement a CI/CD pipeline on AWS for Serverless workloads in a standardized way across an entire organization, allowing Software Engineers to develop and test Serverless workloads as they would in a more traditional environment while DevOps teams can focus on building one single pipeline that satisfies multiple environments and can be distributed as a "product" across multiple development teams.
10 |
11 | 
12 |
--------------------------------------------------------------------------------
/workshop/content/050_catalog/_index.en.md:
--------------------------------------------------------------------------------
1 | +++
2 | title = "Packaging and Distributing the Pipeline"
3 | chapter = true
4 | weight = 50
5 | +++
6 |
7 | # Packaging and Distributing the Pipeline
8 |
9 | We are now going to package our application code and transform the CI/CD pipeline we just create in a reusable product avaible across all our developer teams in our organization using a AWS CloudFormation template and AWS Service Catalog.
10 |
11 | {{% notice note %}}
12 | The idea behind this whole module is to create and package an initial application containing a boilerplate code with meaningful content and information that our development teams will use as a starting point for each new Serverless application they start from scratch.
13 | {{% /notice %}}
14 |
--------------------------------------------------------------------------------
/workshop/content/_index.pt.md:
--------------------------------------------------------------------------------
1 | +++
2 | title = "AWS Serverless Application Catalog Workshop"
3 | chapter = true
4 | weight = 1
5 | +++
6 |
7 | # Serverless Application Catalog Workshop
8 |
9 | Bem-vindo! Neste workshop, iremos explorar algumas das formas que você pode implementar um pipeline de CI/CD para workloads Serverless de forma padronizada através de uma organização, permitindo que Engenheiros de Software desenvolvam e testem aplicações Serverless assim como fariam em um ambiente mais tradicional enquanto times de DevOps podem focar em construir um único pipeline que satisfaça múltiplos ambientes e que possa ser distribuido como um "produto" entre múltiplos times de desenvolvimento.
10 |
11 | 
12 |
--------------------------------------------------------------------------------
/workshop/themes/learn/exampleSite/content/shortcodes/siteparam.fr.md:
--------------------------------------------------------------------------------
1 | ---
2 | title: Site param
3 | description : "Afficher la valeur d'un paramètre global du site dans votre page"
4 | ---
5 |
6 | Les shortcode `siteparam` est utilisé pour vous aider à afficher des valeurs provenant des paramètres globaux du site.
7 |
8 | Par exemple, dans ce site, le paramètre `editURL` est utilisé dans le fichier `config.toml`
9 |
10 | ```toml
11 | [params]
12 | editURL = "https://github.com/matcornic/hugo-theme-learn/edit/master/exampleSite/content/"
13 | ```
14 |
15 | Utilisez le shortcode `siteparam` pour affichier sa valeur.
16 |
17 | ```
18 | Valeur de `editURL` : {{%/* siteparam "editURL" */%}}
19 | ```
20 |
21 | s'affiche comme
22 |
23 | Valeur de `editURL` : {{% siteparam "editURL" %}}
--------------------------------------------------------------------------------
/workshop/layouts/shortcodes/tab.html:
--------------------------------------------------------------------------------
1 | {{ if .Parent }}
2 | {{ $name := trim (.Get "name") " " }}
3 | {{ $include := trim (.Get "include") " "}}
4 | {{ $codelang := .Get "codelang" }}
5 | {{ if not (.Parent.Scratch.Get "tabs") }}
6 | {{ .Parent.Scratch.Set "tabs" slice }}
7 | {{ end }}
8 | {{ with .Inner }}
9 | {{ if $codelang }}
10 | {{ $.Parent.Scratch.Add "tabs" (dict "name" $name "content" (highlight . $codelang "") ) }}
11 | {{ else }}
12 | {{ $.Parent.Scratch.Add "tabs" (dict "name" $name "content" . ) }}
13 | {{ end }}
14 | {{ else }}
15 | {{ $.Parent.Scratch.Add "tabs" (dict "name" $name "include" $include "codelang" $codelang) }}
16 | {{ end }}
17 | {{ else }}
18 | {{- errorf "[%s] %q: tab shortcode missing its parent" .Page.Site.Language.Lang .Page.Path -}}
19 | {{ end}}
--------------------------------------------------------------------------------
/workshop/content/020_prerequisites/workspace/iamrole.en.md:
--------------------------------------------------------------------------------
1 | ---
2 | title: "Create an IAM role for your Workspace"
3 | chapter: false
4 | weight: 15
5 | ---
6 |
7 |
8 | 1. Follow [this deep link to create an IAM role with Administrator access.](https://console.aws.amazon.com/iam/home#/roles$new?step=review&commonUseCase=EC2%2BEC2&selectedUseCase=EC2&policies=arn:aws:iam::aws:policy%2FAdministratorAccess)
9 | 1. Confirm that **AWS service** and **EC2** are selected, then click **Next** to view permissions.
10 | 1. Confirm that **AdministratorAccess** is checked, then click **Next: Tags** to assign tags.
11 | 1. Take the defaults, and click **Next: Review** to review.
12 | 1. Enter **serverless-catalog-workshop-admin** for the Name, and click **Create role**.
13 | 
--------------------------------------------------------------------------------
/workshop/themes/learn/exampleSite/content/shortcodes/_index.en.md:
--------------------------------------------------------------------------------
1 | ---
2 | date: 2016-04-09T16:50:16+02:00
3 | title: Shortcodes
4 | pre: "3. "
5 | weight: 15
6 | ---
7 |
8 | Hugo uses Markdown for its simple content format. However, there are a lot of things that Markdown doesn’t support well. You could use pure HTML to expand possibilities.
9 |
10 | But this happens to be a bad idea. Everyone uses Markdown because it's pure and simple to read even non-rendered. You should avoid HTML to keep it as simple as possible.
11 |
12 | To avoid this limitations, Hugo created [shortcodes](https://gohugo.io/extras/shortcodes/). A shortcode is a simple snippet inside a page.
13 |
14 | **Hugo-theme-learn** provides multiple shortcodes on top of existing ones.
15 |
16 | {{%children style="h2" description="true" %}}
17 |
--------------------------------------------------------------------------------
/workshop/themes/learn/layouts/shortcodes/expand.html:
--------------------------------------------------------------------------------
1 | {{ $_hugo_config := `{ "version": 1 }` }}
2 |
--------------------------------------------------------------------------------
/workshop/content/authors.en.md:
--------------------------------------------------------------------------------
1 | ---
2 | title: Credits
3 | disableToc: true
4 | ---
5 |
6 | #### Main Author(s)
7 |
8 | The AWS Serverless Application Catalog Workshop website has been developed by:
9 |
10 | * **Enrico Bergamo** - Labs, content, website & format
11 |
12 | #### Additional Author(s)
13 |
14 |
17 |
18 | #### Other Contributor(s)
19 |
20 | This website is the result of many reviews and contributions.
21 |
22 | ##### Technical Reviewer(s)
23 |
24 | * **Alexandre Bicas**
25 | * **Ciro Santos**
26 | * **Fabio Agarie**
27 | * **Guilherme França**
28 | * **Ivan Vargas**
29 | * **Kimmy Wu**
30 | * **Lucas Lins**
31 | * **Luiz Yanai**
32 | * **Marcos Cotomacio**
33 | * **Roberto da Silva**
34 | * **Thiago Padua**
35 |
36 | ##### Translator(s)
37 |
38 | * **Enrico Bergamo** (PT)
39 | * **Luiz Yanai** (PT)
40 | * **Rafael Werneck** (PT)
41 |
--------------------------------------------------------------------------------
/workshop/themes/learn/exampleSite/content/shortcodes/_index.fr.md:
--------------------------------------------------------------------------------
1 | ---
2 | date: 2016-04-09T16:50:16+02:00
3 | title: Shortcodes
4 | pre: "3. "
5 | weight: 15
6 | ---
7 |
8 | Hugo utilise Markdown pour son format simple. Cependant, il y a beaucoup de chose que Markdown ne supporte pas bien. On pourrait utiliser du HTML pur pour améliorer les capacité du Markdown.
9 |
10 | Mais c'est probablement une mauvaise idée. Tout le monde utilise le Markdown parce que c'est pur et simple à lire même lorsqu'il est affiché en texte brut. Vous devez éviter le HTML autant que possible pour garder le contenu simple.
11 |
12 | Cependant, pour éviter les limitations, Hugo a créé les [shortcodes](https://gohugo.io/extras/shortcodes/). Un shortcode est un bout de code (*snippet*) dans une page.
13 |
14 | **Hugo-theme-learn** fournit de multiple shortcodes en plus de ceux existant.
15 |
16 | {{%children style="h2" description="true" %}}
17 |
--------------------------------------------------------------------------------
/workshop/themes/learn/exampleSite/content/cont/tags.en.md:
--------------------------------------------------------------------------------
1 | ---
2 | date: 2018-11-29T08:41:44+01:00
3 | title: Tags
4 | weight: 40
5 | tags: ["documentation", "tutorial"]
6 | ---
7 |
8 | *Learn theme* support one default taxonomy of gohugo: the *tag* feature.
9 |
10 | ## Configuration
11 |
12 | Just add tags to any page:
13 |
14 | ```markdown
15 | ---
16 | date: 2018-11-29T08:41:44+01:00
17 | title: Theme tutorial
18 | weight: 15
19 | tags: ["tutorial", "theme"]
20 | ---
21 | ```
22 |
23 | ## Behavior
24 |
25 |
26 | The tags are displayed at the top of the page, in their insertion order.
27 |
28 | Each tag is a link to a *Taxonomy* page displaying all the articles with the given tag.
29 |
30 | ## List all the tags
31 |
32 | In the `config.toml` file you can add a shortcut to display all the tags
33 |
34 | ```toml
35 | [[menu.shortcuts]]
36 | name = " Tags"
37 | url = "/tags"
38 | weight = 30
39 | ```
--------------------------------------------------------------------------------
/workshop/content/authors.pt.md:
--------------------------------------------------------------------------------
1 | ---
2 | title: Créditos
3 | disableToc: true
4 | ---
5 |
6 | #### Main Author(s)
7 |
8 | The AWS Serverless Catalog Workshop website has been developed by:
9 |
10 | * **Enrico Bergamo** - Labs, content, website & format
11 |
12 | #### Additional Author(s)
13 |
14 | * **Luiz Yanai** - Content & tech review, and labs
15 |
16 | #### Other Contributor(s)
17 |
18 | This website is the result of many reviews and contributions.
19 |
20 | ##### Technical Reviewer(s)
21 |
22 | * **Gustavo Rozatti**
23 | * **Claudia Charro**
24 | * **Natalia Girolamo**
25 |
26 | ##### Translator(s)
27 |
28 | * **Enrico Bergamo** (PT)
29 | * **Luiz Yanai** (PT)
30 |
31 | ##### GitHub Contributor(s)
32 |
33 | {{% ghcontributors "https://api.github.com/repos/enr1c091/serverless-catalog-workshop-source/contributors?per_page=1000" %}}
34 |
35 | Thanks to our wonderful contributors
36 |
--------------------------------------------------------------------------------
/workshop/themes/learn/exampleSite/content/shortcodes/button.fr.md:
--------------------------------------------------------------------------------
1 | ---
2 | title: Button (Bouton)
3 | description : "De beaux boutons sur votre page."
4 | ---
5 |
6 | Le shortcode *button* est simplement un bouton cliquable avec une icône optionnelle.
7 |
8 | ```
9 | {{%/* button href="https://getgrav.org/" */%}}Téléchargez Grav{{%/* /button */%}}
10 | {{%/* button href="https://getgrav.org/" icon="fas fa-download" */%}}Téléchargez Grav avec icône{{%/* /button */%}}
11 | {{%/* button href="https://getgrav.org/" icon="fas fa-download" icon-position="right" */%}}Téléchargez Grav avec icône à droite{{%/* /button */%}}
12 | ```
13 |
14 | {{% button href="https://getgrav.org/" %}}Téléchargez Grav{{% /button %}}
15 | {{% button href="https://getgrav.org/" icon="fas fa-download" %}}Téléchargez Grav avec icône{{% /button %}}
16 | {{% button href="https://getgrav.org/" icon="fas fa-download" icon-position="right" %}}Téléchargez Grav avec icône à droite{{% /button %}}
17 |
--------------------------------------------------------------------------------
/LICENSE:
--------------------------------------------------------------------------------
1 | Copyright 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 |
--------------------------------------------------------------------------------
/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.64.1/hugo_0.64.1_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
20 | - git clone https://github.com/matcornic/hugo-theme-learn.git themes/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/content/040_pipeline/_index.en.md:
--------------------------------------------------------------------------------
1 | +++
2 | title = "Create the CI/CD Pipeline"
3 | chapter = true
4 | weight = 40
5 | +++
6 |
7 | # Creating a CI/CD Pipeline
8 |
9 | [Continuous integration (CI)](https://aws.amazon.com/devops/continuous-integration/) and [continuous delivery (CD)](https://aws.amazon.com/devops/continuous-delivery/) are essential for deft organizations. Teams are more productive when they can make discrete changes frequently, release those changes programmatically and deliver updates without disruption.
10 |
11 | In this module, we will build a CI/CD pipeline for our serverless application using [AWS CodeCommit](https://aws.amazon.com/codecommit/), [AWS CodeBuild](https://aws.amazon.com/codebuild/) and [AWS CodePipeline](https://aws.amazon.com/codepipeline/). The CI/CD pipeline will deploy our sample Node.js service in multiple environments, we will make a change to the CodeCommit repository and observe the automated delivery of this change to our account.
12 |
--------------------------------------------------------------------------------
/workshop/layouts/shortcodes/ghcontributors.html:
--------------------------------------------------------------------------------
1 |
22 |
--------------------------------------------------------------------------------
/workshop/content/040_pipeline/upload-code-git.en.md:
--------------------------------------------------------------------------------
1 | +++
2 | title = "Upload Code to Repository"
3 | weight = 44
4 | +++
5 |
6 | Now that we have our CodeCommit permissions and credentials properly configured, let's upload our sample application code to our repository.
7 |
8 | Switch back to your **Cloud9** environoment and open a terminal tab.
9 |
10 | ```sh
11 | cd ~/environment/
12 | git clone https://git-codecommit.${AWS_REGION}.amazonaws.com/v1/repos/serverless-repo
13 | rsync -a --exclude='.git' aws-serverless-application-catalog-workshop/code/sam/nodejs/ serverless-repo/
14 | cd serverless-repo/
15 | ```
16 |
17 | Upload the code to the AWS CodeCommit Repository.
18 |
19 | ```sh
20 | git add .
21 | git commit -m "Initial Commit"
22 | git push
23 | ```
24 |
25 | 
26 |
27 | {{% notice info %}}
28 | If you are prompted to enter an username and password, enter the ones in the credentials we generated in the previous step.
29 | {{% /notice %}}
30 |
--------------------------------------------------------------------------------
/workshop/themes/learn/layouts/partials/search.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 | {{ $assetBusting := not .Site.Params.disableAssetsBusting }}
7 |
8 |
9 |
16 |
17 |
--------------------------------------------------------------------------------
/workshop/themes/learn/exampleSite/content/cont/tags.fr.md:
--------------------------------------------------------------------------------
1 | ---
2 | date: 2018-11-29T08:41:44+01:00
3 | title: Tags
4 | weight: 40
5 | tags: ["documentation", "tutorial"]
6 | ---
7 |
8 |
9 | Le *thème Learn* supporte une des taxonomy par défaut de GoHugo : les tags.
10 |
11 | ## Configuration
12 |
13 | Il suffit d'ajouter un tableau de tags sur la page :
14 |
15 | ```markdown
16 | ---
17 | date: 2018-11-29T08:41:44+01:00
18 | title: Tutoriel pour le thème
19 | weight: 15
20 | tags: ["tutoriel", "theme"]
21 | ---
22 | ```
23 |
24 | ## Comportement
25 |
26 | Les tags sont affichés en haut de la page, dans l'ordre dans lequel ils ont été saisis.
27 |
28 | Chaque tag est un lien vers une page *Taxonomy*, qui affiche tous les article avec ce tag.
29 |
30 |
31 | ## Liste des tags
32 |
33 | Il est possible de rajouter un raccourci dans le fichier `config.toml` afin d'afficher une page listant tous les tags
34 |
35 | ```toml
36 | [[menu.shortcuts]]
37 | name = " Tags"
38 | url = "/tags"
39 | weight = 30
40 | ```
--------------------------------------------------------------------------------
/workshop/content/010_introduction/_index.en.md:
--------------------------------------------------------------------------------
1 | +++
2 | title = "Introduction"
3 | weight = 10
4 | +++
5 |
6 | Many organizations, from small startups to large enterprises, are adopting more and more "serverless-first" architectures to obtain a faster time-to-market with optimized development and operation costs, and higher availability rates. But sometimes, this paradigm shift can be seen as a challenge in how our Engineering teams develop their microservices in an organized fashion while ensuring the best practices are still being applied, how DevOps teams ensure the organization is using the correct tools and how to adequate their existing delivery pipelines to this new concept, and how Operations teams can ensure to measure and monitor these workloads without having to acquire a new skillset.
7 |
8 | This workshop will walk you through some of the best practices to create a serverless backend API and create and configure a multi-environment CI/CD pipeline that can be reused across multiple development teams inside an organization, and is composed of three core objectives:
9 |
10 | {{%children style="h2" description="true" %}}
11 |
--------------------------------------------------------------------------------
/workshop/themes/learn/exampleSite/content/shortcodes/notice.en.md:
--------------------------------------------------------------------------------
1 | ---
2 | title: Notice
3 | description : "Disclaimers to help you structure your page"
4 | ---
5 |
6 | The notice shortcode shows 4 types of disclaimers to help you structure your page.
7 |
8 | ### Note
9 |
10 | ```
11 | {{%/* notice note */%}}
12 | A notice disclaimer
13 | {{%/* /notice */%}}
14 | ```
15 |
16 | renders as
17 |
18 | {{% notice note %}}
19 | A notice disclaimer
20 | {{% /notice %}}
21 |
22 | ### Info
23 |
24 | ```
25 | {{%/* notice info */%}}
26 | An information disclaimer
27 | {{%/* /notice */%}}
28 | ```
29 |
30 | renders as
31 |
32 | {{% notice info %}}
33 | An information disclaimer
34 | {{% /notice %}}
35 |
36 | ### Tip
37 |
38 | ```
39 | {{%/* notice tip */%}}
40 | A tip disclaimer
41 | {{%/* /notice */%}}
42 | ```
43 |
44 | renders as
45 |
46 | {{% notice tip %}}
47 | A tip disclaimer
48 | {{% /notice %}}
49 |
50 | ### Warning
51 |
52 | ```
53 | {{%/* notice warning */%}}
54 | A warning disclaimer
55 | {{%/* /notice */%}}
56 | ```
57 |
58 | renders as
59 |
60 | {{% notice warning %}}
61 | A warning disclaimer
62 | {{% /notice %}}
63 |
--------------------------------------------------------------------------------
/workshop/themes/learn/static/css/auto-complete.css:
--------------------------------------------------------------------------------
1 | .autocomplete-suggestions {
2 | text-align: left;
3 | cursor: default;
4 | border: 1px solid #ccc;
5 | border-top: 0;
6 | background: #fff;
7 | box-shadow: -1px 1px 3px rgba(0,0,0,.1);
8 |
9 | /* core styles should not be changed */
10 | position: absolute;
11 | display: none;
12 | z-index: 9999;
13 | max-height: 254px;
14 | overflow: hidden;
15 | overflow-y: auto;
16 | box-sizing: border-box;
17 |
18 | }
19 | .autocomplete-suggestion {
20 | position: relative;
21 | cursor: pointer;
22 | padding: 7px;
23 | line-height: 23px;
24 | white-space: nowrap;
25 | overflow: hidden;
26 | text-overflow: ellipsis;
27 | color: #333;
28 | }
29 |
30 | .autocomplete-suggestion b {
31 | font-weight: normal;
32 | color: #1f8dd6;
33 | }
34 |
35 | .autocomplete-suggestion.selected {
36 | background: #333;
37 | color: #fff;
38 | }
39 |
40 | .autocomplete-suggestion:hover {
41 | background: #444;
42 | color: #fff;
43 | }
44 |
45 | .autocomplete-suggestion > .context {
46 | font-size: 12px;
47 | }
48 |
--------------------------------------------------------------------------------
/workshop/content/030_application/testing-app.en.md:
--------------------------------------------------------------------------------
1 | +++
2 | title = "Testing the APIs"
3 | weight = 36
4 | +++
5 |
6 | #### Export the stack output variables
7 | To invoke our API's, we first need to fetch the `ApiUrl` output variable that our CloudFormation stack gives us. So let us iterate through our stack and export all output variables as environment variables:
8 |
9 | ```sh
10 | export ApiUrl=$(aws cloudformation describe-stacks --stack-name sam-app --output json | jq '.Stacks[].Outputs[] | select(.OutputKey=="ApiUrl") | .OutputValue' | sed -e 's/^"//' -e 's/"$//')
11 | echo "export ApiUrl="$ApiUrl
12 | ```
13 |
14 | #### Test the `Put Item` operation
15 |
16 | ```sh
17 | curl -X POST \
18 | $ApiUrl/items/ \
19 | -d '{
20 | "id":"1",
21 | "name": "Sample test item"
22 | }'
23 |
24 | curl -X POST \
25 | $ApiUrl/items/ \
26 | -d '{
27 | "id":"2",
28 | "name": "Second test item"
29 | }'
30 | ```
31 |
32 | #### Test the `Get All Items` operation
33 |
34 | ```sh
35 | curl -X GET $ApiUrl/items/ | jq
36 | ```
37 |
38 | #### Test the `Get Item by Id` operation
39 |
40 | ```sh
41 | curl -X GET $ApiUrl/items/1 | jq
42 | ```
43 |
--------------------------------------------------------------------------------
/workshop/content/020_prerequisites/aws_event/portal.en.md:
--------------------------------------------------------------------------------
1 | ---
2 | title: "AWS Workshop Portal"
3 | chapter: false
4 | weight: 20
5 | ---
6 |
7 | ### Login to AWS Workshop Portal
8 |
9 | This workshop creates an AWS acccount and a Cloud9 environment. You will need the **Participant Hash** provided upon entry, and your email address to track your unique session.
10 |
11 | Connect to the portal by clicking the button or browsing to [https://dashboard.eventengine.run/](https://dashboard.eventengine.run/). The following screen shows up.
12 |
13 | 
14 |
15 | Enter the provided hash in the text box. The button on the bottom right corner changes to **Accept Terms & Login**. Click on that button to continue.
16 |
17 | 
18 |
19 | Click on **AWS Console** on dashboard.
20 |
21 | 
22 |
23 | Take the defaults and click on **Open AWS Console**. This will open AWS Console in a new browser tab.
24 |
25 | Once you have completed the step above, you can head straight to [**Create a Workspace**](../../workspace/)
--------------------------------------------------------------------------------
/workshop/themes/learn/exampleSite/LICENSE.md:
--------------------------------------------------------------------------------
1 | The MIT License (MIT)
2 |
3 | Copyright (c) 2016 MATHIEU CORNIC
4 |
5 | Permission is hereby granted, free of charge, to any person obtaining a copy of
6 | this software and associated documentation files (the "Software"), to deal in
7 | the Software without restriction, including without limitation the rights to
8 | use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of
9 | the Software, and to permit persons to whom the Software is furnished to do so,
10 | subject to the following conditions:
11 |
12 | The above copyright notice and this permission notice shall be included in all
13 | copies or substantial portions of the Software.
14 |
15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS
17 | FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
18 | COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
19 | IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
20 | CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
21 |
--------------------------------------------------------------------------------
/workshop/content/020_prerequisites/self_paced/account.en.md:
--------------------------------------------------------------------------------
1 | ---
2 | title: "Create an AWS account"
3 | chapter: false
4 | weight: 1
5 | ---
6 |
7 | {{% notice warning %}}
8 | Your account must have the ability to create new IAM roles and scope other IAM permissions.
9 | {{% /notice %}}
10 |
11 | 1. If you don't already have an AWS account with Administrator access: [create
12 | one now by clicking here](https://aws.amazon.com/getting-started/)
13 |
14 | 1. Once you have an AWS account, ensure you are following the remaining workshop steps
15 | as an IAM user with administrator access to the AWS account:
16 | [Create a new IAM user to use for the workshop](https://console.aws.amazon.com/iam/home?#/users$new)
17 |
18 | 1. Enter the user details:
19 | 
20 |
21 | 1. Attach the AdministratorAccess IAM Policy:
22 | 
23 |
24 | 1. Click to create the new user:
25 | 
26 |
27 | 1. Take note of the login URL and save:
28 | 
29 |
30 | Once you have completed the step above, you can head straight to [**Create a Workspace**](../../workspace/)
--------------------------------------------------------------------------------
/workshop/themes/learn/exampleSite/content/shortcodes/notice.fr.md:
--------------------------------------------------------------------------------
1 | ---
2 | title: Notice
3 | description : "Message pour vous aider à structurer votre contenu"
4 | ---
5 |
6 | Le shortcode *Notice* permet d'afficher 4 types de message pour vous aider à structurer votre contenu.
7 |
8 | ### Note
9 |
10 | ```
11 | {{%/* notice note */%}}
12 | Une notice de type *note*
13 | {{%/* /notice */%}}
14 | ```
15 |
16 | s'affiche comme
17 |
18 | {{% notice note %}}
19 | Une notice de type *note*
20 | {{% /notice %}}
21 |
22 | ### Info
23 |
24 | ```
25 | {{%/* notice info */%}}
26 | Une notice de type *info*
27 | {{%/* /notice */%}}
28 | ```
29 |
30 | s'affiche comme
31 |
32 | {{% notice info %}}
33 | Une notice de type *info*
34 | {{% /notice %}}
35 |
36 | ### Tip
37 |
38 | ```
39 | {{%/* notice tip */%}}
40 | Une notice de type *tip*
41 | {{%/* /notice */%}}
42 | ```
43 |
44 | s'affiche comme
45 |
46 | {{% notice tip %}}
47 | Une notice de type *tip*
48 | {{% /notice %}}
49 |
50 | ### Warning
51 |
52 | ```
53 | {{%/* notice warning */%}}
54 | Une notice de type *warning*
55 | {{%/* /notice */%}}
56 | ```
57 |
58 | s'affiche comme
59 |
60 | {{% notice warning %}}
61 | Une notice de type *warning*
62 | {{% /notice %}}
--------------------------------------------------------------------------------
/workshop/themes/learn/LICENSE.md:
--------------------------------------------------------------------------------
1 | The MIT License (MIT)
2 |
3 | Copyright (c) 2014 Grav
4 | Copyright (c) 2016 MATHIEU CORNIC
5 | Copyright (c) 2017 Valere JEANTET
6 |
7 | Permission is hereby granted, free of charge, to any person obtaining a copy of
8 | this software and associated documentation files (the "Software"), to deal in
9 | the Software without restriction, including without limitation the rights to
10 | use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of
11 | the Software, and to permit persons to whom the Software is furnished to do so,
12 | subject to the following conditions:
13 |
14 | The above copyright notice and this permission notice shall be included in all
15 | copies or substantial portions of the Software.
16 |
17 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
18 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS
19 | FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
20 | COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
21 | IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
22 | CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
23 |
--------------------------------------------------------------------------------
/workshop/themes/learn/exampleSite/layouts/partials/menu-footer.html:
--------------------------------------------------------------------------------
1 |
34 | {{.Inner}}
35 |
36 |
37 |
--------------------------------------------------------------------------------
/workshop/themes/learn/static/css/tags.css:
--------------------------------------------------------------------------------
1 | /* Tags */
2 |
3 | #head-tags{
4 | margin-left:1em;
5 | margin-top:1em;
6 | }
7 |
8 | #body .tags a.tag-link {
9 | display: inline-block;
10 | line-height: 2em;
11 | font-size: 0.8em;
12 | position: relative;
13 | margin: 0 16px 8px 0;
14 | padding: 0 10px 0 12px;
15 | background: #8451a1;
16 |
17 | -webkit-border-bottom-right-radius: 3px;
18 | border-bottom-right-radius: 3px;
19 | -webkit-border-top-right-radius: 3px;
20 | border-top-right-radius: 3px;
21 |
22 | -webkit-box-shadow: 0 1px 2px rgba(0,0,0,0.2);
23 | box-shadow: 0 1px 2px rgba(0,0,0,0.2);
24 | color: #fff;
25 | }
26 |
27 | #body .tags a.tag-link:before {
28 | content: "";
29 | position: absolute;
30 | top:0;
31 | left: -1em;
32 | width: 0;
33 | height: 0;
34 | border-color: transparent #8451a1 transparent transparent;
35 | border-style: solid;
36 | border-width: 1em 1em 1em 0;
37 | }
38 |
39 | #body .tags a.tag-link:after {
40 | content: "";
41 | position: absolute;
42 | top: 10px;
43 | left: 1px;
44 | width: 5px;
45 | height: 5px;
46 | -webkit-border-radius: 50%;
47 | border-radius: 100%;
48 | background: #fff;
49 | }
50 |
--------------------------------------------------------------------------------
/workshop/themes/learn/exampleSite/content/cont/archetypes.en.md:
--------------------------------------------------------------------------------
1 | ---
2 | title: Archetypes
3 | weight: 10
4 | ---
5 |
6 | Using the command: `hugo new [relative new content path]`, you can start a content file with the date and title automatically set. While this is a welcome feature, active writers need more : [archetypes](https://gohugo.io/content/archetypes/).
7 |
8 | It is pre-configured skeleton pages with default front matter. Please refer to the documentation for types of page to understand the differences.
9 |
10 | ## Chapter {#archetypes-chapter}
11 |
12 | To create a Chapter page, run the following commands
13 |
14 | ```
15 | hugo new --kind chapter /_index.md
16 | ```
17 |
18 | It will create a page with predefined Front-Matter:
19 |
20 | ```markdown
21 | +++
22 | title = "{{ replace .Name "-" " " | title }}"
23 | date = {{ .Date }}
24 | weight = 5
25 | chapter = true
26 | pre = "X. "
27 | +++
28 |
29 | ### Chapter X
30 |
31 | # Some Chapter title
32 |
33 | Lorem Ipsum.
34 | ```
35 |
36 | ## Default
37 |
38 | To create a default page, run either one of the following commands
39 |
40 | ```
41 | # Either
42 | hugo new //_index.md
43 | # Or
44 | hugo new /.md
45 | ```
46 |
47 | It will create a page with predefined Front-Matter:
48 |
49 | ```markdown
50 | +++
51 | title = "{{ replace .Name "-" " " | title }}"
52 | date = {{ .Date }}
53 | weight = 5
54 | +++
55 |
56 | Lorem Ipsum.
57 | ```
--------------------------------------------------------------------------------
/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: application-catalog
3 | #title - The title of your workshop
4 | title: AWS Serverless Application Catalog Workshop
5 | #description - A short description that will be displayed in search results
6 | description: Creating CI/CD Pipelines for Serverless Applications!
7 | #categories - Refer to official AWS categories covered by the workshop content here
8 | categories:
9 | - Serverless
10 | - Developer
11 | - Compute
12 | #services - Refer to the official AWS service names covered by the workshop content here
13 | services:
14 | - Api Gateway
15 | - Lambda
16 | - DynamoDB
17 | - CloudFormation
18 | - Service Catalog
19 | - CodeBuild
20 | - CodeCommit
21 | - CodeDeploy
22 | - CodePipeline
23 | - Serverless Application Model
24 | - X-Ray
25 | #level - Approximate skill level needed for this workshop
26 | level: 300
27 | #duration - Estimated duration in minutes
28 | duration: 120
29 | #cost - Cost in USD. If the content is offered without cost, enter 0
30 | cost: 0
31 | #author - Amazon alias of the primary author of the content
32 | author: enricosb
33 | #audience - Names of the personas associated with this workshop
34 | audience:
35 | - IT Professional
36 | - Solutions Architect
37 | - Software Engineer
38 | - DevOps Engineer
39 | - SRE
40 | - Developer
--------------------------------------------------------------------------------
/workshop/content/050_catalog/catalog-create.en.md:
--------------------------------------------------------------------------------
1 | +++
2 | title = "Creating a Service Catalog Product"
3 | weight = 54
4 | +++
5 |
6 |
7 | {{% notice info %}}
8 | Make sure you have the URL of your template file with you. e.g. https://serverless-wksp-sample-**``**.s3.amazonaws.com/service-catalog/template.yaml
9 | {{% /notice %}}
10 |
11 | #### Create a Service Catalog Portfolio
12 |
13 | Click [this deep link](https://console.aws.amazon.com/catalog/home) to access your AWS Service Catalog console
14 |
15 | - Under **Administration** select **Portifolios**
16 | - Click **Create portifolio**
17 | - Name it **Projects with CI/CD Pipeline** and type the **Owner** name, click Create.
18 | - Click on your newly created portifolio.
19 | 
20 |
21 | #### Upload a new Product
22 |
23 | - Click **Upload new product**
24 | - Name it **Serverless Project** and type the **Owner** name.
25 | - On **Description** type **Creates a new Serverless project based on AWS SAM with a multi-environment CI/CD Pipeline**.
26 | - Under **Version Details** check the box **Use a CloudFormation template** as source for your template.
27 | - Paste the S3 URL of your `template.yaml` on **Use a CloudFormation template** text box, click Review.
28 | - Click **Create product**
29 | 
30 |
31 | {{% notice tip %}}
32 | Try refreshing the page if the added Product doesn't show up in your screen.
33 | {{% /notice %}}
34 |
--------------------------------------------------------------------------------
/code/sam/nodejs/buildspec.yml:
--------------------------------------------------------------------------------
1 | version: 0.2
2 | phases:
3 | install:
4 | runtime-versions:
5 | nodejs: 12
6 | commands:
7 | - echo "[Install phase]"
8 | # Install all dependencies (including dependencies for running tests)
9 | - npm install
10 | - pip install --upgrade awscli aws-sam-cli
11 | pre_build:
12 | commands:
13 | - echo "[Pre-Build phase]"
14 | # Use Pre-Build phase to run tests, install any code deps or any other customization before build
15 | # Discover and run unit tests in the '__tests__' directory
16 | # - npm run test # Tests covered in testspec.yml
17 | # Remove all unit tests to reduce the size of the package that will be ultimately uploaded to Lambda
18 | - rm -rf ./__tests__
19 | # Remove all dependencies not needed for the Lambda deployment package (the packages from devDependencies in package.json)
20 | - npm prune --production
21 | build:
22 | commands:
23 | - echo "[Build phase]"
24 | # Use AWS SAM to package the application by using AWS CloudFormation
25 | - sam package --template template.yaml --s3-bucket $BUILD_OUTPUT_BUCKET --output-template-file packaged.yaml
26 | post_build:
27 | commands:
28 | # Use Post Build for notifications, git tags and any further customization after build
29 | - echo "[Post-Build phase]"
30 | - echo "SAM packaging completed on `date`"
31 | artifacts:
32 | type: zip
33 | files:
34 | - packaged.yaml
35 |
--------------------------------------------------------------------------------
/workshop/themes/learn/exampleSite/content/cont/icons.en.md:
--------------------------------------------------------------------------------
1 | ---
2 | title: Icons and logos
3 | weight: 27
4 | ---
5 |
6 | The Learn theme for Hugo loads the [**Font Awesome**](https://fontawesome.com) library, allowing you to easily display any icon or logo available in the Font Awesome free collection.
7 |
8 | ## Finding an icon
9 |
10 | Browse through the available icons in the [Font Awesome Gallery](https://fontawesome.com/icons?d=gallery&m=free). Notice that the **free** filter is enabled, as only the free icons are available by default.
11 |
12 | Once on the Font Awesome page for a specific icon, for example the page for the [heart](https://fontawesome.com/icons/heart?style=solid), copy the HTML reference and paste into the markdown content.
13 |
14 | The HTML to include the heart icon is:
15 |
16 | ```
17 |
18 | ```
19 |
20 | ## Including in markdown
21 |
22 | Paste the `` HTML into markup and Font Awesome will load the relevant icon.
23 |
24 | ```
25 | Built with from Grav and Hugo
26 | ```
27 |
28 | Which appears as
29 |
30 | Built with from Grav and Hugo
31 |
32 | ## Customising icons
33 |
34 | Font Awesome provides many ways to modify the icon
35 |
36 | * Change colour (by default the icon will inherit the parent colour)
37 | * Increase or decrease size
38 | * Rotate
39 | * Combine with other icons
40 |
41 | Check the full documentation on [web fonts with CSS](https://fontawesome.com/how-to-use/web-fonts-with-css) for more.
42 |
--------------------------------------------------------------------------------
/workshop/themes/learn/layouts/index.html:
--------------------------------------------------------------------------------
1 | {{ partial "header.html" . }}
2 |
3 | navigation
4 |
5 |
6 | {{if .Site.Home.Content }}
7 | {{.Site.Home.Content}}
8 | {{else}}
9 | {{if eq .Site.Language.Lang "fr"}}
10 |
Personaliser la page d'accueil
11 |
12 | Le site fonctionne. Ne pas oublier de personaliser cette page avec votre propre contenu. 3 manières de faire :
13 |
14 |
15 |
1. Créer un fichier _index.md dans le dossier content et le remplir de Markdown
16 |
2. Créer un fichier index.html dans le dossier static et le remplir de code HTML
17 |
3. Configurer le serveur http pour rediriger automatiquement la homepage vers la page de votre choix dans le site
18 |
19 | {{else}}
20 |
Customize your own home page
21 |
22 | The site is working. Don't forget to customize this homepage with your own. You typically have 3 choices :
23 |
24 |
25 |
1. Create an _index.md document in content folder and fill it with Markdown content
26 |
2. Create an index.html file in the static folder and fill the file with HTML content
27 |
3. Configure your server to automatically redirect home page to one your documentation page
28 |
29 | {{end}}
30 | {{ end }}
31 | {{ partial "footer.html" . }}
32 |
--------------------------------------------------------------------------------
/workshop/content/050_catalog/catalog-launch.en.md:
--------------------------------------------------------------------------------
1 | +++
2 | title = "Launching a Serverless Project"
3 | weight = 56
4 | +++
5 |
6 | - Click **Product list**
7 | - Click the **three dots** in front of your Product, click Launch.
8 | 
9 |
10 | - Name it **demo-service** and click Next.
11 | - Type **serverless-wksp-sample-``/sam/nodejs** for **CodeS3Bucket** and click Next.
12 | - Type **demo-service** for **ProjectName**.
13 | - Type **demo-service-repo** for **RepositoryName**.
14 | - Type **Repository for our demo service** for **RepositoryDescription**.
15 | - Accept all defaults by clicking Next
16 | - Review and click **Launch**
17 |
18 | Click on the AWS CloudFormation Stack URL to keep up with the product provisioning.
19 | 
20 |
21 | Once the stack status shows as **CREATE_COMPLETE** inspect the [AWS CodePipeline](https://console.aws.amazon.com/codesuite/codepipeline/pipelines/demo-service/view) create for your project.
22 | 
23 |
24 | {{% notice info %}}
25 | The pipeline has been triggered since we uploaded the content of the `sample.zip` to our repository and it interprets the upload action as an **initial commit**. It might take around 10-15 minutes for the whole pipeline to complete.
26 | {{% /notice %}}
27 |
28 | 
29 |
30 | One way to check your resources were properly created for each environment is to check on the AWS Lambda console.
31 |
32 | 
33 |
--------------------------------------------------------------------------------
/workshop/themes/learn/exampleSite/content/cont/archetypes.fr.md:
--------------------------------------------------------------------------------
1 | ---
2 | title: Archétypes
3 | weight: 10
4 | ---
5 |
6 | En utilisant la commande: `hugo new [chemin vers nouveau contenu]`, vous pouvez créer un nouveau fichier avec la date et le title automatiquement initialisé. Même si c'est une fonctionnalité intéressante, elle reste limitée pour les auteurs actifs qui ont besoin de mieux : les [archetypes](https://gohugo.io/content/archetypes/).
7 |
8 | Les archétypes sont des squelettes de pages préconfigurées avec un Front Matter par défaut. Merci de vous référer à la documentation pour connaitre les différents types de page.
9 |
10 | ## Chapitre {#archetypes-chapter}
11 |
12 | Pour créer un chapitre, lancez les commandes suivantes
13 |
14 | ```
15 | hugo new --kind chapter /_index.md
16 | ```
17 |
18 | Cela crééra une page avec le Front Matter suivant:
19 |
20 | ```markdown
21 | +++
22 | title = "{{ replace .Name "-" " " | title }}"
23 | date = {{ .Date }}
24 | weight = 5
25 | chapter = true
26 | pre = "X. "
27 | +++
28 |
29 | ### Chapter X
30 |
31 | # Some Chapter title
32 |
33 | Lorem Ipsum.
34 | ```
35 |
36 | ## Défaut
37 |
38 | Pour créer une page classique, lancer l'une des deux commandes suivantes
39 |
40 | ```
41 | # Soit
42 | hugo new //_index.md
43 | # Ou
44 | hugo new /.md
45 | ```
46 |
47 | Cela crééra une page avec le Front Matter suivant:
48 |
49 | ```markdown
50 | +++
51 | title = "{{ replace .Name "-" " " | title }}"
52 | date = {{ .Date }}
53 | weight = 5
54 | +++
55 |
56 | Lorem Ipsum.
57 | ```
--------------------------------------------------------------------------------
/workshop/content/050_catalog/package-app.en.md:
--------------------------------------------------------------------------------
1 | +++
2 | title = "Packaging the Node.js Application"
3 | weight = 52
4 | +++
5 |
6 | Since we want every new serverless project to be as a boilerplate, The first thing we have to do is to package our application into a ZIP file and upload it to a S3 bucket which used as source for every new AWS CodeCommit repository created.
7 |
8 | #### Package the application
9 |
10 | ```sh
11 | cd ~/environment/aws-serverless-application-catalog-workshop/code/sam/nodejs
12 | rm -rf node_modules/
13 | zip -r ~/environment/sample.zip *
14 | ```
15 |
16 | #### Create an unique S3 bucket
17 |
18 | Create a S3 bucket choosing an unique name for your bucket. e.g: serverless-wksp-sample-**firstname-lastname**
19 |
20 | ```sh
21 | aws s3 mb s3://serverless-wksp-sample-
22 | ```
23 |
24 | Go to your [S3 console](https://s3.console.aws.amazon.com/s3/home) and confirm your bucket has been created.
25 |
26 | 
27 |
28 | #### Upload the ZIP file to S3
29 |
30 | ```sh
31 | cd ~/environment
32 | aws s3 cp sample.zip s3:///sam/nodejs/sample.zip
33 | ```
34 |
35 | Go to your [S3 console](https://s3.console.aws.amazon.com/s3/home) and confirm your upload has been completed successfully.
36 |
37 | 
38 |
39 | {{% notice tip %}}
40 | We are using the `/sam/nodejs/` directory structure to allow our teams to grow this strategy in the future to other frameworks and approaches besides `AWS SAM` (e.g. Kubernetes microservices) and other languages besides `Node.js`.
41 | {{% /notice %}}
42 |
--------------------------------------------------------------------------------
/workshop/themes/learn/exampleSite/content/credits.fr.md:
--------------------------------------------------------------------------------
1 | ---
2 | title: Crédits
3 | disableToc: true
4 | ---
5 |
6 | ## Contributeurs
7 |
8 | Merci à eux de rendre le monde Open Source meilleur !
9 |
10 | {{% ghcontributors "https://api.github.com/repos/matcornic/hugo-theme-learn/contributors?per_page=100" %}}
11 |
12 | Et un grand merci à [@vjeantet](https://github.com/vjeantet) pour son travail sur [docdock](https://github.com/vjeantet/hugo-theme-docdock), un fork de _hugo-theme-learn_. La v2.0.0 du thème est en grande partie inspirée de son travail.
13 |
14 | ## Packages et librairies
15 | * [mermaid](https://knsv.github.io/mermaid) - géneration de diagrames et graphiques à partir de texte similaire à Markdown
16 | * [font awesome](http://fontawesome.io/) - Le framework de polices iconiques
17 | * [jQuery](https://jquery.com) - La plus connue des librairies Javascript
18 | * [lunr](https://lunrjs.com) - Lunr fournit des fonctions de recherche sans service externe
19 | * [horsey](https://bevacqua.github.io/horsey/) - Autocomplétion de composants (utiliser pour les suggestions de recherche)
20 | * [clipboard.js](https://zenorocha.github.io/clipboard.js) - Copier le texte dans le presse-papier
21 | * [highlight.js](https://highlightjs.org) - Mise en valeur de syntaxes
22 | * [modernizr](https://modernizr.com) - Une boite à outil Javascript qui permet aux développeurs d'utiliser les dernières fonctionnalités de CSS et HTML5, même sur de vieux navigateurs.
23 |
24 | ## Outils
25 |
26 | * [Netlify](https://www.netlify.com) - Déploiement continue et hébergement de cette documentation
27 | * [Hugo](https://gohugo.io/)
28 |
29 |
--------------------------------------------------------------------------------
/workshop/content/040_pipeline/cleanup.en.md:
--------------------------------------------------------------------------------
1 | +++
2 | title = "Cleanup"
3 | weight = 49
4 | +++
5 |
6 | #### Delete the stacks for each environment created for our application
7 |
8 | ```sh
9 | aws cloudformation delete-stack --stack-name serverless-service-Dev
10 | aws cloudformation delete-stack --stack-name serverless-service-Prod
11 | ```
12 |
13 | #### Delete the code repository
14 |
15 | ```sh
16 | aws codecommit delete-repository --repository-name serverless-repo
17 | ```
18 |
19 | #### Delete the build projects
20 |
21 | ```sh
22 | aws codebuild delete-project --name serverless-build-project
23 | aws codebuild delete-project --name serverless-test-project
24 | ```
25 |
26 | #### Delete the pipeline
27 |
28 | ```sh
29 | aws codepipeline delete-pipeline --name serverless-pipeline
30 | ```
31 |
32 | #### Empty and delete the S3 bucket for build artifacts
33 |
34 | ```sh
35 | aws s3 rm s3://aws-serverless-catalog-wksp-build- --recursive
36 | aws s3 rb s3://aws-serverless-catalog-wksp-build- --force
37 | ```
38 |
39 | #### Delete the IAM Roles
40 |
41 | ```sh
42 | aws iam delete-role-policy --role-name serverless-catalog-wksp-build-role --policy-name build-permissions
43 | aws iam delete-role --role-name serverless-catalog-wksp-build-role
44 |
45 | aws iam delete-role-policy --role-name serverless-catalog-wksp-pipeline-role --policy-name pipeline-permissions
46 | aws iam delete-role --role-name serverless-catalog-wksp-pipeline-role
47 |
48 | aws iam delete-role-policy --role-name serverless-catalog-wksp-cf-role --policy-name cf-permissions
49 | aws iam delete-role --role-name serverless-catalog-wksp-cf-role
50 | ```
51 |
--------------------------------------------------------------------------------
/workshop/themes/learn/exampleSite/content/credits.en.md:
--------------------------------------------------------------------------------
1 | ---
2 | title: Credits
3 | disableToc: true
4 | ---
5 |
6 | ## Contributors
7 |
8 | Thanks to them for making Open Source Software a better place !
9 |
10 | {{% ghcontributors "https://api.github.com/repos/matcornic/hugo-theme-learn/contributors?per_page=100" %}}
11 |
12 | And a special thanks to [@vjeantet](https://github.com/vjeantet) for his work on [docdock](https://github.com/vjeantet/hugo-theme-docdock), a fork of hugo-theme-learn. v2.0.0 of this theme is inspired by his work.
13 |
14 | ## Packages and libraries
15 | * [mermaid](https://knsv.github.io/mermaid) - generation of diagram and flowchart from text in a similar manner as markdown
16 | * [font awesome](http://fontawesome.io/) - the iconic font and CSS framework
17 | * [jQuery](https://jquery.com) - The Write Less, Do More, JavaScript Library
18 | * [lunr](https://lunrjs.com) - Lunr enables you to provide a great search experience without the need for external, server-side, search services...
19 | * [horsey](https://bevacqua.github.io/horsey/) - Progressive and customizable autocomplete component
20 | * [clipboard.js](https://zenorocha.github.io/clipboard.js) - copy text to clipboard
21 | * [highlight.js](https://highlightjs.org) - Javascript syntax highlighter
22 | * [modernizr](https://modernizr.com) - A JavaScript toolkit that allows web developers to use new CSS3 and HTML5 features while maintaining a fine level of control over browsers that don't support
23 |
24 | ## Tooling
25 |
26 | * [Netlify](https://www.netlify.com) - Continuous deployement and hosting of this documentation
27 | * [Hugo](https://gohugo.io/)
28 |
29 |
--------------------------------------------------------------------------------
/workshop/layouts/shortcodes/tabs.html:
--------------------------------------------------------------------------------
1 |
2 | {{ .Page.Scratch.Add "tabset-counter" 1 }}
3 | {{ $tab_set_id := .Get "name" | default (printf "tabset-%s-%d" (.Page.RelPermalink) (.Page.Scratch.Get "tabset-counter") ) | anchorize }}
4 | {{ $tabs := .Scratch.Get "tabs" }}
5 | {{ if .Inner }}{{/* We don't use the inner content, but Hugo will complain if we don't reference it. */}}{{ end }}
6 |
16 | {{ with .content }}
17 | {{ . }}
18 | {{ else }}
19 | {{ if eq $.Page.BundleType "leaf" }}
20 | {{/* find the file somewhere inside the bundle. Note the use of double asterisk */}}
21 | {{ with $.Page.Resources.GetMatch (printf "**%s*" .include) }}
22 | {{ if ne .ResourceType "page" }}
23 | {{/* Assume it is a file that needs code highlighting. */}}
24 | {{ $codelang := $e.codelang | default ( path.Ext .Name | strings.TrimPrefix ".") }}
25 | {{ highlight .Content $codelang "" }}
26 | {{ else}}
27 | {{ .Content }}
28 | {{ end }}
29 | {{ end }}
30 | {{ else}}
31 | {{ $path := path.Join $.Page.Dir .include }}
32 | {{ $page := $.Page.Site.GetPage "page" $path }}
33 | {{ with $page }}
34 | {{ .Content }}
35 | {{ else }}
36 | {{ errorf "[%s] tabs include not found for path %q" $.Page.Site.Language.Lang $path}}
37 | {{ end }}
38 | {{ end }}
39 | {{ end }}
40 |
41 | {{ end }}
42 |
43 | {{ $elem := $tab_set_id | safeJS }}
44 |
--------------------------------------------------------------------------------
/code/sam/nodejs/__tests__/unit/items/get-all-items.test.js:
--------------------------------------------------------------------------------
1 | // Import all functions from get-all-items.js
2 | const lambda = require('../../../src/items/get-all-items/index.js')
3 | // Import dynamodb from aws-sdk
4 | const dynamodb = require('aws-sdk/clients/dynamodb')
5 |
6 | // This includes all tests for getAllItemsHandler()
7 | describe('Test getAllItemsHandler', () => { // eslint-disable-line
8 | let scanSpy
9 |
10 | // Test one-time setup and teardown, see more in https://jestjs.io/docs/en/setup-teardown
11 | beforeAll(() => { // eslint-disable-line
12 | // Mock dynamodb get and put methods
13 | // https://jestjs.io/docs/en/jest-object.html#jestspyonobject-methodname
14 | scanSpy = jest.spyOn(dynamodb.DocumentClient.prototype, 'scan') // eslint-disable-line
15 | })
16 |
17 | // Clean up mocks
18 | afterAll(() => { // eslint-disable-line
19 | scanSpy.mockRestore()
20 | })
21 |
22 | it('should return ids', async () => { // eslint-disable-line
23 | const items = [{ id: 'id1' }, { id: 'id2' }]
24 |
25 | // Return the specified value whenever the spied scan function is called
26 | scanSpy.mockReturnValue({
27 | promise: () => Promise.resolve({ Items: items })
28 | })
29 |
30 | const event = {
31 | httpMethod: 'GET'
32 | }
33 |
34 | // Invoke helloFromLambdaHandler()
35 | const result = await lambda.getAllItemsHandler(event)
36 |
37 | const expectedResult = {
38 | statusCode: 200,
39 | headers: {
40 | 'Access-Control-Allow-Origin': '*'
41 | },
42 | body: JSON.stringify(items)
43 | }
44 |
45 | // Compare the result with the expected result
46 | expect(result).toEqual(expectedResult) // eslint-disable-line
47 | })
48 | })
49 |
--------------------------------------------------------------------------------
/workshop/content/010_introduction/011_architecture/sam.en.md:
--------------------------------------------------------------------------------
1 | +++
2 | title = "AWS Serverless Application Model (SAM)"
3 | weight = 110
4 | description = "Let's create a sample Serverless application that will be given to our developers using AWS Serverless Application Model(SAM) applying some of the best practices regarding serverless microservices workspace structure, logging, monitoring, and creating the basic unit tests for each one of these microservices."
5 | +++
6 |
7 |
8 | The [AWS Serverless Application Model (SAM)](https://aws.amazon.com/serverless/sam/) is an open-source framework for building serverless applications. It provides shorthand syntax to express functions, APIs, databases, and event source mappings. With just a few lines per resource, you can define the application you want and model it using YAML. During deployment, SAM transforms and expands the SAM syntax into AWS CloudFormation syntax, enabling you to build serverless applications faster.
9 |
10 | To get started with building SAM-based applications, use the [AWS SAM CLI](https://docs.aws.amazon.com/serverless-application-model/latest/developerguide/serverless-sam-reference.html#serverless-sam-cli) and the [SAM Template Specification](https://github.com/awslabs/serverless-application-model/blob/master/versions/2016-10-31.md). SAM CLI provides a Lambda-like execution environment that lets you locally build, test, and debug applications defined by SAM templates. You can also use the SAM CLI to deploy your applications to AWS.
11 | SAM and SAM CLI are open-sourced under the Apache 2.0 license. You can contribute new features and enhancements to [SAM on GitHub](https://github.com/awslabs/serverless-application-model) or [SAM CLI on GitHub](https://github.com/awslabs/aws-sam-cli).
12 |
--------------------------------------------------------------------------------
/code/sam/nodejs/__tests__/unit/items/get-by-id.test.js:
--------------------------------------------------------------------------------
1 | // Import all functions from get-by-id.js
2 | const lambda = require('../../../src/items/get-by-id/index.js')
3 | // Import dynamodb from aws-sdk
4 | const dynamodb = require('aws-sdk/clients/dynamodb')
5 |
6 | // This includes all tests for getByIdHandler()
7 | describe('Test getByIdHandler', () => { // eslint-disable-line
8 | let getSpy
9 |
10 | // Test one-time setup and teardown, see more in https://jestjs.io/docs/en/setup-teardown
11 | beforeAll(() => { // eslint-disable-line
12 | // Mock dynamodb get and put methods
13 | // https://jestjs.io/docs/en/jest-object.html#jestspyonobject-methodname
14 | getSpy = jest.spyOn(dynamodb.DocumentClient.prototype, 'get') // eslint-disable-line
15 | })
16 |
17 | // Clean up mocks
18 | afterAll(() => { // eslint-disable-line
19 | getSpy.mockRestore()
20 | })
21 |
22 | // This test invokes getByIdHandler() and compare the result
23 | it('should get item by id', async () => { // eslint-disable-line
24 | const item = { id: 'id1' }
25 |
26 | // Return the specified value whenever the spied get function is called
27 | getSpy.mockReturnValue({
28 | promise: () => Promise.resolve({ Item: item })
29 | })
30 |
31 | const event = {
32 | httpMethod: 'GET',
33 | pathParameters: {
34 | id: 'id1'
35 | }
36 | }
37 |
38 | // Invoke getByIdHandler()
39 | const result = await lambda.getByIdHandler(event)
40 |
41 | const expectedResult = {
42 | statusCode: 200,
43 | headers: {
44 | 'Access-Control-Allow-Origin': '*'
45 | },
46 | body: JSON.stringify(item)
47 | }
48 |
49 | // Compare the result with the expected result
50 | expect(result).toEqual(expectedResult) // eslint-disable-line
51 | })
52 | })
53 |
--------------------------------------------------------------------------------
/workshop/content/030_application/sam-init.en.md:
--------------------------------------------------------------------------------
1 | +++
2 | title = "Creating a serverless application"
3 | weight = 31
4 | +++
5 |
6 | {{% notice note %}}
7 | This sample application will be built using `Node.js` and this structure tree might differ for other languages.
8 | {{% /notice %}}
9 |
10 | #### Creating an application using `sam init`
11 |
12 | By using AWS SAM CLI, you can quickly create serverless applications using the command [sam init](https://docs.aws.amazon.com/serverless-application-model/latest/developerguide/sam-cli-command-reference-sam-init.html) with different levels of customization and boilerplates to get started.
13 |
14 | Go to your Terminal session in your Cloud9 environment and create your first application.
15 |
16 | ```sh
17 | sam init -n sample-app -r nodejs12.x
18 | ```
19 |
20 | When prompted, select the following settings:
21 |
22 | ```sh
23 | Which template source would you like to use?
24 | 1 - AWS Quick Start Templates
25 | 2 - Custom Template Location
26 | Choice: 1
27 |
28 |
29 | Allow SAM CLI to download AWS-provided quick start templates from Github [Y/n]: n
30 |
31 |
32 | -----------------------
33 | Generating application:
34 | -----------------------
35 | Name: sample-app
36 | Runtime: nodejs12.x
37 | Dependency Manager: npm
38 | Application Template: hello-world
39 | Output Directory: .
40 |
41 | Next steps can be found in the README file at ./sample-app/README.md
42 | ```
43 |
44 | If all steps executed properly, you should have a workspace with the following structure.
45 | 
46 |
47 | {{% notice tip %}}
48 | This creates our sample application, but doesn't deploy any resources to AWS. Let us first understand what's happening and tweak it out a little bit before deploying anything to our AWS account.
49 | {{% /notice %}}
50 |
--------------------------------------------------------------------------------
/code/sam/nodejs/__tests__/unit/items/put-item.test.js:
--------------------------------------------------------------------------------
1 | // Import all functions from put-item.js
2 | const lambda = require('../../../src/items/put-item/index.js')
3 | // Import dynamodb from aws-sdk
4 | const dynamodb = require('aws-sdk/clients/dynamodb')
5 |
6 | // This includes all tests for putItemHandler()
7 | describe('Test putItemHandler', function () { // eslint-disable-line
8 | let putSpy
9 |
10 | // Test one-time setup and teardown, see more in https://jestjs.io/docs/en/setup-teardown
11 | beforeAll(() => { // eslint-disable-line
12 | // Mock dynamodb get and put methods
13 | // https://jestjs.io/docs/en/jest-object.html#jestspyonobject-methodname
14 | putSpy = jest.spyOn(dynamodb.DocumentClient.prototype, 'put') // eslint-disable-line
15 | })
16 |
17 | // Clean up mocks
18 | afterAll(() => { // eslint-disable-line
19 | putSpy.mockRestore()
20 | })
21 |
22 | // This test invokes putItemHandler() and compare the result
23 | it('should add id to the table', async () => { // eslint-disable-line
24 | const returnedItem = { id: 'id1', name: 'name1' }
25 |
26 | // Return the specified value whenever the spied put function is called
27 | putSpy.mockReturnValue({
28 | promise: () => Promise.resolve(returnedItem)
29 | })
30 |
31 | const event = {
32 | httpMethod: 'POST',
33 | body: '{"id": "id1","name": "name1"}'
34 | }
35 |
36 | // Invoke putItemHandler()
37 | const result = await lambda.putItemHandler(event)
38 | const expectedResult = {
39 | statusCode: 200,
40 | headers: {
41 | 'Access-Control-Allow-Origin': '*'
42 | },
43 | body: JSON.stringify(returnedItem)
44 | }
45 |
46 | // Compare the result with the expected result
47 | expect(result).toEqual(expectedResult) // eslint-disable-line
48 | })
49 | })
50 |
--------------------------------------------------------------------------------
/workshop/content/020_prerequisites/workspace/workspace.en.md:
--------------------------------------------------------------------------------
1 | ---
2 | title: "Create a Workspace"
3 | chapter: false
4 | weight: 14
5 | ---
6 |
7 | {{% notice warning %}}
8 | The Cloud9 workspace should be built by an IAM user with Administrator privileges,
9 | not the root account user. Please ensure you are logged in as an IAM user, not the root
10 | account user.
11 | {{% /notice %}}
12 |
13 | {{% notice tip %}}
14 | Ad blockers, javascript disablers, and tracking blockers should be disabled for
15 | the cloud9 domain, or connecting to the workspace might be impacted.
16 | Cloud9 requires third-party-cookies. You can whitelist the [specific domains]( https://docs.aws.amazon.com/cloud9/latest/user-guide/troubleshooting.html#troubleshooting-env-loading).
17 | {{% /notice %}}
18 |
19 | ### Launch Cloud9 in your closest region:
20 | {{< tabs name="Region" >}}
21 | {{{< tab name="N. Virginia" include="us-east-1.en.md" />}}
22 | {{{< tab name="Oregon" include="us-west-2.en.md" />}}
23 | {{{< tab name="Ireland" include="eu-west-1.en.md" />}}
24 | {{{< tab name="Ohio" include="us-east-2.en.md" />}}
25 | {{{< tab name="Singapore" include="ap-southeast-1.en.md" />}}
26 | {{< /tabs >}}
27 |
28 | - Select **Create environment**
29 | - Name it **serverless-catalog-workshop**, click Next.
30 | - Choose **"t3.small"** for instance type, take all default values and click **Create environment**
31 | - When it comes up, customize the environment by closing the **welcome tab**
32 | and **lower work area**, and opening a new **terminal** tab in the main work area:
33 | 
34 |
35 | - Your workspace should now look like this:
36 | 
37 |
38 | - If you like this theme, you can choose it yourself by selecting **View / Themes / Solarized / Solarized Dark**
39 | in the Cloud9 workspace menu.
40 |
41 | #### Install jq
42 | ```
43 | sudo yum -y install jq
44 | ```
--------------------------------------------------------------------------------
/workshop/themes/learn/static/css/featherlight.min.css:
--------------------------------------------------------------------------------
1 | /**
2 | * Featherlight - ultra slim jQuery lightbox
3 | * Version 1.7.13 - http://noelboss.github.io/featherlight/
4 | *
5 | * Copyright 2018, Noël Raoul Bossart (http://www.noelboss.com)
6 | * MIT Licensed.
7 | **/
8 | html.with-featherlight{overflow:hidden}.featherlight{display:none;position:fixed;top:0;right:0;bottom:0;left:0;z-index:2147483647;text-align:center;white-space:nowrap;cursor:pointer;background:#333;background:rgba(0,0,0,0)}.featherlight:last-of-type{background:rgba(0,0,0,.8)}.featherlight:before{content:'';display:inline-block;height:100%;vertical-align:middle}.featherlight .featherlight-content{position:relative;text-align:left;vertical-align:middle;display:inline-block;overflow:auto;padding:25px 25px 0;border-bottom:25px solid transparent;margin-left:5%;margin-right:5%;max-height:95%;background:#fff;cursor:auto;white-space:normal}.featherlight .featherlight-inner{display:block}.featherlight link.featherlight-inner,.featherlight script.featherlight-inner,.featherlight style.featherlight-inner{display:none}.featherlight .featherlight-close-icon{position:absolute;z-index:9999;top:0;right:0;line-height:25px;width:25px;cursor:pointer;text-align:center;font-family:Arial,sans-serif;background:#fff;background:rgba(255,255,255,.3);color:#000;border:0;padding:0}.featherlight .featherlight-close-icon::-moz-focus-inner{border:0;padding:0}.featherlight .featherlight-image{width:100%}.featherlight-iframe .featherlight-content{border-bottom:0;padding:0;-webkit-overflow-scrolling:touch}.featherlight iframe{border:0}.featherlight *{-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box}@media only screen and (max-width:1024px){.featherlight .featherlight-content{margin-left:0;margin-right:0;max-height:98%;padding:10px 10px 0;border-bottom:10px solid transparent}}@media print{html.with-featherlight>*>:not(.featherlight){display:none}}
--------------------------------------------------------------------------------
/workshop/themes/learn/static/css/hybrid.css:
--------------------------------------------------------------------------------
1 | /*
2 |
3 | vim-hybrid theme by w0ng (https://github.com/w0ng/vim-hybrid)
4 |
5 | */
6 |
7 | /*background color*/
8 | .hljs {
9 | display: block;
10 | overflow-x: auto;
11 | padding: 0.5em;
12 | background: #1d1f21;
13 | }
14 |
15 | /*selection color*/
16 | .hljs::selection,
17 | .hljs span::selection {
18 | background: #373b41;
19 | }
20 |
21 | .hljs::-moz-selection,
22 | .hljs span::-moz-selection {
23 | background: #373b41;
24 | }
25 |
26 | /*foreground color*/
27 | .hljs {
28 | color: #c5c8c6;
29 | }
30 |
31 | /*color: fg_yellow*/
32 | .hljs-title,
33 | .hljs-name {
34 | color: #f0c674;
35 | }
36 |
37 | /*color: fg_comment*/
38 | .hljs-comment,
39 | .hljs-meta,
40 | .hljs-meta .hljs-keyword {
41 | color: #707880;
42 | }
43 |
44 | /*color: fg_red*/
45 | .hljs-number,
46 | .hljs-symbol,
47 | .hljs-literal,
48 | .hljs-deletion,
49 | .hljs-link {
50 | color: #cc6666
51 | }
52 |
53 | /*color: fg_green*/
54 | .hljs-string,
55 | .hljs-doctag,
56 | .hljs-addition,
57 | .hljs-regexp,
58 | .hljs-selector-attr,
59 | .hljs-selector-pseudo {
60 | color: #b5bd68;
61 | }
62 |
63 | /*color: fg_purple*/
64 | .hljs-attribute,
65 | .hljs-code,
66 | .hljs-selector-id {
67 | color: #b294bb;
68 | }
69 |
70 | /*color: fg_blue*/
71 | .hljs-keyword,
72 | .hljs-selector-tag,
73 | .hljs-bullet,
74 | .hljs-tag {
75 | color: #81a2be;
76 | }
77 |
78 | /*color: fg_aqua*/
79 | .hljs-subst,
80 | .hljs-variable,
81 | .hljs-template-tag,
82 | .hljs-template-variable {
83 | color: #8abeb7;
84 | }
85 |
86 | /*color: fg_orange*/
87 | .hljs-type,
88 | .hljs-built_in,
89 | .hljs-builtin-name,
90 | .hljs-quote,
91 | .hljs-section,
92 | .hljs-selector-class {
93 | color: #de935f;
94 | }
95 |
96 | .hljs-emphasis {
97 | font-style: italic;
98 | }
99 |
100 | .hljs-strong {
101 | font-weight: bold;
102 | }
103 |
--------------------------------------------------------------------------------
/workshop/themes/learn/static/css/atom-one-dark-reasonable.css:
--------------------------------------------------------------------------------
1 | /*
2 |
3 | Atom One Dark With support for ReasonML by Gidi Morris, based off work by Daniel Gamage
4 |
5 | Original One Dark Syntax theme from https://github.com/atom/one-dark-syntax
6 |
7 | */
8 | .hljs {
9 | display: block;
10 | overflow-x: auto;
11 | padding: 0.5em;
12 | line-height: 1.3em;
13 | color: #abb2bf;
14 | background: #282c34;
15 | border-radius: 5px;
16 | }
17 | .hljs-keyword, .hljs-operator {
18 | color: #F92672;
19 | }
20 | .hljs-pattern-match {
21 | color: #F92672;
22 | }
23 | .hljs-pattern-match .hljs-constructor {
24 | color: #61aeee;
25 | }
26 | .hljs-function {
27 | color: #61aeee;
28 | }
29 | .hljs-function .hljs-params {
30 | color: #A6E22E;
31 | }
32 | .hljs-function .hljs-params .hljs-typing {
33 | color: #FD971F;
34 | }
35 | .hljs-module-access .hljs-module {
36 | color: #7e57c2;
37 | }
38 | .hljs-constructor {
39 | color: #e2b93d;
40 | }
41 | .hljs-constructor .hljs-string {
42 | color: #9CCC65;
43 | }
44 | .hljs-comment, .hljs-quote {
45 | color: #b18eb1;
46 | font-style: italic;
47 | }
48 | .hljs-doctag, .hljs-formula {
49 | color: #c678dd;
50 | }
51 | .hljs-section, .hljs-name, .hljs-selector-tag, .hljs-deletion, .hljs-subst {
52 | color: #e06c75;
53 | }
54 | .hljs-literal {
55 | color: #56b6c2;
56 | }
57 | .hljs-string, .hljs-regexp, .hljs-addition, .hljs-attribute, .hljs-meta-string {
58 | color: #98c379;
59 | }
60 | .hljs-built_in, .hljs-class .hljs-title {
61 | color: #e6c07b;
62 | }
63 | .hljs-attr, .hljs-variable, .hljs-template-variable, .hljs-type, .hljs-selector-class, .hljs-selector-attr, .hljs-selector-pseudo, .hljs-number {
64 | color: #d19a66;
65 | }
66 | .hljs-symbol, .hljs-bullet, .hljs-link, .hljs-meta, .hljs-selector-id, .hljs-title {
67 | color: #61aeee;
68 | }
69 | .hljs-emphasis {
70 | font-style: italic;
71 | }
72 | .hljs-strong {
73 | font-weight: bold;
74 | }
75 | .hljs-link {
76 | text-decoration: underline;
77 | }
78 |
--------------------------------------------------------------------------------
/code/sam/nodejs/src/items/get-all-items/index.js:
--------------------------------------------------------------------------------
1 | // Create clients and set shared const values outside of the handler.
2 |
3 | // Import the X-Ray SDK to capture AWS services calls
4 | const AWSXRay = require('aws-xray-sdk-core')
5 |
6 | // Create a DocumentClient that represents the query to add an item
7 | const AWS = AWSXRay.captureAWS(require('aws-sdk'))
8 | const docClient = new AWS.DynamoDB.DocumentClient()
9 |
10 | // Get the DynamoDB table name from environment variables
11 | const tableName = process.env.SAMPLE_TABLE
12 |
13 | /**
14 | * A simple example includes a HTTP get method to get all items from a DynamoDB table.
15 | */
16 | exports.getAllItemsHandler = async (event) => {
17 | if (event.httpMethod !== 'GET') {
18 | throw new Error(`getAllItems only accept GET method, you tried: ${event.httpMethod}`)
19 | }
20 | // All log statements are written to CloudWatch
21 | console.info('received:', event)
22 |
23 | let response
24 | try {
25 | // get all items from the table (only first 1MB data, you can use `LastEvaluatedKey` to get the rest of data)
26 | // https://docs.aws.amazon.com/AWSJavaScriptSDK/latest/AWS/DynamoDB/DocumentClient.html#scan-property
27 | // https://docs.aws.amazon.com/amazondynamodb/latest/APIReference/API_Scan.html
28 | var params = {
29 | TableName: tableName
30 | }
31 | const data = await docClient.scan(params).promise()
32 | const items = data.Items
33 |
34 | response = {
35 | statusCode: 200,
36 | headers: {
37 | 'Access-Control-Allow-Origin': '*'
38 | },
39 | body: JSON.stringify(items)
40 | }
41 | } catch (err) {
42 | response = {
43 | statusCode: 500,
44 | headers: {
45 | 'Access-Control-Allow-Origin': '*'
46 | },
47 | body: JSON.stringify(err)
48 | }
49 | }
50 | // All log statements are written to CloudWatch
51 | console.info(`response from: ${event.path} statusCode: ${response.statusCode} body: ${response.body}`)
52 | return response
53 | }
54 |
--------------------------------------------------------------------------------
/code/sam/nodejs/src/items/get-by-id/index.js:
--------------------------------------------------------------------------------
1 | // Create clients and set shared const values outside of the handler.
2 |
3 | // Import the X-Ray SDK to capture AWS services calls
4 | const AWSXRay = require('aws-xray-sdk-core')
5 |
6 | // Create a DocumentClient that represents the query to add an item
7 | const AWS = AWSXRay.captureAWS(require('aws-sdk'))
8 | const docClient = new AWS.DynamoDB.DocumentClient()
9 |
10 | // Get the DynamoDB table name from environment variables
11 | const tableName = process.env.SAMPLE_TABLE
12 |
13 | /**
14 | * A simple example includes a HTTP get method to get one item by id from a DynamoDB table.
15 | */
16 | exports.getByIdHandler = async (event) => {
17 | if (event.httpMethod !== 'GET') {
18 | throw new Error(`getMethod only accept GET method, you tried: ${event.httpMethod}`)
19 | }
20 | // All log statements are written to CloudWatch
21 | console.info('received:', event)
22 |
23 | let response
24 | try {
25 | // Get id from pathParameters from APIGateway because of `/{id}` at template.yml
26 | const id = event.pathParameters.id
27 |
28 | // Get the item from the table
29 | // https://docs.aws.amazon.com/AWSJavaScriptSDK/latest/AWS/DynamoDB/DocumentClient.html#get-property
30 | var params = {
31 | TableName: tableName,
32 | Key: { id: id }
33 | }
34 |
35 | const data = await docClient.get(params).promise()
36 | const item = data.Item
37 |
38 | response = {
39 | statusCode: item ? 200 : 404,
40 | headers: {
41 | 'Access-Control-Allow-Origin': '*'
42 | },
43 | body: JSON.stringify(item)
44 | }
45 | } catch (err) {
46 | response = {
47 | statusCode: 500,
48 | headers: {
49 | 'Access-Control-Allow-Origin': '*'
50 | },
51 | body: JSON.stringify(err)
52 | }
53 | }
54 |
55 | // All log statements are written to CloudWatch
56 | console.info(`response from: ${event.path} statusCode: ${response.statusCode} body: ${response.body}`)
57 | return response
58 | }
59 |
--------------------------------------------------------------------------------
/workshop/themes/learn/exampleSite/content/shortcodes/children/_index.en.md:
--------------------------------------------------------------------------------
1 | ---
2 | title : Children
3 | description : List the child pages of a page
4 | ---
5 |
6 | Use the children shortcode to list the child pages of a page and the further descendants (children's children). By default, the shortcode displays links to the child pages.
7 |
8 | ## Usage
9 |
10 | | Parameter | Default | Description |
11 | |:--|:--|:--|
12 | | page | _current_ | Specify the page name (section name) to display children for |
13 | | style | "li" | Choose the style used to display descendants. It could be any HTML tag name |
14 | | showhidden | "false" | When true, child pages hidden from the menu will be displayed |
15 | | description | "false" | Allows you to include a short text under each page in the list. when no description exists for the page, children shortcode takes the first 70 words of your content. [read more info about summaries on gohugo.io](https://gohugo.io/content/summaries/) |
16 | | depth | 1 | Enter a number to specify the depth of descendants to display. For example, if the value is 2, the shortcode will display 2 levels of child pages. **Tips:** set 999 to get all descendants|
17 | | sort | none | Sort Children By
Weight - to sort on menu order
Name - to sort alphabetically on menu label
Identifier - to sort alphabetically on identifier set in frontmatter
URL - URL
|
18 |
19 | ## Demo
20 |
21 | {{%/* children */%}}
22 |
23 | {{% children %}}
24 |
25 | {{%/* children description="true" */%}}
26 |
27 | {{%children description="true" %}}
28 |
29 | {{%/* children depth="3" showhidden="true" */%}}
30 |
31 | {{% children depth="3" showhidden="true" %}}
32 |
33 | {{%/* children style="h2" depth="3" description="true" */%}}
34 |
35 | {{% children style="h2" depth="3" description="true" %}}
36 |
37 | {{%/* children style="div" depth="999" */%}}
38 |
39 | {{% children style="div" depth="999" %}}
40 |
41 |
42 |
43 |
44 |
45 |
46 |
--------------------------------------------------------------------------------
/workshop/content/040_pipeline/create-build-actions.en.md:
--------------------------------------------------------------------------------
1 | +++
2 | title = "Configure Additional Build Actions"
3 | weight = 47
4 | +++
5 |
6 | Open your [recently created pipeline](https://console.aws.amazon.com/codesuite/codepipeline/pipelines/serverless-pipeline/view).
7 |
8 | - Click **Edit**
9 |
10 | 
11 |
12 | - In the **Build** section click **Edit stage**
13 | - Click **Add action group** below the current Build action to configure a new AWS CodeBuild action.
14 |
15 | 
16 |
17 | - Name it **UnitTest**
18 | - Select **AWS CodeBuild** as **Action provider**
19 | - Select your current region
20 | - Select **SourceArtifact** as **Input artifacts**
21 | - Click **Create project** to configure your CodeBuild project. A pop-up will open.
22 |
23 | 
24 |
25 | - Name it **serverless-test-project**
26 | - In the **Environment** section select **Managed image** as **Environment image**
27 | - Select **Amazon Linux 2** as **Operating system**
28 | - Select **Standard** as **Runtime(s)**
29 | - Select **aws/codebuild/amazonlinux2-x86-64-standard:2.0** as **Image**
30 | - For **Service role**, choose **Existing service role**
31 | - Browse for **serverless-catalog-wksp-build-role** under **Role ARN**
32 | - Uncheck the **Allow AWS CodeBuild to modify this service role so it can be used with this build project** box
33 | - In the **Buildspec** section, type **testspec.yml** in the ***Buildspec name - optional*** textbox.
34 | - Leave all other settings as default, click **Continue to CodePipeline**
35 | - Click **Done**
36 |
37 | 
38 |
39 | - Click **Done** again.
40 |
41 | 
42 |
43 | **Do not save your work just yet**. We still need to configure the deployment stages of our pipeline in the next step.
44 |
--------------------------------------------------------------------------------
/code/sam/nodejs/src/items/put-item/index.js:
--------------------------------------------------------------------------------
1 | // Create clients and set shared const values outside of the handler.
2 |
3 | // Import the X-Ray SDK to capture AWS services calls
4 | const AWSXRay = require('aws-xray-sdk-core')
5 |
6 | // Create a DocumentClient that represents the query to add an item
7 | const AWS = AWSXRay.captureAWS(require('aws-sdk'))
8 | const docClient = new AWS.DynamoDB.DocumentClient()
9 |
10 | // Get the DynamoDB table name from environment variables
11 | const tableName = process.env.SAMPLE_TABLE
12 |
13 | /**
14 | * A simple example includes a HTTP post method to add one item to a DynamoDB table.
15 | */
16 | exports.putItemHandler = async (event) => {
17 | if (event.httpMethod !== 'POST') {
18 | throw new Error(`postMethod only accepts POST method, you tried: ${event.httpMethod} method.`)
19 | }
20 | // All log statements are written to CloudWatch
21 | console.info('received:', event)
22 |
23 | let response
24 | try {
25 | // Get id and name from the body of the request
26 | const body = JSON.parse(event.body)
27 | const id = body.id
28 | const name = body.name
29 |
30 | // Creates a new item, or replaces an old item with a new item
31 | // https://docs.aws.amazon.com/AWSJavaScriptSDK/latest/AWS/DynamoDB/DocumentClient.html#put-property
32 | var params = {
33 | TableName: tableName,
34 | Item: { id: id, name: name }
35 | }
36 |
37 | const item = await docClient.put(params).promise()
38 |
39 | response = {
40 | statusCode: 200,
41 | headers: {
42 | 'Access-Control-Allow-Origin': '*'
43 | },
44 | body: JSON.stringify(item)
45 | }
46 | } catch (err) {
47 | response = {
48 | statusCode: 500,
49 | headers: {
50 | 'Access-Control-Allow-Origin': '*'
51 | },
52 | body: JSON.stringify(err)
53 | }
54 | }
55 |
56 | // All log statements are written to CloudWatch
57 | console.info(`response from: ${event.path} statusCode: ${response.statusCode} body: ${response.body}`)
58 | return response
59 | }
60 |
--------------------------------------------------------------------------------
/workshop/themes/learn/exampleSite/content/shortcodes/children/_index.fr.md:
--------------------------------------------------------------------------------
1 | ---
2 | title : Children (Pages filles)
3 | description : Liste les pages filles de la page
4 | ---
5 |
6 | Utilisez le shortcode *children* pour lister les pages filles de la page et tous ses déscendants (pages filles de pages filles). Par défaut, le shortcode affiche des liens vers les pages filles.
7 |
8 | ## Utilisation
9 |
10 | | Paramètre | Défaut | Description |
11 | |:--|:--|:--|
12 | | page | _current_ | Spécifie le nom de la page (nom de la section) à afficher |
13 | | style | "li" | Choisi le style à utiliser pour afficher les descendants. Cela peut être n'importe quel balise HTML |
14 | | showhidden | "false" | Quand *true*, pages filles cachées dans le menu seront affichées quand même |
15 | | description | "false" | Permet d'inclure le texte de la description de la page sous chaque entré de la liste. quand aucune description existe pour la page, le shortcode prend les 70 premiers mots du contenu. [plus d'infos sur gohugo.io](https://gohugo.io/content/summaries/) |
16 | | depth | 1 | Nombre de descendants à afficher. Par exemple, si la valeur est 2, le shortcode va afficher 2 niveaux de pages filels. **Astuce:** Utilisez 999 pour avoir tous les descendants|
17 | | sort | | Tri les pages filles par
Weight - Poids
Name - Nom
Identifier - Trier alphabétiquement par identifiant configuré dans le front matter
URL - URL
|
18 |
19 | ## Démo
20 |
21 | {{%/* children */%}}
22 |
23 | {{% children %}}
24 |
25 | {{%/* children description="true" */%}}
26 |
27 | {{%children description="true" %}}
28 |
29 | {{%/* children depth="3" showhidden="true" */%}}
30 |
31 | {{% children depth="3" showhidden="true" %}}
32 |
33 | {{%/* children style="h2" depth="3" description="true" */%}}
34 |
35 | {{% children style="h2" depth="3" description="true" %}}
36 |
37 | {{%/* children style="div" depth="999" */%}}
38 |
39 | {{% children style="div" depth="999" %}}
40 |
41 |
42 |
43 |
44 |
45 |
46 |
--------------------------------------------------------------------------------
/workshop/content/070_cleanup/service-catalog.en.md:
--------------------------------------------------------------------------------
1 | ---
2 | title: "Undeploy the Service Catalog"
3 | chapter: false
4 | weight: 73
5 | ---
6 |
7 | Let us now terminate the provisioned product in Service Catalog as well as deleting both the product and portifolio we created.
8 |
9 | #### Empty the Build Artifact S3 Bucket
10 |
11 | Go to your [AWS CloudFormation](https://console.aws.amazon.com/cloudformation/home) and search for the stack Service Catalog created starting with the **SC-** prefix. Go to Outputs and take note of the ArtifactBucket S3 Bucket name.
12 | 
13 |
14 | ```sh
15 | aws s3 rm s3:// --recursive
16 | ```
17 |
18 | #### Terminate provisioned product
19 |
20 | ```sh
21 | aws servicecatalog terminate-provisioned-product --provisioned-product-name demo-service
22 | ```
23 |
24 | Go to your [Service Catalog console](https://console.aws.amazon.com/servicecatalog/home) in **Provisioned Products** and wait until the termination is complete to move forward
25 | 
26 |
27 | #### Remove product association from the portifolio
28 |
29 | - Go to **Portifolios**.
30 | - Select the product named **Projects with CI/CD Pipeline**.
31 | - Click the **Products** tab.
32 | - Select the product named **Serverless Project**, click **Remove** and confirm.
33 |
34 | 
35 |
36 | #### Remove user association from the portifolio
37 |
38 | - Click the **Group, roles, and users** tab.
39 | - Select your user, click **Remove group, role, or user** and confirm.
40 |
41 | 
42 |
43 | #### Delete the portifolio
44 |
45 | - Click **Actions** and choose **Delete**.
46 | - Click **Delete** once again.
47 |
48 | 
49 |
50 | #### Delete the product
51 |
52 | - Go to **Products**.
53 | - Select the product named **Serverless Project**, click **Actions** and choose **Delete**.
54 | - Click **Delete** once again.
55 |
56 | 
57 |
--------------------------------------------------------------------------------
/workshop/themes/learn/exampleSite/content/shortcodes/expand.en.md:
--------------------------------------------------------------------------------
1 | ---
2 | title : Expand
3 | description : "Displays an expandable/collapsible section of text on your page"
4 | ---
5 |
6 | The Expand shortcode displays an expandable/collapsible section of text on your page.
7 | Here is an example
8 |
9 | {{%expand%}}
10 | Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod
11 | tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam,
12 | quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo
13 | consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse
14 | cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non
15 | proident, sunt in culpa qui officia deserunt mollit anim id est laborum.
16 | {{%/expand%}}
17 |
18 |
19 | ## Usage
20 |
21 |
22 | this shortcode takes exactly one optional parameter to define the text that appears next to the expand/collapse icon. (default is "Expand me...")
23 |
24 | {{%/*expand "Is this learn theme rocks ?" */%}}Yes !.{{%/* /expand*/%}}
25 |
26 | {{%expand "Is this learn theme rocks ?" %}}Yes !{{% /expand%}}
27 |
28 | # Demo
29 |
30 | {{%/*expand*/%}}
31 | Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod
32 | tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam,
33 | quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo
34 | consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse
35 | cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non
36 | proident, sunt in culpa qui officia deserunt mollit anim id est laborum.
37 | {{%/* /expand*/%}}
38 |
39 |
40 | {{%expand%}}Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod
41 | tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam,
42 | quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo
43 | consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse
44 | cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non
45 | proident, sunt in culpa qui officia deserunt mollit anim id est laborum.{{% /expand%}}
--------------------------------------------------------------------------------
/workshop/themes/learn/exampleSite/content/shortcodes/expand.fr.md:
--------------------------------------------------------------------------------
1 | ---
2 | title : Expand
3 | description : "Affiche une section de texte qui se plie et se déplie"
4 | ---
5 |
6 | Le shortcode *Expand* affiche une section de texte qui se plie et se déplie.
7 | Ci-dessous un exemple.
8 |
9 | {{%expand%}}
10 | Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod
11 | tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam,
12 | quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo
13 | consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse
14 | cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non
15 | proident, sunt in culpa qui officia deserunt mollit anim id est laborum.
16 | {{%/expand%}}
17 |
18 |
19 | ## Utilisation
20 |
21 |
22 | Ce shortcode prends exactement un paramètre optionel pour définir le texte à côté de l'icone. (valeur par défaut est "Déroulez-moi...")
23 |
24 | {{%/*expand "Est-ce que ce thème envoie du pâté ?" */%}}Oui !.{{%/* /expand*/%}}
25 |
26 | {{%expand "Est-ce que ce thème envoie du pâté ?" %}}Oui !{{% /expand%}}
27 |
28 | # Demo
29 |
30 | {{%/*expand*/%}}
31 | Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod
32 | tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam,
33 | quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo
34 | consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse
35 | cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non
36 | proident, sunt in culpa qui officia deserunt mollit anim id est laborum.
37 | {{%/* /expand*/%}}
38 |
39 |
40 | {{%expand%}}Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod
41 | tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam,
42 | quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo
43 | consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse
44 | cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non
45 | proident, sunt in culpa qui officia deserunt mollit anim id est laborum.{{% /expand%}}
--------------------------------------------------------------------------------
/.gitignore:
--------------------------------------------------------------------------------
1 | # Logs
2 | logs
3 | *.log
4 | npm-debug.log*
5 | yarn-debug.log*
6 | yarn-error.log*
7 | lerna-debug.log*
8 |
9 | # Diagnostic reports (https://nodejs.org/api/report.html)
10 | report.[0-9]*.[0-9]*.[0-9]*.[0-9]*.json
11 |
12 | # Runtime data
13 | pids
14 | *.pid
15 | *.seed
16 | *.pid.lock
17 |
18 | # Directory for instrumented libs generated by jscoverage/JSCover
19 | lib-cov
20 |
21 | # Coverage directory used by tools like istanbul
22 | coverage
23 | *.lcov
24 |
25 | # nyc test coverage
26 | .nyc_output
27 |
28 | # Grunt intermediate storage (https://gruntjs.com/creating-plugins#storing-task-files)
29 | .grunt
30 |
31 | # Bower dependency directory (https://bower.io/)
32 | bower_components
33 |
34 | # node-waf configuration
35 | .lock-wscript
36 |
37 | # Compiled binary addons (https://nodejs.org/api/addons.html)
38 | build/Release
39 |
40 | # Dependency directories
41 | node_modules/
42 | jspm_packages/
43 |
44 | # TypeScript v1 declaration files
45 | typings/
46 |
47 | # TypeScript cache
48 | *.tsbuildinfo
49 |
50 | # Optional npm cache directory
51 | .npm
52 |
53 | # Optional eslint cache
54 | .eslintcache
55 |
56 | # Microbundle cache
57 | .rpt2_cache/
58 | .rts2_cache_cjs/
59 | .rts2_cache_es/
60 | .rts2_cache_umd/
61 |
62 | # Optional REPL history
63 | .node_repl_history
64 |
65 | # Output of 'npm pack'
66 | *.tgz
67 |
68 | # Yarn Integrity file
69 | .yarn-integrity
70 |
71 | # dotenv environment variables file
72 | .env
73 | .env.test
74 |
75 | # parcel-bundler cache (https://parceljs.org/)
76 | .cache
77 |
78 | # Next.js build output
79 | .next
80 |
81 | # Nuxt.js build / generate output
82 | .nuxt
83 | dist
84 |
85 | # Gatsby files
86 | .cache/
87 | # Comment in the public line in if your project uses Gatsby and *not* Next.js
88 | # https://nextjs.org/blog/next-9-1#public-directory-support
89 | # public
90 |
91 | # vuepress build output
92 | .vuepress/dist
93 |
94 | # Serverless directories
95 | .serverless/
96 |
97 | # FuseBox cache
98 | .fusebox/
99 |
100 | # DynamoDB Local files
101 | .dynamodb/
102 |
103 | # TernJS port file
104 | .tern-port
105 | .DS_Store
--------------------------------------------------------------------------------
/workshop/content/030_application/sam-deploy.en.md:
--------------------------------------------------------------------------------
1 | +++
2 | title = "Deploying the Backend Service"
3 | weight = 35
4 | +++
5 |
6 | After we deploy this application, the following resources will be provisioned in our AWS account:
7 |
8 | 
9 |
10 | ### Deploying your application
11 |
12 | ```sh
13 | cd ~/environment/aws-serverless-application-catalog-workshop/code/sam/nodejs/
14 | npm install
15 | sam deploy -g
16 | ```
17 |
18 | Enter the following settings when prompted:
19 |
20 | ```sh
21 | Setting default arguments for 'sam deploy'
22 | =========================================
23 | Stack Name [sam-app]:
24 | AWS Region [us-east-1]:
25 | Parameter ProjectName []: backend-demo
26 | Parameter Stage []: Dev
27 | #Shows you resources changes to be deployed and require a 'Y' to initiate deploy
28 | Confirm changes before deploy [y/N]: n
29 | #SAM needs permission to be able to create roles to connect to the resources in your template
30 | Allow SAM CLI IAM role creation [Y/n]: y
31 | getAllItemsFunction may not have authorization defined, Is this okay? [y/N]: y
32 | getByIdFunction may not have authorization defined, Is this okay? [y/N]: y
33 | putItemFunction may not have authorization defined, Is this okay? [y/N]: y
34 | Save arguments to configuration file [Y/n]: y
35 | ```
36 |
37 | Wait for a few minutes and then enter the following when prompted again:
38 |
39 |
40 | ```sh
41 | Changeset created successfully. arn:aws:cloudformation:us-east-1:1234567890:changeSet/samcli-deploy135353414/3d893bb8-2ecf-4491-9022-0644f5534da
42 |
43 |
44 | Previewing CloudFormation changeset before deployment
45 | ======================================================
46 | Deploy this changeset? [y/N]: Y
47 | ```
48 |
49 | Follow [this deep link to CloudFormation](https://console.aws.amazon.com/cloudformation/home#/stacks?filteringText=sam-&filteringStatus=active&viewNested=true&hideStacks=false&stackId=) to keep up with the stack deployment.
50 |
51 | 
52 |
53 | Wait until both stacks complete its deployment and take note of your API URL endpoint for later testing.
54 |
55 | 
56 |
--------------------------------------------------------------------------------
/workshop/content/050_catalog/testing-app.en.md:
--------------------------------------------------------------------------------
1 | +++
2 | title = "Testing the APIs"
3 | weight = 57
4 | +++
5 |
6 | Go back to your Cloud9 environment and open a terminal tab.
7 |
8 | ### Development Environment Testing
9 |
10 | #### Export the Dev stack output variables
11 |
12 | To invoke our API's, we first need to fetch the `ApiUrl` output variable that our CloudFormation Development stack gives us. So let us iterate through our stack and export all output variables as environment variables.
13 |
14 | ```sh
15 | export ApiUrl=$(aws cloudformation describe-stacks --stack-name demo-service-Dev --output json | jq '.Stacks[].Outputs[] | select(.OutputKey=="ApiUrl") | .OutputValue' | sed -e 's/^"//' -e 's/"$//')
16 | echo "export ApiUrl="$ApiUrl
17 | ```
18 |
19 | #### Test the `Put Item` operation
20 |
21 | ```sh
22 | curl -X POST \
23 | $ApiUrl/items/ \
24 | -d '{
25 | "id":"1",
26 | "name": "Development Test Item"
27 | }'
28 | ```
29 |
30 | #### Test the `Get Item by Id` operation
31 |
32 | ```sh
33 | curl -X GET $ApiUrl/items/1 | jq
34 | ```
35 |
36 | Your expected output should be:
37 |
38 | ```json
39 | {"id":"1","name":"Development Test Item"}
40 | ```
41 |
42 | ### Production Environment Testing
43 |
44 | #### Export the Prod stack output variables
45 |
46 | Let's override our environment variables with the values from the Production stack.
47 |
48 | ```sh
49 | export ApiUrl=$(aws cloudformation describe-stacks --stack-name demo-service-Prod --output json | jq '.Stacks[].Outputs[] | select(.OutputKey=="ApiUrl") | .OutputValue' | sed -e 's/^"//' -e 's/"$//')
50 | echo "export ApiUrl="$ApiUrl
51 | ```
52 |
53 | #### Test the `Get Item by Id` operation
54 |
55 | Let's first make sure that we are calling a different endpoint return different data.
56 |
57 | ```sh
58 | curl -X GET $ApiUrl/items/1 | jq
59 | ```
60 |
61 | Your expected output should be:
62 |
63 | ```json
64 | {}
65 | ```
66 |
67 | #### Test the `Put Item` operation
68 |
69 | ```sh
70 | curl -X POST \
71 | $ApiUrl/items/ \
72 | -d '{
73 | "id":"1",
74 | "name": "Production Test Item"
75 | }'
76 | ```
77 |
78 | #### Test the `Get Item by Id` operation again
79 |
80 | ```sh
81 | curl -X GET $ApiUrl/items/1 | jq
82 | ```
83 |
84 | Your expected output should be:
85 |
86 | ```json
87 | {"id":"1","name":"Production Test Item"}
88 | ```
89 |
--------------------------------------------------------------------------------
/workshop/content/040_pipeline/create-pipeline.en.md:
--------------------------------------------------------------------------------
1 | +++
2 | title = "Multi-Environment Pipeline Setup"
3 | weight = 46
4 | +++
5 |
6 | Open your [AWS CodePipeline console](https://console.aws.amazon.com/codepipeline/home).
7 |
8 | - Click **Create pipeline**
9 | - Name it **serverless-pipeline**
10 | - Select **Existing service role**
11 | - Browse for **serverless-catalog-wksp-pipeline-role**, click **Next**
12 |
13 | 
14 |
15 | - Select **AWS CodeCommit** as **Source provider**
16 | - Select **serverless-repo** as **Repository name**
17 | - Select **master** as **Branch name**
18 | - Leave the last option as default and click **Next**
19 |
20 | 
21 |
22 | - Select **AWS CodeBuild** as **Build provider**
23 | - Select your current region
24 | - Click **Create project** to configure your CodeBuild project. A pop-up will open.
25 |
26 | 
27 |
28 | - Name it **serverless-build-project**
29 | - In the **Environment** section select **Managed image** as **Environment image**
30 | - Select **Amazon Linux 2** as **Operating system**
31 | - Select **Standard** as **Runtime(s)**
32 | - Select **aws/codebuild/amazonlinux2-x86-64-standard:2.0** as **Image**
33 | - For **Service role**, choose **Existing service role**
34 | - Browse for **serverless-catalog-wksp-build-role** under **Role ARN**
35 | - Uncheck the **Allow AWS CodeBuild to modify this service role so it can be used with this build project** box
36 | - Expand the arrow for **Additional configuration**
37 | - On **Environment variables** set **Name** as **BUILD_OUTPUT_BUCKET** and **Value** as **aws-serverless-catalog-wksp-build-``** created in the previous step **(without the s3://)**
38 | - Leave all other settings as default, click **Continue to CodePipeline**
39 | - Click **Next**
40 |
41 | 
42 |
43 | - Click **Skip deploy stage**
44 | - Click **Skip**
45 | - Review your settings and click **Create pipeline**
46 |
47 | Your pipeline has now been created with minimal configuration and will attempt to run for the first time. Allow it a couple of minutes to complete until we move on.
48 |
49 | 
50 |
--------------------------------------------------------------------------------
/workshop/themes/learn/exampleSite/content/shortcodes/attachments.en.md:
--------------------------------------------------------------------------------
1 | ---
2 | title: Attachments
3 | description : "The Attachments shortcode displays a list of files attached to a page."
4 | ---
5 |
6 | The Attachments shortcode displays a list of files attached to a page.
7 |
8 | {{% attachments /%}}
9 |
10 | ## Usage
11 |
12 | The shortcurt lists files found in a **specific folder**.
13 | Currently, it support two implementations for pages
14 |
15 | 1. If your page is a markdown file, attachements must be place in a **folder** named like your page and ending with **.files**.
16 |
17 | > * content
18 | > * _index.md
19 | > * page.files
20 | > * attachment.pdf
21 | > * page.md
22 |
23 | 2. If your page is a **folder**, attachements must be place in a nested **'files'** folder.
24 |
25 | > * content
26 | > * _index.md
27 | > * page
28 | > * index.md
29 | > * files
30 | > * attachment.pdf
31 |
32 | Be aware that if you use a multilingual website, you will need to have as many folders as languages.
33 |
34 | That's all !
35 |
36 | ### Parameters
37 |
38 | | Parameter | Default | Description |
39 | |:--|:--|:--|
40 | | title | "Attachments" | List's title |
41 | | style | "" | Choose between "orange", "grey", "blue" and "green" for nice style |
42 | | pattern | ".*" | A regular expressions, used to filter the attachments by file name.
The **pattern** parameter value must be [regular expressions](https://en.wikipedia.org/wiki/Regular_expression).
43 |
44 | For example:
45 |
46 | * To match a file suffix of 'jpg', use **.*jpg** (not *.jpg).
47 | * To match file names ending in 'jpg' or 'png', use **.*(jpg|png)**
48 |
49 | ### Examples
50 |
51 | #### List of attachments ending in pdf or mp4
52 |
53 |
54 | {{%/*attachments title="Related files" pattern=".*(pdf|mp4)"/*/%}}
55 |
56 | renders as
57 |
58 | {{%attachments title="Related files" pattern=".*(pdf|mp4)"/%}}
59 |
60 | #### Colored styled box
61 |
62 | {{%/*attachments style="orange" /*/%}}
63 |
64 | renders as
65 |
66 | {{% attachments style="orange" /%}}
67 |
68 |
69 | {{%/*attachments style="grey" /*/%}}
70 |
71 | renders as
72 |
73 | {{% attachments style="grey" /%}}
74 |
75 | {{%/*attachments style="blue" /*/%}}
76 |
77 | renders as
78 |
79 | {{% attachments style="blue" /%}}
80 |
81 | {{%/*attachments style="green" /*/%}}
82 |
83 | renders as
84 |
85 | {{% attachments style="green" /%}}
--------------------------------------------------------------------------------
/workshop/content/030_application/clone-repo.en.md:
--------------------------------------------------------------------------------
1 | +++
2 | title = "Cloning the Service Repo"
3 | weight = 34
4 | +++
5 |
6 | ```sh
7 | cd ~/environment
8 | git clone https://github.com/aws-samples/aws-serverless-application-catalog-workshop.git
9 | cd aws-serverless-application-catalog-workshop/code/sam/nodejs
10 | ```
11 |
12 | This repo brings us the following proposed structure for our backend application:
13 |
14 | ```markdown
15 | nodejs
16 | ├── __tests__ <-- Parent folder for all tests
17 | │ ├── unit <-- Parent folder for all unit tests
18 | │ │ ├── items <-- Parent folder for tests of a logical context
19 | │ │ │ └── put-item.test.js <-- put-item service unit tests
20 | │ │ │ └── get-all-items.test.js <-- get-all-items service unit tests
21 | │ │ │
22 | ├── src <-- source code of our microservices
23 | │ ├── items <-- Parent folder for a logical context
24 | │ │ ├── get-all-items <-- Parent folder for a single lambda function
25 | │ │ │ ├── event.json <-- Sample payload for local/unit testing
26 | │ │ │ └── index.js <-- get-all-items Lambda function
27 | │ │ │
28 | │ │ ├── put-item <-- Parent folder a function within the same context
29 | │ │ │ ├── event.json <-- Sample payload for local/unit testing
30 | │ │ │ └── index.js <-- put-item Lambda function
31 | │ │ │
32 | │ │ ├── another-item-service <-- Parent folder a function within the same context
33 | │ ├── another-business-context <-- Different logical context (e.g. users)
34 | │ ├── lib <-- commons lib
35 | ├── template.yaml <-- SAM definition file
36 | └── package.json <-- Node.js dependencies
37 | └── buildspec.yml <-- AWS CodeBuild script for building our application
38 | └── testspec.yml <-- AWS CodeBuild script for executing unit tests
39 | └── style-checker.yml <-- AWS CodeBuild script for static code analysis
40 | ```
41 |
42 | {{% notice tip %}}
43 | Spare a couple of minutes to understand which resources are being provisioned in the `template.yaml` file.
44 | {{% /notice %}}
45 |
--------------------------------------------------------------------------------
/workshop/themes/learn/layouts/404.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | {{ partial "meta.html" . }} {{ partial "favicon.html" . }} {{ .Scratch.Add "title" "" }}{{ if eq .Site.Data.titles .Title }}{{ .Scratch.Set "title" (index .Site.Data.titles .Title).title }}{{ else }}{{ .Scratch.Set "title" .Title}}{{end}}
6 | {{ .Scratch.Get "title" }}
7 |
8 | {{ $assetBusting := not .Site.Params.disableAssetsBusting }}
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 | {{with .Site.Params.themeVariant}}
17 |
18 | {{end}}
19 |
34 | {{ partial "custom-header.html" . }}
35 |
36 |
37 |
38 |
39 |
40 |
41 |
52 |
53 |
54 |
55 |
56 |
57 |
--------------------------------------------------------------------------------
/workshop/content/050_catalog/service-catalog.en.md:
--------------------------------------------------------------------------------
1 | +++
2 | title = "AWS Service Catalog"
3 | weight = 51
4 | +++
5 |
6 | [AWS Service Catalog](https://aws.amazon.com/servicecatalog/) allows organizations to create and manage catalogs of IT services that are approved for use on AWS. These IT services can include everything from virtual machine images, servers, software, and databases to complete multi-tier application architectures. AWS Service Catalog allows you to centrally manage commonly deployed IT services, and helps you achieve consistent governance and meet your compliance requirements, while enabling users to quickly deploy only the approved IT services they need.
7 |
8 | As core concepts, AWS Service Catalog works with Products and Portifolios.
9 |
10 | ### Produtcs
11 |
12 | A product is an IT service that you want to make available for deployment on AWS. A product can comprise one or more AWS resources, such as EC2 instances, storage volumes, databases, monitoring configurations, and networking components, or packaged AWS Marketplace products. A product can be a single compute instance running AWS Linux, a fully configured multi-tier web application running in its own environment, or anything in between. You create your products by importing [AWS CloudFormation](https://aws.amazon.com/cloudformation/) templates. These templates define the AWS resources required for the product, the relationships between resources, and the parameters that the end user can plug in when they launch the product to configure security groups, create key pairs, and perform other customizations.
13 |
14 | ### Portifolios
15 |
16 | A portfolio is a collection of products, together with configuration information. Portfolios help manage product configuration, and who can use specific products and how they can use them. With AWS Service Catalog, you can create a customized portfolio for each type of user in your organization and selectively grant access to the appropriate portfolio. When you add a new version of a product to a portfolio, that version is automatically available to all current users of that portfolio. You also can share your portfolios with other AWS accounts and allow the administrator of those accounts to distribute your portfolios with additional constraints. For example, for developers, you can define a portfolio of development environments, such as a LAMP stack with approved versions that users can use for software development and testing. You could also define a portfolio for the marketing organizations that includes campaign websites and market analysis applications.
17 |
--------------------------------------------------------------------------------