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

Commit a2ef07c

Browse files
committed
Added Bucket Versioning Configuration.
1 parent ab3fbe3 commit a2ef07c

File tree

1 file changed

+18
-14
lines changed

1 file changed

+18
-14
lines changed

templates/git2s3.template.yaml

Lines changed: 18 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -140,6 +140,8 @@ Resources:
140140
Type: AWS::S3::Bucket
141141
Properties:
142142
Tags: []
143+
VersioningConfiguration:
144+
Status: Enabled
143145

144146
CopyZips:
145147
Type: AWS::CloudFormation::CustomResource
@@ -261,6 +263,8 @@ Resources:
261263
Type: AWS::S3::Bucket
262264
Properties:
263265
Tags: []
266+
VersioningConfiguration:
267+
Status: Enabled
264268

265269
OutputBucket:
266270
Type: AWS::S3::Bucket
@@ -276,7 +280,7 @@ Resources:
276280
KMSKey:
277281
Type: AWS::KMS::Key
278282
Properties:
279-
Description: AWS KWS key to encrypt and decrypt SSH keys stored in S3.
283+
Description: AWS KWS key to encrypt and decrypt SSH keys stored in S3.
280284
KeyPolicy:
281285
Version: '2012-10-17'
282286
Statement:
@@ -336,7 +340,7 @@ Resources:
336340
Condition:
337341
Bool:
338342
kms:GrantIsForAWSResource: true
339-
343+
340344
CreateSSHKeyRole:
341345
Type: AWS::IAM::Role
342346
Properties:
@@ -383,7 +387,7 @@ Resources:
383387
- logs:PutLogEvents
384388
Resource:
385389
- arn:aws:logs:*:*:*
386-
390+
387391
CreateSSHKeyLambda:
388392
DependsOn: CopyZips
389393
Type: AWS::Lambda::Function
@@ -396,7 +400,7 @@ Resources:
396400
Code:
397401
S3Bucket: !Ref 'LambdaZipsBucket'
398402
S3Key: !Sub '${QSS3KeyPrefix}functions/packages/CreateSSHKey/lambda.zip'
399-
403+
400404
CreateSSHKey:
401405
Type: AWS::CloudFormation::CustomResource
402406
Version: '1.0'
@@ -405,7 +409,7 @@ Resources:
405409
KeyBucket: !Ref 'KeyBucket'
406410
Region: !Ref 'AWS::Region'
407411
KMSKey: !Ref 'KMSKey'
408-
412+
409413
DeleteBucketContentsRole:
410414
Type: AWS::IAM::Role
411415
Properties:
@@ -451,7 +455,7 @@ Resources:
451455
- logs:PutLogEvents
452456
Resource:
453457
- arn:aws:logs:*:*:*
454-
458+
455459
DeleteBucketContentsLambda:
456460
DependsOn: CopyZips
457461
Type: AWS::Lambda::Function
@@ -464,7 +468,7 @@ Resources:
464468
Code:
465469
S3Bucket: !Ref 'LambdaZipsBucket'
466470
S3Key: !Sub '${QSS3KeyPrefix}functions/packages/DeleteBucketContents/lambda.zip'
467-
471+
468472
DeleteBucketContents:
469473
Type: AWS::CloudFormation::CustomResource
470474
Version: '1.0'
@@ -484,13 +488,13 @@ Resources:
484488
Statement:
485489
- Effect: "Allow"
486490
Principal:
487-
Service: "codebuild.amazonaws.com"
488-
Action:
491+
Service: "codebuild.amazonaws.com"
492+
Action:
489493
- "sts:AssumeRole"
490494
Path: "/"
491495
ManagedPolicyArns:
492496
- !Ref CodeBuildEndpointPolicy
493-
Tags:
497+
Tags:
494498
-
495499
Key: 'tagging-policy'
496500
Value: !Join ['-', ["test", "ok"]]
@@ -500,13 +504,13 @@ Resources:
500504
Properties:
501505
Description: Policy with base permissions for CodeBuild.
502506
Path: /
503-
Roles:
507+
Roles:
504508
- !Ref CodeBuildServiceRole
505509
PolicyDocument:
506510
Version: 2012-10-17
507511
Statement:
508512
- Effect: "Allow"
509-
Action:
513+
Action:
510514
- "logs:CreateLogGroup"
511515
- "logs:PutLogEvents"
512516
- "logs:CreateLogStream"
@@ -680,7 +684,7 @@ Resources:
680684
- mv ./enc_key.pem ~/.ssh/id_rsa
681685
- ls ~/.ssh/
682686
- echo "Setting SSH config profile"
683-
- |
687+
- |
684688
cat > ~/.ssh/config <<EOF
685689
Host *
686690
AddKeysToAgent yes
@@ -695,7 +699,7 @@ Resources:
695699
- |
696700
if [ "$exclude_git" = "True" ]; then
697701
zip -r $outputbucketkey ./ -x '*.git*'
698-
else
702+
else
699703
zip -r $outputbucketkey ./
700704
fi
701705
- ls -alh

0 commit comments

Comments
 (0)