Skip to content

Instantly share code, notes, and snippets.

I'll be doing a Kubernetes Intro to Advanced workshop on Feb 20th 9am to 5pm and Feb 25th 9am to 5pm.

Here is a rough syllabus for the workshop (subject to change):

Overview (How we got here): [20 min]

  • Story of a web dude (how a monolith service is managed)
  • Move from monolith to microservices
  • How is the infrastructure moving with this trend (baremetal -> VM -> containers -> serverless)
  • Where everything is at on the technology curve

I'll be doing an Advanced Microservices workshop on Sept 5th & 6th This is the second course in the series. First one is the Kubernetes Intro to Advanced workshop

Here is a rough syllabus for the training (subject to change):

Day 1

Intro

  • What are microservices
  • Quick 101 on containers with a demo
@vvalorous
vvalorous / ami-security-validator.tf
Created July 13, 2019 17:36 — forked from davidski/ami-security-validator.tf
Step Function Definition for AMI Security Validator
# reusable policy for the roles which Lambda has permission to assume
data "aws_iam_policy_document" "lambda-assume-role-policy" {
statement {
actions = ["sts:AssumeRole"]
principals = {
type = "Service"
identifiers = ["lambda.amazonaws.com"]
}
}
@vvalorous
vvalorous / aws-athena-auto-partition-between-dates.py
Created October 2, 2018 03:57 — forked from SQLadmin/aws-athena-auto-partition-between-dates.py
AWS Athena automatically add partitions for given two dates for cloudtrail logs via lambda / Python
# Lambda function / Python to create athena partitions for Cloudtrail log between any given days.
# If you run this in AWS Lambda then it can't able to ceate all the partitions.
# Because lambda can run any functions up to 5mins. But create partition query will take avg 6 secs.
# I did a benchmark on lambda, it created upto 3 months of partitions on 16 regions.
'''
-----------------------------------------------------------------
AWS Athena Create Partitions Automatically For Given Any TWO DAYS
-----------------------------------------------------------------
Version 1.0
@vvalorous
vvalorous / s3bucketsize.py
Created October 2, 2018 03:56 — forked from pilgrim2go/s3bucketsize.py
Simple python script to calculate size of S3 buckets
import boto
s3 = boto.connect_s3(aws_id, aws_secret_key)
# based on http://www.quora.com/Amazon-S3/What-is-the-fastest-way-to-measure-the-total-size-of-an-S3-bucket
def get_bucket_size(bucket_name):
bucket = s3.lookup(bucket_name)
total_bytes = 0
n = 0
for key in bucket:
@vvalorous
vvalorous / README.md
Created October 2, 2018 03:55 — forked from sapessi/README.md
Continuous deployment of React websites to Amazon S3

Continuous deployment of React websites to Amazon S3

This sample includes a continuous deployment pipiline for websites built with React. We use AWS CodePipeline, CodeBuild, and SAM to deploy the application. To deploy the application to S3 using SAM we use a custom CloudFormation resource.

Files included

  • buildspec.yml: YAML configuration for CodeBuild, this file should be in the root of your code repository
  • configure.js: Script executed in the build step to generate a config.json file for the application, this is used to include values exported by other CloudFormation stacks (separate services of the same application).
  • index.js: Custom CloudFormation resource that publishes the website to an S3 bucket. As you can see from the buildspec and SAM template, this function is located in a s3-deployment-custom-resource sub-folder of the repo
  • app-sam.yaml: Serverless Application model YAML file. This configures the S3 bucket and the cu
@vvalorous
vvalorous / security-group-cleanup.py
Created October 2, 2018 03:54 — forked from pilgrim2go/security-group-cleanup.py
Security Group Cleanup using boto3
#!/usr/bin/env python
import boto3
import argparse
def lookup_by_id(sgid):
sg = ec2.get_all_security_groups(group_ids=sgid)
return sg[0].name
@vvalorous
vvalorous / aws-athena-auto-partition-lambda.py
Created October 2, 2018 03:53 — forked from pilgrim2go/aws-athena-auto-partition-lambda.py
AWS Athena create auto partition for CloudTrail logs on Daily Basis
# Lambda function to create partition for Cloudtrail log on daily basis.
# You need to schedule it in AWS Lambda.
'''
-------------------------------------------
AWS Athena Create Partitions Automatically
-------------------------------------------
Version 1.0
Author: SqlAdmin
"""
Slack chat-bot Lambda handler.
"""
import os
import logging
import urllib
# Grab the Bot OAuth token from the environment.
BOT_TOKEN = os.environ["BOT_TOKEN"]