Open blimmer opened 2 years ago
This PR updates main.tf to pass the site_prefix variable to the CloudFront module. The module references the site prefix when creating the Wordpress bucket: https://github.com/TechToSpeech/terraform-aws-serverless-static-wordpress/blob/abc903d9d3aabbb2fbb51e47679c0b2c61b3f6e7/modules/cloudfront/distribution.tf#L4-L5
main.tf
site_prefix
However, site_prefix was not passed from the main module instantiation to the submodule. For me, this caused an error because I already had an S3 bucket with the www.<site_domain>.com created. www is the variable default defined here: https://github.com/TechToSpeech/terraform-aws-serverless-static-wordpress/blob/abc903d9d3aabbb2fbb51e47679c0b2c61b3f6e7/modules/cloudfront/variables.tf#L6-L10
www.<site_domain>.com
www
Error creating S3 bucket: BucketAlreadyOwnedByYou: Your previous request to create the named bucket succeeded and you already own it.
By passing through the site prefix, with this PR, I was able to get past the error and create the bucket <custom_site_prefix>.<site_domain>.com.
<custom_site_prefix>.<site_domain>.com
This PR updates
main.tf
to pass thesite_prefix
variable to the CloudFront module. The module references the site prefix when creating the Wordpress bucket: https://github.com/TechToSpeech/terraform-aws-serverless-static-wordpress/blob/abc903d9d3aabbb2fbb51e47679c0b2c61b3f6e7/modules/cloudfront/distribution.tf#L4-L5However,
site_prefix
was not passed from the main module instantiation to the submodule. For me, this caused an error because I already had an S3 bucket with thewww.<site_domain>.com
created.www
is the variable default defined here: https://github.com/TechToSpeech/terraform-aws-serverless-static-wordpress/blob/abc903d9d3aabbb2fbb51e47679c0b2c61b3f6e7/modules/cloudfront/variables.tf#L6-L10By passing through the site prefix, with this PR, I was able to get past the error and create the bucket
<custom_site_prefix>.<site_domain>.com
.