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 | |
# Define the connection | |
client = boto3.client('ec2') | |
# Get all Regions | |
response = client.describe_regions() | |
# Create an Array for Region Names | |
RegionNames = [] |
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 update-account-password-policy --minimum-password-length 8 --require-numbers --require-uppercase-characters --require-lowercase-characters --require-symbols |
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': [ |
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
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
#!/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
#!/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
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
# 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 = @() |