Steve Pham cd07167884 Python Relocation (#17540) | 8 månader sedan | |
---|---|---|
.. | ||
aws_metrics | 1 år sedan | |
.gitignore | 1 år sedan | |
README.md | 8 månader sedan | |
api_spec.json | 2 år sedan | |
app.py | 1 år sedan | |
architecture.png | 3 år sedan | |
cdk.json | 1 år sedan | |
requirements.txt | 1 år sedan |
This is the long term supported CDK v2 version of this template. If you have preexisting versions of this template see the CDK guidance about upgrading to CDK v2.
This is an optional CDKv2 application that provides a stack to build the metrics analytics pipeline. The deployed pipeline is simplified from the production ready AWS solution: https://docs.aws.amazon.com/solutions/latest/game-analytics-pipeline/welcome.html.
AWS services used by this CDK application may not be available in all regions.
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) 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. Please note that Python version 3.10.13 or higher is required to deploy this CDK application.
To manually create a virtualenv on macOS and Linux:
$ python -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
O3DE_AWS_DEPLOY_REGION
: The region to deploy the stacks into, will default to CDK_DEFAULT_REGIONO3DE_AWS_DEPLOY_ACCOUNT
: The account to deploy stacks into, will default to CDK_DEFAULT_ACCOUNTO3DE_AWS_PROJECT_NAME
: The name of the O3DE project stacks should be deployed for will default to AWS-PROJECTSee https://docs.aws.amazon.com/cdk/v2/guide/environments.html for more information including how to pass parameters to use for environment variables.
Each AWS environment (a combination of AWS account and region) needs to be bootstrapped since this CDK application uses assets like a local directory that contains the handler code for the AWS Lambda functions.
Use the following CDK bootstrap command to bootstrap one or more AWS environments.
cdk bootstrap aws://ACCOUNT-NUMBER-1/REGION-1 aws://ACCOUNT-NUMBER-2/REGION-2 ...
See https://docs.aws.amazon.com/cdk/v2/guide/bootstrapping.html for more information about bootstrapping.
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 requirements.txt
file and rerun the pip install -r requirements.txt
command.
To deploy the CDK application, use the following CLI command:
$ cdk deploy
You can optionally enable the batch processing feature by specifying the context variable like below:
$ cdk synth -c batch_processing=true
$ cdk deploy -c batch_processing=true
This will deploy the AWS resources required by the batch processing feature and bring additional cost.
To disable the feature and remove related AWS resources, you need to empty the deployed S3 bucket manually and run the normal CDK CLI commands for updating the CDK application:
$ cdk synth
$ cdk deploy
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 documentationSee https://docs.aws.amazon.com/cdk/v2/guide/troubleshooting.html