Skip to content

Commit 8ef742c

Browse files
committed
chore: use Fn::Sub instead of Fn::Join
1 parent a727a5a commit 8ef742c

File tree

2 files changed

+5
-14
lines changed

2 files changed

+5
-14
lines changed

lib/package/sns/compileMethodsToSns.js

Lines changed: 1 addition & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -51,16 +51,7 @@ module.exports = {
5151
'Fn::GetAtt': ['ApigatewayToSnsRole', 'Arn']
5252
},
5353
Uri: {
54-
'Fn::Join': [
55-
'',
56-
[
57-
'arn:aws:apigateway:',
58-
{
59-
Ref: 'AWS::Region'
60-
},
61-
':sns:path//'
62-
]
63-
]
54+
'Fn::Sub': 'arn:aws:apigateway:${AWS::Region}:sns:path//'
6455
},
6556
PassthroughBehavior: 'NEVER',
6657
RequestParameters: {

lib/package/sns/compileMethodsToSns.test.js

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,7 @@ describe('#compileMethodsToSns()', () => {
7070
Type: 'AWS',
7171
Credentials: { 'Fn::GetAtt': ['ApigatewayToSnsRole', 'Arn'] },
7272
Uri: {
73-
'Fn::Join': ['', ['arn:aws:apigateway:', { Ref: 'AWS::Region' }, ':sns:path//']]
73+
'Fn::Sub': 'arn:aws:apigateway:${AWS::Region}:sns:path//'
7474
},
7575
PassthroughBehavior: 'NEVER',
7676
RequestParameters: {
@@ -196,7 +196,7 @@ describe('#compileMethodsToSns()', () => {
196196
Type: 'AWS',
197197
Credentials: { 'Fn::GetAtt': ['ApigatewayToSnsRole', 'Arn'] },
198198
Uri: {
199-
'Fn::Join': ['', ['arn:aws:apigateway:', { Ref: 'AWS::Region' }, ':sns:path//']]
199+
'Fn::Sub': 'arn:aws:apigateway:${AWS::Region}:sns:path//'
200200
},
201201
PassthroughBehavior: 'NEVER',
202202
RequestParameters: {
@@ -465,7 +465,7 @@ describe('#compileMethodsToSns()', () => {
465465
Type: 'AWS',
466466
Credentials: { 'Fn::GetAtt': ['ApigatewayToSnsRole', 'Arn'] },
467467
Uri: {
468-
'Fn::Join': ['', ['arn:aws:apigateway:', { Ref: 'AWS::Region' }, ':sns:path//']]
468+
'Fn::Sub': 'arn:aws:apigateway:${AWS::Region}:sns:path//'
469469
},
470470
PassthroughBehavior: 'NEVER',
471471
RequestParameters: {
@@ -578,7 +578,7 @@ describe('#compileMethodsToSns()', () => {
578578
Type: 'AWS',
579579
Credentials: { 'Fn::GetAtt': ['ApigatewayToSnsRole', 'Arn'] },
580580
Uri: {
581-
'Fn::Join': ['', ['arn:aws:apigateway:', { Ref: 'AWS::Region' }, ':sns:path//']]
581+
'Fn::Sub': 'arn:aws:apigateway:${AWS::Region}:sns:path//'
582582
},
583583
PassthroughBehavior: 'NEVER',
584584
RequestParameters: {

0 commit comments

Comments
 (0)