Random recipes of JMESPath for the AWS CLI tools that I might have written or stumbled upon.
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
{ | |
"Version": "2012-10-17", | |
"Statement": [ | |
{ | |
"Effect": "Deny", | |
"Action": "*", | |
"Resource": "*", | |
"Condition": { | |
"ForAllValues:StringEquals": { | |
"aws:RequestedRegion": [ |
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
———————————————————————————————————————————————————————————————————————————————————————————————————— | |
BBEDIT/TEXTWRANGLER REGULAR EXPRESSION GUIDE MODIFIED 2016/02/29 17:26 | |
———————————————————————————————————————————————————————————————————————————————————————————————————— | |
NOTES: | |
The PCRE engine (Perl Compatible Regular Expressions) is what BBEdit and TextWrangler use. | |
Items I'm unsure of are marked '# PCRE?'. The list while fairly comprehensive is not complete. |
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
#!/usr/bin/python | |
import boto3 | |
from contextlib import closing | |
client = boto3.client('polly') | |
response = client.synthesize_speech( | |
OutputFormat='mp3', | |
Text='Amazon Polly is a service that turns text into lifelike speech. Polly lets you create applications that talk, enabling you to build entirely new categories of speech-enabled products. Polly is an Amazon AI service that uses advanced deep learning technologies to synthesize speech that sounds like a human voice. Polly includes 47 lifelike voices spread across 24 languages, so you can select the ideal voice and build speech-enabled applications that work in many different countries.', |
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
\+?1?\s?\-?\(?\d{3}\)?\s?\-?\d{3}\s?\-?\d{4} |
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
<# | |
NOTE: DO NOT RUN THIS SCRIPT | |
This is simply a record of commands | |
demonstrated in the AWS PowerShell Webinar | |
#> | |
#Credentials | |
Get-EC2Instance -AccessKey $AccessKey -SecretKey $SecretKey -Region us-west-1 |
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
# https://www.radishlogic.com/aws/lambda/how-to-get-the-aws-account-id-in-lambda-python/ | |
def lambda_handler(event, context): | |
aws_account_id = context.invoked_function_arn.split(":")[4] | |
print(aws_account_id) |
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
--- | |
AWSTemplateFormatVersion: 2010-09-09 | |
Description: Creates a CodeBuild project to audit an AWS account with Prowler and stores the html report in a S3 bucket. This will run onece at the beginning and on a schedule afterwards. Partial contribution from https://github.com/stevecjones | |
Parameters: | |
ServiceName: | |
Description: 'Specifies the service name used within component naming' | |
Type: String | |
Default: 'prowler' | |
LogsRetentionInDays: |
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
#Function Create-RandomFiles{ | |
<# | |
.SYNOPSIS | |
Generates a number of dumb files for a specific size. | |
.DESCRIPTION | |
Generates a defined number of files until reaching a maximum size. | |
.PARAMETER TotalSize | |
Specify the total size you would all the files combined should use on the harddrive. |