Navigation Menu

Skip to content

Instantly share code, notes, and snippets.

View s0enke's full-sized avatar

Soenke Ruempler s0enke

View GitHub Profile
@s0enke
s0enke / index.php
Created August 29, 2022 06:48
CDK code for serverless PHP with Lambda and bref.sh
import { CfnOutput, Stack, StackProps } from "aws-cdk-lib";
import { Construct } from "constructs";
import * as lambda from "aws-cdk-lib/aws-lambda";
import * as apigateway from "@aws-cdk/aws-apigatewayv2-alpha";
import { HttpLambdaIntegration } from "@aws-cdk/aws-apigatewayv2-integrations-alpha";
import * as cdk from "aws-cdk-lib";
export class CdkBrefStack extends Stack {
constructor(scope: Construct, id: string, props?: StackProps) {
@s0enke
s0enke / cdk_with_service_catalog.ts
Last active May 24, 2022 00:14
Generate AWS Service Catalog Products from CDK Constructs
// Possible since https://github.com/aws/aws-cdk/pull/17144
class VpcProduct extends servicecatalog.ProductStack {
vpc: aws_ec2.Vpc;
constructor(scope: Construct, id: string) {
super(scope, id);
this.vpc = new aws_ec2.Vpc(this, 'Vpc', {
@s0enke
s0enke / host_id_new
Created February 17, 2020 08:41
Mit neuem Host-ID Tool
PS C:\gfos\jdk\bin> java -jar .\HostId.jar
display name : Software Loopback Interface 1
name : lo
index : 1
loopback : true
p2p : false
up : true
virtual : false
network interface Software Loopback Interface 1 is invalid: no hardware address
{
"Sid": "ProtectBackups",
"Condition": {
"ArnNotLike": {
"aws:PrincipalARN": "arn:aws:iam::*:role/AWSControlTowerExecution"
}
},
"Action": [
"backup:Delete*",
"backup:Update*"
AWSTemplateFormatVersion: "2010-09-09"
Resources:
BackupRole:
Type: "AWS::IAM::Role"
Properties:
RoleName: SampleBackupRole
AssumeRolePolicyDocument:
Version: "2012-10-17"
Statement:
- Effect: "Allow"
@s0enke
s0enke / manifest.yaml
Created May 14, 2019 08:36
Restrict AWS Org to Regions
# Landing Zone Service Control Policies
organization_policies:
...
- name: restrict-to-eu
description: Restrict to EU regions
policy_file: policies/restrict_to_eu_regions.json
#Apply to accounts in the following OU(s)
apply_to_accounts_in_ou:
- core
- applications
@s0enke
s0enke / ansible_playbook.yaml
Created March 16, 2017 07:22
Ansible Playbook to deploy a CloudFormation stack
# call me with
# $ ansible-playbook ansible_playbook.yaml
---
- hosts: localhost
connection: local
gather_facts: no
tasks:
- cloudformation:
stack_name: "stack_name"
@s0enke
s0enke / gist:97920702cf1cdb4f45411e926ca028a3
Created February 10, 2017 13:22
cloud-custodian error message when running as Lambda function
policies:
- name: s3-bucket-check
resource: s3
mode:
role: arn:aws:iam::xxxxx:role/lambda-basic-execution
type: periodic
schedule: "rate(10 minutes)"