[Bug]: aws_organizations_organization resource import doesn't validate input organization id. #31783
Labels
bug
Addresses a defect in current functionality.
service/organizations
Issues and PRs that pertain to the organizations service.
Milestone
Terraform Core Version
1.3.9
AWS Provider Version
4.67.0
Affected Resource(s)
resource "aws_organizations_organization" "foo" {}
Expected Behavior
If I import an AWS Organization into my state, then I'd expect it to refuse to import an invalid/non-existent organization id, or to complain loudly at the next apply that the id supplied doesn't match the current organization id.
Actual Behavior
It doesn't seem to matter what you specify as an id, the input succeeds, and you can then use the organization resource elsewhere in the config.
Where things get confusing is that the id returned by the resource continues to be whatever you supplied to the import, so you get baffling inconsistencies between data and resource (see example below)
Relevant Error/Panic Output Snippet
No response
Terraform Configuration Files
If I add config for an Organization resource,
and then import the current Org into state with a nonsense id
terraform import aws_organizations_organization.foo tada
then apply this tf code
then I get this output:
Steps to Reproduce
normal terraform import
Debug Output
No response
Panic Output
No response
Important Factoids
No response
References
No response
Would you like to implement a fix?
None
The text was updated successfully, but these errors were encountered: