Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: pass site_prefix to CloudFront module #66

Open
wants to merge 2 commits into
base: release/0.2.0
Choose a base branch
from

Conversation

blimmer
Copy link

@blimmer blimmer commented May 15, 2022

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:

resource "aws_s3_bucket" "wordpress_bucket" {
bucket = "${var.site_prefix}.${var.site_domain}"

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:

variable "site_prefix" {
type = string
description = "The subdomain prefix of the website domain. E.g. www"
default = "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.

@blimmer blimmer requested a review from petewilcock as a code owner May 15, 2022 00:36
@blimmer blimmer mentioned this pull request May 15, 2022
@petewilcock petewilcock changed the base branch from master to release/0.2.0 May 15, 2022 09:14
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants