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
### Keybase proof | |
I hereby claim: | |
* I am flochaz on github. | |
* I am fchazal (https://keybase.io/fchazal) on keybase. | |
* I have a public key ASDozIA_q6wVt0Fy9KnDbu9g3GoQuM5ymp7tTrQAg2Mfcgo | |
To claim this, I am signing this 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
######### | |
# WARNING WARNING WARNING | |
# WARNING WARNING WARNING | |
# WARNING WARNING WARNING | |
# WARNING WARNING WARNING | |
# WARNING WARNING WARNING | |
# this file is generated dynamically from /etc/aide/aide.conf and the files | |
# in /etc/aide/aide.conf.d | |
# Any changes you make here will be lost. | |
# WARNING WARNING WARNING |
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 axios = require('axios'); | |
/** | |
* @param {Event} event - Login event | |
*/ | |
exports.onExecutePostLogin = async (event, api) => { | |
console.log(`creating user`); | |
const createUserResponse = await axios.post( | |
`https://scim.us-west-2.amazonaws.com/${event.secrets.TENANT_ID}/scim/v2/Users`, | |
{ |
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
private void createCustomResourceToPopulateDb(ApiStackProps props, Role lambdaRdsProxyRoleWithPw) throws IOException { | |
// See https://docs.aws.amazon.com/cdk/api/latest/java/software/amazon/awscdk/customresources/package-summary.html for details on writing a Lambda function | |
// and providers | |
Function dbPopulatorHandler = | |
defaultLambdaRdsProxy("PopulateFarmDb", props, lambdaRdsProxyRoleWithPw); | |
Provider dbPopulatorProvider = | |
new Provider( | |
this, | |
"InvokePopulateDataProvider", | |
ProviderProps.builder().onEventHandler(dbPopulatorHandler).build()); |
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
String change001File = "../ApiHandlers/scripts/com/ilmlf/db/001.sql"; | |
String change001Script = new String(Files.readAllBytes(Paths.get(scriptFile))); | |
String change002File = "../ApiHandlers/scripts/com/ilmlf/db/002.sql"; | |
String change002Script = new String(Files.readAllBytes(Paths.get(scriptFile))); | |
CustomResource change001to002 = new CustomResource( | |
this, | |
"change-001", | |
CustomResourceProps.builder() |
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
@NotNull ISource sqlFilesAsset = Source.asset(options.migrationScriptsFolderAbsolutePath); | |
Bucket migrationFilesBucket = new Bucket(this, "MigrationFilesBucket"); | |
BucketDeployment migrationFilesDeployment = BucketDeployment.Builder | |
.create(this, "DeploySQLMigrationFiles") | |
.sources(List.of(sqlFilesAsset)) | |
.destinationBucket(migrationFilesBucket) | |
.build(); |
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 flywayServiceLambda = new Function( | |
this, | |
"runner", | |
FunctionProps.builder() | |
.environment( | |
Map.of( | |
"S3_BUCKET", migrationFilesBucket.getBucketName(), | |
"DB_CONNECTION_STRING", String.format("jdbc:mysql://{}/{}", options.databaseInstance.getDbInstanceEndpointAddress(), options.getDatabaseName()), | |
"DB_SECRET", options.databaseInstance.getSecret().getSecretFullArn())) | |
.runtime(Runtime.JAVA_11) |
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
aws lambda invoke --cli-binary-format raw-in-base64-out \ | |
--payload '{ "flywayRequest": {"flywayMethod": "migrate" }}' \ | |
--function-name FlywayLambdaS3 |
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
new AwsCustomResource(this, "trigger", AwsCustomResourceProps.builder() | |
.logRetention(options.logRetention != null ? options.logRetention : RetentionDays.ONE_DAY) | |
.onUpdate(AwsSdkCall.builder() | |
.service("Lambda") | |
.action("invoke") | |
.physicalResourceId(PhysicalResourceId.of("flywayTrigger")) | |
.parameters(Map.of( | |
"FunctionName", flywayServiceLambda.getFunctionName(), | |
"InvocationType", "RequestResponse", | |
"Payload", "{" + |