Difference between revisions of "Cloudformation AWS::S3::Bucket example"

From wikieduonline
Jump to navigation Jump to search
Line 2: Line 2:
 
  Description: Create an S3 bucket.
 
  Description: Create an S3 bucket.
 
   
 
   
  Parameters:
+
  [[Parameters:]]
 
   BucketName:
 
   BucketName:
 
     Type: String
 
     Type: String

Revision as of 11:03, 30 March 2022

AWSTemplateFormatVersion: "2010-09-09"
Description: Create an S3 bucket.

Parameters:
  BucketName:
    Type: String
    Description: The name of the S3 bucket. 

Resources:
 TemplatesBucket:
    Type: AWS::S3::Bucket
    DeletionPolicy: Retain
    UpdateReplacePolicy: Retain
    Properties:
      BucketName: !Ref BucketName
      PublicAccessBlockConfiguration:
        BlockPublicAcls: true
        BlockPublicPolicy: true
        IgnorePublicAcls: true
        RestrictPublicBuckets: true
      BucketEncryption:
        ServerSideEncryptionConfiguration:
          - ServerSideEncryptionByDefault:
              SSEAlgorithm: AES256


Related

  • aws cloudformation deploy --template-file /path_to_template/template.json --stack-name my-new-stack-name --parameter-overrides BucketName={bucket_name}

Related

See also

Advertising: