Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
T
terraform-aws-ec2-instance
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Packages
Packages
Container Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Terraform Modules
terraform-aws-ec2-instance
Commits
9d31a735
Unverified
Commit
9d31a735
authored
Jun 14, 2019
by
Anton Babenko
Committed by
GitHub
Jun 14, 2019
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Added support for the list of private_ips (fixes #102) (#103)
parent
f43568fa
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
19 additions
and
6 deletions
+19
-6
main.tf
examples/basic/main.tf
+1
-0
main.tf
main.tf
+12
-6
variables.tf
variables.tf
+6
-0
No files found.
examples/basic/main.tf
View file @
9d31a735
...
@@ -67,6 +67,7 @@ module "ec2" {
...
@@ -67,6 +67,7 @@ module "ec2" {
ami
=
data
.
aws_ami
.
amazon_linux
.
id
ami
=
data
.
aws_ami
.
amazon_linux
.
id
instance_type
=
"c5.large"
instance_type
=
"c5.large"
subnet_id
=
tolist
(
data
.
aws_subnet_ids
.
all
.
ids
)
[
0
]
subnet_id
=
tolist
(
data
.
aws_subnet_ids
.
all
.
ids
)
[
0
]
private_ip
=
[
"123.0.0.1"
,
"123.0.0.2"
]
vpc_security_group_ids
=
[
module
.
security_group
.
this_security_group_id
]
vpc_security_group_ids
=
[
module
.
security_group
.
this_security_group_id
]
associate_public_ip_address
=
true
associate_public_ip_address
=
true
placement_group
=
aws_placement_group
.
web
.
id
placement_group
=
aws_placement_group
.
web
.
id
...
...
main.tf
View file @
9d31a735
...
@@ -24,9 +24,12 @@ resource "aws_instance" "this" {
...
@@ -24,9 +24,12 @@ resource "aws_instance" "this" {
iam_instance_profile
=
var
.
iam_instance_profile
iam_instance_profile
=
var
.
iam_instance_profile
associate_public_ip_address
=
var
.
associate_public_ip_address
associate_public_ip_address
=
var
.
associate_public_ip_address
private_ip
=
var
.
private_ip
private_ip
=
element
(
ipv6_address_count
=
var
.
ipv6_address_count
distinct
(
compact
(
concat
(
[
var
.
private_ip
]
,
var
.
private_ips
))),
ipv6_addresses
=
var
.
ipv6_addresses
count
.
index
,
)
ipv6_address_count
=
var
.
ipv6_address_count
ipv6_addresses
=
var
.
ipv6_addresses
ebs_optimized
=
var
.
ebs_optimized
ebs_optimized
=
var
.
ebs_optimized
...
@@ -110,9 +113,12 @@ resource "aws_instance" "this_t2" {
...
@@ -110,9 +113,12 @@ resource "aws_instance" "this_t2" {
iam_instance_profile
=
var
.
iam_instance_profile
iam_instance_profile
=
var
.
iam_instance_profile
associate_public_ip_address
=
var
.
associate_public_ip_address
associate_public_ip_address
=
var
.
associate_public_ip_address
private_ip
=
var
.
private_ip
private_ip
=
element
(
ipv6_address_count
=
var
.
ipv6_address_count
distinct
(
compact
(
concat
(
[
var
.
private_ip
]
,
var
.
private_ips
))),
ipv6_addresses
=
var
.
ipv6_addresses
count
.
index
,
)
ipv6_address_count
=
var
.
ipv6_address_count
ipv6_addresses
=
var
.
ipv6_addresses
ebs_optimized
=
var
.
ebs_optimized
ebs_optimized
=
var
.
ebs_optimized
...
...
variables.tf
View file @
9d31a735
...
@@ -90,6 +90,12 @@ variable "private_ip" {
...
@@ -90,6 +90,12 @@ variable "private_ip" {
default
=
""
default
=
""
}
}
variable
"private_ips"
{
description
=
"A list of private IP address to associate with the instance in a VPC. Should match the number of instances."
type
=
list
(
string
)
default
=
[]
}
variable
"source_dest_check"
{
variable
"source_dest_check"
{
description
=
"Controls if traffic is routed to the instance when the destination address does not match the instance. Used for NAT or VPNs."
description
=
"Controls if traffic is routed to the instance when the destination address does not match the instance. Used for NAT or VPNs."
type
=
bool
type
=
bool
...
...
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