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

[Bug]: aws_datasync_agent can't be imported cleanly #33458

Closed
samantha-lic opened this issue Sep 13, 2023 · 4 comments · Fixed by #35150
Closed

[Bug]: aws_datasync_agent can't be imported cleanly #33458

samantha-lic opened this issue Sep 13, 2023 · 4 comments · Fixed by #35150
Assignees
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

Comments

@samantha-lic
Copy link

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

│ Error: Invalid combination of arguments
│
│   with aws_datasync_agent.example,
│   on main.tf line 8, in resource "aws_datasync_agent" "example":
│    8: resource "aws_datasync_agent" "example" {
│
│ "activation_key": one of `activation_key,ip_address` must be specified

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

  1. Create a datasync agent in the AWS console with an activation key.
  2. Create the main.tf terraform with the example resource block
  3. Import the aws_datasync_agent
  4. Attempt to run terraform plan

Debug Output

No response

Panic Output

No response

Important Factoids

No response

References

No response

Would you like to implement a fix?

None

@samantha-lic samantha-lic added the bug Addresses a defect in current functionality. label Sep 13, 2023
@github-actions
Copy link

Community Note

Voting for Prioritization

  • Please vote on this issue by adding a 👍 reaction to the original post to help the community and maintainers prioritize this request.
  • Please see our prioritization guide for information on how we prioritize.
  • Please do not leave "+1" or other comments that do not add relevant new information or questions, they generate extra noise for issue followers and do not help prioritize the request.

Volunteering to Work on This Issue

  • If you are interested in working on this issue, please leave a comment.
  • If this would be your first contribution, please review the contribution guide.

@github-actions github-actions bot added the service/datasync Issues and PRs that pertain to the datasync service. label Sep 13, 2023
@terraform-aws-provider terraform-aws-provider bot added the needs-triage Waiting for first response or review from a maintainer. label Sep 13, 2023
@justinretzolk justinretzolk removed the needs-triage Waiting for first response or review from a maintainer. label Nov 14, 2023
@jar-b jar-b self-assigned this Jan 4, 2024
@terraform-aws-provider terraform-aws-provider bot added the prioritized Part of the maintainer teams immediate focus. To be addressed within the current quarter. label Jan 4, 2024
@github-actions github-actions bot added this to the v5.32.0 milestone Jan 5, 2024
@jar-b
Copy link
Member

jar-b commented Jan 5, 2024

This issue has been resolved with #35150, and will be released in v5.32.0 next week. One important note is that the activation_key should now be omitted completely from the Terraform configuration when importing an existing agent. For example:

import {
  to = aws_datasync_agent.example
  id = "arn:aws:datasync:us-east-1:123456789012:agent/agent-12345678901234567"
}

resource "aws_datasync_agent" "example" {
  # activation_key no longer required here!
  name = "example"
}

@github-actions github-actions bot removed the bug Addresses a defect in current functionality. label Jan 12, 2024
Copy link

This functionality has been released in v5.32.0 of the Terraform AWS Provider. Please see the Terraform documentation on provider versioning or reach out if you need any assistance upgrading.

For further feature requests or bug reports with this functionality, please create a new GitHub issue following the template. Thank you!

@justinretzolk justinretzolk added the bug Addresses a defect in current functionality. label Feb 10, 2024
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 Mar 12, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
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.
Projects
None yet
3 participants