[Bug]: aws_datasync_agent can't be imported cleanly #33458
Labels
bug
Addresses a defect in current functionality.
prioritized
Part of the maintainer teams immediate focus. To be addressed within the current quarter.
service/datasync
Issues and PRs that pertain to the datasync service.
Milestone
Terraform Core Version
1.5.5
AWS Provider Version
5.16.2
Affected Resource(s)
resource: aws_datasync_agent
Expected Behavior
AWS Terraform documentation clearly states that: One of activation_key or ip_address must be provided for resource creation (agent activation). Neither is required for resource import.
When the datasync agent is created through the AWS console with an activation_key. I should be able to import that resource AND use the aws_datasync_agent resource WITHOUT providing activation_key or ip_address.
The activation key is short lived so shouldn't be a cause to force replace.
Actual Behavior
Datasync agent is imported with null for activation key.
Then when we don't have at least one of activation_key/ip_address as a resource argument, the Terraform plan fails with "Invalid combination of arguments".
activation_key value in the state file needs to be updated with the correct activation key value (taken from the aws console), then added to the resource block code as an argument to be successful with no replacement of resource.
Relevant Error/Panic Output Snippet
Terraform Configuration Files
terraform import aws_datasync_agent.example arn:aws:datasync:us-east-1:123456789012:agent/agent-12345678901234567
main.tf:
resource "aws_datasync_agent" "example" {
name = "example"
}
Steps to Reproduce
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: