English / 日本語
An example CDK stack for cdk-rest-api-with-spec
.
This CDK stack was initialized with the following command,
cdk init --language typescript
The CDK version is 2.
You have to install Node.js. v18.x should work.
Example,
export AWS_PROFILE=kikuo-jp
Example,
TOOLKIT_STACK_NAME=api-with-spec-example-toolkit
Example,
TOOLKIT_QUALIFIER=apispc2022
pnpm cdk bootstrap --toolkit-stack-name $TOOLKIT_STACK_NAME --qualifier $TOOLKIT_QUALIFIER
pnpm cdk synth -c "@aws-cdk/core:bootstrapQualifier=$TOOLKIT_QUALIFIER"
You will find the OpenAPI definition created or updated in the file openapi.json
.
pnpm cdk deploy --toolkit-stack-name $TOOLKIT_STACK_NAME -c "@aws-cdk/core:bootstrapQualifier=$TOOLKIT_QUALIFIER"
You will find a CloudFormation stack api-with-spec-example
created or updated.
You will also find the OpenAPI definition created or updated in the file openapi.json
.