-
Notifications
You must be signed in to change notification settings - Fork 4k
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
codeguruprofiler: Invalid profilingGroupName on resource import #22546
Comments
Hi @openwebsolns, Thank you for reporting this issue. I've confirmed that this is an issue and that your proposed solution would likely work. In the meantime I would suggest using I've marked this issue as a |
Thanks! I have a PR coming up soon. I don't think |
…n using importing (#22554) Closes #22546. Verified via TDD with new unit test. Before the change, the unit test failed, replicating the bug in the issue with output: ```plain FAIL test/profiling-group.test.js profiling group ✓ attach read permission to Profiling group via fromProfilingGroupArn (71 ms) ✓ attach publish permission to Profiling group via fromProfilingGroupName (27 ms) ✕ use name specified via fromProfilingGroupName (8 ms) ✓ default profiling group (21 ms) ✓ allows setting its ComputePlatform (14 ms) ✓ default profiling group without name (13 ms) ✓ default profiling group without name when name exceeding limit is generated (18 ms) ✓ grant publish permissions profiling group (25 ms) ✓ grant read permissions profiling group (25 ms) ● profiling group › use specified via name via fromProfilingGroupName expect(received).toEqual(expected) // deep equality Expected: "MyAwesomeProfilingGroup" Received: "profilingGroup" 174 | 175 | const profilingGroup = ProfilingGroup.fromProfilingGroupName(stack, 'MyProfilingGroup', 'MyAwesomeProfilingGroup'); > 176 | expect(profilingGroup.profilingGroupName).toEqual('MyAwesomeProfilingGroup'); | ^ 177 | }); 178 | 179 | test('default profiling group', () => { at Object.<anonymous> (test/profiling-group.test.ts:176:47) ``` ---- ### All Submissions: * [Yes] Have you followed the guidelines in our [Contributing guide?](https://github.com/aws/aws-cdk/blob/main/CONTRIBUTING.md) ### Adding new Unconventional Dependencies: * [No] This PR adds new unconventional dependencies following the process described [here](https://github.com/aws/aws-cdk/blob/main/CONTRIBUTING.md/#adding-new-unconventional-dependencies) ### New Features * [N/A] Have you added the new feature to an [integration test](https://github.com/aws/aws-cdk/blob/main/INTEGRATION_TESTS.md)? * [ ] Did you use `yarn integ` to deploy the infrastructure and generate the snapshot (i.e. `yarn integ` without `--dry-run`)? *By submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license*
|
…n using importing (#22554) Closes #22546. Verified via TDD with new unit test. Before the change, the unit test failed, replicating the bug in the issue with output: ```plain FAIL test/profiling-group.test.js profiling group ✓ attach read permission to Profiling group via fromProfilingGroupArn (71 ms) ✓ attach publish permission to Profiling group via fromProfilingGroupName (27 ms) ✕ use name specified via fromProfilingGroupName (8 ms) ✓ default profiling group (21 ms) ✓ allows setting its ComputePlatform (14 ms) ✓ default profiling group without name (13 ms) ✓ default profiling group without name when name exceeding limit is generated (18 ms) ✓ grant publish permissions profiling group (25 ms) ✓ grant read permissions profiling group (25 ms) ● profiling group › use specified via name via fromProfilingGroupName expect(received).toEqual(expected) // deep equality Expected: "MyAwesomeProfilingGroup" Received: "profilingGroup" 174 | 175 | const profilingGroup = ProfilingGroup.fromProfilingGroupName(stack, 'MyProfilingGroup', 'MyAwesomeProfilingGroup'); > 176 | expect(profilingGroup.profilingGroupName).toEqual('MyAwesomeProfilingGroup'); | ^ 177 | }); 178 | 179 | test('default profiling group', () => { at Object.<anonymous> (test/profiling-group.test.ts:176:47) ``` ---- ### All Submissions: * [Yes] Have you followed the guidelines in our [Contributing guide?](https://github.com/aws/aws-cdk/blob/main/CONTRIBUTING.md) ### Adding new Unconventional Dependencies: * [No] This PR adds new unconventional dependencies following the process described [here](https://github.com/aws/aws-cdk/blob/main/CONTRIBUTING.md/#adding-new-unconventional-dependencies) ### New Features * [N/A] Have you added the new feature to an [integration test](https://github.com/aws/aws-cdk/blob/main/INTEGRATION_TESTS.md)? * [ ] Did you use `yarn integ` to deploy the infrastructure and generate the snapshot (i.e. `yarn integ` without `--dry-run`)? *By submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license*
…n using importing (aws#22554) Closes aws#22546. Verified via TDD with new unit test. Before the change, the unit test failed, replicating the bug in the issue with output: ```plain FAIL test/profiling-group.test.js profiling group ✓ attach read permission to Profiling group via fromProfilingGroupArn (71 ms) ✓ attach publish permission to Profiling group via fromProfilingGroupName (27 ms) ✕ use name specified via fromProfilingGroupName (8 ms) ✓ default profiling group (21 ms) ✓ allows setting its ComputePlatform (14 ms) ✓ default profiling group without name (13 ms) ✓ default profiling group without name when name exceeding limit is generated (18 ms) ✓ grant publish permissions profiling group (25 ms) ✓ grant read permissions profiling group (25 ms) ● profiling group › use specified via name via fromProfilingGroupName expect(received).toEqual(expected) // deep equality Expected: "MyAwesomeProfilingGroup" Received: "profilingGroup" 174 | 175 | const profilingGroup = ProfilingGroup.fromProfilingGroupName(stack, 'MyProfilingGroup', 'MyAwesomeProfilingGroup'); > 176 | expect(profilingGroup.profilingGroupName).toEqual('MyAwesomeProfilingGroup'); | ^ 177 | }); 178 | 179 | test('default profiling group', () => { at Object.<anonymous> (test/profiling-group.test.ts:176:47) ``` ---- ### All Submissions: * [Yes] Have you followed the guidelines in our [Contributing guide?](https://github.com/aws/aws-cdk/blob/main/CONTRIBUTING.md) ### Adding new Unconventional Dependencies: * [No] This PR adds new unconventional dependencies following the process described [here](https://github.com/aws/aws-cdk/blob/main/CONTRIBUTING.md/#adding-new-unconventional-dependencies) ### New Features * [N/A] Have you added the new feature to an [integration test](https://github.com/aws/aws-cdk/blob/main/INTEGRATION_TESTS.md)? * [ ] Did you use `yarn integ` to deploy the infrastructure and generate the snapshot (i.e. `yarn integ` without `--dry-run`)? *By submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license*
Describe the bug
When importing a ProfilingGroup by either name or ARN, the resulting construct uses the wrong value for profiling group name.
Expected Behavior
Current Behavior
Output of above is instead the hard-coded value
profilingGroup
.Reproduction Steps
Possible Solution
Replace resource when importing for
resourceName
.Additional Information/Context
No response
CDK CLI Version
2.44.0
Framework Version
No response
Node.js Version
14.17.0
OS
Linux
Language
Typescript
Language Version
4.8.4
Other information
No response
The text was updated successfully, but these errors were encountered: