AWS S3

<dependency>
	<groupId>one.microstream</groupId>
	<artifactId>microstream-afs-aws-s3</artifactId>
	<version>07.01.00-MS-GA</version>
</dependency>
S3Client client = ...;
BlobStoreFileSystem fileSystem = BlobStoreFileSystem.New(
	S3Connector.Caching(client)
);
EmbeddedStorage.start(fileSystem.ensureDirectoryPath("microstream_storage"));

Configuration

When using external configuration AWS S3 can be set as follows.

microstream-storage.properties
storage-filesystem.aws.s3.credentials.type=static
storage-filesystem.aws.s3.credentials.access-key-id=my-access-key-id
storage-filesystem.aws.s3.credentials.secret-acces-key=my-secret-access-key
storage-filesystem.aws.s3.credentials.region=us-east-1

Supported properties

Property Description

endpoint-override

The endpoint with which the SDK should communicate.

region

Configure the region with which the SDK should communicate. If this is not specified, the SDK will attempt to identify the endpoint automatically using the following logic:

  1. Check the 'aws.region' system property for the region.

  2. Check the 'AWS_REGION' environment variable for the region.

  3. Check the {user.home}/.aws/credentials and {user.home}/.aws/config files for the region.

  4. If running in EC2, check the EC2 metadata service for the region.

credentials.type

The type of the credentials provider. Supported values are:

  • "environment-variables" Credentials will be loaded from the AWS_ACCESS_KEY_ID, AWS_SECRET_ACCESS_KEY and AWS_SESSION_TOKEN environment variables.

  • "system-properties" Credentials will be loaded from the aws.accessKeyId, aws.secretAccessKey and aws.sessionToken system properties.

  • "static" Credentials will be loaded from the credentials.access-key-id and credentials.secret-access-key properties.

  • "default" Credentials provider chain that looks for credentials in this order:

    1. Java System Properties - aws.accessKeyId and aws.secretKey

    2. Environment Variables - AWS_ACCESS_KEY_ID and AWS_SECRET_ACCESS_KEY

    3. Credential profiles file at the default location (~/.aws/credentials) shared by all AWS SDKs and the AWS CLI

    4. Credentials delivered through the Amazon EC2 container service if AWS_CONTAINER_CREDENTIALS_RELATIVE_URI" environment variable is set and security manager has permission to access the variable,

    5. Instance profile credentials delivered through the Amazon EC2 metadata service

credentials.access-key-id

The access key id, used when "credentials.type" is "static".

credentials.secret-access-key

The secret access key, used when "credentials.type" is "static".