{
  "AWSTemplateFormatVersion": "2010-09-09",
  "Description": "S3 bucket",
  "Parameters": {
    "BucketName": {
      "Type": "String",
      "Description": "S3 bucket name"
    }
  },

  "Resources": {
    "S3Bucket": {
      "Type": "AWS::S3::Bucket",
      "Properties": {
        "AccessControl": "Private",
        "BucketName": {"Ref": "BucketName"}
      }
    }
  },

  "Outputs": {
    "Name": {
      "Description": "S3 bucket name",
      "Value": {"Ref": "S3Bucket"}
    },
    "Domain": {
      "Description": "S3 bucket domain name",
      "Value": {"Fn::GetAtt": ["S3Bucket", "DomainName"]}
    },
    "URL" : {
      "Value" : {"Fn::Join": ["", [
        "https://", {"Fn::GetAtt": ["S3Bucket", "DomainName"]}
      ]]},
      "Description" : "S3 bucket URL"
    }
  }
}

{
  "AWSTemplateFormatVersion": "2010-09-09",
  "Description": "S3 bucket",
  "Parameters": {
    "BucketName": {
      "Type": "String",
      "Description": "S3 bucket name"
    }
  },

  "Resources": {
    "S3Bucket": {
      "Type": "AWS::S3::Bucket",
      "Properties": {
        "AccessControl": "Private",
        "VersioningConfiguration": {
          "Status": "Enabled"
        },
        "BucketName": {"Ref": "BucketName"}
      }
    }
  },

  "Outputs": {
    "Name": {
      "Description": "S3 bucket name",
      "Value": {"Ref": "S3Bucket"}
    },
    "Domain": {
      "Description": "S3 bucket domain name",
      "Value": {"Fn::GetAtt": ["S3Bucket", "DomainName"]}
    },
    "URL" : {
      "Value" : {"Fn::Join": ["", [
        "https://", {"Fn::GetAtt": ["S3Bucket", "DomainName"]}
      ]]},
      "Description" : "S3 bucket URL"
    }
  }
}

Enable Object Versioning for S3 buckets
Enable Object Versioning for S3 buckets

Object versioning will automatically keep old file versions so
that there's less need for us to do manual copies and backups
of modified or removed documents.
