A convenient way to test
SNS Subscription Filter Policies
Show archive.org snapshot
is using an email address as the subscription endpoint. However, for this to work when the filter is applied to the MessageBody
the protocol must be set to email-json
. Using the email
protocol will change the message format and filtering will not work as expected.
Related cards:
HowTo apply Test Driven Development to Container Images
Apply Test Driven Development(TDD) to the process of building container images by defining test before writing code and automate the testing process. Iterate through the TDD cycle while developing and running the tests later in continuous integrat...
Change / Update SSL certificate for Amazon Elastic Load Balancer with AWS Command Line Interface
-
Install and configure the AWS Command Line Interface
-
Show existing certificates to test if the AWS Cli is working:
$ aws iam list-server-certificates { "ServerCertificateMetadataList": [...
Listing sizes in AWS S3 Buckets
Getting the whole bucket size
aws s3 ls s3://$BUCKETNAME/ --recursive --human-readable --summarize | tail -n2
Tail is used because otherwise all files will be printed on screen (but you may want that for some reason).
Getting...
HowTo: enable termination protection for all EC2 instances not in autoscaling groups via aws cli
aws ec2 describe-instances --output text --query 'Reservations[].Instances[?!not_null(Tags[?Key == `aws:autoscaling:groupName`].Value)] | [].[InstanceId]' | xargs -L1 -t aws ec2 modify-instance-attribute --disable-api-termination --instance-id...
Fix "A client error (MalformedCertificate) occurred: Invalid Private Key." at AWS SSL Certificate upload
I'm creating certificate requests with this command:
openssl req -new -out www.example.com.csr -keyout www.example.com.key -newkey rsa:2048 -nodes
When I try to upload the certificate to AWS IAM I get this error:
$ aws iam upload-se...
HowTo: enable DeletionProtection for all RDS instances via aws cli and jq
aws rds describe-db-instances | jq '.[][] | select(.DeletionProtection == false) | .DBInstanceIdentifier' | xargs -L1 -t aws rds modify-db-instance --deletion-protection --db-instance-identifier
Disable AWS Free Tier Usage Alerts
Ever felt annoyed by AWS Free Tier limit alert emails?
Just disable them:
Billing preferences -> Cost Management Preferences -> Receive Fr...
How to unban host with Fail2ban
To see all jails:
fail2ban status
Our $JAIL is usually ssh
.
To see which IPs are banned currently:
fail2ban-client status ssh
If you want to unban a host banned by fail2ban on Ubuntu 14.04 or later use this method:
Terraform: Deploying code for lambda functions
If you're deploying code for your lambda function via terraform, this code is usually zipped and uploaded to Amazon S3 by terraform. The ZIP file's hash is then stored to terraform's state. However we have observed that zipping files can create ZI...