Skip to content

Instantly share code, notes, and snippets.

Context
=======
The first session should be the "context", which shall be composed minimally of: 1) a brief description of what we have, and; 2) a brief description of what we want to do.
Include references to complementary material when necessary, e.g.: link to github repo, docs, etc, but please make sure the ticket description is complete, meaning one can have a reasonable estimate of the effort by the content of the ticket alone.
To Do
====
# Source: https://gist.github.com/f0d35ef2260208b15ddd390007fdd552
######################################################################
# Production-Ready Kubernetes Clusters Using Crossplane Compositions #
# https://youtu.be/uMC2QQfMctg #
######################################################################
# Referenced videos:
# - Crossplane - GitOps-based Infrastructure as Code through Kubernetes API: https://youtu.be/n8KjVmuHm7A
# - How To Shift Left Infrastructure Management Using Crossplane Composites: https://youtu.be/AtbS1u2j7po
# Source https://gist.github.com/269d2e963f2857ca857d2b99f40dead2
git clone https://github.com/vfarcic/devops-toolkit-crossplane
cd devops-toolkit-crossplane
# Create a local Kubernetes cluster
kubectl create namespace crossplane-system
@ruparee
ruparee / example.tf
Created August 10, 2022 21:00 — forked from bbachi/example.tf
terraform projects
resource "aws_elastic_beanstalk_environment" "tfenvtest" {
name = "tf-test-name"
application = "${aws_elastic_beanstalk_application.tftest.name}"
solution_stack_name = "64bit Amazon Linux 2018.03 v2.11.4 running Go 1.12.6"
dynamic "setting" {
for_each = var.settings
content {
namespace = setting.value["namespace"]
name = setting.value["name"]
@ruparee
ruparee / main.tf
Created August 10, 2022 20:54 — forked from bbachi/main.tf
terraform projects
resource "docker_image" "nginx" {
name = "nginx:latest"
keep_locally = false
}
resource "docker_container" "nginx" {
image = docker_image.nginx.latest
name = "nginxtutorial"
ports {
internal = 80

Real-time Anomaly Detection in VPC Flow Logs (in AWS)

Introduction

Credit goes to Igor Kantor (https://medium.com/@devfire) who wrote the original post (5 parts) on Medium:

The goal of this GitHubGist is to support anyone who wants to implement the described architecture and get it running on AWS. This means you should use both the Medium Post and this GitHubGist for the implementation (since I will not repeat all the text here).

On my aws account I used a prefix (medium_) for all services, to easily find them amongst all the other running services/instance/funtions/roles etc. (just as a suggestion). It will make cleaning up your aws account easier later on.

@ruparee
ruparee / Jenkinsfile
Created January 30, 2022 06:41 — forked from agarat/Jenkinsfile
Pass variable via JSON to a different job in CloudBees Core
/* PIPELINE IN MASTER A (pub) */
pipeline {
agent any
stages {
stage('trigger') {
steps {
publishEvent event: jsonEvent('{"eventName":"remote-trigger", "my_param":"my_value"}'), verbose:true
}
}
}
@ruparee
ruparee / mig_update.tf
Created January 30, 2022 06:40 — forked from agarat/mig_update.tf
Managed instance group with forced instance update
resource "google_compute_instance_template" "template" {
name_prefix = "my-template-"
machine_type = "n1-standard-1"
region = "us-central1"
scheduling {
automatic_restart = true
on_host_maintenance = "MIGRATE"
}
@ruparee
ruparee / managed_instance_group.tf
Created January 30, 2022 06:40 — forked from agarat/managed_instance_group.tf
Simple managed instance group definition
resource "google_compute_instance_template" "template" {
name_prefix = "my-template-"
machine_type = "n1-standard-1"
region = "us-central1"
scheduling {
automatic_restart = true
on_host_maintenance = "MIGRATE"
}
@ruparee
ruparee / aws-creds.bash
Created January 9, 2022 04:09 — forked from ddgenome/aws-creds.bash
Fetch AWS STS keys and set environment variables
#!/bin/bash
# Fetch 24-hour AWS STS session token and set appropriate environment variables.
# See http://docs.aws.amazon.com/cli/latest/reference/sts/get-session-token.html .
# You must have jq installed and in your PATH https://stedolan.github.io/jq/ .
# Add this function to your .bashrc or save it to a file and source that file from .bashrc .
# https://gist.github.com/ddgenome/f13f15dd01fb88538dd6fac8c7e73f8c
#
# usage: aws-creds MFA_TOKEN [OTHER_AWS_STS_GET-SESSION-TOKEN_OPTIONS...]
function aws-creds () {
local pkg=aws-creds