Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add C9 template #215

Merged
merged 17 commits into from
Apr 28, 2023
Merged
Show file tree
Hide file tree
Changes from 9 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .bumpversion.cfg
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
[bumpversion]
current_version = 2.4.3
current_version = 2.5.0
commit = True
tag = False
2 changes: 1 addition & 1 deletion content/basics/templates/intrinsic-functions/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,7 @@ Now it is time to update your stack. Go to the AWS console and update your Cloud
![tags-png](/static/basics/templates/intrinsic-functions/tags.png)

### Challenge
Crete another tag named `InstanceType` and use intrinsic function **Fn::Sub** to return type of the instance.
Create another tag named `InstanceType` and use the `Fn::Sub` intrinsic function to return the type of the instance.

The syntax for the short form is `!Sub`
rezabekf marked this conversation as resolved.
Show resolved Hide resolved

Expand Down
2 changes: 1 addition & 1 deletion content/basics/templates/resources/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -136,7 +136,7 @@ If you have deleted your default VPC, you can create a new one by following the

In this exercise, use the AWS CLI to query the AWS Systems Manager Parameter Store to get the latest Amazon Linux AMI ID.

::alert[To complete this challenge, you have to have [AWS CLI](../../../prerequisites/awscli) configured.]{type="info"}
::alert[To complete this challenge, you have to have [AWS CLI](../../../prerequisites/local-development) configured.]{type="info"}
rezabekf marked this conversation as resolved.
Show resolved Hide resolved

::expand[Check out the [AWS Compute Blog](https://aws.amazon.com/blogs/compute/query-for-the-latest-amazon-linux-ami-ids-using-aws-systems-manager-parameter-store/) to find out.]{header="Need a hint?"}

Expand Down
rezabekf marked this conversation as resolved.
Show resolved Hide resolved
Original file line number Diff line number Diff line change
Expand Up @@ -53,8 +53,7 @@ With the strategy shown earlier, you have not only designed your templates by ta

Unless you have done this already, make sure you follow prerequisites, and install the following in your own workstation (you'll use Cloud9 later on in this lab, but you'll start with using your workstation first):

1. [Install Git](/prerequisites/git).
2. [Get lab resources](/prerequisites/lab-resources): clone the lab repository. This will clone the repository into a `cfn101-workshop` directory in your workstation.
1. [Get lab resources](/prerequisites/local-development): clone the lab repository. This will clone the repository into a `cfn101-workshop` directory in your workstation.


Next, change directory to the `cfn101-workshop/code/workspace/architecting-templates` directory of the repository you have cloned. Locate the `base-network.template` file and the `cloud9.template` file: you'll first use them to create the base infrastructure and your Cloud9 environment respectively.
Expand Down
28 changes: 0 additions & 28 deletions content/prerequisites/awscli/index.md

This file was deleted.

55 changes: 55 additions & 0 deletions content/prerequisites/cloud9/index.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
---
title: "AWS Cloud9 Setup (Recommended)"
weight: 200
---

_Lab Duration: ~10 minutes_

## Overview

[AWS Cloud9](https://aws.amazon.com/cloud9/) is a cloud-based IDE that lets you write, run, and debug your code with
just a browser. It includes a code editor, debugger, and terminal. Since your Cloud9 IDE is cloud-based, you can do labs
rezabekf marked this conversation as resolved.
Show resolved Hide resolved
from your office, home, or anywhere using an internet-connected machine.

For the best experience with the workshop and minimal setup effort we recommend using it to run this workshop because it
rezabekf marked this conversation as resolved.
Show resolved Hide resolved
comes with the necessary set of tools pre-installed. If you prefer to work locally, follow the
[Local Development Setup](/prerequisites/local-development) instead.

:::alert{type="info"}
We recommend using **us-east-1 (N. Virginia)** as the _AWS Region_ for the workshop.
:::

## Create a Cloud9 instance from AWS Console

1. Create a Cloud9 instance from the **AWS Console** by following the steps from the [Creating an EC2 Environment](https://docs.aws.amazon.com/cloud9/latest/user-guide/create-environment-main.html) guide.
1. Once created, your instance should be listed on the AWS Cloud9 [Environments](https://console.aws.amazon.com/cloud9/home) page. Choose **Open** if not already.
1. You will see a terminal area at the bottom where you will run the commands as you progress through the workshop. In the main work area you will open and edit code and template files.
1. In a Cloud9 terminal, download and run a bootstrap script to upgrade SAM CLI to the most recent version and install few other tools:
:::code{language=shell showLineNumbers=false showCopyAction=true}
curl 'https://static.us-east-1.prod.workshops.aws/public/ca3cac3e-84b1-4b6a-bd2b-d4565df5a5db/static/bin/bootstrap.sh' | bash
:::
1. Verify the new version
:::code{language=shell showLineNumbers=false showCopyAction=true}
sam --version
:::

:::alert{type="info"}
If you have issues using the Cloud9 environment, please see the [Troubleshooting AWS Cloud9](https://docs.aws.amazon.com/cloud9/latest/user-guide/troubleshooting.html) page in the user guide.
:::

### Clone lab resources using `git`
Clone the repository to your working directory. In the Cloud9 terminal run:

:::code{language=shell showLineNumbers=false showCopyAction=true}
git clone https://github.com/aws-samples/cfn101-workshop
:::

### Open workshop files
The templates and code you will work on is located in the **code** folder.
Expand the tree on the left to open the **code** folder:

![toggletree-png](/static/prerequisites/cloud9/toggletree.png)

---

Congratulations, your workshop development environment is now ready to use!
2 changes: 1 addition & 1 deletion content/prerequisites/default-vpc/index.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
---
title: "Default VPC"
weight: 600
weight: 400
---
A default VPC is suitable for getting started quickly, and for launching public instances such as a blog or simple website.

Expand Down
22 changes: 0 additions & 22 deletions content/prerequisites/editor/index.md

This file was deleted.

45 changes: 0 additions & 45 deletions content/prerequisites/git/index.md

This file was deleted.

20 changes: 0 additions & 20 deletions content/prerequisites/lab-resources/index.md

This file was deleted.

64 changes: 64 additions & 0 deletions content/prerequisites/local-development/index.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,64 @@
---
title: "Local Development Setup"
weight: 300
---

rezabekf marked this conversation as resolved.
Show resolved Hide resolved
Local development for this workshop requires a number of development tools. Please install and verify these are installed correctly before proceeding with the workshop.

### Install AWS CLI

The [AWS CLI](https://aws.amazon.com/cli/) allows you to interact with AWS services from a terminal session.
Make sure you have the latest version of the AWS CLI installed on your system.

See the [Installing or updating the latest version of the AWS CLI](https://docs.aws.amazon.com/cli/latest/userguide/getting-started-install.html)
page for installation instructions for your operating system.

### Configure your credentials

Open a terminal window and run `aws configure` to set up your environment.

:::code{language=shell showLineNumbers=false showCopyAction=true}
aws configure
:::

Type the **access key ID** and **secret key** you created in [the previous step](/prerequisites/account) and choose a default region (for example you can use `us-east-1`). Preferably use a region that doesn't have any resources already deployed into it.

:::code{language=shell showLineNumbers=false showCopyAction=false}
AWS Access Key ID [None]: <type key ID here>
AWS Secret Access Key [None]: <type access key>
Default region name [None]: <choose region (e.g. "us-east-1", "eu-west-1")>
Default output format [None]: <leave blank>
:::

### Clone lab resources using git
Clone the repository to your working directory:

:::code{language=shell showLineNumbers=false showCopyAction=true}
git clone https://github.com/aws-samples/cfn101-workshop
:::

### Install Code Editor

You may use any code editor or IDE of your choice that supports editing [YAML](https://yaml.org/) but for this workshop
we will assume the use of [Visual Studio Code](https://code.visualstudio.com/) as it works well on macOS, Linux, and Windows.

To install VS Code, use your operating system's package manager (e.g. `brew cask install visual-studio-code` on macOS)
or follow [the instructions on the VS code website](https://code.visualstudio.com/).

### CloudFormation Linter

We recommend you install the [AWS CloudFormation Linter](https://github.com/aws-cloudformation/cfn-python-lint).
A [linter](https://en.wikipedia.org/wiki/Lint_(software)) will proactively flag basic errors in your CloudFormation templates before you deploy them.

If you are using Visual Studio Code, you should install the [cfn-lint](https://marketplace.visualstudio.com/items?itemName=kddejong.vscode-cfn-lint) plugin.

:::alert{type="info"}
Note that `cfn-lint` is not installed automatically with the Visual Studio Code `cfn-lint` extension.
Install it separately following the [installation instructions](https://github.com/aws-cloudformation/cfn-python-lint#install)
:::

### Open workshop files
The templates and the code you will work on are both located in the **code** folder.
Open the **code** section from downloaded files in your code editor, as installed in [a previous step](/prerequisites/editor):
rezabekf marked this conversation as resolved.
Show resolved Hide resolved

![vscode-png](/static/prerequisites/local-development/vscode.png)
Binary file added static/prerequisites/cloud9/toggletree.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file not shown.