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

ID Interpolation not working #33896

Closed
ezienecker opened this issue Sep 14, 2023 · 2 comments · Fixed by #33897
Closed

ID Interpolation not working #33896

ezienecker opened this issue Sep 14, 2023 · 2 comments · Fixed by #33897

Comments

@ezienecker
Copy link

Terraform Version

Terraform v1.6.0-beta1
on darwin_arm64
+ provider registry.terraform.io/azure/azapi v1.9.0
+ provider registry.terraform.io/carlpett/sops v0.7.2
+ provider registry.terraform.io/elastic/ec v0.8.0
+ provider registry.terraform.io/elastic/elasticstack v0.7.0
+ provider registry.terraform.io/hashicorp/azurerm v3.72.0

Terraform Configuration Files

...terraform config...

Debug Output

https://gist.github.com/ezienecker/dfd8a1556bde535f61302308a15af25f

Expected Behavior

I thought that in the course of following PR #33618 it is possible to use the following notation in the import block:

this is in my main.tf

import {
  to = module.ec-deployment.ec_deployment.main
  id = var.ec_deployment_id
}

Additionally, this is my variables.tf

variable "ec_deployment_id" {
  type        = string
  description = "The unique ID of the elastic cloud deployment."
  default     = "aaabbbcccdddeeefff"
}

Actual Behavior

When I declare the above import block I get the following error message:

╷
│ Error: Reference to undeclared input variable
│ 
│   on main.tf line 63, in import:
│   63:   id = var.ec_deployment_id
│ 
│ An input variable with the name "ec_deployment_id" has not been declared. This variable can be declared with a variable "ec_deployment_id" {} block.
╵
╷
│ Error: Invalid import id argument
│ 
│   on main.tf line 63, in import:
│   63:   id = var.ec_deployment_id
│ 
│ The import block "id" argument depends on resource attributes that cannot be determined until apply, so Terraform cannot plan to import this resource.
╵

Steps to Reproduce

terraform init
terraform plan -target module.ec-deployment

Additional Context

No, nothing special

References

@ezienecker ezienecker added bug new new issue not yet triaged labels Sep 14, 2023
@jbardin jbardin added plannable-import and removed new new issue not yet triaged labels Sep 14, 2023
@jbardin jbardin self-assigned this Sep 14, 2023
@kmoe
Copy link
Member

kmoe commented Sep 19, 2023

Fixed by #33897

Copy link

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.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Dec 10, 2023
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.

3 participants