From 26d51bb04d73a38851988c09fc8d2d7a9f0269ab Mon Sep 17 00:00:00 2001 From: michaelolear <75473730+michaelolear@users.noreply.github.com> Date: Mon, 3 Jul 2023 07:44:12 -0400 Subject: [PATCH] Update Lab1_S3Retain.json --- Labs/TemplatesAndStacks/Lab1_S3Retain.json | 81 ++++++++++++++-------- 1 file changed, 54 insertions(+), 27 deletions(-) diff --git a/Labs/TemplatesAndStacks/Lab1_S3Retain.json b/Labs/TemplatesAndStacks/Lab1_S3Retain.json index 225e812..2ab9ac7 100644 --- a/Labs/TemplatesAndStacks/Lab1_S3Retain.json +++ b/Labs/TemplatesAndStacks/Lab1_S3Retain.json @@ -1,30 +1,57 @@ { - "AWSTemplateFormatVersion" : "2010-09-09", - - "Description" : "AWS CloudFormation Sample Template S3_Website_Bucket_With_Retain_On_Delete: Sample template showing how to create a publicly accessible S3 bucket configured for website access with a deletion policy of retail on delete. **WARNING** This template creates an S3 bucket that will NOT be deleted when the stack is deleted. You will be billed for the AWS resources used if you create a stack from this template.", - - "Resources" : { - "S3Bucket" : { - "Type" : "AWS::S3::Bucket", - "Properties" : { - "AccessControl" : "PublicRead", - "WebsiteConfiguration" : { - "IndexDocument" : "index.html", - "ErrorDocument" : "error.html" - } - }, - "DeletionPolicy" : "Retain" - } - }, - - "Outputs" : { - "WebsiteURL" : { - "Value" : { "Fn::GetAtt" : [ "S3Bucket", "WebsiteURL" ] }, - "Description" : "URL for website hosted on S3" + "AWSTemplateFormatVersion": "2010-09-09", + "Description": "AWS CloudFormation Sample Template S3_Website_Bucket_With_Retain_On_Delete: Sample template showing how to create a publicly accessible S3 bucket configured for website access with a deletion policy of retail on delete. **WARNING** This template creates an S3 bucket that will NOT be deleted when the stack is deleted. You will be billed for the AWS resources used if you create a stack from this template.", + "Resources": { + "S3Bucket": { + "Type": "AWS::S3::Bucket", + "Properties": { + "OwnershipControls": { + "Rules": [ + { + "ObjectOwnership": "ObjectWriter" + } + ] + }, + "PublicAccessBlockConfiguration": { + "BlockPublicAcls": false, + "BlockPublicPolicy": false, + "IgnorePublicAcls": false, + "RestrictPublicBuckets": false + }, + "WebsiteConfiguration": { + "IndexDocument": "index.html", + "ErrorDocument": "error.html" + } + }, + "DeletionPolicy": "Retain" + } }, - "S3BucketSecureURL" : { - "Value" : { "Fn::Join" : [ "", [ "https://", { "Fn::GetAtt" : [ "S3Bucket", "DomainName" ] } ] ] }, - "Description" : "Name of S3 bucket to hold website content" + "Outputs": { + "WebsiteURL": { + "Value": { + "Fn::GetAtt": [ + "S3Bucket", + "WebsiteURL" + ] + }, + "Description": "URL for website hosted on S3" + }, + "S3BucketSecureURL": { + "Value": { + "Fn::Join": [ + "", + [ + "https://", + { + "Fn::GetAtt": [ + "S3Bucket", + "DomainName" + ] + } + ] + ] + }, + "Description": "Name of S3 bucket to hold website content" + } } - } -} \ No newline at end of file +}