Skip to content

Instantly share code, notes, and snippets.

View readybuilderone's full-sized avatar

Yihui Han readybuilderone

  • Shanghai, China
View GitHub Profile
@readybuilderone
readybuilderone / find_ec2_target_group.sh
Created October 12, 2023 09:12
find alb target group for given ec2
#!/bin/bash
# 检查是否提供了实例ID和区域作为参数
if [ -z "$1" ] || [ -z "$2" ]; then
echo "Usage: $0 <Instance ID> <AWS Region>"
exit 1
fi
# 从命令行参数获取实例ID和AWS区域
INSTANCE_ID="$1"
@readybuilderone
readybuilderone / clone-elasticache-parametergroup.py
Last active May 5, 2022 04:48
Boto3 Scripts to Clone Elasticache Parameter Group
from curses import has_key
from urllib import response
import boto3
SourceParameterGroupName = 'sample-source-pg'
TargetParameterGroupName = 'sample-target-pg'
def createParameterGroup(client, pgName, pgFamily, pgDescription=''):
response = client.create_cache_parameter_group(
@readybuilderone
readybuilderone / update-rule-group.py
Created April 25, 2022 02:23
Python Scripts to update AWS Network Firewall rule group in batch, python3
from urllib import response
import boto3
TargetRuleGroupName='aurora-firewall-sample-stateful-rule-group'
ExpectedIPList=['54.222.61.40','54.222.61.41','54.222.61.42','54.222.61.43','54.222.61.45','54.222.61.40']
def getUpdateToken(filewallClient, targetRuleGroupName):
rulegroupResponse = filewallClient.describe_rule_group(
@readybuilderone
readybuilderone / cn-north-1-vpc-endpoints.md
Created August 12, 2021 01:28
cn-north-1-vpc-endpoints

aws ec2 describe-vpc-endpoint-services

    "aws.sagemaker.cn-north-1.notebook",
    "aws.sagemaker.cn-north-1.studio",
    "cn.com.amazonaws.cn-north-1.application-autoscaling",
    "cn.com.amazonaws.cn-north-1.athena",
    "cn.com.amazonaws.cn-north-1.autoscaling",
    "cn.com.amazonaws.cn-north-1.awsconnector",

"cn.com.amazonaws.cn-north-1.cassandra",

@readybuilderone
readybuilderone / cn-northwest-1-vpc-endpoints.md
Last active August 12, 2021 01:48
cn-northwest-1-vpc-endpoints

aws ec2 describe-vpc-endpoint-services

    "aws.sagemaker.cn-northwest-1.notebook",
    "aws.sagemaker.cn-northwest-1.studio",
    "cn.com.amazonaws.cn-northwest-1.application-autoscaling",
    "cn.com.amazonaws.cn-northwest-1.athena",
    "cn.com.amazonaws.cn-northwest-1.autoscaling",
    "cn.com.amazonaws.cn-northwest-1.awsconnector",

"cn.com.amazonaws.cn-northwest-1.cassandra",