You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
If you have > 1 awsApiCall calls on the same API & Action, then there will be a collision in the constructs' names.
Expected Behavior
Sometimes you have to do the same API call against different resources, so I would expect different construct names.
Current Behavior
Any AwsApiCall with the same API + action instantiates constructs with the same name.
Reproduction Steps
import{AccountRootPrincipal,Role}from'aws-cdk-lib/aws-iam';import{Key}from'aws-cdk-lib/aws-kms';import{App,CfnOutput,RemovalPolicy,Stack}from'aws-cdk-lib';import*asintegfrom'@aws-cdk/integ-tests-alpha';import{DeduplicationScope,FifoThroughputLimit,Queue,QueueEncryption}from'aws-cdk-lib/aws-sqs';constapp=newApp();conststack=newStack(app,'aws-cdk-sqs');constdlq=newQueue(stack,'DeadLetterQueue');constqueue=newQueue(stack,'Queue',{deadLetterQueue: {queue: dlq,maxReceiveCount: 5},});constfifo=newQueue(stack,'FifoQueue',{fifo: true,encryptionMasterKey: newKey(stack,'EncryptionKey',{removalPolicy: RemovalPolicy.DESTROY}),});consthighThroughputFifo=newQueue(stack,'HighThroughputFifoQueue',{fifo: true,fifoThroughputLimit: FifoThroughputLimit.PER_MESSAGE_GROUP_ID,deduplicationScope: DeduplicationScope.MESSAGE_GROUP,});constkmsManagedEncryptedQueue=newQueue(stack,'kmsManagedEncryptedQueue',{encryption: QueueEncryption.KMS_MANAGED,});constunencryptedQueue=newQueue(stack,'UnencryptedQueue',{encryption: QueueEncryption.UNENCRYPTED,});constssl=newQueue(stack,'SSLQueue',{enforceSSL: true});constrole=newRole(stack,'Role',{assumedBy: newAccountRootPrincipal(),});dlq.grantConsumeMessages(role);queue.grantConsumeMessages(role);fifo.grantConsumeMessages(role);highThroughputFifo.grantConsumeMessages(role);kmsManagedEncryptedQueue.grantConsumeMessages(role);unencryptedQueue.grantConsumeMessages(role);ssl.grantConsumeMessages(role);newCfnOutput(stack,'QueueUrl',{value: queue.queueUrl});constintegtest=newinteg.IntegTest(app,'SqsTest',{testCases: [stack],});// GIVEN a defaults-only SQS Queue// WHEN we query it for the `sqsManagedSseEnabled` attributeconstdefaultQueueAttrs=integtest.assertions.awsApiCall('SQS','getQueueAttributes',{QueueUrl: queue.queueUrl,AttributeNames: ['SqsManagedSseEnabled'],});// THEN we expect it to return `true`defaultQueueAttrs.expect(integ.ExpectedResult.stringLikeRegexp('true'));// GIVEN a SQS Queue with KMS// WHEN we query it for the `sqsManagedSseEnabled` attributeconstkmsQueueAttrs=integtest.assertions.awsApiCall('SQS','getQueueAttributes',{QueueUrl: kmsManagedEncryptedQueue.queueUrl,AttributeNames: ['SqsManagedSseEnabled'],});// THEN we expect it to return `false`kmsQueueAttrs.expect(integ.ExpectedResult.stringLikeRegexp('false'));app.synth();
Possible Solution
No response
Additional Information/Context
No response
CDK CLI Version
2.70.0
Framework Version
No response
Node.js Version
16.3.0
OS
Mac
Language
Typescript
Language Version
No response
Other information
No response
The text was updated successfully, but these errors were encountered:
… different parameters (#25241)
This PR allows multiple AwsApiCalls with the same action and different parameters.
Closes#25014
To be able to test the new behavior, a new integration test has been added in aws-redshift-alpha package.
Next possible step (to be discussed): add an optional `callNumber` in `awsApiCall` method to be able to use this method twice with the same action and same parameters.
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.
Describe the bug
If you have > 1
awsApiCall
calls on the same API & Action, then there will be a collision in the constructs' names.Expected Behavior
Sometimes you have to do the same API call against different resources, so I would expect different construct names.
Current Behavior
Any
AwsApiCall
with the same API + action instantiates constructs with the same name.Reproduction Steps
Possible Solution
No response
Additional Information/Context
No response
CDK CLI Version
2.70.0
Framework Version
No response
Node.js Version
16.3.0
OS
Mac
Language
Typescript
Language Version
No response
Other information
No response
The text was updated successfully, but these errors were encountered: