Skip to content

Commit

Permalink
Merge pull request #206 from BurMachine/dev
Browse files Browse the repository at this point in the history
Add examples
  • Loading branch information
BurMachine authored Jul 5, 2023
2 parents d3da3c5 + 2064ba5 commit 321c3b4
Show file tree
Hide file tree
Showing 135 changed files with 6,019 additions and 1,540 deletions.
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -25,3 +25,5 @@ terraform-provider-sbercloud
*.out

.idea/


8 changes: 7 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,10 +1,16 @@

## 1.11.3 (July 05, 2023)
ENHANCEMENTS:

* Update documentation for all data source and resource objects ([#211](https://github.com/sbercloud-terraform/terraform-provider-sbercloud/issues/211))
* Update existing and add more useful examples ([#205](https://github.com/sbercloud-terraform/terraform-provider-sbercloud/issues/205))

## 1.11.2 (June 13, 2023)

ENHANCEMENTS:

* Fix problems working CSS_cluster & CES_alarmrule with API V2


## 1.11.1 (June 05, 2023)

ENHANCEMENTS:
Expand Down
2 changes: 1 addition & 1 deletion docs/data-sources/cce_cluster.md
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ In addition to all arguments above, the following attributes are exported:

* `container_network_type` - The container network type: **overlay_l2** , **underlay_ipvlan**, **vpc-router** or **eni**.

* `eni_subnet_id` - ENI subnet ID. Specified when creating a CCE Turbo cluster.
* `eni_subnet_id` - The **IPv4 subnet ID** of the subnet where the ENI resides. Specified when creating a CCE Turbo cluster.

* `eni_subnet_cidr` - ENI network segment. Specified when creating a CCE Turbo cluster.

Expand Down
6 changes: 5 additions & 1 deletion docs/data-sources/cce_clusters.md
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ The `clusters` block supports:

* `container_network_type` - The container network type: **overlay_l2** , **underlay_ipvlan**, **vpc-router** or **eni**.

* `eni_subnet_id` - The ENI subnet ID.
* `eni_subnet_id` - The ENI**IPv4 subnet ID** of the subnet where the ENI resides.

* `eni_subnet_cidr` - The ENI network segment.

Expand Down Expand Up @@ -96,6 +96,10 @@ The `clusters` block supports:

* `kube_config_raw` - The raw Kubernetes config to be used by kubectl and other compatible tools.

The `masters` block supports:

* `availability_zone` - The availability zone (AZ) of the master node.

The `endpoints` block supports:

* `url` - The URL of the cluster access address.
Expand Down
47 changes: 47 additions & 0 deletions docs/data-sources/compute_flavors.md
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,53 @@ In addition to all arguments above, the following attributes are exported:
* `memory_size` - (Optional, Int) Specifies the memory size(GB) in the ECS flavor.


## Attributes Reference

In addition to all arguments above, the following attributes are exported:

subcategory: "Elastic Cloud Server (ECS)"
---

# sbercloud\_compute\_flavors

Use this data source to get the ID of the available Compute Flavors.

## Example Usage

```hcl
data "sbercloud_compute_flavors" "flavors" {
availability_zone = "ru-moscow-1a"
performance_type = "normal"
cpu_core_count = 2
memory_size = 4
}
# Create ECS instance with the first matched flavor
resource "sbercloud_compute_instance" "instance" {
flavor_id = data.sbercloud_compute_flavors.flavors.ids[0]
# Other properties...
}
```

## Argument Reference

In addition to all arguments above, the following attributes are exported:

* `region` - (Optional, String) The region in which to obtain the flavors. If omitted, the provider-level region will be used.

* `availability_zone` - (Optional, String) Specifies the AZ name.

* `performance_type` - (Optional, String) Specifies the ECS flavor type.

* `generation` - (Optional, String) Specifies the generation of an ECS type.

* `cpu_core_count` - (Optional, Int) Specifies the number of vCPUs in the ECS flavor.

* `memory_size` - (Optional, Int) Specifies the memory size(GB) in the ECS flavor.


## Attributes Reference

In addition to all arguments above, the following attributes are exported:
Expand Down
4 changes: 4 additions & 0 deletions docs/data-sources/compute_instance.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,8 @@ The following arguments are supported:

* `name` - (Optional, String) Specifies the ECS name, which can be queried with a regular expression.

* `instance_id` - (Optional, String) Specifies the ECS ID.
*
* `fixed_ip_v4` - (Optional, String) Specifies the IPv4 addresses of the ECS.

* `flavor_id` - (Optional, String) Specifies the flavor ID.
Expand All @@ -44,6 +46,7 @@ In addition to all arguments above, the following attributes are exported:
* `public_ip` - The EIP address that is associted to the instance.
* `system_disk_id` - The system disk voume ID.
* `user_data` - The user data (information after encoding) configured during instance creation.
* `security_groups` - An array of one or more security groups to associate with the instance.¶
* `security_group_ids` - An array of one or more security group IDs to associate with the instance.
* `network` - An array of one or more networks to attach to the instance. The network object structure is documented
below.
Expand All @@ -66,6 +69,7 @@ The `volume_attached` block supports:

* `volume_id` - The volume id on that attachment.
* `boot_index` - The volume boot index on that attachment.
* `is_sys_volume` - Whether the volume is the system disk.
* `size` - The volume size on that attachment.
* `type` - The volume type on that attachment.
* `pci_address` - The volume pci address on that attachment.
Expand Down
19 changes: 19 additions & 0 deletions docs/data-sources/compute_instances.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,8 @@ The following arguments are supported:
* `name` - (Optional, String) Specifies the instance name, which can be queried with a regular expression.
The instance name supports fuzzy matching query too.

* `instance_id` - (Optional, String) Specifies the ECS ID.

* `flavor_name` - (Optional, String) Specifies the flavor name of the instance.

* `enterprise_project_id` - (Optional, String) Specifies the enterprise project ID.
Expand All @@ -37,11 +39,17 @@ The following arguments are supported:

* `image_id` - (Optional, String) Specifies the image ID of the instance.

* `image_name` - The image name of the instance.

* `flavor_id` - (Optional, String) Specifies the flavor ID.

* `availability_zone` - (Optional, String) Specifies the availability zone where the instance is located.
Please following [reference](https://support.hc.sbercloud.ru/endpoint/index.html) for this argument.

* `public_ip` - The EIP address that is associted to the instance.

* `system_disk_id` - The system disk voume ID.

* `key_pair` - (Optional, String) Specifies the key pair that is used to authenticate the instance.

## Attributes Reference
Expand Down Expand Up @@ -83,11 +91,22 @@ The `instances` block supports:

* `tags` - The key/value pairs to associate with the instance.

The `network` block supports:

* `uuid` - The network ID to attach to the server.
* `port` - The port ID corresponding to the IP address on that network.
* `mac` - The MAC address of the NIC on that network.
* `fixed_ip_v4` - The fixed IPv4 address of the instance on this network.
* `fixed_ip_v6` - The Fixed IPv6 address of the instance on that network.

The `volume_attached` block supports:

* `volume_id` - The volume id on that attachment.

* `is_sys_volume` - Whether the volume is the system disk.
* `size` - The volume size on that attachment.
* `type` - The volume type on that attachment.
* `pci_address` - The volume pci address on that attachment.

The `scheduler_hints` block supports:

Expand Down
6 changes: 5 additions & 1 deletion docs/data-sources/dms_kafka_instances.md
Original file line number Diff line number Diff line change
Expand Up @@ -131,6 +131,10 @@ The `instances` block supports:

The `cross_vpc_accesses` block supports:

* `port` - The port number.
* `listener_ip` - The listener IP address.

* `advertised_ip` - The advertised IP Address.

* `port` - The port number.

* `port_id` - The port ID associated with the address
42 changes: 30 additions & 12 deletions docs/data-sources/dms_product.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,15 @@
subcategory: "Distributed Message Service (DMS)"
---

# sbercloud\_dms\_product
# sbercloud_dms_product

Use this data source to get the ID of an available SberCloud DMS product.

## Example Usage

```hcl
### Filter DMS kafka product list by I/O specification

```hcl
data "sbercloud_dms_product" "product1" {
engine = "kafka"
version = "1.1.0"
Expand All @@ -20,33 +21,50 @@ data "sbercloud_dms_product" "product1" {
}
```

### Filter DMS kafka product list by underlying VM specification

```
data "sbercloud_dms_product" "product2" {
engine = "kafka"
version = "2.3.0"
instance_type = "cluster"
vm_specification = "c6.large.2"
}
```

## Argument Reference

* `region` - (Optional, String) The region in which to obtain the dms products. If omitted, the provider-level region will be used.
* `region` - (Optional, String) The region in which to obtain the dms products. If omitted, the provider-level region
will be used.

* `engine` - (Required, String) Indicates the name of a message engine. The valid values are **kafka**, **rabbitmq**.

* `engine` - (Required, String) Indicates the name of a message engine.
* `instance_type` - (Required, String) Indicates an instance type. The valid values are **single** and **cluster**.

* `version` - (Optional, String) Indicates the version of a message engine.

* `instance_type` - (Required, String) Indicates an instance type. Options: "single" and "cluster"
* `availability_zones` - (Optional, List) Indicates the list of availability zones with available resources.

* `vm_specification` - (Optional, String) Indicates VM specifications.
* `vm_specification` - (Optional, String) Indicates underlying VM specification, such as **c6.large.2**.

* `storage` - (Optional, String) Indicates the message storage space.
* `storage` - (Optional, String) Indicates the storage capacity of the resource.
The default value is the storage capacity of the product.

* `bandwidth` - (Optional, String) Indicates the baseline bandwidth of a Kafka instance.
* `bandwidth` - (Optional, String) Indicates the baseline bandwidth of a DMS instance.
The valid values are **100MB**, **300MB**, **600MB** and **1200MB**.

* `partition_num` - (Optional, String) Indicates the maximum number of topics that can be created for a Kafka instance.
The valid values are **300**, **900** and **1800**.

* `storage_spec_code` - (Optional, String) Indicates an I/O specification.

* `io_type` - (Optional, String) Indicates an I/O type.
The valid values are **dms.physical.storage.high** and **dms.physical.storage.ultra**.

* `node_num` - (Optional, String) Indicates the number of nodes in a cluster.


## Attributes Reference

In addition to all arguments above, the following attributes are exported:

* `id` - Specifies a data source ID in UUID format.
* `id` - The data source ID.

* `storage_spec_codes` - The available I/O specifications.
83 changes: 60 additions & 23 deletions docs/data-sources/images_image.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@
subcategory: "Image Management Service (IMS)"
---

# sbercloud\_images\_image
# sbercloud_images_image

Use this data source to get the ID of an available Sbercloud image.
Use this data source to get the ID of an available SberCloud image.

## Example Usage

Expand All @@ -14,50 +14,87 @@ data "sbercloud_images_image" "ubuntu" {
visibility = "public"
most_recent = true
}
data "sbercloud_images_image" "centos-1" {
architecture = "x86"
os_version = "CentOS 7.4 64bit"
visibility = "public"
most_recent = true
}
data "sbercloud_images_image" "centos-2" {
architecture = "x86"
name_regex = "^CentOS 7.4"
visibility = "public"
most_recent = true
}
data "sbercloud_images_image" "bms_image" {
architecture = "x86"
image_type = "Ironic"
os_version = "CentOS 7.4 64bit"
visibility = "public"
most_recent = true
}
```

## Argument Reference

* `region` - (Optional, String) The region in which to obtain the images. If omitted, the provider-level region will be used.
* `region` - (Optional, String) The region in which to obtain the images. If omitted, the provider-level region will be
used.

* `most_recent` - (Optional, Bool) If more than one result is returned, use the most recent image.
* `most_recent` - (Optional, Bool) If more than one result is returned, use the latest updated image.

* `name` - (Optional, String) The name of the image.
* `name` - (Optional, String) The name of the image. Cannot be used simultaneously with `name_regex`.

* `owner` - (Optional, String) The owner (UUID) of the image.
* `name_regex` - (Optional, String) The regular expressian of the name of the image.
Cannot be used simultaneously with `name`.

* `size_min` - (Optional, Int) The minimum size (in bytes) of the image to return.
* `visibility` - (Optional, String) The visibility of the image. Must be one of
**public**, **private**, **market** or **shared**.

* `size_max` - (Optional, Int) The maximum size (in bytes) of the image to return.
* `architecture` - (Optional, String) Specifies the image architecture type. The value can be **x86** and **arm**.

* `os` - (Optional, String) Specifies the image OS type. The value can be **Windows**, **Ubuntu**,
**RedHat**, **SUSE**, **CentOS**, **Debian**, **OpenSUSE**, **Oracle Linux**, **Fedora**, **Other**,
**CoreOS**, or **EulerOS**.

* `os_version` - (Optional, String) Specifies the OS version. For example, *CentOS 7.4 64bit* or *Ubuntu 18.04 server 64bit*.

* `image_type` - (Optional, String) Specifies the environment where the image is used. For a BMS image, the value is **Ironic**.

* `owner` - (Optional, String) The owner (UUID) of the image.

* `tag` - (Optional, String) Search for images with a specific tag in "Key=Value" format.

* `sort_direction` - (Optional, String) Order the results in either `asc` or `desc`.

* `sort_key` - (Optional, String) Sort images based on a certain key. Must be one of
"name", "container_format", "disk_format", "status", "id" or "size".
Defaults to `name`.
"name", "container_format", "disk_format", "status", "id" or "size". Defaults to `name`.

* `visibility` - (Optional, String) The visibility of the image. Must be one of
"public", "private", "community", or "shared". Defaults to `private`.
* `enterprise_project_id` - (Optional, String) Specifies the enterprise project ID of the image.

* `flavor_id` - (Optional, String) Specifies the ECS flavor ID used to filter out available images.
You can specify only one flavor ID and only ECS flavor ID is valid, BMS flavor is not supported.

## Attributes Reference

In addition to all arguments above, the following attributes are exported:

* `id` - Specifies a resource ID in UUID format.
* `checksum` - The checksum of the data associated with the image.
* `created_at` - The date the image was created.
* `container_format`: The format of the image's container.
* `disk_format`: The format of the image's disk.
* `file` - the trailing path after the glance endpoint that represent the
location of the image or the path to retrieve it.
* `metadata` - The metadata associated with the image.
Image metadata allow for meaningfully define the image properties and tags.
* `container_format` - The format of the image's container.
* `disk_format` - The format of the image's disk.
* `file` - the trailing path after the glance endpoint that represent the location of the image or the path to retrieve
it.
* `metadata` - The metadata associated with the image. Image metadata allow for meaningfully define the image properties
and tags.
* `min_disk_gb` - The minimum amount of disk space required to use the image.
* `min_ram_mb` - The minimum amount of ram required to use the image.
* `properties` - Freeform information about the image.
* `protected` - Whether or not the image is protected.
* `schema` - The path to the JSON-schema that represent
the image or image
* `schema` - The path to the JSON-schema that represent the image or image.
* `size_bytes` - The size of the image (in bytes).
* `update_at` - The date the image was last updated.
* `status` - The status of the image.
* `backup_id` - The backup ID of the whole image in the CBR vault.
* `created_at` - The date when the image was created.
* `updated_at` - The date when the image was last updated.
Loading

0 comments on commit 321c3b4

Please sign in to comment.