Using S3 for temporary storage

The agent SDK needs a location to store files that are being uploaded and files that it has generated. By default, it uses the filesystem to store these, within the current working directory. In some cases, particuarly if you want users to download those files that are created, you'll want to setup an S3 bucket.

Setting up S3 in the SDK

To configure S3 within the SDK, there are a few steps you need to take. First you need to tell the SDK which region and what bucket to use. Just set the environment variables below or add the properties to your application.properties. To set this up.

aws.download.region=${AWS_DOWNLOAD_REGION:eu-central-1}
aws.download.bucket=${AWS_DOWNLOAD_BUCKET:}

Now we need to ensure we have our credentials set.

Running locally

When we're running locally (the dev or local profile) - you'll also need to set your AWS credentials. We recommend setting these inside a application-local.properties file or similar that is just for that running profile:

application-local.properties
aws.secret.key=${AWS_SECRET_KEY:}
aws.access.key=${AWS_ACCESS_KEY:}

Now when you run the SDK you'll be able to interact with S3 just as if you were inside AWS.

Running inside AWS

When running within AWS, all you need to do is set the profile to aws . This tells the SDK to pick up the access from the instance roles. Just be sure that you have setup your instance IAM profile to have access to S3.

Last updated

Was this helpful?