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

Deployment fails with "MalformedPolicy: Policy has invalid resource" with enable_loadbalancer_logs = true #259

Closed
benjamin-hg opened this issue Apr 26, 2024 · 0 comments · Fixed by #264
Labels
bug 🐛 An issue with the system

Comments

@benjamin-hg
Copy link
Contributor

Describe the Bug

The issue arises with enable_loadbalancer_logs = true

Deployment fails, because the EB's ELB does not get permissions to access the bucket.
This is caused by terraform failing to create the policy.
The policy creation fails because it is invalid.
The policy is invalid because a wrong bucket name is used as resource in some of the policy statements.

The bug seems to be that the bucket name is not set properly at

https://github.com/cloudposse/terraform-aws-elastic-beanstalk-environment/blob/0.51.2/main.tf#L1107

Expected Behavior

The created policy statements reference the bucket with the correct name

Steps to Reproduce

  1. Create a terraform-aws-elastic-beanstalk-environment
  2. Set enable_loadbalancer_logs = true in that module
  3. Try terraform apply

Screenshots

No response

Environment

modules:

  • "cloudposse/lb-s3-bucket/aws" v0.19.0
  • "cloudposse/elastic-beanstalk-environment/aws" v0.51.2

Additional Context

Related to cloudposse/terraform-aws-lb-s3-bucket#81

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug 🐛 An issue with the system
Projects
None yet
1 participant