Skip to content

Instantly share code, notes, and snippets.

View elliotforbes's full-sized avatar
:octocat:

Elliot Forbes elliotforbes

:octocat:
View GitHub Profile
package main
import (
"encoding/json"
"fmt"
"log"
"github.com/graphql-go/graphql"
)
package main
import (
"encoding/json"
"fmt"
"log"
"net/http"
"github.com/gorilla/mux"
"github.com/jinzhu/gorm"
package main
import (
"encoding/json"
"fmt"
"log"
"github.com/graphql-go/graphql"
)
from datetime import date, timedelta
from aiohttp import web
import aiohttp_cors
import boto3
import re
app = web.Application()
cors = aiohttp_cors.setup(app)
AWS_ACCESS_KEY_ID=''
provider "aws" {
region = "eu-west-1"
}
data "aws_availability_zones" "available" {}
resource "aws_security_group" "instance" {
name = "go-api-instance"
ingress {
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"]
var request = require('request');
var blc = require('broken-link-checker');
exports.handler = function(event, context, callback) {
let response = {
status: 'success',
links: [],
brokenLinks: []
};
package main
import (
"fmt"
"log"
"net/http"
)
func main() {
http.HandleFunc("/", func(w http.ResponseWriter, r *http.Request) {
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"
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"
}