Skip to content

Commit

Permalink
Feature/ssd volumes (#24)
Browse files Browse the repository at this point in the history
* update genesiscloud-go package

* add support for specifying volume storage type
  • Loading branch information
theocod3s authored Sep 12, 2023
1 parent 634bee4 commit 36b07f0
Show file tree
Hide file tree
Showing 21 changed files with 110 additions and 169 deletions.
2 changes: 1 addition & 1 deletion docs/data-sources/images.md
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ Required:
Optional:

- `region` (String) Filter by the region identifier.
- The value must be one of: [`ARC-IS-HAF-1` `NORD-NO-KRS-1`].
- The value must be one of: [`ARC-IS-HAF-1` `EUC-DE-MUC-1` `NORD-NO-KRS-1`].


<a id="nestedatt--timeouts"></a>
Expand Down
2 changes: 1 addition & 1 deletion docs/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -138,7 +138,7 @@ output "connect" {

### Optional

- `endpoint` (String) Genesis Cloud API endpoint. May also be provided via `GENESISCLOUD_ENDPOINT` environment variable. If neither is provided, defaults to `https://api.genesiscloud.com`.
- `endpoint` (String) Genesis Cloud API endpoint. May also be provided via `GENESISCLOUD_ENDPOINT` environment variable. If neither is provided, defaults to `https://api.genesiscloud.com/compute/v1`.
- `polling_interval` (String) The polling interval.
- The string must be a positive [time duration](https://pkg.go.dev/time#ParseDuration), for example "10s".
- `token` (String, Sensitive) Genesis Cloud API token. May also be provided via `GENESISCLOUD_TOKEN` environment variable.
6 changes: 2 additions & 4 deletions docs/resources/instance.md
Original file line number Diff line number Diff line change
Expand Up @@ -36,10 +36,9 @@ resource "genesiscloud_instance" "example" {
- `name` (String) The human-readable name for the instance.
- `region` (String) The region identifier.
- If the value of this attribute changes, Terraform will destroy and recreate the resource.
- The value must be one of: [`ARC-IS-HAF-1` `NORD-NO-KRS-1`].
- `type` (String) The instance type identifier.
- The value must be one of: [`ARC-IS-HAF-1` `EUC-DE-MUC-1` `NORD-NO-KRS-1`].
- `type` (String) The instance type identifier. Learn more about instance types [here](https://developers.genesiscloud.com/instances#instance-types).
- If the value of this attribute changes, Terraform will destroy and recreate the resource.
- The value must be one of: [`vcpu-12_memory-24g_disk-80g` `vcpu-12_memory-36g_disk-80g_nvidia1080ti-3` `vcpu-12_memory-36g_disk-80g_nvidia3060ti-3` `vcpu-12_memory-36g_disk-80g_nvidia3080-3` `vcpu-12_memory-72g_disk-80g_nvidia3090-3` `vcpu-16_memory-32g_disk-80g` `vcpu-16_memory-48g_disk-80g_nvidia1080ti-4` `vcpu-16_memory-48g_disk-80g_nvidia3060ti-4` `vcpu-16_memory-48g_disk-80g_nvidia3080-4` `vcpu-16_memory-64g_disk-80g_nvidia3080-2` `vcpu-16_memory-96g_disk-80g_nvidia3090-2` `vcpu-16_memory-96g_disk-80g_nvidia3090-4` `vcpu-20_memory-120g_disk-80g_nvidia3090-5` `vcpu-20_memory-40g_disk-80g` `vcpu-20_memory-60g_disk-80g_nvidia1080ti-5` `vcpu-20_memory-60g_disk-80g_nvidia3060ti-5` `vcpu-20_memory-60g_disk-80g_nvidia3080-5` `vcpu-24_memory-144g_disk-80g_nvidia3090-3` `vcpu-24_memory-144g_disk-80g_nvidia3090-6` `vcpu-24_memory-48g_disk-80g` `vcpu-24_memory-72g_disk-80g_nvidia1080ti-6` `vcpu-24_memory-72g_disk-80g_nvidia3060ti-6` `vcpu-24_memory-72g_disk-80g_nvidia3080-6` `vcpu-24_memory-96g_disk-80g_nvidia3080-3` `vcpu-28_memory-168g_disk-80g_nvidia3090-7` `vcpu-28_memory-84g_disk-80g_nvidia1080ti-7` `vcpu-28_memory-84g_disk-80g_nvidia3060ti-7` `vcpu-28_memory-84g_disk-80g_nvidia3080-7` `vcpu-2_memory-4g_disk-80g` `vcpu-2_memory-8g_disk-80g_amdrx470-4` `vcpu-2_memory-8g_disk-80g_amdrx470-5` `vcpu-2_memory-8g_disk-80g_amdrx470-6` `vcpu-2_memory-8g_disk-80g_amdrx470-7` `vcpu-2_memory-8g_disk-80g_amdrx470-8` `vcpu-32_memory-128g_disk-80g_nvidia3080-4` `vcpu-32_memory-192g_disk-80g_nvidia3090-4` `vcpu-32_memory-192g_disk-80g_nvidia3090-8` `vcpu-32_memory-96g_disk-80g_nvidia1080ti-8` `vcpu-32_memory-96g_disk-80g_nvidia3060ti-8` `vcpu-32_memory-96g_disk-80g_nvidia3080-8` `vcpu-4_memory-12g_disk-80g_nvidia1080ti-1` `vcpu-4_memory-12g_disk-80g_nvidia3060ti-1` `vcpu-4_memory-12g_disk-80g_nvidia3080-1` `vcpu-4_memory-24g_disk-80g_nvidia3090-1` `vcpu-4_memory-8g_disk-80g` `vcpu-8_memory-16g_disk-80g` `vcpu-8_memory-24g_disk-80g_nvidia1080ti-2` `vcpu-8_memory-24g_disk-80g_nvidia3060ti-2` `vcpu-8_memory-24g_disk-80g_nvidia3080-2` `vcpu-8_memory-32g_disk-80g_nvidia3080-1` `vcpu-8_memory-48g_disk-80g_nvidia3090-1` `vcpu-8_memory-48g_disk-80g_nvidia3090-2`].

### Optional

Expand All @@ -52,7 +51,6 @@ resource "genesiscloud_instance" "example" {
- `placement_option` (String) The placement option identifier in which instances are physically located relative to each other within a zone.
- If the value of this attribute changes, Terraform will destroy and recreate the resource.
- Sets the default value `AUTO` if the attribute is not set.
- The value must be one of: [`A` `AUTO` `B`].
- `public_ip_type` (String) When set to `static`, the instance's public IP will not change between start and stop actions.
- If the value of this attribute changes, Terraform will destroy and recreate the resource.
- Sets the default value `dynamic` if the attribute is not set.
Expand Down
2 changes: 1 addition & 1 deletion docs/resources/security_group.md
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ resource "genesiscloud_security_group" "allow-https" {
- `name` (String) The human-readable name for the security group.
- `region` (String) The region identifier.
- If the value of this attribute changes, Terraform will destroy and recreate the resource.
- The value must be one of: [`ARC-IS-HAF-1` `NORD-NO-KRS-1`].
- The value must be one of: [`ARC-IS-HAF-1` `EUC-DE-MUC-1` `NORD-NO-KRS-1`].
- `rules` (Attributes List) (see [below for nested schema](#nestedatt--rules))

### Optional
Expand Down
6 changes: 5 additions & 1 deletion docs/resources/volume.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ resource "genesiscloud_volume" "example" {
name = "example"
region = "ARC-IS-HAF-1"
size = 50
type = "hdd"
}
```

Expand All @@ -28,10 +29,13 @@ resource "genesiscloud_volume" "example" {
- `name` (String) The human-readable name for the volume.
- `region` (String) The region identifier.
- If the value of this attribute changes, Terraform will destroy and recreate the resource.
- The value must be one of: [`ARC-IS-HAF-1` `NORD-NO-KRS-1`].
- The value must be one of: [`ARC-IS-HAF-1` `EUC-DE-MUC-1` `NORD-NO-KRS-1`].
- `size` (Number) The storage size of this volume given in GiB.
- If the value of this attribute changes, Terraform will destroy and recreate the resource.
- The value must be at least 1.
- `type` (String) The storage type of the volume.
- If the value of this attribute changes, Terraform will destroy and recreate the resource.
- The value must be one of: [`hdd` `ssd`].

### Optional

Expand Down
1 change: 1 addition & 0 deletions examples/resources/genesiscloud_volume/resource.tf
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,5 @@ resource "genesiscloud_volume" "example" {
name = "example"
region = "ARC-IS-HAF-1"
size = 50
type = "hdd"
}
38 changes: 8 additions & 30 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ module github.com/genesiscloud/terraform-provider-genesiscloud
go 1.18

require (
github.com/genesiscloud/genesiscloud-go v1.0.0-rc.1
github.com/genesiscloud/genesiscloud-go v1.0.1
github.com/hashicorp/go-retryablehttp v0.7.4
github.com/hashicorp/terraform-plugin-docs v0.13.0
github.com/hashicorp/terraform-plugin-framework v1.1.1
Expand All @@ -23,21 +23,12 @@ require (
github.com/apparentlymart/go-textseg/v13 v13.0.0 // indirect
github.com/armon/go-radix v1.0.0 // indirect
github.com/bgentry/speakeasy v0.1.0 // indirect
github.com/bytedance/sonic v1.9.2 // indirect
github.com/chenzhuoyu/base64x v0.0.0-20221115062448-fe3a3abad311 // indirect
github.com/davecgh/go-spew v1.1.1 // indirect
github.com/deepmap/oapi-codegen v1.13.0 // indirect
github.com/deepmap/oapi-codegen v1.15.0 // indirect
github.com/fatih/color v1.13.0 // indirect
github.com/gabriel-vasile/mimetype v1.4.2 // indirect
github.com/gin-contrib/sse v0.1.0 // indirect
github.com/gin-gonic/gin v1.9.1 // indirect
github.com/go-playground/locales v0.14.1 // indirect
github.com/go-playground/universal-translator v0.18.1 // indirect
github.com/go-playground/validator/v10 v10.14.1 // indirect
github.com/goccy/go-json v0.10.2 // indirect
github.com/golang/protobuf v1.5.2 // indirect
github.com/google/go-cmp v0.5.9 // indirect
github.com/google/uuid v1.3.0 // indirect
github.com/google/uuid v1.3.1 // indirect
github.com/hashicorp/errwrap v1.1.0 // indirect
github.com/hashicorp/go-checkpoint v0.5.0 // indirect
github.com/hashicorp/go-cleanhttp v0.5.2 // indirect
Expand All @@ -57,11 +48,6 @@ require (
github.com/hashicorp/yamux v0.0.0-20181012175058-2f1d1f20f75d // indirect
github.com/huandu/xstrings v1.3.2 // indirect
github.com/imdario/mergo v0.3.13 // indirect
github.com/json-iterator/go v1.1.12 // indirect
github.com/klauspost/cpuid/v2 v2.2.5 // indirect
github.com/labstack/echo/v4 v4.10.2 // indirect
github.com/labstack/gommon v0.4.0 // indirect
github.com/leodido/go-urn v1.2.4 // indirect
github.com/mattn/go-colorable v0.1.13 // indirect
github.com/mattn/go-isatty v0.0.19 // indirect
github.com/mitchellh/cli v1.1.4 // indirect
Expand All @@ -70,32 +56,24 @@ require (
github.com/mitchellh/go-wordwrap v1.0.0 // indirect
github.com/mitchellh/mapstructure v1.5.0 // indirect
github.com/mitchellh/reflectwalk v1.0.2 // indirect
github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd // indirect
github.com/modern-go/reflect2 v1.0.2 // indirect
github.com/oapi-codegen/runtime v1.0.0 // indirect
github.com/oklog/run v1.0.0 // indirect
github.com/pelletier/go-toml/v2 v2.0.8 // indirect
github.com/posener/complete v1.2.3 // indirect
github.com/russross/blackfriday v1.6.0 // indirect
github.com/shopspring/decimal v1.3.1 // indirect
github.com/spf13/cast v1.5.0 // indirect
github.com/twitchyliquid64/golang-asm v0.15.1 // indirect
github.com/ugorji/go/codec v1.2.11 // indirect
github.com/valyala/bytebufferpool v1.0.0 // indirect
github.com/valyala/fasttemplate v1.2.2 // indirect
github.com/vmihailenco/msgpack v4.0.4+incompatible // indirect
github.com/vmihailenco/msgpack/v4 v4.3.12 // indirect
github.com/vmihailenco/tagparser v0.1.2 // indirect
github.com/zclconf/go-cty v1.12.1 // indirect
golang.org/x/arch v0.4.0 // indirect
golang.org/x/crypto v0.11.0 // indirect
golang.org/x/net v0.12.0 // indirect
golang.org/x/sys v0.10.0 // indirect
golang.org/x/text v0.11.0 // indirect
golang.org/x/crypto v0.13.0 // indirect
golang.org/x/net v0.15.0 // indirect
golang.org/x/sys v0.12.0 // indirect
golang.org/x/text v0.13.0 // indirect
google.golang.org/appengine v1.6.7 // indirect
google.golang.org/genproto v0.0.0-20200711021454-869866162049 // indirect
google.golang.org/grpc v1.51.0 // indirect
google.golang.org/protobuf v1.31.0 // indirect
gopkg.in/yaml.v3 v3.0.1 // indirect
)

replace github.com/hashicorp/terraform-plugin-framework => github.com/genesiscloud/terraform-plugin-framework v0.0.0-20230209224658-8e5bdfcff8eb
Loading

0 comments on commit 36b07f0

Please sign in to comment.