This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
resource "template_file" "registry-service" { | |
filename = "registry.service.tpl" | |
vars { | |
region = "${var.region}" | |
id = "${aws_iam_access_key.registry.id}" | |
secret = "${aws_iam_access_key.registry.secret}" | |
bucket = "${aws_s3_bucket.registry.bucket}" | |
} | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
variable "region" { | |
default = "us-east-1" | |
} | |
variable "subnets" { | |
default { | |
"0" = "b" | |
"1" = "c" | |
"2" = "d" | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
variable "subnets" { | |
default = { | |
us-east-1 = { | |
"0" = "b" | |
"1" = "c" | |
"2" = "d" | |
} | |
us-west-2 = { | |
"0" = "a" | |
"1" = "b" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
resource "aws_instance" "registry" { | |
ami = "${var.ami}" | |
key_name = "psev" | |
instance_type = "t2.small" | |
subnet_id = "${element(aws_subnet.registry.*.id, 1)}" | |
vpc_security_group_ids = [ "${aws_security_group.registry.id}" ] | |
associate_public_ip_address = true | |
provisioner "remote-exec" { | |
inline = [ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
provisioner "remote-exec" { | |
inline = [ | |
"echo \"HOSTNAME=${var.cluster}-${count.index}\" >> /etc/environment", | |
"echo \"ECS_CLUSTER=${var.cluster}\" >> /etc/environment", | |
"echo \"ECS_REGISTRY=${var.registry}\" >> /etc/environment", | |
"echo \"ECS_AUTH=${var.auth}\" >> /etc/environment", | |
"echo \"ECS_EMAIL=${var.email}\" >> /etc/environment", | |
"echo \"NEWRELIC_TOKEN=${var.newrelic}\" >> /etc/environment", | |
"echo \"LOGENTRIES_TOKEN=${var.logentries}\" >> /etc/environment", | |
"echo \"TAGS=base,ecs\" >> /etc/environment" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
- name: wait for node to become active | |
wait_for: host=0.0.0.0 port=9160 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[Unit] | |
Description=Tomcat 8 servlet container | |
After=network.target | |
[Service] | |
Type=forking | |
PIDFile=/var/run/tomcat8.pid | |
Environment=CATALINA_PID=/var/run/tomcat8.pid | |
Environment=TOMCAT_JAVA_HOME=/usr/lib/jvm/default-runtime | |
Environment=CATALINA_HOME=/usr/share/tomcat8 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[Unit] | |
Description=Sakai | |
After=network.target | |
[Service] | |
Type=forking | |
EnvironmentFile=/var/sakai/%i/environment | |
Environment=CATALINA_RUN=/var/run/%i | |
Environment=CATALINA_TEMP=/var/tmp/%i | |
Environment=CATALINA_BASE=/var/sakai/%i |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
stream | |
|from() | |
.measurement('cpu') | |
// create a new field called 'used' which inverts the idle cpu. | |
|eval(lambda: 100.0 - "usage_idle") | |
.as('used') | |
|groupBy('service', 'datacenter') | |
|window() | |
.period(1m) | |
.every(1m) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
func jsonResponse(w http.ResponseWriter, code int, err interface{}) int { | |
<<<<<<< HEAD | |
http.Error(w, fmt.Sprintf("{\"error\" : %s }", strconv.Quote(fmt.Sprintf("%s", err))), code) | |
======= | |
w.Header().Set("Content-Type", contentTypeJSON) | |
w.Write([]byte(`{"error": `)) | |
json.NewEncoder(w).Encode(fmt.Sprint(err)) | |
w.Write([]byte(`}`)) | |
>>>>>>> e65d1557262c9b485336c3df7f35c049839ac497 | |
return code |