I have created a simple template which i am going to use to create s3 buckets. My template looks like this.
Parameters:
Environment:
Type: String
Default: prod
AllowedPattern: '[a-z\-]+'
BucketName:
Type: String
AllowedPattern: '[a-z\-]+'
Resources:
Bucket:
Type: AWS::S3::Bucket
Properties:
BucketName: !Sub foo-${Environment}-${BucketName}
Tags:
- Key: key_1
Value: foo
- Key: key_2
Value: foo
DeletionPolicy: Retain
I want to make a generic template and not create a different template each time a i create an s3 bucket. Only thing that will vary between my s3 buckets is the # of tags i add to it. Some S3 buckets may have 2 tags and others may have more. At the most i will have 5 tags to my s3 bucket. So i am wondering if there is a way to pass tags through parameter such that if i pass 3 tags , 3 tags get created, if i pass 2 tags 2 tags get created.