CloudFormation Repository will load in a git repository and recursively read in all the files and then present them with their description, name, parameters and launch button so that you can launch the stack in your AWS Account.
If you deploy this into your AWS Account it will create resources that will cost you money. It's likely to be only a few dollars per month, but please take your own steps to ensure you understand the cost.
cfrepo
- This has the CDK stack in it.cloudformationrepo
- This has the application that is built into a container in it.
The cdk.json
file tells the CDK Toolkit how to execute your app.
python -m venv .venv
source .venv/bin/activate
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.
cdk ls
list all stacks in the appcdk synth
emits the synthesized CloudFormation templatecdk deploy
deploy this stack to your default AWS account/regioncdk diff
compare deployed stack with current statecdk docs
open CDK documentation
cd cloudformationrepo
docker image build -f dev-Dockerfile . -t cfrepodev:latest
cd cloudformationrepo
docker run -it -e AWS_PROFILE=my-profile \
-e DYNAMODB_TABLE=mydynamodb-table \
-e S3_BUCKET=mys3-bucket \
-p 5000:5000 -v $PWD:/srv -v ~/.aws:/root/.aws cfrepodev:latest
You can then browse to http://localhost:5000/ on your desktop.
Editing the application code in cloudformationrepo
will result in the Flask reloading.
Note: The flask development server is used in development while uwsgi is used in the production container build.
-
Repository URI
- Authentication details
-
Metadata
- Template Path
- Template Description
- Template Parameters
You need a route53 hosted public zone for this project to deploy successfully.
To deploy, you'll need to get the zoneid and the zone name.
CDK requires bootstrapping as this project uses assets for the Docker container.
cdk bootstrap
Deployment is then as simple as:
ZONEID=abc1234 ZONENAME=example.com cdk deploy
Once deployment is completed, CloudFormation Repository will be available at a host called cfrepo
on your domain.