Skip to content

S3 Configuration

assafkamil edited this page Jan 15, 2021 · 2 revisions

Flyway lambda supports loading S3 bucket configuration from environment variables and function parameters.

Function parameters take precedence over environment variables.

S3 options

Option Description Parameter Environment variable Value type Required Default
S3 bucket Bucket name bucket S3_BUCKET string Yes
Folder Folder (prefix) in bucket (e.g., migrations) folder S3_FOLDER string No

Example for invoking the lambda with S3 parameters:

aws lambda invoke --function-name FlywayLambda --payload '{ "s3Request": {"folder": "migrations"} }' response.json

Permissions

Flyway lambda IAM execution role needs access to read from the S3 bucket. The minimal permissions required are:

{
  "Effect": "Allow",
  "Action": [
     "s3:GetObject"
  ],
  "Resource": ["arn:aws:s3:::mybucket/*"]
}