-
Notifications
You must be signed in to change notification settings - Fork 763
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
r/github_repository_webhook: Add import #29
Conversation
Adds import functionality to the `github_repository_webhook` resource. ``` $ make testacc TEST=./github TESTARGS="-run=TestAccGithubRepositoryWebhook_importBasic" ==> Checking that code complies with gofmt requirements... TF_ACC=1 go test ./github -v -run=TestAccGithubRepositoryWebhook_importBasic -timeout 120m === RUN TestAccGithubRepositoryWebhook_importBasic --- PASS: TestAccGithubRepositoryWebhook_importBasic (3.75s) PASS ok github.com/terraform-providers/terraform-provider-github/github 3.753s ```
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 LGTM, just left you two nitpicky comments there.
|
||
## Import | ||
|
||
Repository Webhooks can be imported using the `name` of the repository, combined with the `id` of the webhook`, separated by a `/` character. |
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.
I think there's one extra backtick here. 👀
@@ -14,6 +16,17 @@ func resourceGithubRepositoryWebhook() *schema.Resource { | |||
Read: resourceGithubRepositoryWebhookRead, | |||
Update: resourceGithubRepositoryWebhookUpdate, | |||
Delete: resourceGithubRepositoryWebhookDelete, | |||
Importer: &schema.ResourceImporter{ | |||
State: func(d *schema.ResourceData, meta interface{}) ([]*schema.ResourceData, error) { | |||
combined := strings.Split(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.
Probably a nitpick, but I this variable deserves a better name, e.g. parts
or something similar that's plural.
…webhook r/github_repository_webhook: Add import
Adds import functionality to the
github_repository_webhook
resource.Fixes: #12