Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
T
tf_mod_aws_elasticsearch
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Registry
Registry
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
steamhaus
tf_mod_aws_elasticsearch
Commits
df4aea33
Commit
df4aea33
authored
Apr 21, 2017
by
A-Gordon
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Initial Commit
parents
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
124 additions
and
0 deletions
+124
-0
access_policy.json
access_policy.json
+31
-0
main.tf
main.tf
+93
-0
No files found.
access_policy.json
0 → 100644
View file @
df4aea33
{
"Version"
:
"2012-10-17"
,
"Statement"
:
[
{
"Effect"
:
"Allow"
,
"Principal"
:
{
"AWS"
:
"*"
},
"Action"
:
"es:*"
,
"Condition"
:
{
"IpAddress"
:
{
"aws:SourceIp"
:
[
"${other_ips}"
]
}
}
},
{
"Sid"
:
""
,
"Effect"
:
"Allow"
,
"Principal"
:
{
"AWS"
:
"*"
},
"Action"
:
"es:*"
,
"Condition"
:
{
"IpAddress"
:
{
"aws:SourceIp"
:
$
{
nat_ips
}
}
}
}
]
}
\ No newline at end of file
main.tf
0 → 100644
View file @
df4aea33
variable
environment
{}
variable
name
{}
variable
nat_gateway_ips
{}
variable
access_ips
{}
variable
private_dns_zone
{}
variable
private_dns_address
{}
variable
public_dns_zone
{}
variable
public_dns_address
{}
variable
elasticsearch_version
{
default
=
"1.5"
}
variable
automated_snapshot_start_hour
{
default
=
"02"
}
# EBS options
variable
ebs_enabled
{
default
=
"true"
}
variable
ebs_volume_type
{
default
=
"gp2"
}
variable
ebs_volume_size
{
default
=
"20"
}
# Cluster config
# If zone awareness is enabled then an even number of data nodes is required.
# Dedicated master count should be greater than 1
variable
instance_type
{
default
=
"t2.micro.elasticsearch"
}
variable
instance_count
{
default
=
"2"
}
variable
zone_awareness_enabled
{
default
=
"true"
}
variable
dedicated_master_enabled
{
default
=
"true"
}
variable
dedicated_master_type
{
default
=
"t2.micro.elasticsearch"
}
variable
dedicated_master_count
{
default
=
"2"
}
data
"template_file"
"access_policy"
{
template
=
"
${
file
(
"
${
path
.
module}
/access_policy.json"
)
}
"
vars
{
nat_ips
=
"
${
jsonencode
(
split
(
","
,
var
.
nat_gateway_ips
))
}
"
other_ips
=
"
${
var
.
access_ips
}
"
}
}
# Add var for domain name
resource
"aws_elasticsearch_domain"
"elasticsearch"
{
domain_name
=
"es-
${
var
.
name
}
-
${
var
.
environment
}
"
elasticsearch_version
=
"
${
var
.
elasticsearch_version
}
"
ebs_options
{
ebs_enabled
=
"
${
var
.
ebs_enabled
}
"
volume_type
=
"
${
var
.
ebs_volume_type
}
"
volume_size
=
"
${
var
.
ebs_volume_size
}
"
#iops - (Optional) The baseline input/output (I/O) performance of EBS volumes attached to data nodes. Applicable only for the Provisioned IOPS EBS volume type.
}
snapshot_options
{
automated_snapshot_start_hour
=
"
${
var
.
automated_snapshot_start_hour
}
"
}
access_policies
=
"
${data
.
template_file
.
access_policy
.
rendered
}
"
cluster_config
{
instance_type
=
"
${
var
.
instance_type
}
"
instance_count
=
"
${
var
.
instance_count
}
"
zone_awareness_enabled
=
"
${
var
.
zone_awareness_enabled
}
"
dedicated_master_enabled
=
"
${
var
.
dedicated_master_enabled
}
"
dedicated_master_type
=
"
${
var
.
dedicated_master_type
}
"
dedicated_master_count
=
"
${
var
.
dedicated_master_count
}
"
}
tags
{
Name
=
"
${
var
.
name
}
-
${
var
.
environment
}
-elasticsearch"
environment
=
"
${
var
.
name
}
-
${
var
.
environment
}
"
version
=
"
${
var
.
elasticsearch_version
}
"
}
lifecycle
{
# TODO: Remove this to update access policies for ElasticSearch LUL.
# It is in place because of diff errors for this field causing ElasticSearch rebuilds on every provisioning
ignore_changes
=
[
"access_policies"
]
}
}
resource
"aws_route53_record"
"public"
{
zone_id
=
"
${
var
.
public_dns_zone
}
"
name
=
"
${
var
.
public_dns_address
}
"
type
=
"CNAME"
ttl
=
60
records
=
[
"
${
aws_elasticsearch_domain
.
elasticsearch
.
endpoint
}
"
]
}
resource
"aws_route53_record"
"private"
{
zone_id
=
"
${
var
.
private_dns_zone
}
"
name
=
"
${
var
.
private_dns_address
}
"
type
=
"CNAME"
ttl
=
60
records
=
[
"
${
aws_elasticsearch_domain
.
elasticsearch
.
endpoint
}
"
]
}
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