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 is not implemented in data sources #8527

Closed
romachalm opened this issue Aug 29, 2016 · 2 comments · Fixed by #8635
Closed

count is not implemented in data sources #8527

romachalm opened this issue Aug 29, 2016 · 2 comments · Fixed by #8635

Comments

@romachalm
Copy link

romachalm commented Aug 29, 2016

Hi,

Terraform Version

Terraform v0.7.2

Affected Resource(s)

Related to data sources implementation
error noticed with

  • data.template_file
  • data.null_data_source

Terraform Configuration Files

data "template_file" "check_connection_to_jboss" {
    count = "2"
    template = "${file("${path.root}/files/consul/check_connection_to_jboss.json.tpl")}"
    vars {
        aps = "${element(azurerm_virtual_machine.aps.*.name, count.index)}"
    }
}

Expected Behavior

I need to generate specific consul check scripts for each created node.
To do that, I have looped on the VMs count and pass them as vars to rendered templates.
It was working fine with terraform 0.6.16. To migrate in 7.2, I have transformed

resource "template_file" "check_connection_to_jboss" {

into

data "template_file" "check_connection_to_jboss" {

Actual Behavior

I got the message

I cannot see in the documentation reference to supported meta-parameters for data sources.
I have found the same limitation with null_data_source.
So, I would assume that this affects any data source.

Steps to Reproduce

terraform plan

@romachalm
Copy link
Author

romachalm commented Sep 13, 2016

Hi,

I confirm it is solved in 0.7.3.
Thanks for the fix

Romain

@ghost
Copy link

ghost commented Apr 22, 2020

I'm going to lock this issue because it has been closed for 30 days ⏳. This helps our maintainers find and focus on the active issues.

If you have found a problem that seems similar to this, please open a new issue and complete the issue template so we can capture all the details necessary to investigate further.

@ghost ghost locked and limited conversation to collaborators Apr 22, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants