-
-
Notifications
You must be signed in to change notification settings - Fork 248
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
Error using existing S3 bucket in 0.59.0 #151
Comments
@syphernl may be related to your PR? |
@jamengual @pearsonhenri ISTM that the logging bucket already exists, and that Terraform errors on that, since it refers to |
Thanks for the replies guys. @syphernl I don't think it's that, because the bucket currently has access logging disabled. I can enable it, but then I need to specify a logging bucket, which from what your saying sounds like Terraform won't properly handle? |
Unless you're suggesting that Terraform is trying to create a logging bucket called |
Ooph but yeah I'm kinda stumped here, I can't even interact with this module now because Terraform errors in the planning phase now with the whole
thing |
The particular ID I mentioned is the module name you are using with There are two ways of fixing this:
|
Ah, cool--ok I tried setting
So maybe that's a separate issue? |
Can you verify whether it works in the previous version, |
Yeah actually when I recreated just now it was on 0.58.1 and I still hit this error |
So just to be clear, my updated configuration looks like this:
and applying this configuration results in the mentioned error and even prevents me from being able to run |
ISTM the module "my_module" {
source = "cloudposse/cloudfront-s3-cdn/aws"
version = "0.58.1"
origin_bucket = "my.s3.bucket"
override_origin_bucket_policy = false
aliases = ["my.cname.net"]
dns_alias_enabled = true
logging_enabled = false
parent_zone_id = var.my_zone_id
acm_certificate_arn = var.my_acm_arn
name = "cdn"
stage = "prod"
namespace = "eg"
} |
@syphernl nice, looks like that was indeed the problem! Would be great if you could include that in the docs--the README lists an example like this for importing an existing S3 bucket:
(without name/stage/namespace args), which is what got me down this wayward path. |
Ooph, one more problem @syphernl: I removed the
Seems like my provided bucket name isn't getting passed along somewhere? |
Hi there--any update on the above? I'm manually copy-pasting a bucket policy to work around this for now |
@pearsonhenri Another issue has been created for that with a PR to fix it. |
Still running into this issue on |
Oof. Over a year and a half later, that same code snippet in the readme sent me down a rabbit hole with this same error message. Adding |
Added `name` field to second example. There is a known bug cloudposse#151 if the name field is ommited. Might be easier to just update the docs than fix the bug, since it's been open since 2021.
* Update README.md Added `name` field to second example. There is a known bug #151 if the name field is ommited. Might be easier to just update the docs than fix the bug, since it's been open since 2021. * added name to 2nd example
Found a bug? Maybe our Slack Community can help.
Describe the Bug
Using 0.59.0 of this module, if I specify an existing S3 bucket (which also has an existing bucket policy) and run
terraform apply
, the operation fails withI tried re-running
terraform apply
thereafter, but then I get a rather inscrutable error:(I'm assuming that means an empty string is being passed for
origin_id
)Expected Behavior
Well... it should work? 😅
Steps to Reproduce
Steps to reproduce the behavior:
terraform apply
Environment (please complete the following information):
The text was updated successfully, but these errors were encountered: