I have a yaml file to create a stack with CloudFormation. However when it comes to create some S3 buckets the script fails giving me a 400 Bad Request error in the console. I tried to run a script that does only this, but has the same result. This is the yaml file i'm using
AWSTemplateFormatVersion: 2010-09-09
Parameters:
ArtifactsBucket:
Type: String
Default: artifacts.bucket
Description: S3 Bucket Name for CodeBuild Artifacts
DevBucket:
Type: String
Default: dev.bucket
Description: S3 Bucket Name for Dev environment.
StagingBucket:
Type: String
Default: staging.bucket
Description: S3 Bucket Name for Staging environment
ProductionBucket:
Type: String
Default: production.bucket
Description: S3 Bucket Name for Production environment
Resources:
# S3 Bucket for build artifacts
BuildArtifactsBucket:
Type: AWS::S3::Bucket
Properties:
AccessControl: Private
BucketName: !Sub '${ArtifactsBucket}'
# S3 Bucket for Dev environment
DevS3Bucket:
Type: AWS::S3::Bucket
Properties:
AccessControl: Private
BucketName: !Sub '${DevBucket}'
# S3 Bucket for Staging environment
StagingS3Bucket:
Type: AWS::S3::Bucket
Properties:
AccessControl: Private
BucketName: !Sub '${StagingBucket}'
# S3 Bucket for Production environment
ProductionS3Bucket:
Type: AWS::S3::Bucket
Properties:
AccessControl: Private
BucketName: !Sub '${ProductionBucket}'
I really don't understand what is wrong with this, since if i left only one S3 Bucket resource it works