Skip to content
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

Merged
merged 10 commits into from
Jan 6, 2023

Conversation

mnguyendatadog
Copy link
Contributor

@mnguyendatadog mnguyendatadog commented Dec 23, 2022

Adds the service_account resource, which is a subclass of the User resource.

addresses #1266

Verified

This commit was signed with the committer’s verified signature.
christophetd Christophe Tafani-Dereeper

Verified

This commit was signed with the committer’s verified signature.
christophetd Christophe Tafani-Dereeper

Verified

This commit was signed with the committer’s verified signature.
christophetd Christophe Tafani-Dereeper
@mnguyendatadog mnguyendatadog marked this pull request as ready for review December 23, 2022 16:34
@mnguyendatadog mnguyendatadog requested a review from a team as a code owner December 23, 2022 16:34
@sseg-dd sseg-dd requested review from a team, Alchemille and mustaphaelghoul and removed request for a team December 23, 2022 19:26
StateContext: schema.ImportStatePassthroughContext,
},

Schema: map[string]*schema.Schema{
Copy link
Member

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.

Copy link
Contributor Author

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?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

adding

Copy link
Contributor Author

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,
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
DeleteContext: resourceDatadogUserDelete,
DeleteContext: resourceDatadogServiceAccountDelete,

Copy link
Contributor Author

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

@mnguyendatadog mnguyendatadog force-pushed the mike.nguyen/IDENTITY-2220_add_service_account_resource branch from 248d63c to b3f981b Compare January 4, 2023 18:05
@nkzou nkzou changed the title Mike.nguyen/identity 2220 add service account resource [datadog_service_account] Add service account resource Jan 4, 2023
@jorhett
Copy link

jorhett commented Jan 5, 2023

@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.

@jorhett
Copy link

jorhett commented Jan 5, 2023

@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
+```

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants