Skip to content
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

RestApi: wrong description used for deployments #26148

Closed
woltsu opened this issue Jun 28, 2023 · 3 comments · Fixed by #26149
Closed

RestApi: wrong description used for deployments #26148

woltsu opened this issue Jun 28, 2023 · 3 comments · Fixed by #26149
Labels
bug This issue is a bug. effort/small Small work item – less than a day of effort p2 package/tools Related to AWS CDK Tools or CLI

Comments

@woltsu
Copy link
Contributor

woltsu commented Jun 28, 2023

Describe the bug

When creating an instance of a RestApi construct, by default it has a Deployment attached to it. The description of the Deployment can be configured with an option given to the RestApi, like so:

const api = new RestApi(this, 'Api', {
	restApiName: 'MyApi',
	deployOptions: {
		description: 'Deployment description'
	}
});

However, looking at the source code, we see that instead of using the props.deployOptions.description, it uses props.description.

Expected Behavior

It should use the description provided in deployOptions

Current Behavior

It uses the description of the RestApi

Reproduction Steps

const api = new RestApi(this, 'Api', {
	restApiName: 'MyApi',
        description: 'My api description',
	deployOptions: {
		description: 'Deployment description'
	}
});

The created deployment's description will be My api description instead of Deployment description

Possible Solution

No response

Additional Information/Context

No response

CDK CLI Version

2.85.0

Framework Version

No response

Node.js Version

16

OS

Mac

Language

Typescript

Language Version

No response

Other information

No response

@woltsu woltsu added bug This issue is a bug. needs-triage This issue or PR still needs to be triaged. labels Jun 28, 2023
@github-actions github-actions bot added the package/tools Related to AWS CDK Tools or CLI label Jun 28, 2023
@pahud pahud self-assigned this Jun 28, 2023
@pahud
Copy link
Contributor

pahud commented Jun 28, 2023

Yes, we should get it fixed. Thanks for your report.

@pahud pahud added p2 effort/small Small work item – less than a day of effort and removed needs-triage This issue or PR still needs to be triaged. labels Jun 28, 2023
@pahud pahud removed their assignment Jun 28, 2023
@woltsu
Copy link
Contributor Author

woltsu commented Jun 28, 2023

Fixed in #26149 😊

@mergify mergify bot closed this as completed in #26149 Aug 22, 2023
mergify bot pushed a commit that referenced this issue Aug 22, 2023
…'s description (#26149)

When creating an instance of a `RestApi` construct, by default it has a `Deployment` attached to it. The description of the `Deployment` can be configured with an option given to the `RestApi`, like so:

```tsx
const api = new RestApi(this, 'Api', {
	restApiName: 'MyApi',
	deployOptions: {
		description: 'Deployment description'
	}
});
```

However, looking at the [source code](https://github.com/aws/aws-cdk/blob/72eb1e957afb9d1573445999eddd38b5c345fa7a/packages/aws-cdk-lib/aws-apigateway/lib/restapi.ts#L592C25-L592C25), we see that instead of using the `props.deployOptions.description`, it uses `props.description`.

Fixes #26148

----

*By submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license*
@github-actions
Copy link

⚠️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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug This issue is a bug. effort/small Small work item – less than a day of effort p2 package/tools Related to AWS CDK Tools or CLI
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants