Skip to content

Instantly share code, notes, and snippets.

View yagonobre's full-sized avatar

Yago Nobre yagonobre

  • Recife
  • 09:13 (UTC -03:00)
View GitHub Profile
@yagonobre
yagonobre / vars.yml
Last active August 16, 2017 00:57
Ansible Bastion
bastion_ip: 10.0.10.10
user: centos
ansible_ssh_common_args: '-o ProxyCommand="ssh -W %h:%p -q -o UserKnownHostsFile=/dev/null -o StrictHostKeyChecking=no {{ user }}@{{ bastion_ip }}"'
@yagonobre
yagonobre / lambda_invalidate_cdn.py
Last active April 12, 2024 13:25
Invalidate Cloudfront
from __future__ import print_function
import boto3
import time
def lambda_handler(event, context):
path = "/" + event["Records"][0]["s3"]["object"]["key"]
bucket_name = event["Records"][0]["s3"]["bucket"]["name"]
client = boto3.client('s3')
@yagonobre
yagonobre / policy.json
Created September 10, 2017 00:52
Invalidate Cloudfront
{
"Version": "2012-10-17",
"Statement": [
{
"Sid": "Stmt1505004397098",
"Action": [
"cloudfront:CreateInvalidation"
],
"Effect": "Allow",
"Resource": "*"