Skip to content

Commit 790a290

Browse files
author
rjabhi
committed
fix(migrate-template-gen): no need to reconstruct arn for iam role output
1 parent 8f9bef1 commit 790a290

File tree

2 files changed

+7
-6
lines changed

2 files changed

+7
-6
lines changed

packages/amplify-migration-template-gen/src/resolvers/cfn-output-resolver.test.ts

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -176,11 +176,11 @@ describe('CFNOutputResolver', () => {
176176
},
177177
LambdaRole: {
178178
Description: 'Lambda execution role',
179-
Value: 'lambda-exec-role',
179+
Value: 'arn:aws:iam::12345:role/lambda-exec-role',
180180
},
181181
CreatedSNSRole: {
182182
Description: 'role arn',
183-
Value: 'sns_role_arn',
183+
Value: 'arn:aws:iam::12345:role/sns12345-dev',
184184
},
185185
},
186186
Resources: {
@@ -213,7 +213,7 @@ describe('CFNOutputResolver', () => {
213213
UserPoolName: 'MyUserPool',
214214
SmsConfiguration: {
215215
ExternalId: 'testsns_role_external_id',
216-
SnsCallerArn: 'arn:aws:iam::12345:role/sns_role_arn',
216+
SnsCallerArn: 'arn:aws:iam::12345:role/sns12345-dev',
217217
},
218218
},
219219
},
@@ -315,11 +315,11 @@ describe('CFNOutputResolver', () => {
315315
},
316316
{
317317
OutputKey: 'LambdaRole',
318-
OutputValue: 'lambda-exec-role',
318+
OutputValue: 'arn:aws:iam::12345:role/lambda-exec-role',
319319
},
320320
{
321321
OutputKey: 'CreatedSNSRole',
322-
OutputValue: 'sns_role_arn',
322+
OutputValue: 'arn:aws:iam::12345:role/sns12345-dev',
323323
},
324324
],
325325
),

packages/amplify-migration-template-gen/src/resolvers/cfn-output-resolver.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -93,7 +93,8 @@ class CfnOutputResolver {
9393
};
9494
case 'AWS::IAM::Role':
9595
return {
96-
Arn: `arn:aws:iam::${this.accountId}:role/${resourceIdentifier}`,
96+
// output is already in ARN format
97+
Arn: resourceIdentifier,
9798
};
9899
default:
99100
return undefined;

0 commit comments

Comments
 (0)