Skip to content

Instantly share code, notes, and snippets.

View eladb's full-sized avatar
☁️
winging it

Elad Ben-Israel eladb

☁️
winging it
View GitHub Profile
@eladb
eladb / wing-code-artifact.w
Created May 16, 2024 17:55
Defining code artifact domain/repository with Winglang
bring "aws-cdk-lib" as cdk;
let domain = new cdk.aws_codeartifact.CfnDomain(
domainName: "o-4e7dgfcrpx-platform"
);
new cdk.aws_codeartifact.CfnRepository(
description: "artifact repository for this <winglang> account",
domainName: domain.domainName,
repositoryName: "winglang-artifacts",
@eladb
eladb / go.mod
Created December 19, 2021 09:25
Projen in Go
module github.com/eladb/my-test
go 1.17
require github.com/projen/projen-go/projen v0.45.0
require (
github.com/Masterminds/semver/v3 v3.1.1 // indirect
github.com/aws/jsii-runtime-go v1.49.0
)
@eladb
eladb / cdk8s-eks.ts
Created March 10, 2020 13:28
cdk8s + EKS = ❤️
import * as eks from '@aws-cdk/aws-eks';
import * as iam from '@aws-cdk/aws-iam';
import * as cdk8s from 'cdk8s';
import { Construct, Stack, StackProps } from '@aws-cdk/core';
import * as k8s from '../imports/k8s';
export class TestClusterStack extends Stack {
constructor(scope: Construct, id: string, props?: StackProps) {
super(scope, id, props);
@eladb
eladb / tsconfig.json
Last active November 10, 2019 16:45
my tsconfig.json
{
"compilerOptions": {
"alwaysStrict": true,
"charset": "utf8",
"declaration": true,
"experimentalDecorators": true,
"inlineSourceMap": true,
"inlineSources": true,
"lib": [
"es2016"
import cdk = require('@aws-cdk/cdk');
import ec2 = require('@aws-cdk/aws-ec2');
import { Fn } from '@aws-cdk/cdk';
export class MyStack extends cdk.Stack {
constructor(scope: cdk.Construct, id: string, props?: cdk.StackProps) {
super(scope, id, props);
this.node.setContext(`availability-zones:account=${this.env.account}:region=${this.env.region}`, [
Fn.select(0, Fn.getAZs()),
@eladb
eladb / awscl-guidelines.md
Created April 17, 2019 22:48
AWS Construct Library Guidelines - Draft

AWS Construct Library Design Guidelines

The AWS Construct Library is a rich class library of CDK constructs which represent all resources offered by the AWS Cloud and higher-level constructs for achieving common tasks.

The purpose of this document is to provide guidelines for designing the APIs in the AWS Construct Library in order to ensure a consistent and integrated experience across the entire AWS surface area.

As much as possible, the guidelines in this document are enforced using the awslint tool which reflects on the APIs and verifies that the APIs adhere to the guidelines. When a guideline is backed by a linter rule, the rule name will be referenced like this: [awslint:resource-class-is-construct].

For the purpose of this document we will use "Foo" to denote the official name of the resource as defined in the AWS CloudFormation resource specification (i.e. "Bucket", "Queue", "Topic", etc). This notation allows deriving names from the official name. For example, FooProps would be `BucketP

const markets = {
  'US': { region: 'us-east-1', account: '1234' },
  'EU': { region: 'eu-west-2', account: '3333' },
};


interface MyThingProps {
 market: string;
@eladb
eladb / extract-jsii.sh
Last active January 19, 2021 11:19
Reflecting on the AWS CDK Type System using jsii-reflect
#!/bin/bash
set -euo pipefail
# given an aws-cdk bundle archive (the one published to github releases), extract
# all .jsii manifests and places them under "jsii/*.jsii"
# now they can be used with jsii-reflect
zip=${1:-}
if [ -z "${zip}" ]; then
echo "Usage: $(basename $0) <cdk-bundle-zip>"
#!/bin/bash
set -eu # we don't want "pipefail" to implement idempotency
###
# Usage: ./publish-mvn.sh
#
# Publishes the content of an offline Maven repository to Maven Central.
#
# This script expects the following environment variables to be set to appropriate
# values (which can be achieved by using scripts/with-signing-key.sh):
@eladb
eladb / relnotes.rb
Created June 10, 2014 09:20
Markdown release notes since last bump commit with github links
#!/usr/bin/env ruby
#
# relnotes.rb
# Markdown release notes since last bump commit with github links
# Awesome for creating release notes for a release.
#
# Usage: ruby relnotes.rb [github-prefix]
#
# The script will extract all git commits since the last "bump commit" (a commit with the text "bump")
# and will generate a bulletted description of all the commits. If `github-prefix` is provided (e.g. "eladb/myrepo"),