Create a role with a trust policy that can be assumed by Cloudformation. Trust policy looks like this:
{
"Version": "2012-10-17",
"Statement": [
{
"Sid": "",
"Effect": "Allow",
Create a role with a trust policy that can be assumed by Cloudformation. Trust policy looks like this:
{
"Version": "2012-10-17",
"Statement": [
{
"Sid": "",
"Effect": "Allow",
{ "accountId": "$context.accountId", "apiId": "$context.apiId", "authorizer.error": "$context.authorizer.error", "authorizer.principalId": "$context.authorizer.principalId", "authorizer.property": "$context.authorizer.property", "awsEndpointRequestId": "$context.awsEndpointRequestId", "awsEndpointRequestId2": "$context.awsEndpointRequestId2", "customDomain.basePathMatched": "$context.customDomain.basePathMatched", "dataProcessed": "$context.dataProcessed", "domainName": "$context.domainName", "domainPrefix": "$context.domainPrefix", "error.message": "$context.error.message", "error.messageString": "$context.error.messageString", "error.responseType": "$context.error.responseType", "extendedRequestId": "$context.extendedRequestId", "httpMethod": "$context.httpMethod", "identity.accountId": "$context.identity.accountId", "identity.caller": "$context.identity.caller", "identity.cognitoAuthenticationProvider": "$context.identity.cognitoAuthenticationProvider", "identity.cognitoAuthenticationType": "$context.ident |
# after doing `brew install awscli`, add the following to the bottom of your .zshrc: | |
autoload bashcompinit && bashcompinit | |
source /opt/homebrew/share/zsh/site-functions/aws_zsh_completer.sh |
# connect your flash drive
# make sure it is visible to etcher
$ balena util available-drives
#!/bin/bash | |
curl -s 'https://api.regional-table.region-services.aws.a2z.com/index.json' \ | |
| jq '.prices[] | .attributes | .["aws:region"], .["aws:serviceName"]' \ | |
| sed '$!N;s/\n/,/' |
#!/bin/bash | |
# Specify contact list name here | |
CONTACT_LIST_NAME='' | |
OUTPUT_FILE="./contact-list_$CONTACT_LIST_NAME-$(date +%s).csv" | |
AWS_CLI_COMMAND="aws sesv2 list-contacts --contact-list-name $CONTACT_LIST_NAME --filter FilteredStatus=OPT_IN --page-size 1000 " | |
function cli_call() { | |
if [ ! -z NEXT_TOKEN ]; then | |
cli_output=$($AWS_CLI_COMMAND) |
# Get a list of all SSM managed instances that appear to be online | |
aws ssm describe-instance-information --filter Key=PingStatus,Values=Online --query "InstanceInformationList[*].{Instance:InstanceId,Name:Name}" --output=text | |
# Get a list of all IPs for a service in region | |
# Way 1: using prefix lists | |
aws ec2 get-managed-prefix-list-entries --prefix-list-id pl-b8a742d1 | |
# Way 2: using ip-ranges.json | |
curl https://ip-ranges.amazonaws.com/ip-ranges.json | jq '.prefixes | map(select(.region=="ap-southeast-2" and .service=="EC2")) | map(.ip_prefix) | .[]' |
echo -e "Running custom Unifi userdata" | |
AWS_DEFAULT_REGION=ap-southeast-2 | |
# Assoicate an elastic IP | |
ALLOC_ID=eipalloc-deadbeef | |
# Set timezone | |
ln -fs /usr/share/zoneinfo/Pacific/Auckland /etc/localtime | |
apt-key adv --keyserver keyserver.ubuntu.com --recv 06E85760C0A52C50 |
Content-Type: multipart/mixed; boundary="//" | |
MIME-Version: 1.0 | |
--// | |
Content-Type: text/cloud-config; charset="us-ascii" | |
MIME-Version: 1.0 | |
Content-Transfer-Encoding: 7bit | |
Content-Disposition: attachment; filename="cloud-config.txt" | |
#cloud-config |
brew install --cask visual-studio-code | |
brew install --cask iterm2 | |
brew install --cask alfred | |
brew install --cask istatmenus | |
brew install --cask hiddenbar | |
# Shell | |
echo 'alias l="ls -lashF"' >> ~/.zshrc |