Skip to content

Instantly share code, notes, and snippets.

import * as cdk from '@aws-cdk/core';
import * as eks from '@aws-cdk/aws-eks';
import * as cdk8s from 'cdk8s';
import { MyChart } from './my-chart';
export class CdkEksAppStack extends cdk.Stack {
constructor(scope: cdk.Construct, id: string, props?: cdk.StackProps) {
super(scope, id, props);
// The code that defines your stack goes here
import * as constructs from 'constructs';
import * as cdk8s from 'cdk8s';
import * as kplus from 'cdk8s-plus';
export class MyChart extends cdk8s.Chart {
constructor(scope: constructs.Construct, name: string) {
super(scope, name);
const deploy = new kplus.Deployment(this, 'deployment', {
spec: {
@paavan98pm
paavan98pm / cluster.yaml
Created March 30, 2020 11:21
eksctl cluster configuration for KMS encryption-enabled EKS clusters
apiVersion: eksctl.io/v1alpha5
kind: ClusterConfig
metadata:
name: mar2020
region: us-west-2
nodeGroups:
- name: ng1
instanceType: m5.xlarge
@paavan98pm
paavan98pm / build_logs.log
Last active March 27, 2020 09:39
html-proofer errors
#618/619
Checking 514 external links...
Ran on 326 files!
- /public/intermediate/220_codepipeline/codepipeline/index.html
* External link https://s3.amazonaws.com/eksworkshop.com/templates/master/ci-cd-codepipeline.cfn.yml failed: 400 No error
- /public/intermediate/260_weave_flux/codepipeline/index.html
* External link https://s3.amazonaws.com/eksworkshop.com/templates/master/weave_flux_pipeline.cfn.yml failed: 400 No error
package main
import (
"fmt"
"github.com/aws/aws-sdk-go/service/secretsmanager"
"github.com/aws/aws-sdk-go/aws"
"github.com/aws/aws-sdk-go/aws/endpoints"
"github.com/aws/aws-sdk-go/aws/session"
"github.com/aws/aws-secretsmanager-caching-go/secretcache"
)
@paavan98pm
paavan98pm / without_cache.go
Last active June 20, 2019 17:05
AWS Secrets Manager Go Test Code
package main
import (
"fmt"
"encoding/json"
"github.com/aws/aws-sdk-go/aws"
"github.com/aws/aws-sdk-go/aws/endpoints"
"github.com/aws/aws-sdk-go/aws/session"
"github.com/aws/aws-sdk-go/service/secretsmanager"
)
@paavan98pm
paavan98pm / post_sigv4_kms.py
Created January 3, 2019 12:50
Sigv4 API call to AWS KMS GenerateDataKey
# Copyright 2010-2018 Amazon.com, Inc. or its affiliates. All Rights Reserved.
#
# This file is licensed under the Apache License, Version 2.0 (the "License").
# You may not use this file except in compliance with the License. A copy of the
# License is located at
#
# http://aws.amazon.com/apache2.0/
#
# This file is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS
# OF ANY KIND, either express or implied. See the License for the specific
@paavan98pm
paavan98pm / locustfile.py
Created December 19, 2018 10:45
Locust test for API limits
from __future__ import print_function
from botocore.client import Config
import boto3
import requests
import inspect
import time
from locust import Locust, TaskSet, events, task
config = Config(max_pool_connections=1000)
@paavan98pm
paavan98pm / aws_secrets_mgr.py
Created December 18, 2018 22:43
Get Secret Value from AWS Secrets Manager
from __future__ import print_function
from botocore.client import Config
import boto3
import base64
from botocore.exceptions import ClientError
def get_secret():
secret_name = 'sm-demo-secret'
config = Config(connect_timeout=120)
export TERM="xterm-256color"
export ZSH="/Users/paavan/.oh-my-zsh"
POWERLEVEL9K_INSTALLATION_PATH="{HOME}/.antigen/bundles/bhilburn/powerlevel9k"
POWERLEVEL9K_COMMAND_EXECUTION_TIME_THRESHOLD=0
POWERLEVEL9K_COMMAND_EXECUTION_TIME_BACKGROUND=245
POWERLEVEL9K_COMMAND_EXECUTION_TIME_FOREGROUND='black'
# ZSH_THEME="powerlevel9k/powerlevel9k"
# zsh tmux settings