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 aws-sso() { | |
aws configure sso --profile default | |
ACCESS_KEY_POSTFIX="\"$(aws configure list --profile default | grep access_key | awk '{print $2}' | sed 's/*//g')\"" | |
SECRET_KEY_POSTFIX="$(aws configure list --profile default | grep secret_key | awk '{print $2}' | sed 's/*//g')" | |
ACCESS_KEY_FILTER=". | select(.Credentials.AccessKeyId | endswith($ACCESS_KEY_POSTFIX))" | |
SECRET_KEY_FILTER=". | select(.Credentials.SecretAccessKey | endswith(\"$SECRET_KEY_POSTFIX\"))" | |
for entry in ~/.aws/cli/cache/* | |
do | |
FOUND_ACCESS_KEY="$(cat $entry | jq -r "$ACCESS_KEY_FILTER")" | |
FOUND_ACCESS_SECRET="$(cat $entry | jq -r "$SECRET_KEY_FILTER")" |
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
DROP TRIGGER IF EXISTS NEW_ROUTE; | |
CREATE TRIGGER NEW_ROUTE | |
AFTER INSERT | |
ON routes | |
FOR EACH ROW | |
BEGIN | |
CALL mysql.lambda_async( | |
'arn:aws:lambda:eu-west-1:XXXXXXXXXX:function:RDS-EVENTS-CONSUMER', | |
JSON_OBJECT('new', JSON_OBJECT( | |
'airportFrom', NEW.airportFrom, |
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
DROP TRIGGER IF EXISTS DELETED_ROUTE; | |
CREATE TRIGGER DELETED_ROUTE | |
AFTER DELETE | |
ON routes | |
FOR EACH ROW | |
BEGIN | |
CALL mysql.lambda_async( | |
'arn:aws:lambda:eu-west-1:XXXXXXXXXX:function:RDS-EVENTS-CONSUMER', | |
JSON_OBJECT( | |
'old', JSON_OBJECT( |
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
DROP TRIGGER IF EXISTS UPDATED_ROUTE; | |
CREATE TRIGGER UPDATED_ROUTE | |
AFTER UPDATE | |
ON routes | |
FOR EACH ROW | |
BEGIN | |
IF ( | |
MD5(CONCAT_WS('', NEW.airportFrom, NEW.airportTo, NEW.connectingAirport, NEW.newRoute, NEW.seasonalRoute, NEW.operator, NEW.group, NEW.tags)) | |
<> MD5(CONCAT_WS('', OLD.airportFrom, OLD.airportTo, OLD.connectingAirport, OLD.newRoute, OLD.seasonalRoute, OLD.operator, OLD.group, OLD.tags)) | |
) THEN |
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
START TRANSACTION; | |
INSERT INTO flights.routes (airportFrom, airportTo, connectingAirport, newRoute, seasonalRoute, operator, `group`, tags, similarArrivalAirportCodes, carrierCode) VALUES ('FOO', 'ROLLBACK_1', null, false, false, 'RYANAIR', 'CITY', '', '', 'FR'); | |
INSERT INTO flights.routes (airportFrom, airportTo, connectingAirport, newRoute, seasonalRoute, operator, `group`, tags, similarArrivalAirportCodes, carrierCode) VALUES ('FOO', 'ROLLBACK_2', null, false, false, 'RYANAIR', 'CITY', '', '', 'FR'); | |
INSERT INTO flights.routes (airportFrom, airportTo, connectingAirport, newRoute, seasonalRoute, operator, `group`, tags, similarArrivalAirportCodes, carrierCode) VALUES ('FOO', 'ROLLBACK_3', null, false, false, 'RYANAIR', 'CITY', '', '', 'FR'); | |
ROLLBACK; |
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
const AWS = require("aws-sdk") | |
const _ = require("lodash") | |
const dynamo = new AWS.DynamoDB.DocumentClient({ | |
apiVersion: "2012-08-10", | |
region: "eu-west-1" | |
}) | |
const BATCH_SIZE = 25; | |
const sourceTable = "<put-value-here>"; | |
const destinationTable = "<put-value-here>"; |
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: SSO Account Setup | |
Parameters: | |
InstanceARN: | |
Type: String | |
AllowedPattern: arn:aws:sso:::instance/(sso)?ins-[a-zA-Z0-9-.]{16} | |
Description: 'Enter AWS SSO InstanceARN. Ex: arn:aws:sso:::instance/ssoins-xxxxxxxxxxxxxxxx' | |
ConstraintDescription: AWS SSO InstanceARN - gather with aws sso-admin list-instances | |
IdentityStoreId: |
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
2023-02-26T11:24:51.473000 <--- Loaded 1 messages | |
2023-02-26T11:24:51.473000 xxx> Test event 4 | |
2023-02-26T11:24:51.477000 <--- Loaded 1 messages | |
2023-02-26T11:24:51.477000 ---> Test event 3 | |
2023-02-26T11:24:52.819000 <--- Loaded 1 messages | |
2023-02-26T11:24:52.819000 ---> Test event 2 | |
2023-02-26T11:24:52.843000 <--- Loaded 1 messages | |
2023-02-26T11:24:52.843000 ---> Test event 5 | |
2023-02-26T11:24:52.877000 <--- Loaded 1 messages | |
2023-02-26T11:24:52.877000 ---> Test event 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
2023-02-26T01:38:11.420000 <--- Loaded 6 messages | |
2023-02-26T01:38:11.420000 ---> Test event 1 | |
2023-02-26T01:38:11.420000 ---> Test event 5 | |
2023-02-26T01:38:11.420000 ---> Test event 9 | |
2023-02-26T01:38:11.420000 xxx> Test event 10 | |
2023-02-26T01:38:26.068000 <--- Loaded 4 messages | |
2023-02-26T01:38:26.068000 xxx> Test event 3 | |
2023-02-26T01:38:51.377000 <--- Loaded 5 messages |
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
2023-02-26T19:19:17.383000 <--- Loaded 4 messages | |
2023-02-26T19:19:17.383000 ---> Test event 5 | |
2023-02-26T19:19:17.383000 ---> Test event 3 | |
2023-02-26T19:19:17.383000 xxx> Test event 6 | |
2023-02-26T19:19:17.383000 xxx> Test event 10 | |
2023-02-26T19:19:28.457000 <--- Loaded 6 messages | |
2023-02-26T19:19:28.457000 xxx> Test event 4 | |
2023-02-26T19:19:28.457000 xxx> Test event 2 | |
2023-02-26T19:19:28.457000 ---> Test event 1 |
OlderNewer