-
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
resource/ssm_resource_data_sync: Support import #3232
resource/ssm_resource_data_sync: Support import #3232
Conversation
atsushi-ishibashi
commented
Feb 1, 2018
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 is looking good, thanks!
Just left a comment to discuss before we run tests and merge :)
Thanks!
@@ -15,6 +15,13 @@ func resourceAwsSsmResourceDataSync() *schema.Resource { | |||
Read: resourceAwsSsmResourceDataSyncRead, | |||
Delete: resourceAwsSsmResourceDataSyncDelete, | |||
|
|||
Importer: &schema.ResourceImporter{ | |||
State: func(d *schema.ResourceData, meta interface{}) ([]*schema.ResourceData, error) { | |||
d.Set("name", 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.
Why not reading the name line 103? as in: d.Set("name", syncItem.SyncName)
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.
You're right! Thank you!
TF_ACC=1 go test ./aws -v -run=TestAccAWSSsmResourceDataSync_import -timeout 120m
=== RUN TestAccAWSSsmResourceDataSync_import
--- PASS: TestAccAWSSsmResourceDataSync_import (68.67s)
PASS
ok github.com/terraform-providers/terraform-provider-aws/aws 68.710s
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 is looking very good, thanks for taking the time to do it! 🚀 👍
$ make testacc TEST=./aws TESTARGS='-run=TestAccAWSSsmResourceDataSync_'
==> Checking that code complies with gofmt requirements...
TF_ACC=1 go test ./aws -v -run=TestAccAWSSsmResourceDataSync_ -timeout 120m
=== RUN TestAccAWSSsmResourceDataSync_basic
--- PASS: TestAccAWSSsmResourceDataSync_basic (58.74s)
=== RUN TestAccAWSSsmResourceDataSync_import
--- PASS: TestAccAWSSsmResourceDataSync_import (62.62s)
PASS
ok github.com/terraform-providers/terraform-provider-aws/aws 121.427s
This has been released in terraform-provider-aws version 1.9.0. Please see the Terraform documentation on provider versioning or reach out if you need any assistance upgrading. |
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! |