Skip to content

Instantly share code, notes, and snippets.

View lampidudelj's full-sized avatar

Aleks Obrazcova lampidudelj

View GitHub Profile
@lampidudelj
lampidudelj / aws-cdk-stack.ts
Created July 18, 2019 14:02
aws-cdk initial state
import cdk = require('@aws-cdk/core');
export class AwsCdkStack extends cdk.Stack {
constructor(scope: cdk.Construct, id: string, props?: cdk.StackProps) {
super(scope, id, props);
// The code that defines your stack goes here
}
}
@lampidudelj
lampidudelj / aws-cdk-stack-s3.ts
Created July 18, 2019 15:19
aws-cdk stack with s3 bucket
import cdk = require('@aws-cdk/core');
import s3 = require('@aws-cdk/aws-s3');
export class AwsCdkStack extends cdk.Stack {
constructor(scope: cdk.Construct, id: string, props?: cdk.StackProps) {
super(scope, id, props);
const s3Bucket = new s3.Bucket(this, 'host-bucket', {
bucketName: `react-host-bucket-${Date.now()}`,
websiteIndexDocument: 'index.html',
@lampidudelj
lampidudelj / aws-cdk-stack-cloudfront.ts
Created July 18, 2019 21:02
aws-cdk with s3 and cloudfront distribution
import cdk = require('@aws-cdk/core');
import s3 = require('@aws-cdk/aws-s3');
import cloudfront = require('@aws-cdk/aws-cloudfront');
export class AwsCdkStack extends cdk.Stack {
constructor(scope: cdk.Construct, id: string, props?: cdk.StackProps) {
super(scope, id, props);
const s3Bucket = new s3.Bucket(this, 'host-bucket', {
bucketName: `react-host-bucket-9f7317d0dd7c`,
@lampidudelj
lampidudelj / ChangeCognitoPassword.json
Last active February 11, 2024 02:43
AWS Automation Document - Change Cognito Password
{
"schemaVersion": "0.3",
"description": "Updates a Microsoft Windows AMI. By default it will install all Windows updates, Amazon software, and Amazon drivers. It will then sysprep and create a new AMI. Supports Windows Server 2008 R2 and greater.",
"assumeRole": "{{ AutomationAssumeRole }}",
"parameters": {
"SourceAmiId": {
"type": "String",
"description": "(Required) The source Amazon Machine Image ID."
},
"TopicArn": {
@lampidudelj
lampidudelj / UpdateWindowsAmi.json
Last active February 11, 2024 01:48
AWS Automation Document - Update Windows Ami
{
"schemaVersion": "0.3",
"description": "Updates a Microsoft Windows AMI. By default it will install all Windows updates, Amazon software, and Amazon drivers. It will then sysprep and create a new AMI. Supports Windows Server 2008 R2 and greater.",
"assumeRole": "{{ AutomationAssumeRole }}",
"parameters": {
"SourceAmiId": {
"type": "String",
"description": "(Required) The source Amazon Machine Image ID."
},
"IamInstanceProfileName": {
@lampidudelj
lampidudelj / InstallWindowsUpdatesWithShutdown.json
Last active February 11, 2024 02:09
AWS Automation Document - Install Windows Updates With Shutdown
{
"schemaVersion": "0.3",
"description": "Updates a Microsoft Windows AMI. By default it will install all Windows updates, Amazon software, and Amazon drivers. It will then sysprep and create a new AMI. Supports Windows Server 2008 R2 and greater.",
"assumeRole": "{{ AutomationAssumeRole }}",
"parameters": {
"InstanceId": {
"type": "String",
"description": "(Required) EC2 Instance ID."
},
"AutomationAssumeRole": {
@lampidudelj
lampidudelj / Jenkinsfile.groovy
Last active February 11, 2024 02:13
Jenkins pipeline for nodeJs Lambda service with aliases
pipeline {
agent any
environment {
REPO_URL = 'https://DittoJenkins@bitbucket.org/empiricom/your-repo-name.git'
}
stages {
stage('Build') {
steps {
echo 'Pull code and build'
git credentialsId: 'bitbucket', url: "${REPO_URL}"
@lampidudelj
lampidudelj / config.ts
Created September 20, 2019 10:23
Get Parameters from SSM Store
import * as awsSdk from 'aws-sdk';
async function getParameterFromSystemManager( environment: string ) {
const ssm = new awsSdk.SSM();
const appId = environment.split('.')[0];
const stage = environment.split('.')[1].toUpperCase();
const params = {
Names: [`/${appId}/${stage}/cognito_user_pool_id`, `/${appId}/${stage}/queue_url`, `/${appId}/${stage}/table_name`]/* required */
@lampidudelj
lampidudelj / jmeter.base.dockerfile
Last active November 15, 2019 15:45
Base dockerfile for container running JMeter
FROM openjdk:8u201-jdk-alpine3.9
LABEL mantainer=""
STOPSIGNAL SIGKILL
ENV MIRROR https://www-eu.apache.org/dist/jmeter/binaries
ENV JMETER_VERSION 5.2
ENV JMETER_HOME /opt/apache-jmeter-${JMETER_VERSION}
ENV JMETER_BIN ${JMETER_HOME}/bin
ENV ALPN_VERSION 8.1.13.v20181017
ENV PATH ${JMETER_BIN}:$PATH
@lampidudelj
lampidudelj / jmeter.master.dockerfile
Created November 15, 2019 15:50
Docker image for master instance of JMeter
# Use vinsdocker base image
FROM yourrepo/jmeter:base
LABEL mantainer=""
# Ports to be exposed from the container for JMeter Master
EXPOSE 60000