|
| 1 | +--- |
| 2 | +subcategory: "EBS" |
| 3 | +layout: "volcengine" |
| 4 | +page_title: "Volcengine: volcengine_ebs_snapshot_groups" |
| 5 | +sidebar_current: "docs-volcengine-datasource-ebs_snapshot_groups" |
| 6 | +description: |- |
| 7 | + Use this data source to query detailed information of ebs snapshot groups |
| 8 | +--- |
| 9 | +# volcengine_ebs_snapshot_groups |
| 10 | +Use this data source to query detailed information of ebs snapshot groups |
| 11 | +## Example Usage |
| 12 | +```hcl |
| 13 | +data "volcengine_zones" "foo" { |
| 14 | +} |
| 15 | +
|
| 16 | +resource "volcengine_vpc" "foo" { |
| 17 | + vpc_name = "acc-test-vpc" |
| 18 | + cidr_block = "172.16.0.0/16" |
| 19 | +} |
| 20 | +
|
| 21 | +resource "volcengine_subnet" "foo" { |
| 22 | + subnet_name = "acc-test-subnet" |
| 23 | + cidr_block = "172.16.0.0/24" |
| 24 | + zone_id = data.volcengine_zones.foo.zones[0].id |
| 25 | + vpc_id = volcengine_vpc.foo.id |
| 26 | +} |
| 27 | +
|
| 28 | +resource "volcengine_security_group" "foo" { |
| 29 | + security_group_name = "acc-test-security-group" |
| 30 | + vpc_id = volcengine_vpc.foo.id |
| 31 | +} |
| 32 | +
|
| 33 | +data "volcengine_images" "foo" { |
| 34 | + os_type = "Linux" |
| 35 | + visibility = "public" |
| 36 | + instance_type_id = "ecs.g3il.large" |
| 37 | +} |
| 38 | +
|
| 39 | +resource "volcengine_ecs_instance" "foo" { |
| 40 | + instance_name = "acc-test-ecs" |
| 41 | + description = "acc-test" |
| 42 | + host_name = "tf-acc-test" |
| 43 | + image_id = data.volcengine_images.foo.images[0].image_id |
| 44 | + instance_type = "ecs.g3il.large" |
| 45 | + password = "93f0cb0614Aab12" |
| 46 | + instance_charge_type = "PostPaid" |
| 47 | + system_volume_type = "ESSD_PL0" |
| 48 | + system_volume_size = 40 |
| 49 | + subnet_id = volcengine_subnet.foo.id |
| 50 | + security_group_ids = [volcengine_security_group.foo.id] |
| 51 | + project_name = "default" |
| 52 | + tags { |
| 53 | + key = "k1" |
| 54 | + value = "v1" |
| 55 | + } |
| 56 | +} |
| 57 | +
|
| 58 | +resource "volcengine_volume" "foo" { |
| 59 | + volume_name = "acc-test-volume" |
| 60 | + volume_type = "ESSD_PL0" |
| 61 | + description = "acc-test" |
| 62 | + kind = "data" |
| 63 | + size = 500 |
| 64 | + zone_id = data.volcengine_zones.foo.zones[0].id |
| 65 | + volume_charge_type = "PostPaid" |
| 66 | + project_name = "default" |
| 67 | +} |
| 68 | +
|
| 69 | +resource "volcengine_volume_attach" "foo" { |
| 70 | + instance_id = volcengine_ecs_instance.foo.id |
| 71 | + volume_id = volcengine_volume.foo.id |
| 72 | +} |
| 73 | +
|
| 74 | +resource "volcengine_ebs_snapshot_group" "foo" { |
| 75 | + volume_ids = [volcengine_ecs_instance.foo.system_volume_id, volcengine_volume.foo.id] |
| 76 | + instance_id = volcengine_ecs_instance.foo.id |
| 77 | + name = "acc-test-snapshot-group" |
| 78 | + description = "acc-test" |
| 79 | + project_name = "default" |
| 80 | + tags { |
| 81 | + key = "k1" |
| 82 | + value = "v1" |
| 83 | + } |
| 84 | + depends_on = [volcengine_volume_attach.foo] |
| 85 | +} |
| 86 | +
|
| 87 | +data "volcengine_ebs_snapshot_groups" "foo" { |
| 88 | + ids = [volcengine_ebs_snapshot_group.foo.id] |
| 89 | +} |
| 90 | +``` |
| 91 | +## Argument Reference |
| 92 | +The following arguments are supported: |
| 93 | +* `ids` - (Optional) A list of snapshot group IDs. |
| 94 | +* `instance_id` - (Optional) The instance id of snapshot group. |
| 95 | +* `name_regex` - (Optional) A Name Regex of Resource. |
| 96 | +* `name` - (Optional) The name of snapshot group. |
| 97 | +* `output_file` - (Optional) File name where to save data source results. |
| 98 | +* `project_name` - (Optional) The project name of snapshot group. |
| 99 | +* `status` - (Optional) A list of snapshot group status. Valid values: `creating`, `available`, `failed`. |
| 100 | + |
| 101 | +## Attributes Reference |
| 102 | +In addition to all arguments above, the following attributes are exported: |
| 103 | +* `snapshot_groups` - The collection of query. |
| 104 | + * `creation_time` - The creation time of the snapshot group. |
| 105 | + * `description` - The description of the snapshot group. |
| 106 | + * `id` - The id of the snapshot group. |
| 107 | + * `image_id` - The image id of the snapshot group. |
| 108 | + * `instance_id` - The instance id of the snapshot group. |
| 109 | + * `name` - The name of the snapshot group. |
| 110 | + * `project_name` - The project name of the snapshot group. |
| 111 | + * `snapshot_group_id` - The id of the snapshot group. |
| 112 | + * `snapshots` - The snapshots of the snapshot group. |
| 113 | + * `creation_time` - The creation time of the snapshot. |
| 114 | + * `description` - The description of the snapshot. |
| 115 | + * `image_id` - The image id of the snapshot. |
| 116 | + * `progress` - The progress of the snapshot. |
| 117 | + * `project_name` - The id of the snapshot. |
| 118 | + * `retention_days` - The id of the snapshot. |
| 119 | + * `snapshot_id` - The id of the snapshot. |
| 120 | + * `snapshot_name` - The name of the snapshot. |
| 121 | + * `snapshot_type` - The type of the snapshot. |
| 122 | + * `status` - The status of the snapshot. |
| 123 | + * `tags` - Tags. |
| 124 | + * `key` - The Key of Tags. |
| 125 | + * `value` - The Value of Tags. |
| 126 | + * `volume_id` - The volume id of the snapshot. |
| 127 | + * `volume_kind` - The volume kind of the snapshot. |
| 128 | + * `volume_name` - The volume name of the snapshot. |
| 129 | + * `volume_size` - The volume size of the snapshot. |
| 130 | + * `volume_status` - The volume status of the snapshot. |
| 131 | + * `volume_type` - The volume type of the snapshot. |
| 132 | + * `zone_id` - The zone id of the snapshot. |
| 133 | + * `status` - The status of the snapshot group. |
| 134 | + * `tags` - Tags. |
| 135 | + * `key` - The Key of Tags. |
| 136 | + * `value` - The Value of Tags. |
| 137 | +* `total_count` - The total count of query. |
| 138 | + |
| 139 | + |
0 commit comments