- 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
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 {} |
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 iam upload-server-certificate --server-certificate-name mirrors-test.testtest.vme360.com --certificate-body file://cert.pem --private-key file://privkey.pem --certificate-chain file://chain.pem --path '/cloudfront/openmirror/' |
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
certbot certonly --expand -d pypi.mirrors-test.testtest.vme360.com -d mirrors-test.testtest.vme360.com --config-dir `pwd` --work-dir `pwd` --logs-dir `pwd` --manual --preferred-challenges dns |
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
certbot certonly --expand -d pypi.mirrors-test.testtest.vme360.com -d mirrors-test.testtest.vme360.com --config-dir `pwd` --work-dir `pwd` --logs-dir `pwd` --manual --preferred-challenges dns |