riboseinc / terraform-aws-s3-cloudfront-website

Terraform module for creating a static S3 website with CloudFront with an SSL certificate (e.g., from ACM)
Apache License 2.0
74 stars 40 forks source link

Name Tag is not overridable #39

Closed vKongv closed 2 years ago

vKongv commented 2 years ago

I have faced an issue where my CF fqdn name contains value (Eg: *.website.com) that are not allowed as a tag value in AWS: https://docs.aws.amazon.com/directoryservice/latest/devguide/API_Tag.html

Since S3's bucket name is not allowed to have "*" as part of the name, I have override the bucket name using bucket_name variable. But for the deployment, it will still use fqdn value as Name Tag value which causes me the following error

error updating S3 Bucket (abc.website.com) tags: error setting resource tags (abc.website.com): InvalidTag: The TagValue you have provided is invalid

There is a solution for this which is to use local.localBucketName as the Name Tag value rather than always hardcoded to fqdn. We can also allow overriding of tags value by switching the merge sequence.

phuonghuynh commented 2 years ago

Fixed in #40