-
Notifications
You must be signed in to change notification settings - Fork 9.2k
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
Add import support for aws_batch_job_queue #11406
Add import support for aws_batch_job_queue #11406
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hi @prabusah 👋 Thanks for submitting this, it is almost complete. Please see the testing failures below and the Contributing Guide section on running acceptance testing if necessary. 👍
testAccCheckBatchJobQueueAttributes(&jq), | ||
), | ||
}, | ||
{ | ||
ResourceName: resourceName, | ||
ImportState: true, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This new acceptance testing is currently failing for this test and the others:
--- FAIL: TestAccAWSBatchJobQueue_basic (71.48s)
testing.go:640: Step 1 error: : Provided name is not supported pattern[a-zA-Z_0-9-]{1,128}
status code: 400, request id: fb70a8c2-e8e2-4417-a94e-7f357fda0ebe
This is happening because the resource Read
function is dependent on the name
attribute being set:
The easiest fix here should be to use the resource ID instead of trying to read the name
attribute, since the Batch DescribeJobQueues API notes support for full ARN in addition to just the name, e.g.
jq, err := getJobQueue(conn, d.Id())
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM, minus the extraneous import testing in the "disappears" testing, which I will fix on merge. Thanks, @prabusah! 🚀
Output from acceptance testing (after disappears test fix):
--- PASS: TestAccAWSBatchJobQueue_disappears (80.44s)
--- PASS: TestAccAWSBatchJobQueue_basic (81.18s)
--- PASS: TestAccAWSBatchJobQueue_update (94.82s)
{ | ||
ResourceName: resourceName, | ||
ImportState: true, | ||
ImportStateVerify: true, | ||
}, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Since _disappears
tests are removing the resource in question to verify Terraform triggers recreation of the resource instead of an error, these tests will generate the below error when trying to do ImportState
testing:
--- FAIL: TestAccAWSBatchJobQueue_disappears (80.44s)
testing.go:640: Step 1 error: Resource specified by ResourceName couldn't be found: aws_batch_job_queue.test_queue
The solution here is just to not include the import testing in "disappears" tests like these. 👍
This has been released in version 2.44.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 for triage. Thanks! |
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 feel this issue should be reopened, we encourage creating a new issue linking back to this one for added context. Thanks! |
Community Note
Relates #11207
Release note for CHANGELOG:
Output from acceptance testing: