You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When using the origin_bucket and override_origin_bucket_policy inputs, I consistently got the following error:
│ Error: Error putting S3 policy: InvalidParameter: 1 validation error(s) found.
│ - minimum field size of 1, PutBucketPolicyInput.Bucket.
│
│
│ on .terraform/modules/cdn/main.tf line 79, in resource "aws_s3_bucket_policy" "default":
│ 79: resource "aws_s3_bucket_policy" "default" {
│
╵
Expected Behavior
I was expecting the resulting generated AWS objects to use my provided S3 bucket with it's policy replaced with that of the automagically generated policies equivalent to what would have happened if I'd had the module create the bucket.
Steps to Reproduce
Steps to reproduce the behavior:
Create a terraform module resource using both origin_bucket and override_origin_bucket_policy
Run terraform apply
Environment (please complete the following information):
This happened initially with version 0.52.0, but I also tried it with 0.58.1 and 0.59.0
Additional Context
What I think is happening is that the bucket attribute of the aws_s3_bucket_policy resource is required, and the code for the aws_s3_bucket_policy.default in main.tf is:
If I set the bucket attribute in aws_s3_bucket_policy.default to local.bucket, I am able to cleanly apply, as now bucket contains at least my externally supplied bucket.
There may be subtleties I'm missing, but this seems to be the crux of things.
The text was updated successfully, but these errors were encountered:
Describe the Bug
When using the
origin_bucket
andoverride_origin_bucket_policy
inputs, I consistently got the following error:Expected Behavior
I was expecting the resulting generated AWS objects to use my provided S3 bucket with it's policy replaced with that of the automagically generated policies equivalent to what would have happened if I'd had the module create the bucket.
Steps to Reproduce
Steps to reproduce the behavior:
origin_bucket
andoverride_origin_bucket_policy
terraform apply
Environment (please complete the following information):
This happened initially with version
0.52.0
, but I also tried it with0.58.1
and0.59.0
Additional Context
What I think is happening is that the
bucket
attribute of theaws_s3_bucket_policy
resource is required, and the code for theaws_s3_bucket_policy.default
inmain.tf
is:But if you are providing an external, preexisting S3 bucket,
aws_s3_bucket.origin.*.bucket
isn't going to have a value.Lower down in the code, in the second
locals
block, there is abucket
variable defined like so:If I set the
bucket
attribute inaws_s3_bucket_policy.default
tolocal.bucket
, I am able to cleanly apply, as now bucket contains at least my externally supplied bucket.There may be subtleties I'm missing, but this seems to be the crux of things.
The text was updated successfully, but these errors were encountered: