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
| #set($origin = $input.params().get('header').get('Origin')) | |
| { | |
| ## TODO: update regex to match your supported API origins | |
| #if($origin.matches("https?:example.com")) | |
| "statusCode": 204 | |
| #set($context.responseOverride.header.Access-Control-Allow-Origin = $origin) | |
| #set($context.responseOverride.header.Access-Control-Allow-Methods = "OPTIONS,GET,PUT,POST,DELETE,PATCH,HEAD") | |
| #set($context.responseOverride.header.Access-Control-Allow-Headers = "Authorization,Content-Type,Accept") | |
| #set($context.responseOverride.header.Access-Control-Max-Age = "86400") | |
| #else |
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 bash | |
| BRANCH=$(git rev-parse --abbrev-ref HEAD) | |
| if [[ "$3" == "0" ]]; then | |
| # Exit gracefully when hook is called on file checkout | |
| exit 0 | |
| fi | |
| if [[ "$BRANCH" == "" ]]; then | |
| # Error when the branch could not be determined | |
| echo 'ERROR: Unable to determine the current branch' | |
| exit 1 |
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 python3 | |
| import boto3 | |
| def create_billing_alarm(account, amount, topic): | |
| """Creates a billing alarm for a linked account. | |
| Parameters | |
| ---------- | |
| account : str | |
| Account ID of the linked account. |