This file contains hidden or 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: rbac.authorization.k8s.io/v1 | |
kind: ClusterRole | |
metadata: | |
name: aws-node | |
rules: | |
- apiGroups: | |
- crd.k8s.amazonaws.com | |
resources: | |
- "*" |
This file contains hidden or 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 | |
usage() { | |
echo "Usage $0 -c mongo_docker_container_name" | |
} | |
while [[ $# > 1 ]] | |
do | |
key="$1" |
This file contains hidden or 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
# AWS S3 bucket for static hosting | |
resource "aws_s3_bucket" "website" { | |
bucket = "${var.website_bucket_name}" | |
acl = "public-read" | |
tags { | |
Name = "Website" | |
Environment = "production" | |
} |
This file contains hidden or 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
import logging | |
from logging.handlers import TimedRotatingFileHandler | |
def get_logger(module_name): | |
""" | |
Get logger for all the modules | |
""" | |
logger = logging.getLogger(module_name) |
This file contains hidden or 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
import sys | |
from os import environ | |
from datetime import datetime | |
from multiprocessing import Pool | |
from azure.storage.queue import QueueServiceClient | |
CONNECTION_STRING = environ.get('CONNECTION_STRING') | |
This file contains hidden or 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/sh | |
log_message() | |
{ | |
MSG=$@ | |
LOGTIMESTAMP=`date "+%Y-%m-%d-%H:%M:%S"` | |
LOG_MSG="${LOGTIMESTAMP} Back-up from container $(hostname): ${MSG}" | |
echo "${LOG_MSG}" | |
} |
This file contains hidden or 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/sh | |
# If something goes wrong, this script does not run forever but times out | |
TIMEOUT_SECONDS=300 | |
# Logfile for the keycloak export instance | |
LOGFILE=/tmp/standalone.sh.log | |
# destionation export file | |
JSON_IMPORT_FILE=/opt/jboss/keycloak/imports/realm-export.json |
This file contains hidden or 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
# If something goes wrong, this script does not run forever but times out | |
TIMEOUT_SECONDS=300 | |
# Logfile for the keycloak export instance | |
LOGFILE=/tmp/standalone.sh.log | |
# destionation export file | |
JSON_EXPORT_FILE=/tmp/realms-export-single-file.json | |
rm -f ${LOGFILE} ${JSON_EXPORT_FILE} | |
# Start a new keycloak instance with exporting options enabled. |
This file contains hidden or 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 -x | |
set -e | |
S3_BUCKET="" | |
S3_PREFIX="" | |
OBJECT="$(aws s3 ls s3://$S3_BUCKET/$S3_PREFIX | sort | tail -n 1 | awk '{print $4}')" | |
[ -z "$OBJECT" ] && echo "Object not found in S3 Bucket." && exit 1 |
This file contains hidden or 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
import json | |
import boto3 | |
EC2_INSTANCE_ID="i-xxxxxx" | |
ec2_handle = boto3.client( | |
'ec2' | |
) | |
def lambda_handler(event, context): |