Skip to content
Open
Show file tree
Hide file tree
Changes from all 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
25 changes: 11 additions & 14 deletions content/000_pre/00_page1.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,32 +4,29 @@ chapter = false
weight = 10
+++

You will use AWS Appstream to connect to your lab environment. You will find the Appstream URL in your team dashboard.
Once you are logged in, you will see the event Engine Team dashboard. For most of this lab you will be
using a preconfigured IDE streamed to your browser using AppStream. To launch the development environment, click on the **IDE** link in the **Modules** section of the dashboard.

![ide-button](/images/click-ide.png)

@TODO Screenshot

## Lab information

The AWS Appstream session that you are using for this hands on lab has the following programs pre-installed:

- Python3 (taskcat is Python program)
- Python3 (taskcat is a Python program)
- taskcat (pip install taskcat)
- Vscode with plugins pre-installed
- Vscode with following plugins pre-installed
- taskcat config validation
- cfn-lint validation
- CloudFormation template auto-complete and doc links from the cfn-resource-spec

## Copy paste
#### Copy paste

Copy and paste should work out of the box on all browsers, in some browsers you may get
a dialog box requesting clipboard access which must be allowed to enable copy-paste.
When using IDE, copy and paste should work out of the box on all browsers, however, in some browsers you may get a dialog box requesting clipboard access which must be allowed to enable copy-paste.

The AppStream also provides a tool in the top left of the window that enables placing
data into the AppStream session's clipboard. This is recommended for pasting large
blocks of text.
The AppStream also provides a tool in the top left of the window that enables placing data into the AppStream session's clipboard. This is recommended for pasting large blocks of text.

### MAC OS
#### MAC OS

On Mac OS the function of the Command key is swapped with that of the Control key, so
to copy/paste in the appstream environment the shortcuts are control-c and control-v
respectively.
On Mac OS the function of the Command key is swapped with that of the Control key, so to copy/paste in the appstream environment the shortcuts are control-c and control-v respectively.
6 changes: 1 addition & 5 deletions content/000_pre/_index.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,4 @@ To login to that AWS Account, you will be given a unique **hash**, something as

To login - open a web browser, navigate to https://dashboard.eventengine.run/ and enter the **hash** to proceed.

Once logged in you will see the event Engine dashboard, for most of this lab we will be
using a preconfigured IDE streamed to your browser using AppStream. To launch the
environment, click on the **IDE** link in the **Modules** section of the dashboard.

![fig0.1](images/fig0.1.png)
![fig0.1](/images/fig0.1.png)
2 changes: 1 addition & 1 deletion content/050_concepts/00_page1.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ weight = 60
+++


Taskcat uses two config files: _**Global config**_ and _**Project config**_
Taskcat uses two config files: _**Project config**_ and _**Global config**_.

## Project Config
This config file provides project-specific configurations.
Expand Down
4 changes: 2 additions & 2 deletions content/050_concepts/00_page2.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,9 @@ weight = 70

Parameter Overrides were added to the taskcat to solve a couple of common problems. First, many
templates share common parameters that are unique to an AWS account, like a KeyPair name
or an S3 Bucket, overrides provided a way to store those centrally for all your projects.
or an S3 Bucket; Overrides provided a way to store those centrally for all your projects.
Second, we didn't want to add sensitive data (usernames, passwords, tokens) to a git
repository. The idea was to store sensitive/unique data outside of a git repository, but still
repository. The idea is to store sensitive/unique data outside of a git repository, but still
execute a test using this data. To that end, *any parameter defined in the global config
will take precedence over the same parameter in a project-level config*.

Expand Down
2 changes: 1 addition & 1 deletion content/100_lab1/children1/10_page3.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ First, you will create a project section in your project configuration file.

## Add a project section

To add a project section, copy and paste the following in **.taskcat.yml** file.
To add a project section, copy and paste the following in your **.taskcat.yml** file.

```yaml
project:
Expand Down
2 changes: 1 addition & 1 deletion content/100_lab1/children1/10_page4.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ project:
name: cfn-project
tests:
mytest:
template: templates/lab1.template.yamls
template: templates/lab1.template.yaml
```


6 changes: 2 additions & 4 deletions content/100_lab1/children1/10_page5.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,9 @@ Now, you will define in which AWS regions you want to test your cloudformation t

## Add regions to your test

The **regions:** key is optional for the tests. By default **regions** inherit from the global
configuration (We will conver global configs later in this lab)
The **regions:** key is optional for the tests. By default **regions** inherit from the global configuration (We will conver global configs later in this lab).

The regions key takes a _list_ of regions. When defined in a test, taskcat will
limit test to those regions
The regions key takes a _list_ of regions. When defined in a test, taskcat will limit test to those regions.

For now, specifiy only one region **us-east-1**.

Expand Down
1 change: 0 additions & 1 deletion content/100_lab1/children1/_index.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@ From the vscode file browser, navigate to **lab1/cfn-project**, and open **.tas

The file will be empty, let's start by adding the sections needed for a basic configuration.

@TODO Screen shoot need updated to show appstream
![fig1.1](/images/fig_lab1.1.png)


Expand Down
35 changes: 14 additions & 21 deletions content/100_lab1/children2/_index.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,30 +11,15 @@ weight = 101
From your vscode terminal change directory to your project root for **lab1** __(lab1/cfn-project)__

Under cfn-project you will see the following files

```
cfn-project
├── lambda_functions/source/GenRandom/
├── templates/lab1.template.yaml
└── .taskcat.yml
```

The provided template for this lab uses a Lambda backed custom resource.

**source/GenRandom** contains the lambda source.

When lambda source is detected taskcat will package the lambda zip file and then save it
to lambda_functions/packages/. This zip file is referenced in our lambda function.

{{% notice tip %}}
The default source and package folders can be changed by setting values in your
[project_config](https://aws-quickstart.github.io/taskcat/#project-config) file.
{{% /notice %}}

taskcat is able to build dependencies for your lambda so that you don't need to
check them into source control. This can be done by providing a Dockerfile that
contains the in the build steps in source folder. Or, for python functions, if a
requirements.txt file is found, taskcat will package the dependencies defined in it
into your zip.
The provided template for this lab (**lab1.template.yaml**) uses a Lambda backed custom resource, as shown below. **source/GenRandom** contains the lambda source code.

```
GenRandomLambda:
Expand All @@ -50,10 +35,18 @@ into your zip.
S3Key: !Sub '${S3KeyPrefix}lambda_functions/packages/GenRandom/lambda.zip'
```

Experiment a bit with the template by adding another resource. You will notice that the
IDE provides autocomplete (Ctrl+Space to get a list of available properties). Also every
time the file is saved, validation is done and any errors detected in the template are
displayed inline and in the **PROBLEMS** tab to the left of the terminal.
When lambda source is detected, taskcat will package the lambda function into a zip file and then save it
to lambda_functions/packages/. This zip file is referenced in our lambda function. *HINT: Check S3Key in the lambda function resource above.*

{{% notice tip %}}
The default source and package folders can be changed by setting values in your
[project_config](https://aws-quickstart.github.io/taskcat/#project-config) file.
{{% /notice %}}

taskcat is able to build dependencies for your lambda so that you don't need to
check them into source control. This can be done by providing a Dockerfile that
contains the in the build steps in source folder. Or, for python functions, if a
requirements.txt file is found, taskcat will package the dependencies defined in it, into your zip.

{{% notice tip %}}
If you want to run packaging step on its own you can run `taskcat package`
Expand Down
36 changes: 18 additions & 18 deletions content/200_lab2/20_page1.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,32 +6,32 @@ weight = 210

## Add Psuedo-Parameters to your project-level taskcat config

* Edit your `cfn_project/.taskcat.yml` parameters to include psuedo-parameters.
[Please see the Taskcat Concepts section for more details on psuedo-parameters](../00_concepts.html)
Edit your `cfn_project/.taskcat.yml` parameters to include psuedo-parameters.
Please see the [Getting Started](/050_concepts/00_page2.html#psuedo-parameters) section for more details on psuedo-parameters.

* Example project config file:
Following code sample shows an example project config file:

```yaml
project:
name: cfn-project
tests:
mytest:
template: templates/lab2.template.yaml
regions:
- us-east-1
parameters:
S3BucketName: '$[taskcat_autobucket]'
S3KeyPrefix: 'cfn-project/'
LicenseToken: 'value-to-be-overriden-by-global-config'
AvailabilityZones: '$[taskcat_genaz_2]'
project:
name: cfn-project
tests:
mytest:
template: templates/lab2.template.yaml
regions:
- us-east-1
parameters:
S3BucketName: '$[taskcat_autobucket]'
S3KeyPrefix: 'cfn-project/'
LicenseToken: 'value-to-be-overriden-by-global-config'
AvailabilityZones: '$[taskcat_genaz_2]'
```

## Add Psuedo-parameters to your global taskcat config.

* Edit your <FILE> parameters to include psuedo-parameters.
Edit your <FILE> parameters to include psuedo-parameters.

* Note: For the purposes of this lab, we've created a shortcut command to access to the
file, in the IDE terminal type:
**Note:** For the purposes of this lab, we've created a shortcut command to provide access to the
global config file. Running the following command from your IDE terminal, to open it in the editor.

```bash
open-taskcat-global-config
Expand Down
4 changes: 2 additions & 2 deletions content/200_lab2/20_page2.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,11 @@ weight = 220

## Start a test

From the **cfn-project** dir run you taskcat test
From the **lab2/cfn-project** dir run you taskcat test

```
taskcat test run
```

Estimated runtime (5 mins)
Estimated test run time (5 mins)
![fig2.2](/images/taskcat_execution2.gif)
10 changes: 4 additions & 6 deletions content/200_lab2/20_page3.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,21 +4,19 @@ chapter = false
weight = 230
+++


## Login to the AWS Console

1. from the [Event Engine dashboard](https://dashboard.eventengine.run/) click login to AWS console
2. navigate to the CloudFormation console in us-east-1 (N. Virginia)
1. From the [Event Engine dashboard](https://dashboard.eventengine.run/) click login to AWS console
2. Navigate to the CloudFormation console in us-east-1 (N. Virginia)
3. Change the filter to view **Deleted** stacks
3. Select the top stack ( they are ordered by creation date)
4. Click on the **"Outputs"** tab

Notice that the values for the **LicenseToken** parameter has been replaced with the value
specified in the global override.

Notice that the value for **AvailablityZones** has been replaced with 2 az names from the
us-east-1 region

Notice that the value for **AvailablityZones** has been replaced with 2 AZ names from the
us-east-1 region.

![fig1.4](/images/stack_outputs.png)

4 changes: 2 additions & 2 deletions content/200_lab2/_index.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,9 @@ weight = 200
Using the provided cloudformation template build a taskcat config that uses **psuedo-parameters**

We will use override to inject a `LicenseToken` and dynamically inject `AvailiblityZone`
values during testing
values during testing.

- Use taskcat overrides pass inputs into the stack that you do not want in the
- **Overrides** are used to pass inputs into the stack that you do not want in the
project_root/gitrepo _(secrets like `LicenseKeys` or `APITokens`, etc. Or account specific
values like EC2 KeyPair names, or Rooute53 domain names)_

Expand Down
6 changes: 3 additions & 3 deletions content/300_lab3/_index.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ weight = 300

### Testing in multiple regions

An important part of building high-confidence CloudFormation is multi-region testing.
An important part of building high-confidence CloudFormation is testing in multiple regions.

In this lab, we will see how **taskcat** can help uncover common issues when deploying in different regions.

Expand All @@ -16,9 +16,9 @@ To test this template we will add 2 more regions to the test definition.

- After running the test, we will see that the **us-east-1** region deploys properly, while we _receive failures in other regions._

Looking at the logs we can see that lambda source is not accessible from the other regions.
Looking at the logs you will see that lambda source is not accessible from the other regions.

- We will then modify the our template to include a child stack. This child stack will pre-stage the Lambda source in each region.
- We will then modify our template to include a child stack. This child stack will pre-stage the Lambda source in each region.

- Finally, we'll kick off our **taskcat** test again to validate the fix we implemented!

Expand Down
Binary file added static/images/click-ide.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.