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
data "aws_iam_policy_document" "manager" { | |
statement { | |
sid = "Cache" | |
actions = [ | |
"s3:ListObjects*", | |
"s3:GetObject*", | |
"s3:DeleteObject*", | |
"s3:PutObject*" | |
] | |
resources = ["${module.s3_cache.arn}/*"] |
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
golangci-lint run --disable-all \ | |
--enable=misspell \ | |
--enable=golint \ | |
--enable=govet \ | |
--enable=deadcode \ | |
--enable=goimports \ | |
--enable=errcheck \ | |
--enable=varcheck \ | |
--enable=unparam \ | |
--enable=ineffassign \ |
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
apiVersion: v1 | |
kind: ConfigMap | |
metadata: | |
name: generic | |
data: | |
AWS_REGION: eu-west-1 | |
ENVIRONMENT: staging | |
--- | |
apiVersion: v1 | |
kind: ConfigMap |
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
#!/usr/bin/env bash | |
envs='airhelp-staging airhelp-production ah-test-174206' | |
get_vm_count(){ | |
ENV_NAME="$1" | |
count=$(gcloud --project="$ENV_NAME" compute instances list|grep -v NAME -c) | |
echo "VM count for $ENV_NAME: $count" | |
} |
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
#!/usr/bin/env bash | |
AWS_REGION=eu-west-1 | |
envs='staging development dt-staging dt-production qa accounting team-bravo' | |
aws() { | |
docker run --rm -it \ | |
--mount type=bind,source="$HOME"/.aws,destination=/root/.aws,readonly \ | |
--mount type=bind,source="$(pwd)",destination=/data,consistency=cached \ | |
-e AWS_PROFILE \ |
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
# This is the first stage, for building things that will be required by the | |
# final stage (notably the binary) | |
FROM golang | |
# Copy in just the go.mod and go.sum files, and download the dependencies. By | |
# doing this before copying in the other dependencies, the Docker build cache | |
# can skip these steps so long as neither of these two files change. | |
COPY go.mod go.sum ./ | |
RUN go mod download |
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_sqs_queue" "graceful_termination_queue" { | |
name = "graceful_termination_queue" | |
} | |
resource "aws_iam_role" "autoscaling_role" { | |
name = "autoscaling_role" | |
assume_role_policy = <<EOF | |
{ | |
"Version": "2012-10-17", | |
"Statement": [ |
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
#!/usr/bin/env python3 | |
# script will force to allocate unassigned shards in the cluster | |
# based on: https://www.elastic.co/guide/en/elasticsearch/reference/5.6/cluster-reroute.html | |
import urllib.request | |
import json | |
host = 'http://es-main-master2-gew2-staging' | |
destination_host = 'es-main-data2-gew2-staging' | |
shards_uri = ':9200/_cat/shards?h=index,shard,prirep,state,unassigned.reason&format=json' |
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
#!/bin/bash | |
set -e | |
if [[ $# -ne 1 ]] | |
then | |
echo "Removes all shards from given node's IP." | |
echo | |
echo "$0 source_node_IP|NONE" | |
exit 1 | |
fi |
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 readLines(path string) ([]string, error) { | |
file, err := os.Open(path) | |
if err != nil { | |
return nil, err | |
} | |
defer file.Close() | |
var lines []string | |
scanner := bufio.NewScanner(file) | |
comment := false |
NewerOlder