Skip to content

Instantly share code, notes, and snippets.

Avatar

Soenke Ruempler s0enke

View GitHub Profile
@s0enke
s0enke / index.php
Created Aug 29, 2022
CDK code for serverless PHP with Lambda and bref.sh
View index.php
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
Generate AWS Service Catalog Products from CDK Constructs
View cdk_with_service_catalog.ts
// 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 Feb 17, 2020
Mit neuem Host-ID Tool
View host_id_new
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
View scp.json
{
"Sid": "ProtectBackups",
"Condition": {
"ArnNotLike": {
"aws:PrincipalARN": "arn:aws:iam::*:role/AWSControlTowerExecution"
}
},
"Action": [
"backup:Delete*",
"backup:Update*"
View aws_backup_sample.yaml
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
Restrict AWS Org to Regions
View manifest.yaml
# 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 Mar 16, 2017
Ansible Playbook to deploy a CloudFormation stack
View ansible_playbook.yaml
# 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 Feb 10, 2017
cloud-custodian error message when running as Lambda function
View gist:97920702cf1cdb4f45411e926ca028a3
policies:
- name: s3-bucket-check
resource: s3
mode:
role: arn:aws:iam::xxxxx:role/lambda-basic-execution
type: periodic
schedule: "rate(10 minutes)"