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

Count depends on resource to be created when zone_id is used #82

Closed
kuczko opened this issue Sep 8, 2020 · 1 comment · Fixed by #133
Closed

Count depends on resource to be created when zone_id is used #82

kuczko opened this issue Sep 8, 2020 · 1 comment · Fixed by #133
Labels
bug 🐛 An issue with the system

Comments

@kuczko
Copy link

kuczko commented Sep 8, 2020

Describe the Bug

When i am using this module with zone_id (while zone is not created yet) it results with using terraform-aws-route53-cluster-hostname module, which fails to run as it is using count value which is actually output of another resource to be created.

It results with error:

Error: Invalid count argument

on .terraform/modules/redis.dns/main.tf line 2, in resource "aws_route53_record" "default":
2: count = module.this.enabled ? 1 : 0

The "count" value depends on resource attributes that cannot be determined
until apply, so Terraform cannot predict how many instances will be created.

Expected Behavior

The resource should be able to be created from scratch without count value being unknown at the plan time - it should be possible to create the whole infrastructure at the single run, without using --target to resolve dependencies.

Steps to Reproduce

I believe that using any configuration with this module on version 0.24.0 with zone_id, where zone is to be created will trigger an error.

Environment (please complete the following information):

  • OS:Linux
  • Terraform version 12.23
  • Version: 0.24.0
@kuczko kuczko added the bug 🐛 An issue with the system label Sep 8, 2020
@Nuru
Copy link
Sponsor Contributor

Nuru commented Jul 12, 2021

This is a general and pervasive problem with Terraform. Resolving it would require breaking changes to the module inputs (in this case changing the type of zone_id from string to list and then validating that the list contains no more than 1 item). Considering that DNS Zones are generally very long lived, this does not seem like the kind of change worth breaking backward compatibility for.

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
Development

Successfully merging a pull request may close this issue.

2 participants