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/AWSClientAuth/cdk
Junbo Liang ac5cc04b59
[AWSI Automation] Export more AWS resource names via CloudFormation stack outputs for the automation tests (#4161)
* Read resources name via CloudFormation stack outputs and trim resource names when they are too long

Signed-off-by: Junbo Liang <junbo@amazon.com>
4 years ago
..
auth Shorten copyright headers by splitting into 2 lines (#2213) 4 years ago
aws_client_auth Shorten copyright headers by splitting into 2 lines (#2213) 4 years ago
cognito Shorten copyright headers by splitting into 2 lines (#2213) 4 years ago
utils [AWSI Automation] Export more AWS resource names via CloudFormation stack outputs for the automation tests (#4161) 4 years ago
.gitignore Integrating latest 47acbe8 5 years ago
README.md Added pdbs for python windows in order to allow python/c++ debugging on VS (#3661) 4 years ago
app.py Shorten copyright headers by splitting into 2 lines (#2213) 4 years ago
cdk.json Integrating latest 47acbe8 5 years ago
requirements.txt Add newlines to the end of all files 5 years ago

README.md

Welcome to AWSClientAuth CDK Python project!

Install prerequisites for CDK

https://docs.aws.amazon.com/cdk/latest/guide/getting_started.html#getting_started_prerequisites

Install cdk

https://docs.aws.amazon.com/cdk/latest/guide/getting_started.html#getting_started_install

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

Run from cdk directory within gem.

Optional set up python path to LY Python

set PATH="..\..\..\python\runtime\python-3.7.10-rev2-windows\python\";%PATH%

This project is set up like a standard Python project. Use python interpreter from Open3d to setup python dependencies Once the python and pip are set up, you can install the required dependencies.

# Run from cdk folder in AWSClientAuth gem
..\..\..\python\pip.cmd install -r requirements.txt

Set variables

set O3DE_AWS_DEPLOY_REGION="us-west-2"
set O3DE_AWS_DEPLOY_ACCOUNT=""
set O3DE_AWS_PROJECT_NAME="AWSIProject"

If you want to add 3rd party providers fill values in utils/constant.py

List stacks

cdk ls

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

cdk synth <stackname>

Deploy stacks. Note passed parameters. Deploy will throw error for non-optional parameters.

cdk deploy <stackname> --profile <profile-name>

To add additional dependencies, for example other CDK libraries, just add them to your requirements.txt file and rerun the ..\..\..\Lumberyard\python\pip.cmd install -r .\Gems\AWSClientAuth\cdk\requirements.txt command.

Update Authorization Permissions

To give permissions to call AWS resources, please update CognitoIdentityPoolRole class with correct policy statements.

An example IAM permission policy is provided to grant both authenticated and unauthenticated the permission to list S3 buckets in the project. However, it is expected that developers replace these permissions with those required by your users to use your resources.

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!