Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
T
tf_mod_aws_bastion
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Registry
Registry
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Commits
Open sidebar
steamhaus
tf_mod_aws_bastion
Commits
8066ab3c
Commit
8066ab3c
authored
Oct 01, 2020
by
Jamie Walker
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
no longer require availability_zones argument
parent
49e39431
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
16 additions
and
20 deletions
+16
-20
main.tf
main.tf
+16
-20
No files found.
main.tf
View file @
8066ab3c
variable
"availability_zones"
{
description
=
"List of availability zone in which the ECS cluster should reside"
type
=
"list"
}
variable
"vpc_id"
{
description
=
"ID of the VPC in which the ECS cluster should reside"
}
variable
"subnet_ids"
{
description
=
"List of subnets in which the ECS cluster should reside"
type
=
"list"
type
=
list
}
variable
"image_id"
{
...
...
@@ -34,7 +29,7 @@ variable "bastion_instances" {
resource
"aws_security_group"
"bastion"
{
name
=
"Bastion"
vpc_id
=
"
${
var
.
vpc_id
}
"
vpc_id
=
var
.
vpc_id
description
=
"Allows traffic from and to the Bastion EC2 instance"
ingress
{
...
...
@@ -68,39 +63,40 @@ resource "aws_security_group" "bastion" {
data
"template_file"
"userdata"
{
template
=
"
${
file
(
"
${
path
.
module}
/userdata.yml"
)
}
"
vars
{}
vars
=
{}
}
resource
"aws_launch_configuration"
"bastion"
{
name_prefix
=
"
${
format
(
"%s-"
,
"Bastion"
)
}
"
name_prefix
=
format
(
"%s-"
,
"Bastion"
)
image_id
=
"
${
var
.
image_id
}
"
instance_type
=
"
${
var
.
instance_type
}
"
key_name
=
"
${
var
.
key_name
}
"
security_groups
=
[
"
${
aws_security_group
.
bastion
.
id
}
"
]
user_data
=
"
${data
.
template_file
.
userdata
.
rendered
}
"
image_id
=
var
.
image_id
instance_type
=
var
.
instance_type
key_name
=
var
.
key_name
security_groups
=
[
aws_security_group
.
bastion
.
id
]
user_data
=
data
.
template_file
.
userdata
.
rendered
lifecycle
{
create_before_destroy
=
true
ignore_changes
=
[
"image_id"
,
image_id
,
]
}
}
resource
"aws_autoscaling_group"
"bastion"
{
name
=
"Bastion -
${
aws_launch_configuration
.
bastion
.
name
}
"
vpc_zone_identifier
=
[
"
${
var
.
subnet_ids
}
"
]
launch_configuration
=
"
${
aws_launch_configuration
.
bastion
.
id
}
"
min_size
=
"
${
var
.
bastion_instances
}
"
max_size
=
"
${
var
.
bastion_instances
}
"
desired_capacity
=
"
${
var
.
bastion_instances
}
"
vpc_zone_identifier
=
var
.
subnet_ids
launch_configuration
=
aws_launch_configuration
.
bastion
.
id
min_size
=
var
.
bastion_instances
max_size
=
var
.
bastion_instances
desired_capacity
=
var
.
bastion_instances
tag
{
key
=
"Name"
value
=
"Bastion"
propagate_at_launch
=
true
}
tag
{
key
=
"service"
value
=
"bastion"
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment