(cdk migrate): wrong migration of "special character" JSON Keys ("application/json" -> applicationJson) #29216
Labels
bug
This issue is a bug.
p1
package/tools
Related to AWS CDK Tools or CLI
toolkit/migrate
Related to cdk migrate
Describe the bug
I'm using CDK migrate to create a CDK app for my already deployed CloudFormation Stack.
The CFN template contains an
AWS::ApiGateway::Method
with the following property:note the
/
in the JSON key ofapplication/json
This gets migrated into the following L1 construct code:
which after synth gives us:
which fails the
cdk deploy
with the following messagefailed: Error: The stack named serverless-project-dev failed to deploy: UPDATE_ROLLBACK_FAILED (The following resource(s) failed to update: [ApiGatewayMethodHelloPost]. ): Resource handler returned message: "Validation Result: warnings : [], errors : [Invalid content type specified: applicationJson] (Service: ApiGateway, Status Code: 400, Request ID: 26885dad-a6cb-45a2-8640-53bddad60568)" (RequestToken: d7151781-c4b7-8fae-7545-49b6c1c2eaa2, HandlerErrorCode: InvalidRequest), Resource handler returned message: "Invalid Method identifier specified (Service: ApiGateway, Status Code: 404, Request ID: f25f0c89-6591-41fc-bf0b-33382df1b91f)" (RequestToken: 1ec85c11-87f6-7ced-b3a5-a1018561425f, HandlerErrorCode: NotFound)
...
when I change
applicationJson
to"application/json"
(enclosed in"
) the deployment succeedsExpected Behavior
deployment succeeds and JSON properties are not changed between original CFN stack and resulting/migrated CDK/CFN stack
Current Behavior
quoted String
"application/json"
gets changed toapplicationJson
(not quoted)Reproduction Steps
see above CFN snippet
Possible Solution
No response
Additional Information/Context
No response
CDK CLI Version
2.128.0 (build d995261)
Framework Version
No response
Node.js Version
v20.9.0
OS
macOS
Language
TypeScript
Language Version
~5.3.3
Other information
No response
The text was updated successfully, but these errors were encountered: