You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
o3de/Gems/AWSCore/cdk
Pip Potter 7e678e15e8 lyn2919: Update all references to O3DE
- Also fix issue where invalid SIDs could be generated
- Make default project name consistent across Gems
5 years ago
..
core lyn2919: Update all references to O3DE 5 years ago
example Add newlines to the end of all files 5 years ago
.gitignore Integrating latest 47acbe8 5 years ago
README.md lyn2919: Update all references to O3DE 5 years ago
app.py lyn2919: Update all references to O3DE 5 years ago
architecture.png Integrating up through commit 90f050496 5 years ago
cdk.json Integrating up through commit 90f050496 5 years ago
constants.py Set scripts to be executable 5 years ago
core_stack_properties.py Set scripts to be executable 5 years ago
requirements.txt Integrating latest 47acbe8 5 years ago

README.md

Welcome to the AWS Core CDK Python project!

This is an optional CDK application that provides two stacks:

  • A core stack to use as the basis for a project's CDK application
  • An example stack with example resources that can be connected to ScriptBehavior samples in Core

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 .env directory. To create the virtualenv it assumes that there is a python3 (or python for Windows) (Python 3.7+) 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.

See https://docs.aws.amazon.com/cdk/latest/guide/getting_started.html about for information about how to set up the prerequisites for CDK development.

To manually create a virtualenv on MacOS and Linux:

$ python -m venv .env

Once the virtualenv is created, you can use the following step to activate your virtualenv.

$ source .env/bin/activate

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

% .env\Scripts\activate.bat

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

$ pip install -r requirements.txt

Set environment variables or accept defaults

  • O3DE_AWS_DEPLOY_REGION*: The region to deploy the stacks into, will default to CDK_DEFAULT_REGION
  • O3DE_AWS_DEPLOY_ACCOUNT*: The account to deploy stacks into, will default to CDK_DEFAULT_ACCOUNT
  • O3DE_AWS_PROJECT_NAME*: The name of the O3DE project stacks should be deployed for will default to AWS-PROJECT

See https://docs.aws.amazon.com/cdk/latest/guide/environments.html for more information including how to pass parameters to use for environment variables.

Synthesize the project

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

$ cdk synth

You may need todo a one time bootstrap, once per account, per region. The CDK application will prompt you on this.

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

Troubleshooting

See https://docs.aws.amazon.com/cdk/latest/guide/troubleshooting.html