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

aws_batch_alpha: JobQueue uses wrong id for underlying CfnJobQueue #25248

Closed
diego-santacruz opened this issue Apr 21, 2023 · 6 comments · Fixed by #25269
Closed

aws_batch_alpha: JobQueue uses wrong id for underlying CfnJobQueue #25248

diego-santacruz opened this issue Apr 21, 2023 · 6 comments · Fixed by #25269
Labels
@aws-cdk/aws-batch Related to AWS Batch bug This issue is a bug. effort/small Small work item – less than a day of effort p2

Comments

@diego-santacruz
Copy link

Describe the bug

With the new API in aws_batch_alpha the node.defaultChild property no longer returns the underlying CfnJobQueue.

I tracked this to the fact that instead of using 'Resource' as the id for the CfnJobQueue created in

const resource = new CfnJobQueue(this, id, {
the id of the parent JobQueue is used. Before rewriting JobQueue for the new API it was 'Resource'.

This also has the effect that the logical ID of a JobQueue changed with the new API, although there was no reason for it.

Expected Behavior

JobQueue's node.defaultChild property returns the underlying CfnJobQueue.

Current Behavior

JobQueue's node.defaultChild property returns undefined.

Reproduction Steps

Trivial

Possible Solution

Use the usual 'Resource' string as the id for the CfnJobQueue.

Additional Information/Context

No response

CDK CLI Version

2.76

Framework Version

2.76

Node.js Version

v16.18.1

OS

Linux

Language

Typescript

Language Version

4.9.5

Other information

No response

@diego-santacruz diego-santacruz added bug This issue is a bug. needs-triage This issue or PR still needs to be triaged. labels Apr 21, 2023
@github-actions github-actions bot added the @aws-cdk/aws-batch Related to AWS Batch label Apr 21, 2023
@peterwoodworth
Copy link
Contributor

Makes sense, thanks for reporting. @comcalvi do we want to change the id to Resource, or should we manually set the CfnJobQueue as the default child of this construct?

@peterwoodworth peterwoodworth 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 Apr 21, 2023
@comcalvi
Copy link
Contributor

definitely change the id to Resource

@daschaa
Copy link
Contributor

daschaa commented Apr 24, 2023

Should this be feature-flagged?

@diego-santacruz
Copy link
Author

My opinion is that given that this a change recently introduced (2.74) in an experimental package, and that apparently there are not many users of this new package version given the number of bugs that I've found for ECS on EC2 and that had not been reported yet I think not many people will care or notice the change if released soon. So I would not put it behind a feature flag.

@peterwoodworth
Copy link
Contributor

I don't think it needs to be behind a feature flag simply because this is not a stable package yet

@mergify mergify bot closed this as completed in #25269 Apr 27, 2023
mergify bot pushed a commit that referenced this issue Apr 27, 2023
Closes #25248.

----

*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
@aws-cdk/aws-batch Related to AWS Batch bug This issue is a bug. effort/small Small work item – less than a day of effort p2
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants