terraform-aws-elastic-beanstalk-environment icon indicating copy to clipboard operation
terraform-aws-elastic-beanstalk-environment copied to clipboard

Deployment fails with Invalid Count Argument" with s3_bucket_versioning_enabled = true

Open malikkamranabid opened this issue 10 months ago • 2 comments

Describe the Bug

Describe the Bug The issue arises with s3_bucket_versioning_enabled = true

The "count" value depends on resource attributes that cannot be determined until applied, so Terraform cannot predict how many instances will be created. To work around this, use the target argument first to apply only the resources on which the count depends.

Expected Behavior

It should not throw a count error

Steps to Reproduce

Create a terraform-aws-elastic-beanstalk-environment Set enable_loadbalancer_logs = true in that module Try terraform plan Screenshots

Screenshots

Image

Environment

Environment

  • cloudposse/elastic-beanstalk-environment/aws Version: v0.52.0
  • Terraform Version: v1.10.4
  • Provider Versions:
    • aws: ~> 5.70

Additional Context

No response

malikkamranabid avatar Jan 17 '25 13:01 malikkamranabid

I met the bug too. I have a temporary workaround. The first launch with s3_bucket_versioning_enabled = false — resources created. Then second launch could be s3_bucket_versioning_enabled = true without error.

vladyslav-hurskyi avatar Feb 04 '25 15:02 vladyslav-hurskyi

In my case this won’t work. I am dealing with dynamic environments. Can’t do that.

On Tue, 4 Feb 2025 at 8:10 PM, Vladyslav Hurskyi @.***> wrote:

I met the bug too. I have a temporary workaround. The first launch with s3_bucket_versioning_enabled = false — resources created. Then second launch could be s3_bucket_versioning_enabled = true without error.

— Reply to this email directly, view it on GitHub https://github.com/cloudposse/terraform-aws-elastic-beanstalk-environment/issues/271#issuecomment-2634264494, or unsubscribe https://github.com/notifications/unsubscribe-auth/AHHLWE7LLZZ6OQFPHG7NVTT2ODJ5FAVCNFSM6AAAAABVL57MXSVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDMMZUGI3DINBZGQ . You are receiving this because you authored the thread.Message ID: <cloudposse/terraform-aws-elastic-beanstalk-environment/issues/271/2634264494 @github.com>

malikkamranabid avatar Feb 04 '25 15:02 malikkamranabid

Hi all, this is no longer a bug anymore. Probably it got solved in the downstream module (s3 bucket logs), I was able to create a environment with load balancer logs right away

cilasbeltrame avatar Aug 08 '25 14:08 cilasbeltrame