Skip to content

Instantly share code, notes, and snippets.

:octocat:

Elliot Forbes elliotforbes

:octocat:
Block or report user

Report or block elliotforbes

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
View simple-mutation.go
package main
import (
"encoding/json"
"fmt"
"log"
"github.com/graphql-go/graphql"
)
View main.go
package main
import (
"encoding/json"
"fmt"
"log"
"github.com/graphql-go/graphql"
)
View main.go
package main
import (
"fmt"
"log"
"net/http"
)
func main() {
http.HandleFunc("/", func(w http.ResponseWriter, r *http.Request) {
View elb.tf
resource "aws_autoscaling_group" "example" {
launch_configuration = "${aws_launch_configuration.example.id}"
load_balancers = ["${aws_elb.example.name}"]
availability_zones = ["eu-west-1b", "eu-west-1a"]
min_size = 2
max_size = 5
tag {
key = "Name"
View autoscaler.tf
provider "aws" {
region = "eu-west-1"
}
data "aws_availability_zones" "available" {}
resource "aws_security_group" "instance" {
name = "go-api-instance"
ingress {
View test.tf
provider "aws" {
access_key = "ACCESS_KEY_HERE"
secret_key = "SECRET_KEY_HERE"
region = "us-east-1"
}
resource "aws_instance" "example" {
ami = "ami-2757f631"
instance_type = "t2.micro"
}
View Dockerfile
FROM golang:latest
RUN mkdir /app
ADD ./pkg /app/
WORKDIR /app
RUN go get "github.com/gorilla/mux"
RUN go build -o main .
CMD ["/app/main"]
View main.go
package main
import (
"fmt"
"log"
"net/http"
"github.com/gorilla/mux"
)
View elb.tf
resource "aws_autoscaling_group" "example" {
launch_configuration = "${aws_launch_configuration.example.id}"
load_balancers = ["${aws_elb.example.name}"]
availability_zones = ["eu-west-1b", "eu-west-1a"]
min_size = 2
max_size = 5
tag {
key = "Name"
View launch-config.tf
provider "aws" {
region = "eu-west-1"
}
data "aws_availability_zones" "available" {}
resource "aws_security_group" "instance" {
name = "go-api-instance"
ingress {
You can’t perform that action at this time.