Skip to content

Commit

Permalink
Updated READMEs
Browse files Browse the repository at this point in the history
  • Loading branch information
johnculkin committed Feb 14, 2021
1 parent 60a14fe commit 81eb2f4
Show file tree
Hide file tree
Showing 50 changed files with 1,815 additions and 0 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
*.swp
package-lock.json
__pycache__
.pytest_cache
.env
.venv
*.egg-info

# CDK asset staging directory
.cdk.staging
cdk.out
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
FROM httpd:latest
COPY index.html /usr/local/apache2/htdocs/index.html
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
<html> <head> <title>AWSCookbook</title> <style>body {margin-top: 40px; background-color: rgb(151, 151, 151);} </style> </head><body> <div style=color:blue;text-align:left> <h1>AWS Cookbook BLUE</h1> <p>This HTML is running in an apache container on Fargate!</p> </div></body></html>
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
FROM httpd:latest
COPY index.html /usr/local/apache2/htdocs/index.html
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
<html> <head> <title>AWSCookbook</title> <style>body {margin-top: 40px; background-color: rgb(33, 33, 33);} </style> </head><body> <div style=color:green;text-align:left> <h1>AWS Cookbook GREEN</h1> <p>This HTML is running in an apache container on Fargate!</p> </div></body></html>
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@

# Welcome to your CDK Python project!

This is a blank project for Python development with CDK.

The `cdk.json` file tells the CDK Toolkit how to execute your app.

This project is set up like a standard Python project. The initialization
process also creates a virtualenv within this project, stored under the `.venv`
directory. To create the virtualenv it assumes that there is a `python3`
(or `python` for Windows) executable in your path with access to the `venv`
package. If for any reason the automatic creation of the virtualenv fails,
you can create the virtualenv manually.

To manually create a virtualenv on MacOS and Linux:

```
$ python3 -m venv .venv
```

After the init process completes and the virtualenv is created, you can use the following
step to activate your virtualenv.

```
$ source .venv/bin/activate
```

If you are a Windows platform, you would activate the virtualenv like this:

```
% .venv\Scripts\activate.bat
```

Once the virtualenv is activated, you can install the required dependencies.

```
$ pip install -r requirements.txt
```

At this point you can now synthesize the CloudFormation template for this code.

```
$ cdk synth
```

To add additional dependencies, for example other CDK libraries, just add
them to your `setup.py` file and rerun the `pip install -r requirements.txt`
command.

## Useful commands

* `cdk ls` list all stacks in the app
* `cdk synth` emits the synthesized CloudFormation template
* `cdk deploy` deploy this stack to your default AWS account/region
* `cdk diff` compare deployed stack with current state
* `cdk docs` open CDK documentation

Enjoy!
11 changes: 11 additions & 0 deletions 605-Updating-Containers-With-BlueGreen/cdk-AWS-Cookbook-605/app.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
#!/usr/bin/env python3

from aws_cdk import core

from cdk_aws_cookbook_605.cdk_aws_cookbook_605_stack import CdkAwsCookbook605Stack


app = core.App()
CdkAwsCookbook605Stack(app, "cdk-aws-cookbook-605")

app.synth()
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
{
"app": "python3 app.py",
"context": {
"@aws-cdk/core:enableStackNameDuplicates": "true",
"aws-cdk:enableDiffNoFail": "true",
"@aws-cdk/core:stackRelativeExports": "true",
"@aws-cdk/aws-ecr-assets:dockerIgnoreSupport": true,
"@aws-cdk/aws-secretsmanager:parseOwnedSecretName": true,
"@aws-cdk/aws-kms:defaultKeyPolicies": true,
"@aws-cdk/aws-s3:grantWriteWithoutAcl": true
}
}
Loading

0 comments on commit 81eb2f4

Please sign in to comment.