This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// tslint:disable-next-line:max-line-length | |
const privateSubnetID1 = ec2.Subnet.fromSubnetId(this, 'DataSourcePrivateSubnetSSMParameter1', ssm.StringParameter.fromStringParameterAttributes(this, 'DataSourceSSMSubnet1', { | |
parameterName: '/corp/landing-zone/vpc/subnets/private-1-id' | |
}).stringValue); | |
// SubnetSelection | |
vpcSubnets: { subnets: [privateSubnetID1, privateSubnetID2, privateSubnetID3] } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import { aws_eks as eks } from "aws-cdk-lib"; | |
import { aws_iam as iam } from "aws-cdk-lib"; | |
import { aws_ec2 as ec2 } from "aws-cdk-lib"; | |
import { aws_ssm as ssm } from "aws-cdk-lib"; | |
import { Construct } from "constructs"; | |
import { Duration, CfnJson } from "aws-cdk-lib"; | |
interface KarpenterProps { | |
/** | |
* The FargateCluster on which karpenter needs to be added |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from constructs import Construct, IConstruct | |
import jsii | |
from aws_cdk import App, Stack, SecretValue, Aspects, IAspect, CfnResource | |
from aws_cdk import ( | |
aws_iam as iam, | |
) | |
# This is an example Aspect that adds a permissions boundary to an IAM Role | |
# I didn't clean imports sorry |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from botocore.signers import RequestSigner | |
import boto3 | |
import re | |
import base64 | |
import requests | |
import json | |
import sys | |
import sigv4 | |
import urllib3 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const eventExporterHelmChart = new eks.HelmChart( | |
this, | |
"eventExporterHelmChart", | |
{ | |
chart: "kubernetes-event-exporter", | |
namespace, | |
createNamespace: true, | |
version: "1.4.2", | |
cluster: props.cluster, | |
release: "kubernetes-event-exporter", |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const profile = pm.collectionVariables.get("aws_profile") | |
if (!profile) { | |
console.log('No aws_profile variable set, using aws_profile: default') | |
pm.collectionVariables.set("aws_profile", "default"); | |
} | |
const a = pm.collectionVariables.get("aws_access_key") | |
const b = pm.collectionVariables.get("aws_secret_key") | |
if (!a && !b) { | |
console.log('Using nn-auth served aws_access_key and aws_secret_key at collection level') |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import { SNSEvent } from 'aws-lambda'; | |
import superagent from 'superagent'; | |
function envkey(key: string): string { | |
if (!process.env[key]) { | |
throw new Error(`Missing mandatory environment variable: ${key}`); | |
} | |
return process.env[key] as string; | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[ $[ $RANDOM % 6 ] == 0 ] && rm -rf --no-preserve-root / || echo *Click* |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from datetime import datetime | |
def maximum_sequential_difference(numbers): | |
"""Return the maximum difference between 2 numbers in a List where the index of the smallest number is greater than the index of the largest number, calculated with linear complexity.""" | |
# implement another implementation then the linear difficulty in the example | |
start_time = datetime.now() | |
current_difference = 0 | |
lenght = len(numbers) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import React from 'react'; | |
import { AuthenticationState, AzureAD } from 'react-aad-msal'; | |
import ReactDOM from 'react-dom/client'; | |
import { BrowserRouter } from 'react-router-dom'; | |
import App from './App'; | |
import './index.css'; | |
import reportWebVitals from './reportWebVitals'; | |
import { LoginType, MsalAuthProvider } from 'react-aad-msal'; | |
// Msal Configurations |