- Install
gcloud - Configure account auth via
gcloud auth login - Install
jq
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
| apiVersion: eksctl.io/v1alpha5 | |
| kind: ClusterConfig | |
| metadata: | |
| name: gitops-cluster-prod | |
| region: ap-southeast-1 | |
| version: '1.21' | |
| karpenter: | |
| version: 0.4.3 | |
| createServiceAccount: true | |
| managedNodeGroups: |
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
| #!/bin/bash -xe | |
| create_repo() { | |
| local name=$1 | |
| local region=$2 | |
| # create ecr repo | |
| aws ecr create-repository --region $region --repository-name "$name" --image-tag-mutability IMMUTABLE --image-scanning-configuration scanOnPush=true --encryption-configuration encryptionType=AES256 2>/dev/null | |
| # set repo permission |
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
| # Amazon Neptune version 4 signing example (version v2) | |
| # The following script requires python 3.6+ | |
| # (sudo yum install python36 python36-virtualenv python36-pip) | |
| # => the reason is that we're using urllib.parse() to manually encode URL | |
| # parameters: the problem here is that SIGV4 encoding requires whitespaces | |
| # to be encoded as %20 rather than not or using '+', as done by previous/ | |
| # default versions of the library. | |
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 standardPartitionCondition = new CfnCondition(this, 'IsStandardPartition', { | |
| expression: Fn.conditionEquals(Aws.PARTITION, 'aws'), | |
| }); | |
| const dbUser = 'dashboard'; | |
| const docDBCluster = new DatabaseCluster(this, 'DashboardDatabase', { | |
| masterUser: { | |
| username: dbUser, | |
| }, | |
| storageEncrypted: true, |
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
| local-empty-dir/ |
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
| #!/bin/bash -x | |
| import_key() { | |
| local name=$1 | |
| local path=$2 | |
| local region=$3 | |
| EXISTINGKEY=`aws ec2 describe-key-pairs --region $region --key-names $name --query 'KeyPairs[].KeyName' 2>/dev/null|jq '.[]'|jq '.'` | |
| if [[ -z $EXISTINGKEY ]] | |
| then | |
| aws ec2 import-key-pair --key-name $name --public-key-material fileb://$path --region $region >/dev/null |
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
| aws events list-rules --name-prefix OpenTunaStack-MonitorStac-Monitor --query 'Rules[].Name' --output json |jq '.[]' |jq '.'|xargs -n 1 aws events disable-rule --name |
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
| aws ec2 describe-images --owners amazon --filters "Name=name,Values=amzn2-ami-hvm-*-ebs" "Name=root-device-type,Values=ebs" "Name=architecture,Values=x86_64" --query 'reverse(sort_by(Images, &CreationDate))[:1]' |
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
| aws logs describe-log-groups --query "logGroups[].logGroupName" --log-group-name-prefix /aws/lambda/func-prefix | jq '.[]' | xargs -n 1 -I{} aws logs delete-log-group --log-group-name {} |