From c36585e37a50c4c5a74b945f788626ca9fef84cb Mon Sep 17 00:00:00 2001 From: Matsuda Date: Tue, 15 Oct 2024 00:50:31 +0900 Subject: [PATCH] fix(redshiftserverless): from method generates invalid ARN (#58) fix from method --- src/aws-redshiftserverless/namespace.ts | 4 ++-- src/aws-redshiftserverless/workgroup.ts | 4 ++-- test/aws-redshiftserverless/namespace.test.ts | 4 ++-- test/aws-redshiftserverless/workgroup.test.ts | 4 ++-- 4 files changed, 8 insertions(+), 8 deletions(-) diff --git a/src/aws-redshiftserverless/namespace.ts b/src/aws-redshiftserverless/namespace.ts index 0651c9a..69810b9 100644 --- a/src/aws-redshiftserverless/namespace.ts +++ b/src/aws-redshiftserverless/namespace.ts @@ -170,8 +170,8 @@ export class Namespace extends Resource implements INamespace { public readonly namespaceName = attrs.namespaceName; public readonly namespaceId = attrs.namespaceId; public readonly namespaceArn = Stack.of(this).formatArn({ - resource: 'redshift-serverless', - service: 'namespace', + service: 'redshift-serverless', + resource: 'namespace', resourceName: attrs.namespaceId, }); } diff --git a/src/aws-redshiftserverless/workgroup.ts b/src/aws-redshiftserverless/workgroup.ts index 6316ae1..d1a15ce 100644 --- a/src/aws-redshiftserverless/workgroup.ts +++ b/src/aws-redshiftserverless/workgroup.ts @@ -180,8 +180,8 @@ export class Workgroup extends Resource implements IWorkgroup { defaultPort: aws_ec2.Port.tcp(attrs.port), }); public readonly workgroupArn = Stack.of(this).formatArn({ - resource: 'redshift-serverless', - service: 'workgroup', + service: 'redshift-serverless', + resource: 'workgroup', resourceName: attrs.workgroupId, }); } diff --git a/test/aws-redshiftserverless/namespace.test.ts b/test/aws-redshiftserverless/namespace.test.ts index 21727a9..085d39f 100644 --- a/test/aws-redshiftserverless/namespace.test.ts +++ b/test/aws-redshiftserverless/namespace.test.ts @@ -77,8 +77,8 @@ describe('Redshift Serverless Namespace', () => { test('should correctly format namespaceArn', () => { expect(existingNamespace.namespaceArn).toEqual( Stack.of(stack).formatArn({ - resource: 'redshift-serverless', - service: 'namespace', + service: 'redshift-serverless', + resource: 'namespace', resourceName: 'my-namespace-id', }), ); diff --git a/test/aws-redshiftserverless/workgroup.test.ts b/test/aws-redshiftserverless/workgroup.test.ts index 9410b34..d2bfb12 100644 --- a/test/aws-redshiftserverless/workgroup.test.ts +++ b/test/aws-redshiftserverless/workgroup.test.ts @@ -119,8 +119,8 @@ describe('Redshift Serverless Workgroup', () => { test('should correctly format workgroupArn', () => { expect(importedWorkgroup.workgroupArn).toEqual( Stack.of(stack).formatArn({ - resource: 'redshift-serverless', - service: 'workgroup', + service: 'redshift-serverless', + resource: 'workgroup', resourceName: 'my-workgroup-id', }), );