Skip to content

Instantly share code, notes, and snippets.

View TobiasGeiselmann's full-sized avatar

Tobias Geiselmann TobiasGeiselmann

View GitHub Profile

Not all EC2 instance types are available in all availability zones in a region. If you want to check in which availability zones of a region a particular instance type is available, you can use the following command:

EXPORT TYPE=<instance type> # e.g. EXPORT TYPE=t3a.medium
aws ec2 describe-reserved-instances-offerings --filters 'Name=scope,Values=Availability Zone' --no-include-marketplace --instance-type $TYPE | jq -r '.ReservedInstancesOfferings[].AvailabilityZone' | sort | uniq
git branch -d the_local_branch
git push origin --delete the_remote_branch
git config credential.helper store
# Fetch AZs in the current region
data "aws_availability_zones" "available" {
}
resource "aws_vpc" "main" {
cidr_block = "172.17.0.0/16"
tags = {
Name = "vpc-devops-training"
}
FROM golang:1.7.3 AS builder
WORKDIR /go/src/github.com/alexellis/href-counter/
RUN go get -d -v golang.org/x/net/html
COPY app.go .
RUN CGO_ENABLED=0 GOOS=linux go build -a -installsuffix cgo -o app .
FROM alpine:latest
RUN apk --no-cache add ca-certificates
WORKDIR /root/
COPY --from=builder /go/src/github.com/alexellis/href-counter/app .
# Default Pattern Components
### EnvironmentCode
`(d|t|s|p)` for development, test, staging, production.
### RegionCode
`(ue1|uw1|uw2|ew1|ec1|an1|an2|as1|as2|se1)` for us-east-1, us-west-1, us-west-2, eu-west-1, eu-central-1, ap-northeast-1, ap-northeast-2, ap-southeast-1, ap-southeast-2, sa-east-1.
tar -cvzf my-archive.tar /path/to/directory
tar -cvf my-archive.tar /path/to/directory
tar -xvf archive.tar.gz -C /path/to/directory/