Skip to content

aws-apigateway: Documentation lacks information about stack separation for RestApi and Resources #29690

@engineer-taro

Description

@engineer-taro

Describe the issue

Overview

In this documentation, I would like to note that when separating the stacks for RestApi and Resource, Deployment is not automatically created, and to avoid this issue, it is necessary to use Deployment.addToLogicalId().

Details

When a Resource is added to an IRestApi imported via RestApi.fromRestApiAttribute or RestApi.fromRestApiId, Deployment is not created, so the latest resource state is not associated with the API Gateway stage, which is a known issue.
This has been discussed in several issues, including the following:

We understand that it is not easy to automatically create Deployment, and there may be differing opinions on whether it should be fixed.
However, since there is no mention of this issue in the documentation, we feel that many developers who are separating stacks related to API Gateway may unintentionally create an environment where Deployment is not created.
Due to this issue, developers need to manually deploy to API Gateway after running cdk deploy.

While it is possible to share a workaround implementation, it is difficult to implement an automatic Deployment creation that detects changes in Resource without increasing complexity in the current configuration.

Therefore, we would like to propose adding a note to the documentation first.

Links

https://docs.aws.amazon.com/cdk/api/v2/docs/aws-cdk-lib.aws_apigateway-readme.html#breaking-up-methods-and-resources-across-stacks

Metadata

Metadata

Assignees

No one assigned

    Labels

    @aws-cdk/aws-apigatewayRelated to Amazon API GatewaydocumentationThis is a problem with documentation.effort/smallSmall work item – less than a day of effortfeature-requestA feature should be added or improved.p2

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions