export AWS_REGION=aws-region-code (eg. eu-west-1) export AWS_ACCOUNT_ID=your_account_id (eg. 1234567890) export CODECOMMIT_REPOSITORY_NAME=your_code_commit_repository_name (the one created above)
IMPORTANT : Please note we're giving Administrator access to keep it simple here, please scope down for real usage
cdk bootstrap --trust $AWS_ACCOUNT_ID --trust-for-lookup $AWS_ACCOUNT_ID --cloudformation-execution-policies 'arn:aws:iam::aws:policy/AdministratorAccess' aws://$AWS_ACCOUNT_ID/$AWS_REGION
cd baseline/iac npm install cdk deploy -c envName=preprod
cd infra/iac npm install cdk deploy -c envName=preprod
EC2 instance with SSM
create database myservicepreprod create table items (id int not null auto_increment, name varchar(50) not null, price int not null, primary key (id));
This creates a pipeline building the docker file and deploying to environments. By default, at this stage only preprod will be deployed. Prod stage is commented out in api-container-pipeline.ts, to be deployed in the prod section in the workshop.
cd api-container/iac npm install cdk deploy => please not no env here as it is a cross env pipeline
curl with public URL of API
This creates a pipeline building the reactjs app and deploying to environments. By default, at this stage only preprod will be deployed. Prod stage is commented out in Webapp-pipeline.ts, to be deployed during prod section in the workshop.
cd webapp/iac npm install cdk deploy => please note no env here as it is a cross env pipeline
cd baseline/iac npm install cdk deploy -c envName=preprod
cd infra/iac npm install cdk deploy -c envName=preprod
EC2 instance with SSM
create database myservicepreprod create table items (id int not null auto_increment, name varchar(50) not null, price int not null, primary key (id));
and test
and test
we're using public ecr instead of dockerhub
bucketdeployment when not changed delete assets buckets when it doesn't work redeploy bucket deployment stack pre doesn't work when you want to build but it is probably because of that ??
CDK Deploy-Step Fails - Lambda Assets not uploaded to S3 after build -- "Error occurred while GetObject. S3 Error Code: NoSuchKey" · Issue #11025 · aws/aws-cdk aws/aws-cdk#11025
security groups open to all VPC HTTPS remove sourcemap
it is possible to run DB and opensearch locally useting AWS_REGION and providing info on local tooling.
unset AWS_REGION export OS_LOCAL_USERNAME= export OS_LOCAL_PASSWORD= export DB_LOCAL_HOST= export DB_LOCAL_USERNAME= export DB_LOCAL_PASSWORD= export DATABASE_NAME= export OS_HOSTNAME= export OS_PORT=
API_URL_FOUND=aws cloudformation list-exports --query "Exports[?Name=='apiurlpreprod'].Value" --no-paginate --output text
echo "export const apiURL = 'http://$API_URL_FOUND';" > ./src/Api.js "echo $API_URL_FOUND",