Skip to content
This repository was archived by the owner on Mar 1, 2023. It is now read-only.

Commit 2910831

Browse files
committed
gcore_baremetal added
1 parent 370cf8d commit 2910831

File tree

10 files changed

+814
-9
lines changed

10 files changed

+814
-9
lines changed

docs/index.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ terraform {
1818
required_providers {
1919
gcore = {
2020
source = "local.gcorelabs.com/repo/gcore"
21-
version = "~>0.0.14"
21+
version = "~>0.0.15"
2222
}
2323
}
2424
}

docs/resources/gcore_baremetal.md

Lines changed: 128 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,128 @@
1+
---
2+
# generated by https://github.com/hashicorp/terraform-plugin-docs
3+
page_title: "gcore_baremetal Resource - terraform-provider-gcorelabs"
4+
subcategory: ""
5+
description: |-
6+
Represent baremetal instance
7+
---
8+
9+
# gcore_baremetal (Resource)
10+
11+
Represent baremetal instance
12+
13+
## Example Usage
14+
15+
```terraform
16+
provider gcore {
17+
user_name = "test"
18+
password = "test"
19+
gcore_platform = "https://api.gcdn.co"
20+
gcore_api = "https://api.cloud.gcorelabs.com"
21+
}
22+
23+
resource "gcore_baremetal" "bm" {
24+
name = "test bm instance"
25+
region_id = 1
26+
project_id = 1
27+
flavor_id = "bm1-infrastructure-small"
28+
image_id = "1ee7ccee-5003-48c9-8ae0-d96063af75b2" // your image id
29+
30+
//additional interface, 'subnet' only, 'external' interface create automatically
31+
// interface {
32+
// type = "subnet"
33+
// network_id = "9c7867fb-f404-4a2d-8bb5-24acf2fccaf1" //your network_id
34+
// subnet_id = "b68ea6e2-c2b6-4a8d-95eb-7194d12a2156" // your subnet_id
35+
// }
36+
37+
keypair_name = "test" // your keypair name
38+
}
39+
```
40+
41+
<!-- schema generated by tfplugindocs -->
42+
## Schema
43+
44+
### Required
45+
46+
- **flavor_id** (String)
47+
- **name** (String)
48+
49+
### Optional
50+
51+
- **app_config** (Map of String)
52+
- **apptemplate_id** (String)
53+
- **id** (String) The ID of this resource.
54+
- **image_id** (String)
55+
- **interface** (Block Set) (see [below for nested schema](#nestedblock--interface))
56+
- **keypair_name** (String)
57+
- **last_updated** (String)
58+
- **metadata** (Block List) (see [below for nested schema](#nestedblock--metadata))
59+
- **name_templates** (String)
60+
- **password** (String)
61+
- **project_id** (Number)
62+
- **project_name** (String)
63+
- **region_id** (Number)
64+
- **region_name** (String)
65+
- **timeouts** (Block, Optional) (see [below for nested schema](#nestedblock--timeouts))
66+
- **user_data** (String)
67+
- **username** (String)
68+
69+
### Read-Only
70+
71+
- **addresses** (List of Object) (see [below for nested schema](#nestedatt--addresses))
72+
- **flavor** (Map of String)
73+
- **status** (String)
74+
- **vm_state** (String)
75+
76+
<a id="nestedblock--interface"></a>
77+
### Nested Schema for `interface`
78+
79+
Required:
80+
81+
- **type** (String) Avalilable value is 'subnet', 'external'
82+
83+
Optional:
84+
85+
- **existing_fip_id** (String)
86+
- **fip_source** (String)
87+
- **network_id** (String) required if type is 'subnet' or 'any_subnet'
88+
- **subnet_id** (String) required if type is 'subnet'
89+
90+
Read-Only:
91+
92+
- **ip_address** (String)
93+
- **port_id** (String)
94+
95+
96+
<a id="nestedblock--metadata"></a>
97+
### Nested Schema for `metadata`
98+
99+
Required:
100+
101+
- **key** (String)
102+
- **value** (String)
103+
104+
105+
<a id="nestedblock--timeouts"></a>
106+
### Nested Schema for `timeouts`
107+
108+
Optional:
109+
110+
- **create** (String)
111+
112+
113+
<a id="nestedatt--addresses"></a>
114+
### Nested Schema for `addresses`
115+
116+
Read-Only:
117+
118+
- **net** (List of Object) (see [below for nested schema](#nestedobjatt--addresses--net))
119+
120+
<a id="nestedobjatt--addresses--net"></a>
121+
### Nested Schema for `addresses.net`
122+
123+
Read-Only:
124+
125+
- **addr** (String)
126+
- **type** (String)
127+
128+

examples/provider/provider.tf

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ terraform {
33
required_providers {
44
gcore = {
55
source = "local.gcorelabs.com/repo/gcore"
6-
version = "~>0.0.14"
6+
version = "~>0.0.15"
77
}
88
}
99
}
Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
provider gcore {
2+
user_name = "test"
3+
password = "test"
4+
gcore_platform = "https://api.gcdn.co"
5+
gcore_api = "https://api.cloud.gcorelabs.com"
6+
}
7+
8+
resource "gcore_baremetal" "bm" {
9+
name = "test bm instance"
10+
region_id = 1
11+
project_id = 1
12+
flavor_id = "bm1-infrastructure-small"
13+
image_id = "1ee7ccee-5003-48c9-8ae0-d96063af75b2" // your image id
14+
15+
//additional interface, 'subnet' only, 'external' interface create automatically
16+
// interface {
17+
// type = "subnet"
18+
// network_id = "9c7867fb-f404-4a2d-8bb5-24acf2fccaf1" //your network_id
19+
// subnet_id = "b68ea6e2-c2b6-4a8d-95eb-7194d12a2156" // your subnet_id
20+
// }
21+
22+
keypair_name = "test" // your keypair name
23+
}

gcore/provider.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,7 @@ func Provider() *schema.Provider {
4949
"gcore_lbpool": resourceLBPool(),
5050
"gcore_lbmember": resourceLBMember(),
5151
"gcore_securitygroup": resourceSecurityGroup(),
52+
"gcore_baremetal": resourceBmInstance(),
5253
},
5354
ConfigureContextFunc: providerConfigure,
5455
}

0 commit comments

Comments
 (0)