Skip to content

(aws-apigateway): RestApi imported with method fromRestApiAttributes not updating current deployment in stage #13526

@benticlaskaris

Description

@benticlaskaris

I've imported from a serverless project this restApi.

const restApiId = cdk.Fn.importValue(envRelated(`ApiGateway-restApiId`));
const rootResourceId = cdk.Fn.importValue(envRelated(`ApiGateway-rootResourceId`));
this.apiGw = apigateway.RestApi.fromRestApiAttributes(this, envRelated(`apigw`), {
	restApiId: restApiId,
	rootResourceId: rootResourceId,
});

When deploying with cdk deploy, all resources are updated but not the stage.
No deployment is created.
I've tried also to force a deployment with this snippet.

new Deployment(this,envRelated('deployment-stage') , {
      api: apiGw
    });

Salting the deployment id makes no difference.
After the deployment is done, the api gateway is still pointing to the previous deployment instead of the new deployment done.

chrome_sGUK4TBoqT

Specifying the stage with the forced deployment fails because stage already exists.

Environment

  • CDK CLI Version: 1.9.2
  • Module Version: 1.9.2
  • Node.js Version: 12.14.1
  • OS: Ubuntu Linux 20.04
  • **Language: ts

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions