-
Notifications
You must be signed in to change notification settings - Fork 626
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
Revathy/add webhooks resource #1151
Revathy/add webhooks resource #1151
Conversation
if err != nil { | ||
return fmt.Errorf("error retrieving notification webhooks %s: %s", name, err) | ||
} | ||
id, err := uuid.Parse(notificationWebhooks.Result.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.
if err != nil { | ||
return fmt.Errorf("error setting notification webhooks %s: %s", name, err) | ||
} | ||
d.Set("id", id.String()) |
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.
the Create
should be suffice for setting the resource ID as we shouldn't need to change it after the fact. this value is often used as an "anchor" for lookups and should remain consistent.
side note: setting the resource ID should use d.SetId()
as it is a special attribute.
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.
removed this now and verified that the tests are passing.
"github.com/hashicorp/terraform-plugin-sdk/helper/resource" | ||
) | ||
|
||
func TestAccCloudflareNotificationPolicyWebhooks(t *testing.T) { |
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.
acceptance tests are 🍏
==> Checking that code complies with gofmt requirements...
TF_ACC=1 go test $(go list ./...) -v -run "^TestAccCloudflareNotificationPolicyWebhooks" -timeout 120m -parallel 1
? github.com/cloudflare/terraform-provider-cloudflare [no test files]
=== RUN TestAccCloudflareNotificationPolicyWebhooks
--- PASS: TestAccCloudflareNotificationPolicyWebhooks (9.56s)
PASS
ok github.com/cloudflare/terraform-provider-cloudflare/cloudflare 10.261s
? github.com/cloudflare/terraform-provider-cloudflare/version [no test files]
couple of questions but nothing major! such speed for your 2nd PR! |
0a1e31b
to
a3ac307
Compare
No description provided.