Navigation Menu

Skip to content

Instantly share code, notes, and snippets.

View darko-mesaros's full-sized avatar
🎯
Focusing

Darko Mesaros darko-mesaros

🎯
Focusing
View GitHub Profile

Keybase proof

I hereby claim:

  • I am darko-mesaros on github.
  • I am ruptwelve (https://keybase.io/ruptwelve) on keybase.
  • I have a public key ASDTPyYutDxnE86r3S2xNwGcPoLaoSePOwtrztl7wJc_4Ao

To claim this, I am signing this object:

@darko-mesaros
darko-mesaros / ssm-parameter-cloudformation.yml
Created May 18, 2020 11:08
Automagically resolve the latest Amazon Linux AMI by using the global parameters! 🔍
AWSTemplateFormatVersion: "2010-09-09"
Description: >
https://twitch.tv/ruptwelve
Parameters:
InstanceType:
Type: String
Description: Please Choose the instance type
Default: m6g.medium
AllowedValues:
- m6g.medium
@darko-mesaros
darko-mesaros / cdk-ssm-ec2.ts
Last active May 19, 2020 11:11
Launch an EC2 instance with CDK, by using the latest Amazon Linux AMI - Powered by SSM Parameter store! 🔏
import * as cdk from '@aws-cdk/core';
import * as ec2 from '@aws-cdk/aws-ec2';
export class CdkSsmEc2Stack extends cdk.Stack {
constructor(scope: cdk.Construct, id: string, props?: cdk.StackProps) {
super(scope, id, props);
// import the default VPC
const vpc = ec2.Vpc.fromLookup(this, 'VPC', {
@darko-mesaros
darko-mesaros / github_cfn.yml
Created May 25, 2020 09:32
Creation of GitHub repositories via AWS CloudFormation
AWSTemplateFormatVersion: "2010-09-09"
Description: >
https://twitch.tv/ruptwelve
Parameters:
RepoName:
Type: String
Description: Enter the name for your repository
Default: please-change-me
Resources:
MyGitHubRepo:
@darko-mesaros
darko-mesaros / cloud9-repo.yml
Created May 26, 2020 05:43
Adds a repo to Cloud9 that is automatically cloned at startup
AWSTemplateFormatVersion: "2010-09-09"
Description: >
https://twitch.tv/ruptwelve
Parameters:
EnvName:
Type: String
Description: Enter the name for your IDE
Default: please-change-me
Resources:
Oblak9:
@darko-mesaros
darko-mesaros / cfn-vpcs.yml
Created May 26, 2020 21:09
Create a VPC with 6 subnets - 3 Public and 3 Private - in 3 AZs each
Description: This template deploys a VPC, with a set of three public and private subnets spread
across three Availability Zones. It deploys an internet gateway, with a default
route on the public subnets. It deploys a three NAT gateways (one in each AZ),
and default routes for them in the private subnets.
Parameters:
EnvironmentName:
Description: An environment name that is prefixed to resource names
Type: String
@darko-mesaros
darko-mesaros / lolbanner-function.fish
Created May 28, 2020 11:32
Lolbanner alias / function that shows some colorfull text
function lolbanner
echo
figlet -c -f ~/.local/share/fonts/figlet-fonts/3d.flf $argv | lolcat
echo
end
@darko-mesaros
darko-mesaros / aws-cli-region-services.sh
Created June 4, 2020 10:34
get all services in a region
aws ssm get-parameters-by-path \
--path /aws/service/global-infrastructure/regions/af-south-1/services --output json | \
jq .Parameters[].Name | sort | head -10
@darko-mesaros
darko-mesaros / cdk-asg-userdata.ts
Created June 8, 2020 08:50
AWS CDK - Launch an EC2 Autoscaling Group with userdata read of disk
// VPC
const vpc = new ec2.Vpc(this, 'VPC');
// Security group
const webSg = new ec2.SecurityGroup(this, 'WebSG',{
vpc: vpc,
allowAllOutbound: true,
description: "Web Server Security Group"
});
webSg.addIngressRule(ec2.Peer.anyIpv4(), ec2.Port.tcp(8080), 'Web from anywhere')
@darko-mesaros
darko-mesaros / appconfig.yml
Created June 15, 2020 07:57
Create AppConfig configuration in Parameter Store
AWSTemplateFormatVersion: "2010-09-09"
Description: >
https://twitch.tv/ruptwelve
Parameters:
NumOfRows:
Type: String
Description: Number of Rows for your config
Default: please-change-me
Resources:
### PARAMETER STORE ###