Provisions AWS resources for Dog's Business. All the AWS resources are described with AWS Cloud Development Kit (CDK).
Please configure your AWS_PROFILE
environment variable.
Here is an example in my case:
export AWS_PROFILE=dogsbusiness-jp
You can choose any toolkit stack name you like, or leave it as default. Here is an example in my case:
TOOLKIT_STACK_NAME=dogs-business-toolkit
I strongly recommend setting a non-default bootstrap qualifier if you choose a custom toolkit stack name. Please refer to https://docs.aws.amazon.com/cdk/v2/guide/bootstrapping.html#bootstrapping-custom-synth for more details. Here is an example in my case:
BOOTSTRAP_QUALIFIER=dogsbz2023
You have to bootstrap the toolkit stack if you have not done it yet.
Remove --toolkit-stack-name $TOOLKIT_STACK_NAME
option if you choose the default toolkit stack name.
pnpm cdk bootstrap --toolkit-stack-name $TOOLKIT_STACK_NAME --qualifier $BOOTSTRAP_QUALIFIER
pnpm cdk synth -c "@aws-cdk/core:bootstrapQualifier=$BOOTSTRAP_QUALIFIER"
Production:
pnpm cdk synth -c "@aws-cdk/core:bootstrapQualifier=$BOOTSTRAP_QUALIFIER" -c "dogs-business:deployment-stage=production"
pnpm cdk deploy -c "@aws-cdk/core:bootstrapQualifier=$BOOTSTRAP_QUALIFIER"
Production:
pnpm cdk deploy -c "@aws-cdk/core:bootstrapQualifier=$BOOTSTRAP_QUALIFIER" -c "dogs-business:deployment-stage=production"
aws cloudformation describe-stacks --stack-name dogs-business-$DEPLOYMENT_STAGE --query "Stacks[0].Outputs[?OutputKey=='DistributionInternalUrl'].OutputValue" --output text
aws cloudformation describe-stacks --stack-name dogs-business-$DEPLOYMENT_STAGE --query "Stacks[0].Outputs[?OutputKey=='ContentsBucketName'].OutputValue" --output text