Skip to content
This repository was archived by the owner on Oct 4, 2024. It is now read-only.

Commit 9b14998

Browse files
committed
Updating due to Sig v2 deprecation
1 parent a03e471 commit 9b14998

File tree

1 file changed

+12
-3
lines changed

1 file changed

+12
-3
lines changed

templates/git2s3.template

Lines changed: 12 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@ Metadata:
2424
default: AWS Quick Start Configuration
2525
Parameters:
2626
- QSS3BucketName
27+
- QSS3BucketRegion
2728
- QSS3KeyPrefix
2829
ParameterLabels:
2930
AllowedIps:
@@ -42,6 +43,8 @@ Metadata:
4243
default: Output S3 Bucket Name
4344
QSS3BucketName:
4445
default: Quick Start S3 Bucket Name
46+
QSS3BucketRegion:
47+
default: Quick Start S3 bucket region
4548
QSS3KeyPrefix:
4649
default: Quick Start S3 Key Prefix
4750
Parameters:
@@ -97,6 +100,10 @@ Parameters:
97100
can include numbers, lowercase letters, uppercase letters, and hyphens (-).
98101
It cannot start or end with a hyphen (-).
99102
Type: String
103+
QSS3BucketRegion:
104+
Default: 'us-east-1'
105+
Description: 'The AWS Region where the Quick Start S3 bucket (QSS3BucketName) is hosted. When using your own bucket, you must specify this value.'
106+
Type: String
100107
QSS3KeyPrefix:
101108
AllowedPattern: ^[0-9a-zA-Z-/]*$
102109
ConstraintDescription: Quick Start key prefix can include numbers, lowercase letters,
@@ -155,6 +162,7 @@ Conditions:
155162
- !Equals
156163
- !Ref 'VPCId'
157164
- ''
165+
UsingDefaultBucket: !Equals [!Ref QSS3BucketName, 'aws-quickstart']
158166
Resources:
159167
LambdaZipsBucket:
160168
Type: AWS::S3::Bucket
@@ -165,7 +173,7 @@ Resources:
165173
Properties:
166174
ServiceToken: !GetAtt 'CopyZipsFunction.Arn'
167175
DestBucket: !Ref 'LambdaZipsBucket'
168-
SourceBucket: !Ref 'QSS3BucketName'
176+
SourceBucket: !If [UsingDefaultBucket, !Sub '${QSS3BucketName}-${AWS::Region}', !Ref QSS3BucketName]
169177
Prefix: !Ref 'QSS3KeyPrefix'
170178
Objects:
171179
- functions/packages/CreateSSHKey/lambda.zip
@@ -193,8 +201,9 @@ Resources:
193201
- Effect: Allow
194202
Action:
195203
- s3:GetObject
196-
Resource:
197-
- !Sub 'arn:aws:s3:::${QSS3BucketName}/${QSS3KeyPrefix}*'
204+
Resource: !Sub
205+
- arn:${AWS::Partition}:s3:::${S3Bucket}/${QSS3KeyPrefix}*
206+
- S3Bucket: !If [UsingDefaultBucket, !Sub '${QSS3BucketName}-${AWS::Region}', !Ref QSS3BucketName]
198207
- Effect: Allow
199208
Action:
200209
- s3:PutObject

0 commit comments

Comments
 (0)