diff --git a/cloudscale/resource_cloudscale_load_balancer_health_monitor.go b/cloudscale/resource_cloudscale_load_balancer_health_monitor.go index ecb44ff2..053264a0 100644 --- a/cloudscale/resource_cloudscale_load_balancer_health_monitor.go +++ b/cloudscale/resource_cloudscale_load_balancer_health_monitor.go @@ -52,22 +52,22 @@ func getLoadBalancerHealthMonitorSchema(t SchemaType) map[string]*schema.Schema }, "delay_s": { Type: schema.TypeInt, - Optional: true, + Optional: t.isResource(), Computed: true, }, "timeout_s": { Type: schema.TypeInt, - Optional: true, + Optional: t.isResource(), Computed: true, }, "up_threshold": { Type: schema.TypeInt, - Optional: true, + Optional: t.isResource(), Computed: true, }, "down_threshold": { Type: schema.TypeInt, - Optional: true, + Optional: t.isResource(), Computed: true, }, "type": { @@ -79,28 +79,28 @@ func getLoadBalancerHealthMonitorSchema(t SchemaType) map[string]*schema.Schema "http_expected_codes": { Type: schema.TypeList, Elem: &schema.Schema{Type: schema.TypeString}, - Optional: true, + Optional: t.isResource(), Computed: true, }, "http_method": { Type: schema.TypeString, - Optional: true, + Optional: t.isResource(), Computed: true, }, "http_url_path": { Type: schema.TypeString, - Optional: true, + Optional: t.isResource(), Computed: true, }, "http_version": { Type: schema.TypeString, - Optional: true, + Optional: t.isResource(), Computed: true, - ForceNew: true, + ForceNew: t.isResource(), }, "http_host": { Type: schema.TypeString, - Optional: true, + Optional: t.isResource(), Computed: true, }, "tags": &TagsSchema, diff --git a/cloudscale/resource_cloudscale_load_balancer_listener.go b/cloudscale/resource_cloudscale_load_balancer_listener.go index c0934351..cdf5f918 100644 --- a/cloudscale/resource_cloudscale_load_balancer_listener.go +++ b/cloudscale/resource_cloudscale_load_balancer_listener.go @@ -68,23 +68,23 @@ func getLoadBalancerListenerSchema(t SchemaType) map[string]*schema.Schema { }, "timeout_client_data_ms": { Type: schema.TypeInt, - Optional: true, + Optional: t.isResource(), Computed: true, }, "timeout_member_connect_ms": { Type: schema.TypeInt, - Optional: true, + Optional: t.isResource(), Computed: true, }, "timeout_member_data_ms": { Type: schema.TypeInt, - Optional: true, + Optional: t.isResource(), Computed: true, }, "allowed_cidrs": { Type: schema.TypeList, Elem: &schema.Schema{Type: schema.TypeString}, - Optional: true, + Optional: t.isResource(), Computed: true, }, "tags": &TagsSchema, diff --git a/docs/data-sources/custom_image.md b/docs/data-sources/custom_image.md index 29fd3dca..8da35d72 100644 --- a/docs/data-sources/custom_image.md +++ b/docs/data-sources/custom_image.md @@ -41,6 +41,7 @@ The following arguments can be used to look up a custom image: * `id` - (Optional) The UUID of a custom image. * `name` - (Optional) The human-readable name of a custom image. * `slug` - (Optional) A string identifying a custom image. +* `firmware_type` - (Optional) The firmware type that will be used for servers created with the custom image. Options include `bios` and `uefi`. ## Attributes Reference @@ -50,5 +51,4 @@ In addition to the arguments listed above, the following computed attributes are * `size_gb` - The size in GB of the custom image. * `checksums` - The checksums of the custom image as map. * `user_data_handling` - How user_data will be handled when creating a server. Options include `pass-through` and `extend-cloud-config`. -* `firmware_type` - The firmware type that will be used for servers created with the custom image. Options include `bios` and `uefi`. * `zone_slugs` - The zones in which the custom image will be available. Options include `lpg1` and `rma1`. diff --git a/docs/data-sources/load_balancer.md b/docs/data-sources/load_balancer.md index 5bb05a97..ae52240b 100644 --- a/docs/data-sources/load_balancer.md +++ b/docs/data-sources/load_balancer.md @@ -19,6 +19,7 @@ data "cloudscale_load_balancer" "lb1" { The following arguments can be used to look up a load balancer: * `id` - (Optional) The UUID of the load balancer. +* `name` - (Optional) Name of the load balancer. * `zone_slug` - (Optional) The slug of the zone in which the load balancer exists. Options include `lpg1` and `rma1`. ## Attributes Reference @@ -27,11 +28,10 @@ In addition to the arguments listed above, the following computed attributes are * `href` - The cloudscale.ch API URL of the current resource. * `flavor_slug` - The slug (name) of the flavor to use for the new load balancer. Possible values can be found in our [API documentation](https://www.cloudscale.ch/en/api/v1#load-balancer-flavors). -* `name` - Name of the new load balancer. * `status` - The current status of the load balancer. * `vip_addresses` - A list of VIP address objects. This attributes needs to be specified if the load balancer should be assigned a VIP address in a subnet on a private network. If the VIP address should be created on the public network, this attribute should be omitted. Each VIP address object has the following attributes: * `version` - The IP version, either `4` or `6`. * `subnet_href` - The cloudscale.ch API URL of the subnet the VIP address is part of. * `subnet_uuid` - The UUID of the subnet this VIP address should be part of. * `subnet_cidr` - The cidr of the subnet the VIP address is part of. - * `address` - An VIP address that has been assigned to this load balancer. \ No newline at end of file + * `address` - An VIP address that has been assigned to this load balancer. diff --git a/docs/data-sources/load_balancer_pool_health_monitor.md b/docs/data-sources/load_balancer_health_monitor.md similarity index 93% rename from docs/data-sources/load_balancer_pool_health_monitor.md rename to docs/data-sources/load_balancer_health_monitor.md index d2e261c4..2e53f7a7 100644 --- a/docs/data-sources/load_balancer_pool_health_monitor.md +++ b/docs/data-sources/load_balancer_health_monitor.md @@ -26,8 +26,8 @@ The following arguments can be used to look up a load balancer listener: In addition to the arguments listed above, the following computed attributes are exported: * `href` - The cloudscale.ch API URL of the current resource. -* `pool_href` = The cloudscale.ch API URL of the listener's load balancer pool. -* `pool_name` = The load balancer pool name of the listener. +* `pool_href` - The cloudscale.ch API URL of the listener's load balancer pool. +* `pool_name` - The load balancer pool name of the listener. * `delay_s` - The delay between two successive checks in seconds. * `timeout_s` - The maximum time allowed for an individual check in seconds. * `up_threshold` - The number of checks that need to be successful before the `monitor_status` of a pool member changes to `"up"`. @@ -37,4 +37,4 @@ In addition to the arguments listed above, the following computed attributes are * `http_method` - The HTTP method used for the check. Options include `"CONNECT"`, `"DELETE"`, `"GET"`, `"HEAD"`, `"OPTIONS"`, `"PATCH"`, `"POST"`, `"PUT"` and `"TRACE"`. * `http_url_path` - The URL used for the check. * `http_version` - The HTTP version used for the check. Options include `"1.0"` and `"1.1"`. -* `http_host` - The server name in the HTTP Host: header used for the check. \ No newline at end of file +* `http_host` - The server name in the HTTP Host: header used for the check. diff --git a/docs/data-sources/load_balancer_pool_listener.md b/docs/data-sources/load_balancer_listener.md similarity index 57% rename from docs/data-sources/load_balancer_pool_listener.md rename to docs/data-sources/load_balancer_listener.md index 19948290..e58f401f 100644 --- a/docs/data-sources/load_balancer_pool_listener.md +++ b/docs/data-sources/load_balancer_listener.md @@ -27,11 +27,11 @@ The following arguments can be used to look up a load balancer listener: In addition to the arguments listed above, the following computed attributes are exported: * `href` - The cloudscale.ch API URL of the current resource. -* `pool_href` = The cloudscale.ch API URL of the listener's load balancer pool. -* `pool_name` = The load balancer pool name of the listener. -* `protocol` = The protocol used for receiving traffic. Options include `"tcp"`. -* `protocol_port` = The port on which traffic is received. -* `timeout_client_data_ms` = Client inactivity timeout in milliseconds. -* `timeout_member_connect_ms` = Pool member connection timeout in milliseconds. -* `timeout_member_data_ms` = Pool member inactivity timeout in milliseconds. -* `allowed_cidrs` = Restrict the allowed source IPs for this listener. `[]` means that any source IP is allowed. If the list is non-empty, traffic from source IPs not included is denied. +* `pool_href` - The cloudscale.ch API URL of the listener's load balancer pool. +* `pool_name` - The load balancer pool name of the listener. +* `protocol` - The protocol used for receiving traffic. Options include `"tcp"`. +* `protocol_port` - The port on which traffic is received. +* `timeout_client_data_ms` - Client inactivity timeout in milliseconds. +* `timeout_member_connect_ms` - Pool member connection timeout in milliseconds. +* `timeout_member_data_ms` - Pool member inactivity timeout in milliseconds. +* `allowed_cidrs` - Restrict the allowed source IPs for this listener. `[]` means that any source IP is allowed. If the list is non-empty, traffic from source IPs not included is denied. diff --git a/docs/data-sources/server.md b/docs/data-sources/server.md index e6acb6ac..0679c2d9 100644 --- a/docs/data-sources/server.md +++ b/docs/data-sources/server.md @@ -21,6 +21,7 @@ The following arguments can be used to look up a server: * `id` - (Optional) The UUID of a server. * `name` - (Optional) Name of the server. * `zone_slug` - (Optional) The slug of the zone in which the server exists. Options include `lpg1` and `rma1`. +* `status` - (Optional) The desired state of a server. Can be `running` (default) or `stopped`. ## Attributes Reference @@ -32,22 +33,30 @@ In addition to the arguments listed above, the following computed attributes are * `ssh_host_keys` - A list of SSH host keys (strings) of this server. * `flavor_slug` - The slug (name) of the flavor used by this server. * `image_slug` - The slug (name) of the image (or custom image) used by the server. -* `volumes` - A list of volume objects attached to this server. Each volume object has three attributes: +* `volumes` - A list of volume objects attached to this server. Each volume object has the following attributes: * `device_path` - (Deprecated) The path (string) to the volume on your server (e.g. `/dev/vda`). This attribute is always null and will be removed in a future major version. * `size_gb` - The size (int) of the volume in GB. Typically matches `volume_size_gb` or `bulk_volume_size_gb`. * `type` - A string. Either `ssd` or `bulk`. + * `uuid` - The UUID of the volume. +* `server_groups` - A list of server group objects this server is associated with. Each object has the following attributes: + * `href` - The cloudscale.ch API URL of the server group. + * `name` - The name of the server group. + * `uuid` - The UUID of the server group. * `public_ipv4_address` - The first `public` IPv4 address of this server. The returned IP address may be `""` if the server does not have a public IPv4. * `private_ipv4_address` - The first `private` IPv4 address of this server. The returned IP address may be `""` if the server does not have private networking enabled. * `public_ipv6_address` - The first `public` IPv6 address of this server. The returned IP address may be `""` if the server does not have a public IPv6. * `interfaces` - A list of interface objects attached to this server. Each interface object has the following attributes: * `network_name` - The name of the network the interface is attached to. * `network_href` - The cloudscale.ch API URL of the network the interface is attached to. + * `network_uuid` - The UUID of the network the interface is attached to. * `type` - Either `public` or `private`. Public interfaces are connected to the Internet, while private interfaces are not. + * `no_address` - `true` if no address is configured on this interface. * `addresses` - A list of address objects: + * `address` - The IP address assigned to this interface. + * `subnet_uuid` - The UUID of the subnet this address is part of. * `gateway` - An IPv4 or IPv6 address that represents the default gateway for this interface. * `prefix_length` - The prefix length for this IP address, typically 24 for IPv4 and 128 for IPv6. * `reverse_ptr` - The PTR record (reverse DNS pointer) for this IP address. If you use an FQDN as your server name it will automatically be used here. * `version` - The IP version, either `4` or `6`. * `subnet_cidr` - The cidr of the subnet the address is part of. * `subnet_href` - The cloudscale.ch API URL of the subnet the address is part of. -* `status` - The state of a server. diff --git a/docs/data-sources/volume.md b/docs/data-sources/volume.md index eb6f7900..28d78d26 100644 --- a/docs/data-sources/volume.md +++ b/docs/data-sources/volume.md @@ -30,5 +30,4 @@ The following arguments can be used to look up a volume: In addition to the arguments listed above, the following computed attributes are exported: * `href` - The cloudscale.ch API URL of the current resource. -* `size_gb` - The volume size in GB. Valid values are multiples of 1 for type "ssd" and multiples of 100 for type "bulk". * `server_uuids` - A list of server UUIDs. diff --git a/docs/data-sources/volume_snapshot.md b/docs/data-sources/volume_snapshot.md index c753aad5..675cf7e1 100644 --- a/docs/data-sources/volume_snapshot.md +++ b/docs/data-sources/volume_snapshot.md @@ -28,8 +28,7 @@ The following arguments can be used to look up a volume snapshot: In addition to the arguments listed above, the following computed attributes are exported: * `href` - The cloudscale.ch API URL of the current resource. -* `source_volume_uuid` - The UUID of the source volume. * `source_volume_name` - The name of the source volume. * `source_volume_href` - The cloudscale.ch API URL of the source volume. * `size_gb` - The size of the snapshot in GB. -* `status` - The current status of the volume snapshot. \ No newline at end of file +* `status` - The current status of the volume snapshot. diff --git a/docs/resources/load_balancer_health_monitor.md b/docs/resources/load_balancer_health_monitor.md index 9b33c78d..ac7905fb 100644 --- a/docs/resources/load_balancer_health_monitor.md +++ b/docs/resources/load_balancer_health_monitor.md @@ -26,7 +26,6 @@ resource "cloudscale_load_balancer_health_monitor" "lb1-health-monitor" { The following arguments are supported when creating new load balancer health monitor: -* `name` - (Required) Name of the new load balancer health monitor. * `pool_uuid` - (Required) The pool of the health monitor. * `type` - (Required) The type of the health monitor. Options include: `"ping"`, `"tcp"`, `"http"`, `"https"` and `"tls-hello"`. diff --git a/docs/resources/server.md b/docs/resources/server.md index f4ff4270..402ba7bf 100644 --- a/docs/resources/server.md +++ b/docs/resources/server.md @@ -83,10 +83,15 @@ In addition to the arguments listed above, the following computed attributes are * `href` - The cloudscale.ch API URL of the current resource. * `ssh_fingerprints` - A list of SSH host key fingerprints (strings) of this server. * `ssh_host_keys` - A list of SSH host keys (strings) of this server. -* `volumes` - A list of volume objects attached to this server. Each volume object has three attributes: +* `volumes` - A list of volume objects attached to this server. Each volume object has the following attributes: * `device_path` - (Deprecated) The path (string) to the volume on your server (e.g. `/dev/vda`). This attribute is always null and will be removed in a future major version. * `size_gb` - The size (int) of the volume in GB. Typically matches `volume_size_gb` or `bulk_volume_size_gb`. * `type` - A string. Either `ssd` or `bulk`. + * `uuid` - The UUID of the volume. +* `server_groups` - A list of server group objects this server is associated with. Each object has the following attributes: + * `href` - The cloudscale.ch API URL of the server group. + * `name` - The name of the server group. + * `uuid` - The UUID of the server group. * `public_ipv4_address` - The first `public` IPv4 address of this server. The returned IP address may be `""` if the server does not have a public IPv4. * `private_ipv4_address` - The first `private` IPv4 address of this server. The returned IP address may be `""` if the server does not have private networking enabled. * `public_ipv6_address` - The first `public` IPv6 address of this server. The returned IP address may be `""` if the server does not have a public IPv6.