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

feat: Add support for generic oidc accounts #831

Merged
merged 13 commits into from
Dec 5, 2024

Conversation

grace-rehn
Copy link
Collaborator

@grace-rehn grace-rehn commented Dec 2, 2024

Adds the ability to create and get a generic oidc account

data "octopusdeploy_accounts" "generic_oidc_account" {
  account_type = "GenericOidcAccount"
}
resource "octopusdeploy_generic_oidc_account" "new_generic_oidc_account" {
  name  = "Generic OpenID Connect Account (OK to Delete)"
  execution_subject_keys = ["account"]
  audience = "aud"
}

[sc-98285]

go.mod Outdated
@@ -3,7 +3,7 @@ module github.com/OctopusDeploy/terraform-provider-octopusdeploy
go 1.21

require (
github.com/OctopusDeploy/go-octopusdeploy/v2 v2.60.0
github.com/OctopusDeploy/go-octopusdeploy/v2 v2.62.3-0.20241202024636-075a4f06c227
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Use OctopusDeploy/go-octopusdeploy#288 for now.

Will update with the correct version once go client is merged after octopus server changes.

@grace-rehn grace-rehn marked this pull request as draft December 3, 2024 10:28
@grace-rehn grace-rehn marked this pull request as ready for review December 4, 2024 02:38
Copy link
Collaborator

@IsaacCalligeros95 IsaacCalligeros95 left a comment

Choose a reason for hiding this comment

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

LGTM

return
}

tflog.Debug(ctx, "Creating generic oidc account", map[string]interface{}{
Copy link
Contributor

Choose a reason for hiding this comment

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

Fine to leave this as is but in the future, we can now use any instead of interface{} in Go. Makes the code easier to read.

resource.TestCheckResourceAttr(resourceName, "audience", audience),
),
ResourceName: resourceName,
},
Copy link
Contributor

Choose a reason for hiding this comment

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

could you please include a 2nd TestStep so that we can also test update. It will basically be the same step, just with a slight change in the config, like a different description.

@grace-rehn grace-rehn merged commit 8bfcde1 into main Dec 5, 2024
22 checks passed
@grace-rehn grace-rehn deleted the grace/generic-oidc-accounts branch December 5, 2024 00:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants