Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Cloudformation: API: s3:CreateBucket Access Denied

I am getting

API: s3:CreateBucket Access Denied

in CloudFormation template, but when I try the same code to create the S3 bucket, in another barebones template, it works

AWSTemplateFormatVersion : '2010-09-09'
Transform: AWS::Serverless-2016-10-31
Description: 'Testing'

Parameters:
  TagCostCenter:
    Type: String
  TagDeveloper:
    Type: String
  TagProject:
    Type: String

Resources:
  S3Artifacts:
    Type: AWS::S3::Bucket
    Properties:
      BucketName: !Sub ${AWS::StackName}-artifacts
      AccessControl: Private
      Tags:
        - Key: Cost Center
          Value: !Ref TagCostCenter
        - Key: Developer
          Value: !Ref TagDeveloper
        - Key: Project
          Value: !Ref TagProject

What is wrong? The stack used to work, all I did was add in the S3 bucket

like image 800
Jiew Meng Avatar asked Sep 02 '26 11:09

Jiew Meng


1 Answers

You should have permission to create S3 bucket. Add CreateBucket policy to your IAM user.

like image 163
Kumaresh Babu N S Avatar answered Sep 05 '26 05:09

Kumaresh Babu N S