Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Totango features #121

Open
wants to merge 5 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 11 additions & 0 deletions packer/elasticsearch7-node.packer.json
Original file line number Diff line number Diff line change
Expand Up @@ -105,6 +105,17 @@
{
"type": "shell",
"script": "install-custom.sh"
},
{
"type": "shell",
"environment_vars": [ "NR_LICENSE={{user `nr_license`}}" ],
"script": "install-newrelic.sh"
},
{
"type": "shell",
"environment_vars": [ "SUMO_ACCESS_ID={{user `sumo_acccess_id`}}",
"SUMO_ACCESS_KEY={{user `sumo_acccess_key`}}" ],
"script": "install-sumo.sh"
}
]
}
9 changes: 9 additions & 0 deletions packer/install-newrelic.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
#!/bin/bash
set -e

curl -fsSL https://download.newrelic.com/infrastructure_agent/gpg/newrelic-infra.gpg | sudo gpg --dearmor -o /etc/apt/trusted.gpg.d/newrelic-infra.gpg
echo "deb https://download.newrelic.com/infrastructure_agent/linux/apt focal main" | sudo tee -a /etc/apt/sources.list.d/newrelic-infra.list
sudo apt update
sudo apt-get install newrelic-infra -y
echo $NR_LICENSE | sudo tee -a /etc/newrelic-infra.yml

6 changes: 6 additions & 0 deletions packer/install-sumo.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
#!/bin/bash
set -e

curl -o /tmp/SumoCollector.sh https://collectors.us2.sumologic.com/rest/download/linux/64
chmod +x /tmp/SumoCollector.sh
sudo /tmp/SumoCollector.sh -q -Vsumo.accessid=$SUMO_ACCESS_ID -Vsumo.accesskey=$SUMO_ACCESS_KEY
3 changes: 3 additions & 0 deletions packer/variables.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
{
"elasticsearch_version": "",
"nr_license": "",
"sumo_acccess_id": "",
"sumo_acccess_key": "",

"aws_region": "us-east-1",
"aws_az": "us-east-1d",
Expand Down
1 change: 1 addition & 0 deletions terraform-aws/datas.tf
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@ resource "aws_autoscaling_group" "data_nodes" {
desired_capacity = var.datas_count[keys(var.datas_count)[count.index]]
default_cooldown = 30
force_delete = true
protect_from_scale_in = var.protect_data_from_scale_in

vpc_zone_identifier = local.cluster_subnet_ids[keys(var.datas_count)[count.index]]

Expand Down
3 changes: 3 additions & 0 deletions terraform-aws/main.tf
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
provider "aws" {
region = var.aws_region
default_tags {
tags = var.global_tags
}
}

resource "random_string" "vm-login-password" {
Expand Down
16 changes: 14 additions & 2 deletions terraform-aws/variables.tf
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,12 @@ variable "vpc_id" {
type = string
}

variable "global_tags" {
description = "Tags which are propgated to all resources that support tags excluding auto scalling groups"
type = map(string)
default = {}
}

variable "clients_subnet_ids" {
description = "Subnets to run client nodes in, defined as avalabilityZone -> subnets mapping. Will autofill to all available subnets in AZ when left empty."
type = map(list(string))
Expand Down Expand Up @@ -112,7 +118,7 @@ variable "client_user" {
variable "public_facing" {
description = "Whether or not the created cluster should be accessible from the public internet"
type = bool
default = true
default = false
}

# the ability to add additional existing security groups. In our case
Expand Down Expand Up @@ -205,4 +211,10 @@ variable "log_size" {
variable "log_level" {
description = "log4j log level"
default = "WARN"
}
}

variable "protect_data_from_scale_in" {
description = "Protect data instances from scale in events"
type = bool
default = true
}