From a32ee4dc1af329cecfd6590f728811a9c6960bbe Mon Sep 17 00:00:00 2001 From: Peter Woodworth <44349620+peterwoodworth@users.noreply.github.com> Date: Mon, 28 Mar 2022 18:30:08 -0700 Subject: [PATCH] fix(docdb): DB Instance ARN uses 'docdb' as the service component instead of 'rds' (#19555) Fixes #19554 ---- ### All Submissions: * [x] Have you followed the guidelines in our [Contributing guide?](https://github.com/aws/aws-cdk/blob/master/CONTRIBUTING.md) ### Adding new Unconventional Dependencies: * [ ] This PR adds new unconventional dependencies following the process described [here](https://github.com/aws/aws-cdk/blob/master/CONTRIBUTING.md/#adding-new-unconventional-dependencies) ### New Features * [ ] Have you added the new feature to an [integration test](https://github.com/aws/aws-cdk/blob/master/INTEGRATION_TESTS.md)? * [ ] Did you use `cdk-integ` to deploy the infrastructure and generate the snapshot (i.e. `cdk-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* --- packages/@aws-cdk/aws-docdb/lib/instance.ts | 2 +- packages/@aws-cdk/aws-docdb/test/instance.test.ts | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/packages/@aws-cdk/aws-docdb/lib/instance.ts b/packages/@aws-cdk/aws-docdb/lib/instance.ts index 1a791b99a0bf5..9611235077389 100644 --- a/packages/@aws-cdk/aws-docdb/lib/instance.ts +++ b/packages/@aws-cdk/aws-docdb/lib/instance.ts @@ -101,7 +101,7 @@ abstract class DatabaseInstanceBase extends cdk.Resource implements IDatabaseIns */ public get instanceArn(): string { return cdk.Stack.of(this).formatArn({ - service: 'docdb', + service: 'rds', resource: 'db', arnFormat: ArnFormat.COLON_RESOURCE_NAME, resourceName: this.instanceIdentifier, diff --git a/packages/@aws-cdk/aws-docdb/test/instance.test.ts b/packages/@aws-cdk/aws-docdb/test/instance.test.ts index d7e90af3e3e90..a83525110f8f8 100644 --- a/packages/@aws-cdk/aws-docdb/test/instance.test.ts +++ b/packages/@aws-cdk/aws-docdb/test/instance.test.ts @@ -117,7 +117,7 @@ describe('DatabaseInstance', () => { [ 'arn:', { Ref: 'AWS::Partition' }, - ':docdb:us-test-1:12345:db:', + ':rds:us-test-1:12345:db:', { Ref: 'InstanceC1063A87' }, ], ], @@ -160,7 +160,7 @@ describe('DatabaseInstance', () => { [ 'arn:', { Ref: 'AWS::Partition' }, - `:docdb:us-test-1:12345:db:${instanceIdentifier}`, + `:rds:us-test-1:12345:db:${instanceIdentifier}`, ], ], },