|
| 1 | +--- |
| 2 | +# generated by https://github.com/hashicorp/terraform-plugin-docs |
| 3 | +page_title: "gcore_instance Resource - terraform-provider-gcorelabs" |
| 4 | +subcategory: "" |
| 5 | +description: |- |
| 6 | + Represent instance |
| 7 | +--- |
| 8 | + |
| 9 | +# gcore_instance (Resource) |
| 10 | + |
| 11 | +Represent instance |
| 12 | + |
| 13 | +## Example Usage |
| 14 | + |
| 15 | +```terraform |
| 16 | +provider gcore { |
| 17 | + |
| 18 | + password = "testtest" |
| 19 | + gcore_platform = "http://api.stg-45.staging.gcdn.co" |
| 20 | + gcore_api = "http://10.100.179.92:33081" |
| 21 | +} |
| 22 | +resource "gcore_network" "network" { |
| 23 | + name = "network_example" |
| 24 | + mtu = 1450 |
| 25 | + type = "vxlan" |
| 26 | + region_id = 1 |
| 27 | + project_id = 1 |
| 28 | +} |
| 29 | +
|
| 30 | +resource "gcore_subnet" "subnet" { |
| 31 | + name = "subnet_example" |
| 32 | + cidr = "192.168.10.0/24" |
| 33 | + network_id = gcore_network.network.id |
| 34 | + dns_nameservers = ["8.8.4.4", "1.1.1.1"] |
| 35 | +
|
| 36 | + host_routes { |
| 37 | + destination = "10.0.3.0/24" |
| 38 | + nexthop = "10.0.0.13" |
| 39 | + } |
| 40 | +
|
| 41 | + gateway_ip = "192.168.10.1" |
| 42 | + region_id = 1 |
| 43 | + project_id = 1 |
| 44 | +} |
| 45 | +
|
| 46 | +resource "gcore_volume" "first_volume" { |
| 47 | + name = "boot volume" |
| 48 | + type_name = "ssd_hiiops" |
| 49 | + size = 5 |
| 50 | + image_id = "f4ce3d30-e29c-4cfd-811f-46f383b6081f" |
| 51 | + region_id = 1 |
| 52 | + project_id = 1 |
| 53 | +} |
| 54 | +
|
| 55 | +resource "gcore_volume" "second_volume" { |
| 56 | + name = "second volume" |
| 57 | + type_name = "ssd_hiiops" |
| 58 | + size = 5 |
| 59 | + region_id = 1 |
| 60 | + project_id = 1 |
| 61 | +} |
| 62 | +
|
| 63 | +resource "gcore_instance" "instance" { |
| 64 | + flavor_id = "g1-standard-2-4" |
| 65 | + name = "test" |
| 66 | +
|
| 67 | + volume { |
| 68 | + source = "existing-volume" |
| 69 | + volume_id = gcore_volume.first_volume.id |
| 70 | + boot_index = 0 |
| 71 | + } |
| 72 | +
|
| 73 | + volume { |
| 74 | + source = "existing-volume" |
| 75 | + volume_id = gcore_volume.second_volume.id |
| 76 | + boot_index = 1 |
| 77 | + } |
| 78 | +
|
| 79 | + interface { |
| 80 | + type = "subnet" |
| 81 | + network_id = gcore_network.network.id |
| 82 | + subnet_id = gcore_subnet.subnet.id |
| 83 | + //port_id = null |
| 84 | + //ip_address = null |
| 85 | + //fip_source = null |
| 86 | + //existing_fip_id = null |
| 87 | + } |
| 88 | +
|
| 89 | +
|
| 90 | + security_group { |
| 91 | + id = "d75db0b2-58f1-4a11-88c6-a932bb897310" |
| 92 | + name = "default" |
| 93 | + } |
| 94 | +
|
| 95 | + metadata { |
| 96 | + key = "some_key" |
| 97 | + value = "some_data" |
| 98 | + } |
| 99 | +
|
| 100 | + configuration { |
| 101 | + key = "some_key" |
| 102 | + value = "some_data" |
| 103 | + } |
| 104 | +
|
| 105 | + region_id = 1 |
| 106 | + project_id = 1 |
| 107 | +} |
| 108 | +``` |
| 109 | + |
| 110 | +<!-- schema generated by tfplugindocs --> |
| 111 | +## Schema |
| 112 | + |
| 113 | +### Required |
| 114 | + |
| 115 | +- **flavor_id** (String) |
| 116 | +- **interface** (Block Set, Min: 1) (see [below for nested schema](#nestedblock--interface)) |
| 117 | +- **volume** (Block Set, Min: 1) (see [below for nested schema](#nestedblock--volume)) |
| 118 | + |
| 119 | +### Optional |
| 120 | + |
| 121 | +- **addresses** (Block List) (see [below for nested schema](#nestedblock--addresses)) |
| 122 | +- **allow_app_ports** (Boolean) |
| 123 | +- **configuration** (Block List) (see [below for nested schema](#nestedblock--configuration)) |
| 124 | +- **flavor** (Map of String) |
| 125 | +- **id** (String) The ID of this resource. |
| 126 | +- **keypair_name** (String) |
| 127 | +- **last_updated** (String) |
| 128 | +- **metadata** (Block List) (see [below for nested schema](#nestedblock--metadata)) |
| 129 | +- **name** (String) |
| 130 | +- **name_templates** (List of String) |
| 131 | +- **password** (String) |
| 132 | +- **project_id** (Number) |
| 133 | +- **project_name** (String) |
| 134 | +- **region_id** (Number) |
| 135 | +- **region_name** (String) |
| 136 | +- **security_group** (Block List) Firewalls list (see [below for nested schema](#nestedblock--security_group)) |
| 137 | +- **status** (String) |
| 138 | +- **userdata** (String) |
| 139 | +- **username** (String) |
| 140 | +- **vm_state** (String) |
| 141 | + |
| 142 | +<a id="nestedblock--interface"></a> |
| 143 | +### Nested Schema for `interface` |
| 144 | + |
| 145 | +Optional: |
| 146 | + |
| 147 | +- **existing_fip_id** (String) |
| 148 | +- **fip_source** (String) |
| 149 | +- **ip_address** (String) |
| 150 | +- **network_id** (String) required if type is 'subnet' or 'any_subnet' |
| 151 | +- **port_id** (String) required if type is 'reserved_fixed_ip' |
| 152 | +- **subnet_id** (String) required if type is 'subnet' |
| 153 | +- **type** (String) Avalilable value is 'subnet', 'any_subnet', 'external', 'reserved_fixed_ip' |
| 154 | + |
| 155 | + |
| 156 | +<a id="nestedblock--volume"></a> |
| 157 | +### Nested Schema for `volume` |
| 158 | + |
| 159 | +Required: |
| 160 | + |
| 161 | +- **source** (String) Currently available only 'existing-volume' value |
| 162 | + |
| 163 | +Optional: |
| 164 | + |
| 165 | +- **attachment_tag** (String) |
| 166 | +- **boot_index** (Number) If boot_index==0 volumes can not detached |
| 167 | +- **delete_on_termination** (Boolean) |
| 168 | +- **id** (String) The ID of this resource. |
| 169 | +- **image_id** (String) |
| 170 | +- **name** (String) |
| 171 | +- **size** (Number) |
| 172 | +- **type_name** (String) |
| 173 | +- **volume_id** (String) |
| 174 | + |
| 175 | + |
| 176 | +<a id="nestedblock--addresses"></a> |
| 177 | +### Nested Schema for `addresses` |
| 178 | + |
| 179 | +Required: |
| 180 | + |
| 181 | +- **net** (Block List, Min: 1) (see [below for nested schema](#nestedblock--addresses--net)) |
| 182 | + |
| 183 | +<a id="nestedblock--addresses--net"></a> |
| 184 | +### Nested Schema for `addresses.net` |
| 185 | + |
| 186 | +Required: |
| 187 | + |
| 188 | +- **addr** (String) |
| 189 | +- **type** (String) |
| 190 | + |
| 191 | + |
| 192 | + |
| 193 | +<a id="nestedblock--configuration"></a> |
| 194 | +### Nested Schema for `configuration` |
| 195 | + |
| 196 | +Required: |
| 197 | + |
| 198 | +- **key** (String) |
| 199 | +- **value** (String) |
| 200 | + |
| 201 | + |
| 202 | +<a id="nestedblock--metadata"></a> |
| 203 | +### Nested Schema for `metadata` |
| 204 | + |
| 205 | +Required: |
| 206 | + |
| 207 | +- **key** (String) |
| 208 | +- **value** (String) |
| 209 | + |
| 210 | + |
| 211 | +<a id="nestedblock--security_group"></a> |
| 212 | +### Nested Schema for `security_group` |
| 213 | + |
| 214 | +Required: |
| 215 | + |
| 216 | +- **id** (String) Firewall unique id |
| 217 | +- **name** (String) |
| 218 | + |
| 219 | + |
0 commit comments