Skip to content

Commit

Permalink
Updates for client resources
Browse files Browse the repository at this point in the history
  • Loading branch information
papegaaij committed Nov 15, 2023
1 parent b4f9e3f commit d677402
Show file tree
Hide file tree
Showing 8 changed files with 104 additions and 37 deletions.
10 changes: 5 additions & 5 deletions docs/resources/group.md
Original file line number Diff line number Diff line change
Expand Up @@ -331,7 +331,6 @@ Optional:

Required:

- `content_administrator_uuid` (String)
- `name` (String)
- `owner_uuid` (String)
- `technical_administrator_uuid` (String)
Expand All @@ -340,6 +339,7 @@ Optional:

- `abstract_provisioned_ldap` (Attributes) (see [below for nested schema](#nestedatt--administered_systems--abstract_provisioned_ldap))
- `active` (Boolean)
- `content_administrator_uuid` (String)
- `organizational_unit_uuid` (String)
- `provisioned_a_d` (Attributes) (see [below for nested schema](#nestedatt--administered_systems--provisioned_a_d))
- `provisioned_azure_oidc_directory` (Attributes) (see [below for nested schema](#nestedatt--administered_systems--provisioned_azure_oidc_directory))
Expand Down Expand Up @@ -696,7 +696,6 @@ Optional:

Required:

- `content_administrator_uuid` (String)
- `name` (String)
- `owner_uuid` (String)
- `technical_administrator_uuid` (String)
Expand All @@ -705,6 +704,7 @@ Optional:

- `abstract_provisioned_ldap` (Attributes) (see [below for nested schema](#nestedatt--content_administered_systems--abstract_provisioned_ldap))
- `active` (Boolean)
- `content_administrator_uuid` (String)
- `organizational_unit_uuid` (String)
- `provisioned_a_d` (Attributes) (see [below for nested schema](#nestedatt--content_administered_systems--provisioned_a_d))
- `provisioned_azure_oidc_directory` (Attributes) (see [below for nested schema](#nestedatt--content_administered_systems--provisioned_azure_oidc_directory))
Expand Down Expand Up @@ -1417,7 +1417,6 @@ Optional:

Required:

- `content_administrator_uuid` (String)
- `name` (String)
- `owner_uuid` (String)
- `technical_administrator_uuid` (String)
Expand All @@ -1426,6 +1425,7 @@ Optional:

- `abstract_provisioned_ldap` (Attributes) (see [below for nested schema](#nestedatt--owned_systems--abstract_provisioned_ldap))
- `active` (Boolean)
- `content_administrator_uuid` (String)
- `organizational_unit_uuid` (String)
- `provisioned_a_d` (Attributes) (see [below for nested schema](#nestedatt--owned_systems--provisioned_a_d))
- `provisioned_azure_oidc_directory` (Attributes) (see [below for nested schema](#nestedatt--owned_systems--provisioned_azure_oidc_directory))
Expand Down Expand Up @@ -1733,21 +1733,21 @@ Optional:
Required:

- `name` (String)
- `password_rotation` (String)
- `system_uuid` (String)
- `username` (String)

Optional:

- `active` (Boolean)
- `description` (String)
- `password_rotation` (String)
- `technical_administrator_uuid` (String)

Read-Only:

- `links` (Attributes List) (see [below for nested schema](#nestedatt--service_accounts--links))
- `password_uuid` (String)
- `permissions` (Attributes List) (see [below for nested schema](#nestedatt--service_accounts--permissions))
- `username` (String)
- `uuid` (String)

<a id="nestedatt--service_accounts--links"></a>
Expand Down
2 changes: 1 addition & 1 deletion docs/resources/grouponsystem.md
Original file line number Diff line number Diff line change
Expand Up @@ -125,6 +125,7 @@ Required:

- `name` (String)
- `system_uuid` (String)
- `username` (String)

Optional:

Expand All @@ -134,7 +135,6 @@ Read-Only:

- `links` (Attributes List) (see [below for nested schema](#nestedatt--service_accounts--links))
- `permissions` (Attributes List) (see [below for nested schema](#nestedatt--service_accounts--permissions))
- `username` (String)
- `uuid` (String)

<a id="nestedatt--service_accounts--links"></a>
Expand Down
4 changes: 2 additions & 2 deletions docs/resources/serviceaccount.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,14 +18,15 @@ description: |-
### Required

- `name` (String)
- `password_rotation` (String)
- `system_uuid` (String)
- `username` (String)

### Optional

- `active` (Boolean)
- `additional` (List of String)
- `description` (String)
- `password_rotation` (String)
- `secret` (Attributes) (see [below for nested schema](#nestedatt--secret))
- `technical_administrator_uuid` (String)

Expand All @@ -36,7 +37,6 @@ description: |-
- `links` (Attributes List) (see [below for nested schema](#nestedatt--links))
- `password_uuid` (String)
- `permissions` (Attributes List) (see [below for nested schema](#nestedatt--permissions))
- `username` (String)
- `uuid` (String)

<a id="nestedatt--secret"></a>
Expand Down
31 changes: 30 additions & 1 deletion examples/provider-install-verification/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,8 @@ resource "keyhubpreview_group" "terra" {
client_uuid = "ebdf81ac-b02b-4335-9dc4-4a9bc4eb406d"
value = "GROUP_FULL_VAULT_ACCESS"
}]
additional = ["audit"]
application_administration = "true"
additional = ["audit"]
}

resource "keyhubpreview_group_vaultrecord" "terrarecord" {
Expand All @@ -55,3 +56,31 @@ resource "keyhubpreview_grouponsystem" "terragos" {
group_uuid = "c6c98d08-2cbf-45e9-937a-c5c0427348e2"
}]
}

resource "keyhubpreview_clientapplication" "oauth2client" {
name = "Created by Terraform"
technical_administrator_uuid = resource.keyhubpreview_group.terra.uuid
owner_uuid = resource.keyhubpreview_group.terra.uuid
scopes = ["profile", "access_vault"]
o_auth2_client = {
debug_mode = "true"
}
}

resource "keyhubpreview_clientapplication" "saml2client" {
name = "SAML2 Created by Terraform"
client_id = "https://keyhub-vm3"
technical_administrator_uuid = resource.keyhubpreview_group.terra.uuid
owner_uuid = resource.keyhubpreview_group.terra.uuid
saml2_client = {
subject_format = "ID"
metadata_url = "https://does.not.exist.localhost:8600/metadata"
}
}

resource "keyhubpreview_serviceaccount" "sa" {
name = "Service account by Terraform"
technical_administrator_uuid = resource.keyhubpreview_group.terra.uuid
system_uuid = "47923975-b1af-47c8-bd7a-e52ebb4b9b84"
username = "terraform"
}
14 changes: 7 additions & 7 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,9 @@ require (
github.com/hashicorp/terraform-plugin-framework-validators v0.12.0
github.com/hashicorp/terraform-plugin-log v0.9.0
github.com/microsoft/kiota-abstractions-go v1.5.0
github.com/topicuskeyhub/sdk-go v0.29.1-0.20231109164234-006d9ce6f621
github.com/topicuskeyhub/terraform-provider-keyhub-generator v0.0.7
golang.org/x/exp v0.0.0-20231108232855-2478ac86f678
github.com/topicuskeyhub/sdk-go v0.29.1-0.20231115090905-2e3dacc95093
github.com/topicuskeyhub/terraform-provider-keyhub-generator v0.0.8
golang.org/x/exp v0.0.0-20231110203233-9a3e6036ecaa
)

require (
Expand All @@ -38,7 +38,7 @@ require (
github.com/hashicorp/go-cleanhttp v0.5.2 // indirect
github.com/hashicorp/go-hclog v1.5.0 // indirect
github.com/hashicorp/go-multierror v1.1.1 // indirect
github.com/hashicorp/go-plugin v1.5.2 // indirect
github.com/hashicorp/go-plugin v1.6.0 // indirect
github.com/hashicorp/go-uuid v1.0.3 // indirect
github.com/hashicorp/go-version v1.6.0 // indirect
github.com/hashicorp/hc-install v0.5.2 // indirect
Expand Down Expand Up @@ -72,9 +72,9 @@ require (
github.com/vmihailenco/msgpack/v5 v5.4.1 // indirect
github.com/vmihailenco/tagparser/v2 v2.0.0 // indirect
github.com/zclconf/go-cty v1.14.1 // indirect
go.opentelemetry.io/otel v1.19.0 // indirect
go.opentelemetry.io/otel/metric v1.19.0 // indirect
go.opentelemetry.io/otel/trace v1.19.0 // indirect
go.opentelemetry.io/otel v1.20.0 // indirect
go.opentelemetry.io/otel/metric v1.20.0 // indirect
go.opentelemetry.io/otel/trace v1.20.0 // indirect
golang.org/x/crypto v0.15.0 // indirect
golang.org/x/mod v0.14.0 // indirect
golang.org/x/net v0.18.0 // indirect
Expand Down
28 changes: 14 additions & 14 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -75,8 +75,8 @@ github.com/hashicorp/go-hclog v1.5.0/go.mod h1:W4Qnvbt70Wk/zYJryRzDRU/4r0kIg0PVH
github.com/hashicorp/go-multierror v1.0.0/go.mod h1:dHtQlpGsu+cZNNAkkCN/P3hoUDHhCYQXV3UM06sGGrk=
github.com/hashicorp/go-multierror v1.1.1 h1:H5DkEtf6CXdFp0N0Em5UCwQpXMWke8IA0+lD48awMYo=
github.com/hashicorp/go-multierror v1.1.1/go.mod h1:iw975J/qwKPdAO1clOe2L8331t/9/fmwbPZ6JB6eMoM=
github.com/hashicorp/go-plugin v1.5.2 h1:aWv8eimFqWlsEiMrYZdPYl+FdHaBJSN4AWwGWfT1G2Y=
github.com/hashicorp/go-plugin v1.5.2/go.mod h1:w1sAEES3g3PuV/RzUrgow20W2uErMly84hhD3um1WL4=
github.com/hashicorp/go-plugin v1.6.0 h1:wgd4KxHJTVGGqWBq4QPB1i5BZNEx9BR8+OFmHDmTk8A=
github.com/hashicorp/go-plugin v1.6.0/go.mod h1:lBS5MtSSBZk0SHc66KACcjjlU6WzEVP/8pwz68aMkCI=
github.com/hashicorp/go-uuid v1.0.0/go.mod h1:6SBZvOh/SIDV7/2o3Jml5SYk/TvGqwFJ/bN7x4byOro=
github.com/hashicorp/go-uuid v1.0.3 h1:2gKiV6YVmrJ1i2CKKa9obLvRieoRGviZFL26PcT/Co8=
github.com/hashicorp/go-uuid v1.0.3/go.mod h1:6SBZvOh/SIDV7/2o3Jml5SYk/TvGqwFJ/bN7x4byOro=
Expand Down Expand Up @@ -180,10 +180,10 @@ github.com/stretchr/testify v1.5.1/go.mod h1:5W2xD1RspED5o8YsWQXVCued0rvSQ+mT+I5
github.com/stretchr/testify v1.6.1/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg=
github.com/stretchr/testify v1.7.2/go.mod h1:R6va5+xMeoiuVRoj+gSkQ7d3FALtqAAGI1FQKckRals=
github.com/stretchr/testify v1.8.4 h1:CcVxjf3Q8PM0mHUKJCdn+eZZtm5yQwehR5yeSVQQcUk=
github.com/topicuskeyhub/sdk-go v0.29.1-0.20231109164234-006d9ce6f621 h1:PowF/Yqu7EktfF5TCP7fJzxGqbgOCaJZeNOajVi9J2E=
github.com/topicuskeyhub/sdk-go v0.29.1-0.20231109164234-006d9ce6f621/go.mod h1:PUxjT3L5DlYaftJjcPjsLHZ0PxIuGvrOm9XYhS4KZZQ=
github.com/topicuskeyhub/terraform-provider-keyhub-generator v0.0.7 h1:D+iCJ+pamsUDuIbOwV+nGQo0d9S6V1A253GqeuA3cqY=
github.com/topicuskeyhub/terraform-provider-keyhub-generator v0.0.7/go.mod h1:A7GmW/HaeHNr9Y9vF1FmaxZ6e8ByvrWZmDFh1ELzOTE=
github.com/topicuskeyhub/sdk-go v0.29.1-0.20231115090905-2e3dacc95093 h1:p7OfnBznCA59fRB+E9GL8qxuIAKA+ixdvNcyBWp4MDY=
github.com/topicuskeyhub/sdk-go v0.29.1-0.20231115090905-2e3dacc95093/go.mod h1:0I6HAiTtujy+fsOaCT78L6/wflACImwejPcSfAWKPbU=
github.com/topicuskeyhub/terraform-provider-keyhub-generator v0.0.8 h1:FltyUDCUkhpd8zq+8AQgcLx54tkf9S0lvOuDKK06cvQ=
github.com/topicuskeyhub/terraform-provider-keyhub-generator v0.0.8/go.mod h1:Cneu5QPgWXynzT5IzOW6sX9aAxypPQArE44f0fLyIvg=
github.com/ugorji/go/codec v1.2.7 h1:YPXUKf7fYbp/y8xloBqZOw2qaVggbfwMlI8WM3wZUJ0=
github.com/vmihailenco/msgpack/v5 v5.4.1 h1:cQriyiUvjTwOHg8QZaPihLWeRAAVoCpE00IUPn0Bjt8=
github.com/vmihailenco/msgpack/v5 v5.4.1/go.mod h1:GaZTsDaehaPpQVyxrf5mtQlH+pc21PIudVV/E3rRQok=
Expand All @@ -193,21 +193,21 @@ github.com/xanzy/ssh-agent v0.3.3 h1:+/15pJfg/RsTxqYcX6fHqOXZwwMP+2VyYWJeWM2qQFM
github.com/yuin/goldmark v1.4.13/go.mod h1:6yULJ656Px+3vBD8DxQVa3kxgyrAnzto9xy5taEt/CY=
github.com/zclconf/go-cty v1.14.1 h1:t9fyA35fwjjUMcmL5hLER+e/rEPqrbCK1/OSE4SI9KA=
github.com/zclconf/go-cty v1.14.1/go.mod h1:VvMs5i0vgZdhYawQNq5kePSpLAoz8u1xvZgrPIxfnZE=
go.opentelemetry.io/otel v1.19.0 h1:MuS/TNf4/j4IXsZuJegVzI1cwut7Qc00344rgH7p8bs=
go.opentelemetry.io/otel v1.19.0/go.mod h1:i0QyjOq3UPoTzff0PJB2N66fb4S0+rSbSB15/oyH9fY=
go.opentelemetry.io/otel/metric v1.19.0 h1:aTzpGtV0ar9wlV4Sna9sdJyII5jTVJEvKETPiOKwvpE=
go.opentelemetry.io/otel/metric v1.19.0/go.mod h1:L5rUsV9kM1IxCj1MmSdS+JQAcVm319EUrDVLrt7jqt8=
go.opentelemetry.io/otel/trace v1.19.0 h1:DFVQmlVbfVeOuBRrwdtaehRrWiL1JoVs9CPIQ1Dzxpg=
go.opentelemetry.io/otel/trace v1.19.0/go.mod h1:mfaSyvGyEJEI0nyV2I4qhNQnbBOUUmYZpYojqMnX2vo=
go.opentelemetry.io/otel v1.20.0 h1:vsb/ggIY+hUjD/zCAQHpzTmndPqv/ml2ArbsbfBYTAc=
go.opentelemetry.io/otel v1.20.0/go.mod h1:oUIGj3D77RwJdM6PPZImDpSZGDvkD9fhesHny69JFrs=
go.opentelemetry.io/otel/metric v1.20.0 h1:ZlrO8Hu9+GAhnepmRGhSU7/VkpjrNowxRN9GyKR4wzA=
go.opentelemetry.io/otel/metric v1.20.0/go.mod h1:90DRw3nfK4D7Sm/75yQ00gTJxtkBxX+wu6YaNymbpVM=
go.opentelemetry.io/otel/trace v1.20.0 h1:+yxVAPZPbQhbC3OfAkeIVTky6iTFpcr4SiY9om7mXSQ=
go.opentelemetry.io/otel/trace v1.20.0/go.mod h1:HJSK7F/hA5RlzpZ0zKDCHCDHm556LCDtKaAo6JmBFUU=
golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w=
golang.org/x/crypto v0.0.0-20190911031432-227b76d455e7/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI=
golang.org/x/crypto v0.0.0-20200414173820-0848c9571904/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto=
golang.org/x/crypto v0.0.0-20200820211705-5c72a883971a/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto=
golang.org/x/crypto v0.0.0-20210921155107-089bfa567519/go.mod h1:GvvjBRRGRdwPK5ydBHafDWAxML/pGHZbMvKqRZ5+Abc=
golang.org/x/crypto v0.15.0 h1:frVn1TEaCEaZcn3Tmd7Y2b5KKPaZ+I32Q2OA3kYp5TA=
golang.org/x/crypto v0.15.0/go.mod h1:4ChreQoLWfG3xLDer1WdlH5NdlQ3+mwnQq1YTKY+72g=
golang.org/x/exp v0.0.0-20231108232855-2478ac86f678 h1:mchzmB1XO2pMaKFRqk/+MV3mgGG96aqaPXaMifQU47w=
golang.org/x/exp v0.0.0-20231108232855-2478ac86f678/go.mod h1:zk2irFbV9DP96SEBUUAy67IdHUaZuSnrz1n472HUCLE=
golang.org/x/exp v0.0.0-20231110203233-9a3e6036ecaa h1:FRnLl4eNAQl8hwxVVC17teOw8kdjVDVAiFMtgUdTSRQ=
golang.org/x/exp v0.0.0-20231110203233-9a3e6036ecaa/go.mod h1:zk2irFbV9DP96SEBUUAy67IdHUaZuSnrz1n472HUCLE=
golang.org/x/mod v0.6.0-dev.0.20220419223038-86c51ed26bb4/go.mod h1:jJ57K6gSWd91VN4djpZkiMVwK6gcyfeH4XE8wZrZaV4=
golang.org/x/mod v0.14.0 h1:dGoOF9QVLYng8IHTm7BAyWqCqSheQ5pYWGhzW00YJr0=
golang.org/x/mod v0.14.0/go.mod h1:hTbmBsO62+eylJbnUtE2MGJUyE7QWk4xUqPFrRgJ+7c=
Expand Down
15 changes: 14 additions & 1 deletion internal/provider/full-helpers.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading

0 comments on commit d677402

Please sign in to comment.