Skip to content

Instantly share code, notes, and snippets.

@Bharathkumarraju
Bharathkumarraju / Database.tf
Created September 9, 2019 02:53
Terraform - Create database password securely and store in remote-state
provider "aws" {
region = var.aws_region
profile = var.aws_profile
}
terraform {
backend "s3" {
bucket = "bharaths-terraform-up-and-running"
key = "development/data-stores/mysql/terraform.tfstate"
@Bharathkumarraju
Bharathkumarraju / get_programmatic_access.sh
Last active August 15, 2019 23:00
Use MFA token to authenticate access to AWS resources through the AWS CLI
#!/bin/bash
set -o pipefail
usage() {
echo 'Usage:
source ./script.sh <IAM_USERNAME> <MFA_CODE> <ACCOUNT_ID> <PROFILE_NAME>
Requires:
* jq
* aws cli
* PROFILE_NAME is default when you do 'aws configure' at first
@Bharathkumarraju
Bharathkumarraju / push_images.sh
Created July 20, 2019 02:12
Shell script to push docker images to jfrog artifactory with tagging
#!/bin/bash
# Script to push docker images to jfrog artifactory
# Developers can build local docker images and they can run this script with single argument as ./push_images.sh java/test_app:1.0
# If no tag passed version it will push as latest tag like java/test_app:latest
pushto_jfrog()
{
if [ -z ${tag_name} ]