Create S3 Bucket using CloudFormation

In this blog we will see basic implementation of CloudFormation to create a Bucket using Template file,

Create a Template File to create a Bucket

Copy this content in a text file,

{
 "AWSTemplateFormatVersion":"2010-09-09",
 "Description":"Template for creating bucket",
 "Resources" :{
 "s3Bucket": {
 "Type": "AWS::S3::Bucket",
 "Properties": {
 "BucketName": "mylegiondemo"
              }
      }
 }
}

Save it as bucket.txt

Create a Stack in CloudFormation

Go to AWS Management Console, navigate to CloudFormation console

Follow the below screenshot,

Select Create Stack

In Specify template select Upload a template file and upload the bucket.txt we created earlier,

Add your Stack name in this case its "CreateBucketStack"

Skip the "Configuration Stack options", it stays Default,

Click Submit

After Submitting wait for creation of your bucket, then you will see CREATE_COMPLETE and your bucket is created,

Go to S3 console and look for your bucket,

THANKYOU!!