This file contains 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 | |
export AWS_DEFAULT_PROFILE='my-profile' | |
export AWS_DEFAULT_REGION='us-east-1' | |
# Find all application load balancers | |
load_balancer_arns=$(aws elbv2 describe-load-balancers --query 'LoadBalancers[?Type==`application`].[LoadBalancerArn]' --output text) | |
for load_balancer_arn in $load_balancer_arns | |
do |
This file contains 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-instances \ | |
--filters \ | |
"Name=instance-state-name,Values=running" \ | |
"Name=platform,Values=windows" \ | |
--query 'Reservations[*].Instances[?PlatformDetails==`Windows with SQL Server Standard`].{Name:Tags[?Key==`Name`]|[0].Value,InstanceId:InstanceId,Status:State.Name,InstanceType:InstanceType,ImageId:ImageId,Platform:Platform,PlatformDetails:PlatformDetails}|[]' \ | |
--output json |
This file contains 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 | |
profile_prefix="ProfilePrefix" | |
region="us-east-1" | |
for i in Account1 Account2 Account3 | |
do | |
length=$(aws cloudwatch describe-alarms \ | |
--state-value ALARM \ | |
--query "length(MetricAlarms[?starts_with(AlarmActions[0], \`arn:aws:autoscaling\`) == \`false\`])" \ |
This file contains 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 wafv2 describe-managed-rule-group \ | |
--vendor-name AWS \ | |
--name AWSManagedRulesCommonRuleSet \ | |
--scope REGIONAL \ | |
--region <REGION> \ | |
--query 'AvailableLabels[].[Name]' \ | |
--output text |
This file contains 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 cloudformation get-template \ | |
--stack-name <STACK_NAME> \ | |
--query 'TemplateBody' \ | |
--output text |
This file contains 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 backup list-backup-plans \ | |
--query 'BackupPlansList[].[BackupPlanName]' \ | |
--output text |
This file contains 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 | |
# | |
# TIMING AND PERFORMANCE: | |
# Options which take <time> are in seconds, or append 'ms' (milliseconds), | |
# 's' (seconds), 'm' (minutes), or 'h' (hours) to the value (e.g. 30m). | |
# -T<0-5>: Set timing template (higher is faster) | |
# OUTPUT: | |
# -oN/-oX/-oS/-oG <file>: Output scan in normal, XML, s|<rIpt kIddi3, | |
# and Grepable format, respectively, to the given filename. | |
# -v: Increase verbosity level (use -vv or more for greater effect) |
This file contains 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-instances \ | |
--filters "Name=tag:Name,Values=some-name" \ | |
--query 'Reservations[].Instances[].[InstanceId]' \ | |
--output text |
This file contains 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 elbv2 describe-ssl-policies --query 'sort_by(SslPolicies[], &Name)[].{Name:Name}' --output text |
This file contains 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 | |
# List application load balancers by ARN | |
load_balancer_arns=$(aws elbv2 describe-load-balancers \ | |
--query 'sort_by(LoadBalancers[?contains(LoadBalancerArn,`:loadbalancer/app/`)],&LoadBalancerArn)[].[LoadBalancerArn]' \ | |
--output text) | |
# For each ALB describe listeners with an SSL policy |
NewerOlder