Create an S3 bucket using CloudFormation - AWS

0 votes
How do I create an S3 bucket using CloufFoundation by Hardcoding the name?
Apr 9, 2019 in AWS by Kalgi
• 52,350 points
15,810 views

2 answers to this question.

0 votes

An Amazon S3 bucket is an open cloud storage resource that is available through Amazon Web Services' (AWS) Simple Storage Service (S3) as an offering for object storage. Amazon S3 buckets, which are like file folders contain objects, made up of data and descriptive metadata. You can get a better understanding with the AWS Cloud Migration Course.

Hey Follow these steps to create an S3 bucket using CloudFormation:

  • Create a template with resource "AWS::S3::Bucket" hardcoded with a unique bucket name
  • Go to AWS Management Console, navigate to cloudFormation console and click on create stack
  • Click on "Upload a template file". Select the file you've created in steps 1 and attach that and click Next
  • Enter the stack name and click on Next. In configuration, keep everything as default and click on Next.
  • Finally, check the s3 console, you would find the s3 bucket that you've created.
answered Apr 9, 2019 by Monish
0 votes

Hey you can create an S3 bucket using CloudFormation from CloudFormation Console or Even CLI.

If you want to create it via CloudFormation console here are the steps.

First open a notepad and copy below code into your editor,save it with .yaml extension.

AWSTemplateFormatVersion: 2010-09-09
Description: CloudFormation template for s3 bucket 
    
Resources:
    
  S3Bucket:
    DeletionPolicy: Retain
    Type: AWS::S3::Bucket
    Description: Creating Amazon S3 bucket from CloudFormation
    Properties:
      BucketName: MyHardCodedBucket
      
    
Outputs:
  S3Bucket:
    Description: Bucket Created using this template.
    Value: !Ref S3Bucket
        

Now when you have the file handy

  • Open AWS management console and go to CloudFormation console.
  • Click on Create Stack
  • Upload your template
  • Keep all the configuration as default and click next next
  • Once the stack creation finishes,you can verify your bucket

This will fulfil your need of creating a simple s3 bucket. However If you are looking for more features like enabling versioning ,encryption or making a bucket private please feel free to checkout this

answered Aug 19, 2020 by Preeti

edited Aug 19, 2020

Related Questions In AWS

0 votes
1 answer
+1 vote
1 answer

Create S3 bucket using Java AWS SDK

Hey @Anjali, Creating a bucket using Java AWS-SDK ...READ MORE

answered Jan 23, 2019 in AWS by Priyaj
• 58,100 points
2,527 views
0 votes
1 answer

How do I create folder under an Amazon S3 bucket through PHP API?

Of Course, it is possible to create ...READ MORE

answered Apr 24, 2018 in AWS by anonymous
11,363 views
0 votes
1 answer

How to download the latest file in a S3 bucket using AWS CLI?

You can use the below command $ aws ...READ MORE

answered Sep 6, 2018 in AWS by Archana
• 4,170 points
19,810 views
0 votes
1 answer

AWS S3 uploading hidden files by default

versioning is enabled in your bucket. docs.aws.amazon.com/AmazonS3/latest/user-guide/….... the ...READ MORE

answered Oct 4, 2018 in AWS by Priyaj
• 58,100 points
5,903 views
–1 vote
1 answer

How to decrypt the encrypted S3 file using aws-encryption-cli --decrypt

Use command : aws s3 presign s3://mybucket/abc_count.png you get ...READ MORE

answered Oct 22, 2018 in AWS by Priyaj
• 58,100 points
5,175 views
0 votes
1 answer

Import my AWS credentials using python script

Using AWS Cli  Configure your IAM user then ...READ MORE

answered Nov 16, 2018 in AWS by Jino
• 5,820 points
2,845 views
0 votes
2 answers
0 votes
1 answer

How to create a S3 bucket using AWS CLI?

You can use the following command:- C:\Users\priyj_kumar>aws s3api ...READ MORE

answered Feb 15, 2019 in AWS by Priyaj
• 58,100 points
6,105 views
+1 vote
3 answers

How to get ARN for s3 Bucket using aws cli .

An ARN is a non-opaque, constructible identifier, ...READ MORE

answered Aug 16, 2018 in AWS by Priyaj
• 58,100 points
5,605 views
webinar REGISTER FOR FREE WEBINAR X
REGISTER NOW
webinar_success Thank you for registering Join Edureka Meetup community for 100+ Free Webinars each month JOIN MEETUP GROUP