CDK tutorial does not work [Value of property Types must be of type List of String]
- Dominant language
- Python
- Stars
- 11.1k
- Forks
- 1k
- Avg merge
- 1d 22h
- Merged PRs (30d)
- 2
Description
I followed the steps in official CDK tutorials but couldn't make it work.
Cloudformation detected some type errors, but according to AWS documents, `AWS::ApiGateway::RestApi` doesn't have property `Types`.
I don't know if this is because of my setups. I suspect some Cloudformation APIs have changed.
Are there any workaround for this?
## Steps to reproduce
```
# chalice new-project
___ _ _ _ _ ___ ___ ___
/ __|| || | /_\ | | |_ _|/ __|| __|
| (__ | __ | / _ \ | |__ | || (__ | _|
\___||_||_|/_/ \_\|____||___|\___||___|
The python serverless microframework for AWS allows
you to quickly create and deploy applications using
Amazon API Gateway and AWS Lambda.
Please enter the project name
[?] Enter the project name: testing
[?] Select your project type: [CDK] Rest API with a DynamoDB table
REST API
S3 Event Handler
Lambda Functions only
Legacy REST API Template
> [CDK] Rest API with a DynamoDB table
# cd testing/
# python3 -m pip install -r requirements.txt
# cd infrastructure/
# cdk bootstrap
# cdk deploy
Creating deployment package.
Reusing existing deployment package.
testing: deploying...
[0%] start: Publishing 2bbd148710893c0c814ea4eeff54b84f586a012739c8a7babb10c0b041bc4f8f:current
[100%] success: Published 2bbd148710893c0c814ea4eeff54b84f586a012739c8a7babb10c0b041bc4f8f:current
testing: creating CloudFormation changeset...
6:54:59 AM | CREATE_FAILED | AWS::ApiGateway::RestApi | RestAPI
Value of property Types must be of type List of String
Function._fromCloudFormation (/tmp/jsii-kernel-hoLwjr/node_modules/@aws-cdk/aws-sam/lib/sam.generated.js:171:21)
\_ CfnInclude.getOrCreateResource (/tmp/jsii-kernel-hoLwjr/node_modules/@aws-cdk/cloudformation-include/lib/cfn-include.js:559:48)
\_ new CfnInclude (/tmp/jsii-kernel-hoLwjr/node_modules/@aws-cdk/cloudformation-include/lib/cfn-include.js:68:18)
\_ /tmp/tmp9texe7d7/lib/program.js:8154:58
\_ Kernel._wrapSandboxCode (/tmp/tmp9texe7d7/lib/program.js:8582:24)
\_ Kernel._create (/tmp/tmp9texe7d7/lib/program.js:8154:34)
\_ Kernel.create (/tmp/tmp9texe7d7/lib/program.js:7895:29)
\_ KernelHost.processRequest (/tmp/tmp9texe7d7/lib/program.js:9479:36)
\_ KernelHost.run (/tmp/tmp9texe7d7/lib/program.js:9442:22)
\_ Immediate._onImmediate (/tmp/tmp9texe7d7/lib/program.js:9443:46)
\_ processImmediate (internal/timers.js:464:21)
❌ testing failed: Error: The stack named testing failed creation, it may need to be manually deleted from the AWS console: ROLLBACK_COMPLETE
at Object.waitForStackDeploy (/usr/local/lib/node_modules/aws-cdk/lib/api/util/cloudformation.ts:305:11)
at processTicksAndRejections (internal/process/task_queues.js:95:5)
at Object.deployStack (/usr/local/lib/node_modules/aws-cdk/lib/api/deploy-stack.ts:294:26)
at CdkToolkit.deploy (/usr/local/lib/node_modules/aws-cdk/lib/cdk-toolkit.ts:184:24)
at initCommandLine (/usr/local/lib/node_modules/aws-cdk/bin/cdk.ts:213:9)
The stack named testing failed creation, it may need to be manually deleted from the AWS console: ROLLBACK_COMPLETE
```
## Version information:
```
# cdk --version
1.111.0 (build 556ca93)
# chalice --version
chalice 1.23.0, python 3.8.6, linux 5.4.0-1029-aws
```
Contributor guide
Research direction
Reproduce the failure from the issue's commands in the generated project's infrastructure/ directory using CDK 1.111.0 and Chalice 1.23.0. Inspect the generated CloudFormation for AWS::ApiGateway::RestApi and its Types property, then verify the result with cdk deploy; done means the CDK tutorial project deploys without the CloudFormation type error.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- aws, python
- Domain
- cloud, devops
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100