Skip to content

Instantly share code, notes, and snippets.

@sahil1
sahil1 / cloudwatch.tf
Created December 1, 2019 22:27
Terraform Sample Infrastructure
resource "aws_cloudwatch_log_group" "sample_container_cloudwatch" {
name = "/ecs/${var.sample_container}_${var.ENV_NAME}"
tags = {
Environment = "${var.ENV_NAME}"
Application = "Airflow"
}
}
@sahil1
sahil1 / .travis.yml
Last active December 1, 2019 20:01
Sample travis yml file
sudo: required
language: python
cache: pip
services:
- docker
env:
global:
- EB_REGION="us-east-1"
- secure: secure_AWS_ACCOUNT_ID
- secure: secure_AWS_ACCESS_KEY_ID
@sahil1
sahil1 / .dockerfile
Last active December 18, 2019 22:01
Dockerfile for Sample Container
# location: containers/sample_container/.dockerfile
# Base Image
FROM python:3.7-slim
# DocStr
LABEL environment for test_task
MAINTAINER Ensemble Energy
@sahil1
sahil1 / airflow_dag_test.py
Last active June 17, 2020 18:51
Airflow Sample DAG with ECS Operator
from airflow import DAG
from airflow.operators.python_operator import PythonOperator
from airflow.contrib.operators.ecs_operator import ECSOperator
import os
from datetime import datetime, timedelta
import boto3
import json
from config import *
default_args = {
@sahil1
sahil1 / read-access.sql
Last active August 8, 2019 17:13 — forked from oinopion/read-access.sql
How to create read only user in PostgreSQL
-- Create a group
CREATE ROLE readaccess;
-- Grant access to existing tables
GRANT USAGE ON SCHEMA public TO readaccess;
GRANT SELECT ON ALL TABLES IN SCHEMA public TO readaccess;
-- Grant access to future tables
ALTER DEFAULT PRIVILEGES IN SCHEMA public GRANT SELECT ON TABLES TO readaccess;