Skip to content

Commit e5644d0

Browse files
gurumachupalliGurudeep Machupallisudomateo
authored
Feature silo creation (#425)
Co-authored-by: Gurudeep Machupalli <gmachupalli@anduril.com> Co-authored-by: Matthew Sanabria <matthew.sanabria@oxide.computer>
1 parent 9e5664d commit e5644d0

File tree

6 files changed

+873
-5
lines changed

6 files changed

+873
-5
lines changed

.changelog/0.10.0.toml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
11
[[breaking]]
2-
title = ""
3-
description = ""
2+
title = "Minimum Terraform version required"
3+
description = "`oxide_silo` [#425](https://github.com/oxidecomputer/terraform-provider-oxide/pull/425). Breaking change due to `tls_certificates` attribute being a
4+
[write-only attribute](https://developer.hashicorp.com/terraform/plugin/framework/resources/write-only-arguments)."
45

56
[[features]]
67
title = "New resource"
7-
description = "`oxide_vpc_router_route` [#423](https://github.com/oxidecomputer/terraform-provider-oxide/pull/423)."
8+
description = "`oxide_silo` [#425](https://github.com/oxidecomputer/terraform-provider-oxide/pull/425)."
89

9-
[[features]]
1010
title = "New data resource"
1111
description = "`oxide_vpc_router_route` [#423](https://github.com/oxidecomputer/terraform-provider-oxide/pull/423)."
1212

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
## Requirements
44

5-
- [Terraform](https://www.terraform.io/downloads) 1.x and above, we recommend using the latest stable release whenever possible. When installing on an Illumos machine use the Solaris binary.
5+
- [Terraform](https://www.terraform.io/downloads) 1.11.x and above, we recommend using the latest stable release whenever possible. When installing on an Illumos machine use the Solaris binary.
66

77
## Using the provider
88

docs/resources/oxide_silo.md

Lines changed: 96 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,96 @@
1+
---
2+
page_title: "oxide_silo Resource - terraform-provider-oxide"
3+
---
4+
5+
# oxide_silo (Resource)
6+
7+
This resource manages the creation of an Oxide silo.
8+
9+
-> Only the `quotas` attribute supports in-place modification. Changes to other
10+
attributes will result in the silo being destroyed and created anew.
11+
12+
## Example Usage
13+
14+
```hcl
15+
resource "oxide_silo" "example" {
16+
name = "showcase"
17+
description = "Demo and event silo."
18+
admin_group_name = "showcase_admin"
19+
identity_mode = "saml_jit"
20+
discoverable = true
21+
mapped_fleet_roles = {
22+
admin = ["admin", "collaborator"]
23+
viewer = ["viewer"]
24+
}
25+
quotas = {
26+
cpus = 64
27+
memory = 137438953472 # 128 GiB
28+
storage = 549755813888 # 512 GiB
29+
}
30+
tls_certificates = [
31+
{
32+
name = "wildcard_cert"
33+
description = "Wildcard cert for *.sys.oxide.example.com."
34+
cert = file("cert.pem")
35+
key = file("key.pem")
36+
service = "external_api"
37+
},
38+
]
39+
}
40+
```
41+
42+
## Schema
43+
44+
### Required
45+
46+
- `name` (String) Name of the Oxide silo.
47+
- `description` (String) Description for the Oxide silo.
48+
- `quotas` (Set of Object) Limits the amount of provisionable CPU, memory, and storage in the silo. (See [below for nested schema](#nestedatt--quotas).)
49+
- `tls_certificates` (String, Write-only) TLS certificates to be used for the silo's console and API endpoints. This is a [write-only attribute](https://developer.hashicorp.com/terraform/plugin/framework/resources/write-only-arguments) since TLS certificates can only be specified during silo creation. Refer to the [Silo Management guide](https://docs.oxide.computer/guides/operator/silo-management) for instructions on replacing the TLS certificates of an existing silo _without_ destroying it and creating it anew. Alternatively, if it's acceptable to destroy the silo and create it anew you can modify this attribute and [replace the resource](https://developer.hashicorp.com/terraform/cli/state/taint). (See [below for nested schema](#nestedatt--tls).)
50+
- `discoverable` (Boolean) Whether this silo is present in the silo_list output. Defaults to `true`.
51+
52+
### Optional
53+
54+
- `identity_mode` (String) How identities are managed and users are authenticated in this silo. Valid values are `saml_jit` and `local_only`. Defaults to `local_only`.
55+
- `admin_group_name` (String) This group will be created during silo creation and granted the "Silo Admin" role. Identity providers can assert that users belong to this group and those users can log in and further initialize the Silo.
56+
- `mapped_fleet_roles` (Map) Setting that defines the association between silo roles and fleet roles. By default, silo roles do not grant any fleet roles. To establish a connection, you create entries in this map. The key for each entry must be a silo role: `admin`, `collaborator`, or `viewer`. The value is a list of fleet roles (`admin`, `collaborator`, or `viewer`) that the key silo role will grant.
57+
- `timeouts` (Attribute, Optional) Timeouts for performing API operations. See [below for nested schema](#nestedatt--timeouts).
58+
59+
### Read-Only
60+
61+
- `id` (String) Unique, immutable, system-controlled identifier of the silo.
62+
- `time_created` (String) Timestamp of when this Silo was created.
63+
- `time_modified` (String) Timestamp of when this Silo was last modified.
64+
65+
<a id="nestedatt--quotas"></a>
66+
67+
### Nested Schema for `quotas`
68+
69+
### Required
70+
71+
- `cpus` (Number) The amount of virtual CPUs available for running instances in the silo.
72+
- `memory` (Number) The amount of RAM, in bytes, available for running instances in the silo.
73+
- `storage` (Number) The amount of storage, in bytes, available for disks or snapshots.
74+
75+
<a id="nestedatt--tls"></a>
76+
77+
### Nested Schema for `tls_certificates`
78+
79+
### Required
80+
81+
- `name` (String) The name associated with the certificate.
82+
- `description` (String) Description of the certificate.
83+
- `cert` (String) PEM-formatted string containing public certificate chain.
84+
- `key` (String) PEM-formatted string containing private key.
85+
- `service` (String) The service associated with the certificate. The only valid value is `external_api`.
86+
87+
<a id="nestedatt--timeouts"></a>
88+
89+
### Nested Schema for `timeouts`
90+
91+
#### Optional
92+
93+
- `create` (String, Default `10m`)
94+
- `delete` (String, Default `10m`)
95+
- `read` (String, Default `10m`)
96+
- `update` (String, Default `10m`)

internal/provider/provider.go

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

0 commit comments

Comments
 (0)