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

Commit 370cf8d

Browse files
committed
gcore_securitygroup added
1 parent 50b227d commit 370cf8d

File tree

10 files changed

+628
-3
lines changed

10 files changed

+628
-3
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.13"
21+
version = "~>0.0.14"
2222
}
2323
}
2424
}
Lines changed: 91 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,91 @@
1+
---
2+
# generated by https://github.com/hashicorp/terraform-plugin-docs
3+
page_title: "gcore_securitygroup Resource - terraform-provider-gcorelabs"
4+
subcategory: ""
5+
description: |-
6+
Represent SecurityGroups(Firewall)
7+
---
8+
9+
# gcore_securitygroup (Resource)
10+
11+
Represent SecurityGroups(Firewall)
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_securitygroup" "sg" {
24+
name = "test sg"
25+
region_id = 1
26+
project_id = 1
27+
28+
security_group_rules {
29+
direction = "egress"
30+
ethertype = "IPv4"
31+
protocol = "tcp"
32+
port_range_min = 19990
33+
port_range_max = 19990
34+
}
35+
36+
security_group_rules {
37+
direction = "ingress"
38+
ethertype = "IPv4"
39+
protocol = "tcp"
40+
port_range_min = 19990
41+
port_range_max = 19990
42+
}
43+
44+
security_group_rules {
45+
direction = "egress"
46+
ethertype = "IPv4"
47+
protocol = "vrrp"
48+
}
49+
}
50+
```
51+
52+
<!-- schema generated by tfplugindocs -->
53+
## Schema
54+
55+
### Required
56+
57+
- **name** (String)
58+
- **security_group_rules** (Block Set, Min: 1) Firewall rules control what inbound(ingress) and outbound(egress) traffic is allowed to enter or leave a Instance. At least one 'egress' rule should be set (see [below for nested schema](#nestedblock--security_group_rules))
59+
60+
### Optional
61+
62+
- **description** (String)
63+
- **id** (String) The ID of this resource.
64+
- **last_updated** (String)
65+
- **project_id** (Number)
66+
- **project_name** (String)
67+
- **region_id** (Number)
68+
- **region_name** (String)
69+
70+
<a id="nestedblock--security_group_rules"></a>
71+
### Nested Schema for `security_group_rules`
72+
73+
Required:
74+
75+
- **direction** (String) Available value is 'ingress', 'egress'
76+
- **ethertype** (String) Available value is 'IPv4', 'IPv6'
77+
- **protocol** (String) Available value is udp,tcp,any,icmp,ah,dccp,egp,esp,gre,igmp,ospf,pgm,rsvp,sctp,udplite,vrrp
78+
79+
Optional:
80+
81+
- **description** (String)
82+
- **port_range_max** (Number)
83+
- **port_range_min** (Number)
84+
85+
Read-Only:
86+
87+
- **created_at** (String)
88+
- **id** (String) The ID of this resource.
89+
- **updated_at** (String)
90+
91+

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.13"
6+
version = "~>0.0.14"
77
}
88
}
99
}
Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
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_securitygroup" "sg" {
9+
name = "test sg"
10+
region_id = 1
11+
project_id = 1
12+
13+
security_group_rules {
14+
direction = "egress"
15+
ethertype = "IPv4"
16+
protocol = "tcp"
17+
port_range_min = 19990
18+
port_range_max = 19990
19+
}
20+
21+
security_group_rules {
22+
direction = "ingress"
23+
ethertype = "IPv4"
24+
protocol = "tcp"
25+
port_range_min = 19990
26+
port_range_max = 19990
27+
}
28+
29+
security_group_rules {
30+
direction = "egress"
31+
ethertype = "IPv4"
32+
protocol = "vrrp"
33+
}
34+
}

gcore/provider.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,7 @@ func Provider() *schema.Provider {
4848
"gcore_lblistener": resourceLbListener(),
4949
"gcore_lbpool": resourceLBPool(),
5050
"gcore_lbmember": resourceLBMember(),
51+
"gcore_securitygroup": resourceSecurityGroup(),
5152
},
5253
ConfigureContextFunc: providerConfigure,
5354
}

0 commit comments

Comments
 (0)