(aws-apigateway): RestApi does not support Mode attribute
:question: General Issue
According to AWS docs https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-apigateway-restapi.html#cfn-apigateway-restapi-mode
For REST APIs created before March 29, 2021, the default is overwrite. Otherwise, the default value is merge.
The Question
I am using SpecRestApi class to define my API Gateway resource but there does not appear to be a mode attribute that allows me to change the default setting of merge to overwrite.
Environment
- CDK CLI Version: 1.101.0
- Module Version: 1.91.0
- Node.js Version: v16.0.0
- OS: macOS Catalina
- Language (Version): TypeScript (3.9.9)
I also ran into this issue. For now I'm adding this assuming this will be addressed in an upcoming release:
// The default value of 'Mode' changed from 'overwrite' to 'merge'
// on 3/29/2021 - we want our default to be overwrite.
const cfnRestApi = this.specRestApi.node.defaultChild as CfnRestApi;
cfnRestApi.addPropertyOverride('Mode', 'overwrite');
Hmmm this is strange to me. You linked to the docs where CloudFormation talks about the property mode, however even in their resource specification there is no hint of the mode property. The only place I can find which mentions Mode in this context is the docs you linked. Let me look into this further
@gsdwait Yep that works.
@peterwoodworth The only other place where I saw a reference to mode was in the api specs, see https://docs.aws.amazon.com/cli/latest/reference/apigateway/put-rest-api.html.
Since this has been determined to be a missing Cloudformation component from their resource specification, I am adjusting this issue to be marked as a feature-request so it can be closed on implementation.
😸 😷
This is now available: https://docs.aws.amazon.com/cdk/api/latest/docs/@aws-cdk_aws-apigateway.CfnRestApi.html#mode
⚠️COMMENT VISIBILITY WARNING⚠️
Comments on closed issues are hard for our team to see. If you need more assistance, please either tag a team member or open a new issue that references this one. If you wish to keep having a conversation with other community members under this issue feel free to do so.