Skip to content

Instantly share code, notes, and snippets.

View swade1987's full-sized avatar

Steve Wade swade1987

View GitHub Profile
resource "aws_security_group" "consul_server" {
name = "consul-server-security-group"
description = "Consul internal traffic + maintenance."
// These are for internal traffic
ingress {
from_port = 0
to_port = 65535
protocol = "tcp"
self = true
# Pull the consul image from Docker Hub (https://hub.docker.com/_/consul/)
sudo docker pull consul
# Create a consul server container binding port 8500
sudo docker run -d \
-p 8500:8500 \
-e 'CONSUL_LOCAL_CONFIG={"skip_leave_on_interrupt": true}' \
consul agent \
-server \
-ui \
@swade1987
swade1987 / consul container command
Last active May 18, 2016 14:47
unable to browse to ip:8500/ui
sudo docker run -d --net=host -e 'CONSUL_LOCAL_CONFIG={"skip_leave_on_interrupt": true}' consul agent -server -ui -bind=$instance_ip -retry-join=$instance_ip -bootstrap
all: build push
build:
docker build -t swade1987/find_your_mp .
push:
docker push swade1987/find_your_mp
Stevens-MacBook-Pro:find_your_mp stevenwade$ docker run find_your_mp
--> Downloading a Phusion Passenger agent binary for your platform
--> Installing Nginx 1.10.0 engine
--------------------------
[passenger_native_support.so] trying to compile for the current user (root) and Ruby interpreter...
(set PASSENGER_COMPILE_NATIVE_SUPPORT_BINARY=0 to disable)
Compilation successful. The logs are here:
Step 4 : RUN set -ex && for key in 9554F04D7259F04124DE6B476D5A82AC7E37093B 94AE36675C464D64BAFA68DD7434390BDBE9B9C5 0034A06D9D9B0064CE8ADF6BF1747F4AD2306D93 FD3A5288F042B6850C66B31F09FE44734EB7990E 71DCFD284A79C3B38668286BC97EC7A07EDE3FC1 DD8F2338BAE7501E3DD5AC78C273792F7D83545D B9AE9905FFD7803F25714661B63B535A4C206CA9 C4F0DFFF4E8C1A8236409D08E73BC641CC11F4C8 ; do gpg --keyserver ha.pool.sks-keyservers.net --recv-keys "$key"; done
---> Running in 431f31475481
+ gpg --keyserver ha.pool.sks-keyservers.net --recv-keys 9554F04D7259F04124DE6B476D5A82AC7E37093B
gpg: directory `/root/.gnupg' created
gpg: new configuration file `/root/.gnupg/gpg.conf' created
gpg: WARNING: options in `/root/.gnupg/gpg.conf' are not yet active during this run
gpg: keyring `/root/.gnupg/secring.gpg' created
gpg: keyring `/root/.gnupg/pubring.gpg' created
gpg: requesting key 7E37093B from hkp server ha.pool.sks-keyservers.net
@swade1987
swade1987 / docker run output
Created May 10, 2016 15:28
docker run output
Stevens-MacBook-Pro:find_your_mp stevenwade$ docker run find_your_mp
--> Downloading a Phusion Passenger agent binary for your platform
--> Installing Nginx 1.10.0 engine
--------------------------
[passenger_native_support.so] trying to compile for the current user (root) and Ruby interpreter...
(set PASSENGER_COMPILE_NATIVE_SUPPORT_BINARY=0 to disable)
Compilation successful. The logs are here:
@swade1987
swade1987 / build.log
Created May 8, 2016 14:39
build output
1462717499,,ui,say,amazon-ebs output will be in this color.
1462717499,,ui,say,
1462717499,,ui,say,==> amazon-ebs: Prevalidating AMI Name...
1462717499,,ui,say,==> amazon-ebs: Inspecting the source AMI...
1462717499,,ui,say,==> amazon-ebs: Creating temporary keypair: packer 572f4c3b-b751-752c-eab3-bed4dd329063
1462717500,,ui,say,==> amazon-ebs: Creating temporary security group for this instance...
1462717500,,ui,say,==> amazon-ebs: Authorizing access to port 22 the temporary security group...
1462717500,,ui,say,==> amazon-ebs: Launching a source AWS instance...
1462717501,,ui,message, amazon-ebs: Instance ID: i-c202b84e
1462717501,,ui,say,==> amazon-ebs: Waiting for instance (i-c202b84e) to become ready...
resource "aws_security_group" "gocd_elb" {
name = "gocd-ui-elb-sg"
description = "Security group for the gocd UI ELBs"
vpc_id = "${var.vpc_id}"
tags {
Name = "gocd (ELB)"
}
# HTTP
# Security group for traffic into the ELB
resource "aws_security_group" "ingress_to_elb" {
name = "gocd agent - traffic to elb"
description = "gocd agent - traffic to elb"
vpc_id = "${var.vpc_id}"
ingress {
from_port = 8153
to_port = 8153