File tree 8 files changed +95
-0
lines changed
8 files changed +95
-0
lines changed Original file line number Diff line number Diff line change
1
+ resource "exoscale_security_group" "sks-security-group" {
2
+ name = var. name
3
+ description = var. description
4
+ external_sources = var. external_sources
5
+ }
Original file line number Diff line number Diff line change
1
+ output "id" {
2
+ value = exoscale_security_group. sks-security-group . id
3
+ }
Original file line number Diff line number Diff line change
1
+ variable "name" {
2
+ description = " (Required) The security group name."
3
+ type = string
4
+ }
5
+
6
+ variable "description" {
7
+ description = " A free-form text describing the group."
8
+ type = string
9
+ }
10
+
11
+ variable "external_sources" {
12
+ description = " A list of external network sources, in CIDR notation."
13
+ type = list (string )
14
+ default = []
15
+ }
Original file line number Diff line number Diff line change
1
+ terraform {
2
+ required_providers {
3
+ exoscale = {
4
+ source = " exoscale/exoscale"
5
+ }
6
+ }
7
+ }
Original file line number Diff line number Diff line change
1
+ resource "exoscale_security_group_rule" "nodeport-services-ipv4" {
2
+ security_group_id = var. security_group_id
3
+ description = " NodePort services IPv4 - Managed by Terraform"
4
+ type = " INGRESS"
5
+ protocol = " TCP"
6
+ cidr = " 0.0.0.0/0"
7
+ start_port = 30000
8
+ end_port = 32767
9
+ }
10
+
11
+ resource "exoscale_security_group_rule" "nodeport-services-ipv6" {
12
+ security_group_id = var. security_group_id
13
+ description = " NodePort services IPv6 - Managed by Terraform"
14
+ type = " INGRESS"
15
+ protocol = " TCP"
16
+ cidr = " ::/0"
17
+ start_port = 30000
18
+ end_port = 32767
19
+ }
20
+
21
+ resource "exoscale_security_group_rule" "sks-kubelet" {
22
+ security_group_id = var. security_group_id
23
+ description = " SKS kubelet - Managed by Terraform"
24
+ type = " INGRESS"
25
+ protocol = " TCP"
26
+ start_port = 10250
27
+ end_port = 10250
28
+ user_security_group_id = var. security_group_id
29
+ }
30
+
31
+ resource "exoscale_security_group_rule" "calico" {
32
+ security_group_id = var. security_group_id
33
+ description = " Calico traffic - Managed by Terraform"
34
+ type = " INGRESS"
35
+ protocol = " UDP"
36
+ start_port = 4789
37
+ end_port = 4789
38
+ user_security_group_id = var. security_group_id
39
+ }
Original file line number Diff line number Diff line change
1
+ output "nodeport-services-ipv4" {
2
+ value = exoscale_security_group_rule. nodeport-services-ipv4 . id
3
+ }
4
+
5
+ output "nodeport-services-ipv6" {
6
+ value = exoscale_security_group_rule. nodeport-services-ipv6 . id
7
+ }
8
+
9
+ output "sks-kubelet" {
10
+ value = exoscale_security_group_rule. sks-kubelet . id
11
+ }
12
+
13
+ output "calico_id" {
14
+ value = exoscale_security_group_rule. calico . id
15
+ }
Original file line number Diff line number Diff line change
1
+ variable "security_group_id" {
2
+ description = " (Required) The parent exoscale_security_group ID."
3
+ type = string
4
+ }
Original file line number Diff line number Diff line change
1
+ terraform {
2
+ required_providers {
3
+ exoscale = {
4
+ source = " exoscale/exoscale"
5
+ }
6
+ }
7
+ }
You can’t perform that action at this time.
0 commit comments