-
Notifications
You must be signed in to change notification settings - Fork 392
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
[datadog_service_account] Add service account resource #1685
[datadog_service_account] Add service account resource #1685
Conversation
StateContext: schema.ImportStatePassthroughContext, | ||
}, | ||
|
||
Schema: map[string]*schema.Schema{ |
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.
Looks like there is a missing title
field from the spec.
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.
@skarimo what spec are you referring to?
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 spec at https://github.com/DataDog/datadog-api-spec/blob/master/spec/v2/users.yaml and/or https://github.com/DataDog/datadog-api-spec/blob/master/spec/v2/service_accounts.yaml both have a title field defined.
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.
adding
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.
@nkzou I don't seem to see title
used that often in the UX or code for service accounts. It's not even part of the schema for its parent User
. Are those specs correct/up to date?
CreateContext: resourceDatadogServiceAccountCreate, | ||
ReadContext: resourceDatadogServiceAccountRead, | ||
UpdateContext: resourceDatadogServiceAccountUpdate, | ||
DeleteContext: resourceDatadogUserDelete, |
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.
DeleteContext: resourceDatadogUserDelete, | |
DeleteContext: resourceDatadogServiceAccountDelete, |
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.
sorry this was leftover code - there is no functional difference between deleting a user resource versus a service account resource, so it should be resourceDatadogUserDelete
248d63c
to
b3f981b
Compare
@mnguyendatadog the only change required to get past the test failure is shown in the test output at https://github.com/DataDog/terraform-provider-datadog/actions/runs/3840441200/jobs/6539504078#step:11:178 It's a one-character change to get this moving forward. |
@skarimo @nkzou I've tested this in our existing production environment and it works 👍 @mnguyendatadog small docs patch improvement: --- a/docs/resources/service_account.md
+++ b/docs/resources/service_account.md
@@ -42,4 +42,10 @@ resource "datadog_service_account" "bar" {
- `id` (String) The ID of this resource.
+## Import
+Import is supported using the following syntax:
+
+```shell
+terraform import datadog_service_account.example_sa 6f1b44c0-30b2-11eb-86bc-279f7c1ebaa4
+``` |
Adds the service_account resource, which is a subclass of the User resource.
addresses #1266