You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Terraform v1.5.5
on darwin_amd64
+ provider registry.terraform.io/hashicorp/archive v2.1.0
+ provider registry.terraform.io/hashicorp/aws v4.9.0
Your version of Terraform is out of date! The latest version
is 1.8.5. You can update by downloading from https://www.terraform.io/downloads.html
Use Cases
When using
import {
to = aws_identitystore_group_membership.example
id = "d-0000000000/00000000-0000-0000-0000-000000000000"
}
and you import for default workspace all ok, but when you import and you have several workspace you getting a error and you dont have a way to just say apply this only for this workspace.
Attempted Solutions
The solution is to comment the code which is not "clean"
/*
import {
to = aws_identitystore_group_membership.example
id = "d-0000000000/00000000-0000-0000-0000-000000000000"
}
*/
Proposal
Allow Count inside a import.
import {
count = terraform.workspace == "dev" ? 1 : 0
to = aws_identitystore_group_membership.example
id = "d-0000000000/00000000-0000-0000-0000-000000000000"
}
References
No response
The text was updated successfully, but these errors were encountered:
import blocks deliberately do not have a count meta-argument, because instances to be imported always have unique identities unrelated to the order the instances in the state. You can still use the same conditional expressions in the for_each argument, or provide the id's more dynamically via input variables.
That solution sounds great @jbardin but i get this error "Unexpected attribute: An attribute named "for_each" is not expected here". Correct me if im wrong but you cant put foreach of count in an import statement.
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.
Terraform Version
Terraform v1.5.5 on darwin_amd64 + provider registry.terraform.io/hashicorp/archive v2.1.0 + provider registry.terraform.io/hashicorp/aws v4.9.0 Your version of Terraform is out of date! The latest version is 1.8.5. You can update by downloading from https://www.terraform.io/downloads.html
Use Cases
When using
and you import for default workspace all ok, but when you import and you have several workspace you getting a error and you dont have a way to just say apply this only for this workspace.
Attempted Solutions
The solution is to comment the code which is not "clean"
/*
import {
to = aws_identitystore_group_membership.example
id = "d-0000000000/00000000-0000-0000-0000-000000000000"
}
*/
Proposal
Allow Count inside a import.
import {
count = terraform.workspace == "dev" ? 1 : 0
to = aws_identitystore_group_membership.example
id = "d-0000000000/00000000-0000-0000-0000-000000000000"
}
References
No response
The text was updated successfully, but these errors were encountered: