feat(rds): add clusterArn property to IServerlessCluster#10741
feat(rds): add clusterArn property to IServerlessCluster#10741mergify[bot] merged 9 commits intoaws:masterfrom
Conversation
…rikx/aws-cdk into serverlesscluster-resource-arn-prop
…rikx/aws-cdk into serverlesscluster-resource-arn-prop
…rikx/aws-cdk into serverlesscluster-resource-arn-prop
| // THEN | ||
| expect(stack).to(haveOutput({ | ||
| exportName, | ||
| outputValue: { | ||
| 'Fn::Join': [ | ||
| '', | ||
| [ | ||
| 'arn:', | ||
| { Ref: 'AWS::Partition' }, | ||
| ':rds:us-test-1:12345:cluster:', | ||
| { Ref: 'DatabaseB269D8BB' }, | ||
| ], | ||
| ], | ||
| }, | ||
| })); |
There was a problem hiding this comment.
why not directly compare the cluster.clusterArn property to the expected value?
Is an output required?
There was a problem hiding this comment.
No, it's actually not. I just took inspiration from the DocDB construct tests:
aws-cdk/packages/@aws-cdk/aws-docdb/lib/instance.ts
Lines 101 to 108 in 0297f31
Should I compare the values directly instead?
There was a problem hiding this comment.
I tired:
test.deepEqual(cluster.clusterArn, 'arn:rds:us-test-1:12345:cluster:DatabaseB269D8BB');but that one fails with:
AssertionError: 'arn:${Token[AWS.Partition.3]}:rds:us-test-1:12345:cluster:${Token[TOKEN.13366]}' deepEqual 'arn:rds:us-test-1:12345:cluster:DatabaseB269D8BB'
Can you point me to an example on how to compare values directly?
There was a problem hiding this comment.
I suspect including token placeholders isn't the way to go ;)
There was a problem hiding this comment.
you'd need to do a stack.resolve(cluster.clusterArn) to resolve the tokens 🙂
|
Thank you for contributing! Your pull request will be updated from master and then merged automatically (do not update manually, and be sure to allow changes to be pushed to your fork). |
AWS CodeBuild CI Report
Powered by github-codebuild-logs, available on the AWS Serverless Application Repository |
|
Thank you for contributing! Your pull request will be updated from master and then merged automatically (do not update manually, and be sure to allow changes to be pushed to your fork). |
### Issue # (if applicable) ### Reason for this change This is to bring parity with #10741, we need the cluster arn to enable data api manually waiting for #28574. ### Description of changes This adds a clusterArn property to IDatabaseCluster ### Description of how you validated changes The changes have been validated through a unit test ### Checklist - [x] My code adheres to the [CONTRIBUTING GUIDE](https://github.com/aws/aws-cdk/blob/main/CONTRIBUTING.md) and [DESIGN GUIDELINES](https://github.com/aws/aws-cdk/blob/main/docs/DESIGN_GUIDELINES.md) ---- *By submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license*
This PR adds a property
clusterArntoIServerlessCluster. This simplifies the usage of the Data API which requires passing the ARN of the cluster in Data API calls.closes #10736
By submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license