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 | |
| function delete_container_exited(){ | |
| docker rm -v $(docker ps -a -q -f status=exited) | |
| } | |
| function delete_container_all(){ | |
| docker rm -v $(docker ps -a -q) | |
| } |
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 s3api list-objects-v2 --bucket BUCKET_NAME --prefix folder1/folder2 --query "Contents[?StorageClass=='GLACIER']" --output text | awk '{print $2}' > glacier-objects.txt |
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 --profile sdsdevelmanager ec2 describe-instances --filters "Name=tag:Domain, Values=PRODUCTION-GOLD"\ | |
| --query 'Reservations[*].Instances[*].[ [Tags[?Key==`Name`].Value] [0][0], [Tags[?Key==`Domain`].Value] [0][0], InstanceId, PublicIpAddress, PrivateIpAddress, InstanceType, Placement.AvailabilityZone ]'\ | |
| --output text > instances.csv |
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 --profile PROFILE_NAME iam list-instance-profiles // List all instance Profile | |
| aws --profile PROFILE_NAME iam delete-instance-profile --instance-profile-name INSTANCE_PROFILE_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
| { | |
| "agent": { | |
| "metrics_collection_interval": 15, | |
| "logfile": "{{ aws_cwa_logfile_path }}" | |
| }, | |
| "metrics": { | |
| "namespace": "CWAgent2", | |
| "metrics_collected": { | |
| "cpu": { |
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
| { | |
| "agent": { | |
| "metrics_collection_interval": 15, | |
| "logfile": "{{ aws_cwa_logfile_path }}" | |
| }, | |
| "metrics": { | |
| "namespace": "CWAgentNew", | |
| "metrics_collected": { | |
| "cpu": { |
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 \ | |
| rds \ | |
| describe-events \ | |
| --source-identifier ab-postgres-01 \ | |
| --source-type db-instance \ | |
| --start-time $(date -u -v-13d -v-23H -v-59M -v-55S'+%FT%T') \ | |
| --end-time $(date -u '+%FT%T') \ | |
| --query 'Events[*].[Date,Message]' --output text |
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 \ | |
| rds \ | |
| describe-events \ | |
| --source-identifier db_identifier \ | |
| --source-type db-instance \ | |
| --start-time $(date -u -d "14 days ago + 5 seconds" '+%FT%T') \ | |
| --end-time $(date -u '+%FT%T') \ | |
| --query 'Events[*].[Date,Message]' --output text |
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
| policies: | |
| - name: list_specific-postgres-rds | |
| resource: rds | |
| filters: | |
| - type: value | |
| key: "Engine" | |
| op: equal | |
| value: postgres | |
| - type: value | |
| key: "EngineVersion" |
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
| custodian report rds-postgres.yml -s . --field "DBInstanceIdentifier=DBInstanceIdentifier" --field "EngineVersion=EngineVersion" --field "MultiAZ=MultiAZ" --field "ProductDomain=tag:ProductDomain" --field "PendingUpdate=PendingModifiedValues" --field "AllocatedStorage=AllocatedStorage" --field "MaintenanceWindowTime=PreferredMaintenanceWindow" --no-default-fields > list_rds.xls |
NewerOlder