-
Notifications
You must be signed in to change notification settings - Fork 3.9k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
core: Tags aspect breaks API Gateway V2 that uses OpenAPI spec #28552
Comments
Cloudformation does not allow you to specify properties like
I think you will need something like this new apigwv2.CfnApi(this, 'MyApi', {
body: openApiSpec
});
cdk.Tags.of(stack).add("tag-name", "tag-value", {
excludeResourceTypes: ['AWS::ApiGatewayV2::Api'],
}); And probably specify your tags in x-amazon-apigateway-tag-value instead. Let me know if it works for you. |
Awesome, thanks for finding the working solution! |
|
Describe the bug
I am creating an API Gateway V2 using a hard-coded OpenAPI spec.
I am then adding tags to my resources using the
Tags.of(..).add(..)
pattern (as is recommended).This results in an error in CloudFormation:
Looks like there is an edge case where tags are not supported when using
Body
to specify an OpenAPI spec.Expected Behavior
Adding tags to an API Gateway V2 that uses OpenAPI should not modify the resource configuration in a way that is incompatible with CloudFormation.
Current Behavior
Tags are added to the API GW resource which then fails to deploy.
Reproduction Steps
Possible Solution
Perhaps the tags should be added to the spec or not added at all?
Additional Information/Context
No response
CDK CLI Version
2.117.0 (build 59d9b23)
Framework Version
2.110.1
Node.js Version
v20.9.0
OS
Mac OS 13.1
Language
TypeScript
Language Version
5
Other information
No response
The text was updated successfully, but these errors were encountered: