Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
terraform
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Container registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
GitLab community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
702
HADOOP
terraform
Commits
a180810f
Commit
a180810f
authored
4 years ago
by
František Dvořák
Browse files
Options
Downloads
Patches
Plain Diff
Custom security groups
parent
0a5a3fa6
No related branches found
No related tags found
No related merge requests found
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
deploy.tf
+1
-0
1 addition, 0 deletions
deploy.tf
firewall.tf
+48
-0
48 additions, 0 deletions
firewall.tf
variables.tf
+27
-0
27 additions, 0 deletions
variables.tf
with
76 additions
and
0 deletions
deploy.tf
+
1
−
0
View file @
a180810f
...
...
@@ -31,6 +31,7 @@ resource "openstack_compute_instance_v2" "server" {
flavor_name
=
"standard.medium"
image_name
=
var
.
image
key_pair
=
var
.
ssh
security_groups
=
[
openstack_networking_secgroup_v2
.
secgroup
.
name
]
user_data
=
data
.
template_cloudinit_config
.
user_data
[
count
.
index
].
rendered
network
{
name
=
var
.
local_network
...
...
This diff is collapsed.
Click to expand it.
firewall.tf
0 → 100644
+
48
−
0
View file @
a180810f
resource
"openstack_networking_secgroup_v2"
"secgroup"
{
name
=
var
.
domain
description
=
"
${
title
(
var
.
domain
)}
security group"
}
resource
"openstack_networking_secgroup_rule_v2"
"secgroup_rule_self4"
{
direction
=
"ingress"
ethertype
=
"IPv4"
remote_group_id
=
openstack_networking_secgroup_v2
.
secgroup
.
id
security_group_id
=
openstack_networking_secgroup_v2
.
secgroup
.
id
}
resource
"openstack_networking_secgroup_rule_v2"
"secgroup_rule_self6"
{
direction
=
"ingress"
ethertype
=
"IPv6"
remote_group_id
=
openstack_networking_secgroup_v2
.
secgroup
.
id
security_group_id
=
openstack_networking_secgroup_v2
.
secgroup
.
id
}
resource
"openstack_networking_secgroup_rule_v2"
"secgroup_rule_icmp4"
{
direction
=
"ingress"
ethertype
=
"IPv4"
protocol
=
"icmp"
security_group_id
=
openstack_networking_secgroup_v2
.
secgroup
.
id
}
resource
"openstack_networking_secgroup_rule_v2"
"secgroup_rule_icmp6"
{
direction
=
"ingress"
ethertype
=
"IPv6"
protocol
=
"ipv6-icmp"
security_group_id
=
openstack_networking_secgroup_v2
.
secgroup
.
id
}
resource
"openstack_networking_secgroup_rule_v2"
"secgroup_rule_other4"
{
for_each
=
var
.
security_trusted_cidr4
direction
=
"ingress"
ethertype
=
"IPv4"
remote_ip_prefix
=
each
.
key
security_group_id
=
openstack_networking_secgroup_v2
.
secgroup
.
id
}
resource
"openstack_networking_secgroup_rule_v2"
"secgroup_rule_other6"
{
for_each
=
var
.
security_trusted_cidr6
direction
=
"ingress"
ethertype
=
"IPv6"
remote_ip_prefix
=
each
.
key
security_group_id
=
openstack_networking_secgroup_v2
.
secgroup
.
id
}
This diff is collapsed.
Click to expand it.
variables.tf
+
27
−
0
View file @
a180810f
...
...
@@ -44,6 +44,33 @@ variable "public_network" {
# default = "public-cesnet-78-128-250-PERSONAL"
}
variable
"security_trusted_cidr4"
{
description
=
"Trusted networks"
type
=
set
(
string
)
default
=
[
"78.128.128.0/17"
,
# CESNET
"116.216.0.0/15"
,
# UNOB, JČU
"146.102.0.0/16"
,
# VŠE
"147.32.0.0/15"
,
# ČVUT, VSCHT
"147.228.0.0/14"
,
# ZČU, VUT, TUL, AVČR
"147.251.0.0/16"
,
# MUNI
"158.194.0.0/16"
,
# UPOL
"158.196.0.0/16"
,
# VŠB
"193.84.32.0/20"
,
# ČZU
"193.84.192.0/19"
,
# SLU
"195.113.0.0/16"
,
# CESNET
"195.178.64.0/19"
,
# CESNET
]
}
variable
"security_trusted_cidr6"
{
description
=
"Trusted networks"
type
=
set
(
string
)
default
=
[
"2001:718::/32"
,
# CESNET
]
}
variable
"ssh"
{
description
=
"SSH key name"
default
=
"openstack"
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment