Skip to content

Instantly share code, notes, and snippets.

@cloudfiles-me
cloudfiles-me / outposts.json
Created April 20, 2021 17:54 — forked from ahl/outposts.json
AWS Outposts configurations from an unpublished API
{
"NextToken": null,
"PodCatalogItems": [
{
"AvailableEC2Capacities": [
{
"Family": "m5",
"MaxSize": "24xlarge",
"Quantity": "6"
},
@cloudfiles-me
cloudfiles-me / systemd-prblm.service
Created April 30, 2020 17:37 — forked from nickjacob/systemd-prblm.service
execute arbitrary bash code/variable substitution in systemd units
[Unit]
Description=Demonstrate Bash
[Service]
ExecStartPre=/usr/bin/bash -c "/usr/bin/systemctl set-environment MYVAR=$(( 2 + 2 ))"
ExecStart=/usr/bin/echo "2 + 2 = ${MYVAR}"
@cloudfiles-me
cloudfiles-me / eks.py
Last active June 9, 2020 22:02 — forked from iferca/eks.py
eks_cluster_cdk.py
from aws_cdk import (
core,
aws_ec2 as ec2,
aws_eks as eks,
aws_iam as iam
)
class StackK8SStack(core.Stack):
@cloudfiles-me
cloudfiles-me / kinesis-twitter.py
Created October 15, 2019 20:59 — forked from DaisukeMiyamoto/kinesis-twitter.py
put twitter search results to Amazon Kinesis on AWS
# -*- coding: utf-8 -*-
from __future__ import unicode_literals
import os
import time
import json
import twitter
import boto3
@cloudfiles-me
cloudfiles-me / lambda_assume_role.py
Created October 3, 2019 18:03 — forked from ozgurakan/lambda_assume_role.py
Assume Role within A Lambda function (Python)
import boto3
# you can assign role in the function like below
# ROLE_ARN = 'arn:aws:iam::01234567890:role/my_role'
#
# or you can pass role as an evironment varibale
# ROLE_ARN = os.environ['role_arn']
ROLE_ARN = = os.environ['role_arn']
@cloudfiles-me
cloudfiles-me / queues.py
Created August 14, 2019 13:48 — forked from juandesant/queues.py
Shows how to use SQS to generate and receive messages in AWS
#in order to run the code above, install the python packages above:
#pip install ec2-metadata
#pip install boto3
#!/usr/bin/python
import time
import boto3
from ec2_metadata import ec2_metadata
#constants
import os
import sys
from zipfile import ZipFile
import boto3
S3 = boto3.resource('s3')
@cloudfiles-me
cloudfiles-me / k8s-svc-annotations.md
Created December 18, 2018 23:22 — forked from mgoodness/k8s-svc-annotations.md
AWS ELB-related annotations for Kubernetes Services (as of v1.12.0)
  • service.beta.kubernetes.io/aws-load-balancer-access-log-emit-interval (in minutes)
  • service.beta.kubernetes.io/aws-load-balancer-access-log-enabled (true|false)
  • service.beta.kubernetes.io/aws-load-balancer-access-log-s3-bucket-name
  • service.beta.kubernetes.io/aws-load-balancer-access-log-s3-bucket-prefix
  • service.beta.kubernetes.io/aws-load-balancer-additional-resource-tags (comma-separated list of key=value)
  • service.beta.kubernetes.io/aws-load-balancer-backend-protocol (http|https|ssl|tcp)
  • service.beta.kubernetes.io/aws-load-balancer-connection-draining-enabled (true|false)
@cloudfiles-me
cloudfiles-me / curl.md
Created December 17, 2018 17:59 — forked from subfuzion/curl.md
curl POST examples

Common Options

-#, --progress-bar Make curl display a simple progress bar instead of the more informational standard meter.

-b, --cookie <name=data> Supply cookie with request. If no =, then specifies the cookie file to use (see -c).

-c, --cookie-jar <file name> File to save response cookies to.

@cloudfiles-me
cloudfiles-me / readme.md
Created December 17, 2018 16:22 — forked from arun-gupta/readme.md
knative + kubernetes + aws

Knative on Kubernetes on AWS

Knative requires Kubernetes 1.10 and Istio 0.8.0 to be installed. It also requires default namespace injection for Istio to be enabled which rules out EKS as a deployment platform. One of Istio pods is failing and so it cannot be installed on a kops-based cluster as well. This is filed as knative/docs#359.

EKS

  • Install eksctl: brew install weaveworks/tap/eksctl
  • Create EKS cluster: eksctl create cluster --name myeks --nodes 4 --region us-west-2