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
• 51,970 points
7,228 views

2 answers to this question.

0 votes

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 by Preeti

edited Aug 19

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
• 57,700 points
788 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
6,543 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,150 points
10,073 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
• 57,700 points
1,333 views
0 votes
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
• 57,700 points
2,201 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,770 points
1,301 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
• 57,700 points
3,636 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
• 57,700 points
2,997 views