Skip to content

Commit 9284379

Browse files
authored
oxide_silo_saml_identity_provider: initial resource (#442)
Added the `oxide_silo_saml_identity_provider` resource. Note that this resource does not support updates or deletion.
1 parent 3c960ab commit 9284379

File tree

7 files changed

+645
-4
lines changed

7 files changed

+645
-4
lines changed

.changelog/0.14.0.toml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,8 @@ title = ""
33
description = ""
44

55
[[features]]
6+
title = "New resource"
7+
description = "`oxide_silo_saml_identity_provider` [#442](https://github.com/oxidecomputer/terraform-provider-oxide/pull/442)."
68

79
[[enhancements]]
810
title = ""
Lines changed: 115 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,115 @@
1+
---
2+
page_title: "oxide_silo_saml_identity_provider Resource - terraform-provider-oxide"
3+
---
4+
5+
# oxide_silo_saml_identity_provider (Resource)
6+
7+
Manages a SAML identity provider (IdP) for an Oxide silo.
8+
9+
-> This resource does not support updates. All attributes are immutable once
10+
created.
11+
12+
-> This resource does not support deletion from the Oxide API. When destroyed in
13+
Terraform, it will be removed from state but will continue to exist in Oxide.
14+
15+
## Example Usage
16+
17+
### With URL Metadata Source
18+
19+
```hcl
20+
resource "oxide_silo_saml_identity_provider" "example" {
21+
silo = oxide_silo.example.id
22+
name = "keycloak"
23+
description = "Managed by Terraform."
24+
group_attribute_name = "groups"
25+
idp_entity_id = "https://keycloak.example.com/realms/oxide"
26+
acs_url = "https://example.com/saml/acs"
27+
slo_url = "https://example.com/saml/logout"
28+
sp_client_id = "oxide-sp"
29+
technical_contact_email = "admin@example.com"
30+
31+
idp_metadata_source = {
32+
type = "url"
33+
url = "https://keycloak.example.com/realms/oxide/protocol/saml/descriptor"
34+
}
35+
}
36+
```
37+
38+
### With Base64-Encoded XML Metadata
39+
40+
```hcl
41+
resource "oxide_silo_saml_identity_provider" "example" {
42+
silo = oxide_silo.example.id
43+
name = "custom-idp"
44+
description = "Custom SAML identity provider"
45+
idp_entity_id = "https://idp.example.com"
46+
acs_url = "https://example.com/saml/acs"
47+
slo_url = "https://example.com/saml/logout"
48+
sp_client_id = "oxide-sp"
49+
technical_contact_email = "admin@example.com"
50+
51+
idp_metadata_source = {
52+
type = "base64_encoded_xml"
53+
data = base64encode(file("${path.module}/idp-metadata.xml"))
54+
}
55+
56+
signing_keypair = {
57+
private_key = base64encode(file("${path.module}/saml-key.pem"))
58+
public_cert = base64encode(file("${path.module}/saml-cert.pem"))
59+
}
60+
}
61+
```
62+
63+
## Schema
64+
65+
### Required
66+
67+
- `acs_url` (String) URL where the identity provider should send the SAML response.
68+
- `description` (String) Free-form text describing the SAML identity provider.
69+
- `idp_entity_id` (String) Identity provider's entity ID.
70+
- `idp_metadata_source` (Attributes) Source of identity provider metadata (URL or base64-encoded XML). (see [below for nested schema](#nestedatt--idp_metadata_source))
71+
- `name` (String) Unique, immutable, user-controlled identifier of the SAML identity provider. Maximum length is 63 characters.
72+
- `silo` (String) Name or ID of the silo.
73+
- `slo_url` (String) URL where the identity provider should send logout requests.
74+
- `sp_client_id` (String) Service provider's client ID.
75+
- `technical_contact_email` (String) Technical contact email for SAML configuration.
76+
77+
### Optional
78+
79+
- `group_attribute_name` (String) SAML attribute that holds a user's group membership.
80+
- `signing_keypair` (Attributes) RSA private key and public certificate for signing SAML requests. (see [below for nested schema](#nestedatt--signing_keypair))
81+
- `timeouts` (Attributes) (see [below for nested schema](#nestedatt--timeouts))
82+
83+
### Read-Only
84+
85+
- `id` (String) Unique, immutable, system-controlled identifier of the SAML identity provider.
86+
- `time_created` (String) Timestamp of when this SAML identity provider was created.
87+
- `time_modified` (String) Timestamp of when this SAML identity provider was last modified.
88+
89+
<a id="nestedatt--idp_metadata_source"></a>
90+
### Nested Schema for `idp_metadata_source`
91+
92+
Required:
93+
94+
- `type` (String) The type of metadata source. Must be one of: `url`, `base64_encoded_xml`.
95+
96+
Optional:
97+
98+
- `data` (String) Base64-encoded XML metadata (required when type is `base64_encoded_xml`). Conflicts with `url`.
99+
- `url` (String) URL to fetch metadata from (required when type is `url`). Conflicts with `data`.
100+
101+
<a id="nestedatt--signing_keypair"></a>
102+
### Nested Schema for `signing_keypair`
103+
104+
Required:
105+
106+
- `private_key` (String, Sensitive) RSA private key (base64 encoded).
107+
- `public_cert` (String) Public certificate (base64 encoded).
108+
109+
<a id="nestedatt--timeouts"></a>
110+
### Nested Schema for `timeouts`
111+
112+
Optional:
113+
114+
- `create` (String) A string that can be [parsed as a duration](https://pkg.go.dev/time#ParseDuration) consisting of numbers and unit suffixes, such as "30s" or "2h45m". Valid time units are "s" (seconds), "m" (minutes), "h" (hours).
115+
- `read` (String) A string that can be [parsed as a duration](https://pkg.go.dev/time#ParseDuration) consisting of numbers and unit suffixes, such as "30s" or "2h45m". Valid time units are "s" (seconds), "m" (minutes), "h" (hours).

docs/resources/oxide_vpc_firewall_rules.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -70,12 +70,12 @@ resource "oxide_vpc_firewall_rules" "example" {
7070
},
7171
# Echo Reply types.
7272
{
73-
type = "icmp",
73+
type = "icmp",
7474
icmp_type = 0
7575
},
7676
# Echo Reply types with codes 1-3.
7777
{
78-
type = "icmp",
78+
type = "icmp",
7979
icmp_type = 0
8080
icmp_code = "1-3"
8181
},

internal/provider/provider.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -199,5 +199,6 @@ func (p *oxideProvider) Resources(_ context.Context) []func() resource.Resource
199199
NewVPCSubnetResource,
200200
NewFloatingIPResource,
201201
NewSiloResource,
202+
NewSiloSamlIdentityProviderResource,
202203
}
203204
}

0 commit comments

Comments
 (0)