This repository contains the source code, AWS environment build, of the Zero Trust Service2Service Workshop workshop. It does not contain the source code of the workshop's website.
There are two main CDK stacks in this code:
- ServiceA
- ServiceB
- python3
- node
- aws-cdk
-
Clone this repo &
cd aws-zerotrust-service2service-workshop
-
Create and activate virtual environment:
python3 -m venv .venv source .venv/bin/activate
-
Once the virtual environment is activated, install the required dependencies:
pip install -r requirements.txt
-
You should now be able to run CDK commands. Start by listing available stacks:
cdk ls
-
For example, if you want to synthesize the CloudFormation template for a stack:
cdk synth <StackName>
# While in the root directory of this repo:
pip3 install aws_requests_auth -t src/lambda/layer/python
Why? I create a Lambda layer that contains the aws_requests_auth
package used by Lambda functions. I avoid pushing the package's files to the repo (.gitignore). So you need to pip install the package after cloning this repo. Then at cdk deploy
time CDK uses packages installed in ./src/lambda/layer/python
to create the Lambda Layer.
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
This project is initialized by cdk init
and has the standard structure of a Python project.
.
├── cfn_templates <-- Directory for synthesized CFN templates
├── src <-- Directory for Lambda and EC2 source codes
├── zerotrust_service2service_workshop <-- Directory for main CDK stacks
├── app.py <-- The entry point for this application.
├── config.yml <-- [Not a CDK thing] Static variables used in this app.
├── README.md <-- This instructions file
├── setup.py <-- Defines package's construction and dependencies.
See CONTRIBUTING for more information.
This library is licensed under the MIT-0 License. See the LICENSE file.