-
Notifications
You must be signed in to change notification settings - Fork 20
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
60a14fe
commit 81eb2f4
Showing
50 changed files
with
1,815 additions
and
0 deletions.
There are no files selected for viewing
11 changes: 11 additions & 0 deletions
11
605-Updating-Containers-With-BlueGreen/cdk-AWS-Cookbook-605/.gitignore
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
2 changes: 2 additions & 0 deletions
2
605-Updating-Containers-With-BlueGreen/cdk-AWS-Cookbook-605/DockerBlue/Dockerfile
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
1 change: 1 addition & 0 deletions
1
605-Updating-Containers-With-BlueGreen/cdk-AWS-Cookbook-605/DockerBlue/index.html
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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> |
2 changes: 2 additions & 0 deletions
2
605-Updating-Containers-With-BlueGreen/cdk-AWS-Cookbook-605/DockerGreen/Dockerfile
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
1 change: 1 addition & 0 deletions
1
605-Updating-Containers-With-BlueGreen/cdk-AWS-Cookbook-605/DockerGreen/index.html
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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> |
58 changes: 58 additions & 0 deletions
58
605-Updating-Containers-With-BlueGreen/cdk-AWS-Cookbook-605/README.md
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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
11
605-Updating-Containers-With-BlueGreen/cdk-AWS-Cookbook-605/app.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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() |
12 changes: 12 additions & 0 deletions
12
605-Updating-Containers-With-BlueGreen/cdk-AWS-Cookbook-605/cdk.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 | ||
} | ||
} |
Empty file.
Oops, something went wrong.