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

aws_cloudfront_distribution: InvalidArgument: The parameter Logging Bucket does not refer to a valid S3 bucket #13381

Open
ghost opened this issue May 18, 2020 · 5 comments
Labels
service/cloudfront Issues and PRs that pertain to the cloudfront service.

Comments

@ghost
Copy link

ghost commented May 18, 2020

This issue was originally opened by @cat-turner as hashicorp/terraform#24962. It was migrated here as a result of the provider split. The original body of the issue is below.


Hi
According to the docs, we need to specify the logging bucket as

myawslogbucket.s3.amazonaws.com

https://www.terraform.io/docs/providers/aws/r/cloudfront_distribution.html#logging-config-arguments

AWS is planning to deprecate path style access logs in favor of virtual. I am unable to point to the s3 bucket in any other way. Will we need to update this?

https://forums.aws.amazon.com/ann.jspa?annID=6776
https://docs.aws.amazon.com/AmazonS3/latest/dev/UsingBucket.html

@cat-turner
Copy link

hello I am open to work arounds. thanks

@brendanbenke
Copy link

brendanbenke commented Aug 25, 2020

@cat-turner you want something like this:

logging_config {
    include_cookies = false
    bucket = data.aws_s3_bucket.bucket.bucket_domain_name
    prefix = "logs/"
  }

@ewbankkit ewbankkit added the service/cloudfront Issues and PRs that pertain to the cloudfront service. label Dec 21, 2020
@justinretzolk
Copy link
Member

Hey @cat-turner 👋 Thank you for taking the time to file this issue. Given that there's been a few Terraform and AWS Provider releases since you initially filed it, and given the information provided above, can you confirm whether you're still running into this?

@justinretzolk justinretzolk added waiting-response Maintainers are waiting on response from community or contributor. and removed needs-triage Waiting for first response or review from a maintainer. labels Sep 27, 2021
@github-actions github-actions bot removed the waiting-response Maintainers are waiting on response from community or contributor. label Sep 27, 2021
@appwebtech
Copy link

I ran into this issue after referencing my bucket from main.tf. It appears the issue was fixed by updating the documentation to include the fqdn s3.amazonaws.com as part of the bucket name which may not be intuitive for someone with a pre-baked module or config.

#....
   logging_config {
    include_cookies = false
    bucket          = "${aws_s3_bucket.cdn-website-logs.id}.s3.amazonaws.com"
    prefix          = "logs/cdn"
#....
  }

I'm using the current AWS provider;

terraform {
  required_providers {
    aws = {
      source  = "hashicorp/aws"
      version = "~> 5.31.0"
    }
  }
  required_version = "~> 1.6.5"
  }
}

@h2oearth
Copy link

Thank you @appwebtech ! The documentation is not CLEAR at all :-/. They shall add a note to let users know that .s3.amazonaws.com shall be added at the end of the bucket name.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
service/cloudfront Issues and PRs that pertain to the cloudfront service.
Projects
None yet
Development

No branches or pull requests

6 participants