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
CREATE EXTERNAL TABLE IF NOT EXISTS athenadatabaseforcsvs.athenatableforcsvs ( | |
aws_account_id string, | |
name string, | |
email string, | |
status string, | |
category string, | |
description string, | |
refreshed string, | |
processed string, | |
flagged string, |
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
SELECT a.aws_account_id, a.name, a.description, a.refreshed, a.status | |
FROM | |
athenatableforcsvs AS a | |
INNER JOIN | |
athenatableforcsvs AS b | |
ON a.aws_account_id = b.aws_account_id AND a.description = b.description | |
WHERE | |
a.status <> b.status | |
GROUP BY a.aws_account_id, a.name, a.description, a.refreshed, a.status | |
ORDER BY 1, 2, 3, 4, 5; |
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
# Programmatically get the # of virtual cores for an EC2 instance type to figure out licensing costs | |
# https://aws.amazon.com/ec2/virtualcores/ | |
$Region = 'us-east-1' | |
$ServiceCode = 'AmazonEC2' | |
$Products = Get-plsproduct -ServiceCode $ServiceCode -Filter @{Type="TERM_MATCH";Field="productFamily";Value="Compute Instance"},@{Type="TERM_MATCH";Field="location";Value="Asia Pacific (Sydney)"} -Region $Region | |
$VirtualCoresByAmazonEC2InstanceType = @() |
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
import time | |
import boto3 | |
import pprint | |
# setup pprint | |
pp = pprint.PrettyPrinter(indent=1) | |
# define the connection | |
client = boto3.client('organizations') |
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 | |
# Tested using bash version 3.2.57 | |
echo Source Test Bucket? | |
read sourcetestbucketname | |
sourcetestbucket="s3://$sourcetestbucketname" | |
aws s3 mb $sourcetestbucket | |
echo Destination Test Bucket? |
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
#!/usr/bin/env | |
# To check RI Utilization | |
echo "What is your Start Date for checking RI Utilization? (YYYY-MM-DD)" | |
read startDate | |
startDateString="Start=$startDate" | |
echo "What is your End Date for checking RI Utilization? (YYYY-MM-DD)" | |
read endDate | |
endDateString="End=$endDate" |
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
cls | |
$ASGs = Get-ASAutoScalingGroup | |
$ASGsWithoutSLR = @() | |
foreach ($ASG in $ASGs) | |
{ | |
if ($ASG.ServiceLinkedRoleARN -eq $null) | |
{ | |
$ASGsWithoutSLR += $ASG |
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
{ | |
"AWSTemplateFormatVersion": "2010-09-09", | |
"Description": "T2 Unlimited Launch Template", | |
"Outputs": { | |
"LaunchTemplate": { | |
"Value": { | |
"Ref": "TestLaunchTemplate" | |
} | |
} | |
}, |
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
import boto3 | |
ec2_client = boto3.client('ec2') | |
rds_client = boto3.client('rds') | |
rdsNetworkInterfaces = ec2_client.describe_network_interfaces( | |
Filters=[ | |
{ | |
'Name': 'attachment.instance-owner-id', | |
'Values': [ |
OlderNewer