Skip to content

Instantly share code, notes, and snippets.

View Rud5G's full-sized avatar
🏡
Working remotely

Rudger Rud5G

🏡
Working remotely
View GitHub Profile
// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
// SPDX-License-Identifier: MIT-0
exports.SUCCESS = "SUCCESS";
exports.FAILED = "FAILED";
exports.send = function(event, context, responseStatus, responseData, physicalResourceId, noEcho) {
return new Promise((resolve, reject) => {
var responseBody = JSON.stringify({
@Rud5G
Rud5G / auto-vpa-creation-policy.yaml
Created December 22, 2024 12:35 — forked from iyalang/auto-vpa-creation-policy.yaml
Kyverno policy for automated creation of Vertical Pod Autoscalers (VPAs)
---
apiVersion: kyverno.io/v1
kind: ClusterPolicy
metadata:
name: auto-vpa-creation
annotations:
policies.kyverno.io/title: Add default VPA
policies.kyverno.io/category: Cost Optimization
policies.kyverno.io/subject: Vertical Pod Autoscaler
policies.kyverno.io/description: >-
<!doctype html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<meta name="description" content="">
<meta name="author" content="">
<title>Starter Template</title>
const commonBinaryMimeTypes = new Set([
"application/octet-stream",
// Docs
"application/epub+zip",
"application/msword",
"application/pdf",
"application/rtf",
"application/vnd.amazon.ebook",
"application/vnd.ms-excel",
"application/vnd.ms-powerpoint",
@Rud5G
Rud5G / cluster-utils.ts
Last active November 10, 2024 14:08
from aws-quickstart/cdk-eks-blueprints
import { Construct } from "constructs";
import * as customResource from 'aws-cdk-lib/custom-resources';
import { ClusterInfo } from "../spi";
interface Tag {
Key: string;
Value: string;
}
@Rud5G
Rud5G / add-cfn-nag-suppression.ts
Last active November 9, 2024 19:02
addCfnNagSuppression
import { CfnResource } from 'aws-cdk-lib';
import { IConstruct } from 'constructs';
export interface CfnNagSuppression {
readonly id: string;
readonly reason: string;
}
export function addCfnNagSuppression(resource: IConstruct, suppression: CfnNagSuppression): void {
const cfnResource = resource.node.defaultChild as CfnResource;
@Rud5G
Rud5G / node-setup.sh
Created September 22, 2024 13:00
K3s Pi Cluster Node setup
echo 'execute manually'
exit 0
# become root
sudo bash
# add vim
apt install vim
@Rud5G
Rud5G / terraform_state_cloudformation_template.yml
Created August 18, 2024 15:07 — forked from qtangs/terraform_state_cloudformation_template.yml
CloudFormation Template for creating S3 bucket and DynamoDB table to hold Terraform state and locks
AWSTemplateFormatVersion: 2010-09-09
Description: >
Template for creating S3 bucket and DynamoDB table to hold Terraform state and locks
Validate: aws cloudformation validate-template --template-body file://terraform_state.yml
Deploy: aws cloudformation create-stack --region us-east-1 --stack-name Terraform-State-Resources --enable-termination-protection --template-body file://terraform_state.yml --parameters ParameterKey=TerraformStateBucketPrefix,ParameterValue=terraform-state ParameterKey=TerraformStateLockTableName,ParameterValue=terraform-state-locks
Parameters:
TerraformStateBucketPrefix:
Type: String
Default: terraform-state
Description: A prefix for S3 bucket name, account id will be added to ensure global uniqueness
aws iam create-group --group-name kops
aws iam attach-group-policy --policy-arn arn:aws:iam::aws:policy/AmazonEC2FullAccess --group-name kops
aws iam attach-group-policy --policy-arn arn:aws:iam::aws:policy/AmazonRoute53FullAccess --group-name kops
aws iam attach-group-policy --policy-arn arn:aws:iam::aws:policy/AmazonS3FullAccess --group-name kops
aws iam attach-group-policy --policy-arn arn:aws:iam::aws:policy/IAMFullAccess --group-name kops
aws iam attach-group-policy --policy-arn arn:aws:iam::aws:policy/AmazonVPCFullAccess --group-name kops
aws iam attach-group-policy --policy-arn arn:aws:iam::aws:policy/AmazonSQSFullAccess --group-name kops
aws iam attach-group-policy --policy-arn arn:aws:iam::aws:policy/AmazonEventBridgeFullAccess --group-name kops
import * as cdk from 'aws-cdk-lib';
import * as pipelines from 'aws-cdk-lib/pipelines';
import { Construct } from 'constructs';
import { PipelineStage } from '../pipeline-stage/pipeline-stage';
import { environments } from '../pipeline-config/pipeline-config';
export class PipelineStack extends cdk.Stack {
constructor(scope: Construct, id: string, props?: cdk.StackProps) {
super(scope, id, props);