Skip to main content
Version: Next

AWS S3

Overview​

Retrieves the configuration from an AWS S3 bucket. This retriever is useful when you are using AWS and want to use S3 to store you configuration files.

Configure the relay proxy​

To configure your relay proxy to use the AWS S3 retriever, you need to add the following configuration to your relay proxy configuration file:

goff-proxy.yaml
# ...
retrievers:
- kind: s3
bucket: my-featureflag-bucket
item: flag/flags.goff.yaml
# ...
info

If you are using the S3 provider, the easiest way to provide credentials is to set environment variables. It will be used by GO Feature Flag to identify to your S3 bucket.

export AWS_SECRET_ACCESS_KEY=xxxx
export AWS_ACCESS_KEY_ID=xxx
export AWS_DEFAULT_REGION=eu-west-1
Field nameMandatoryTypeDefaultDescription
kindstringnoneValue should be s3.
This field is mandatory and describes which retriever you are using.
bucketstringnoneThis is the name of your S3 bucket (ex: my-featureflag-bucket).
itemstringnonePath to the file inside the bucket (ex: config/flag/my-flags.yaml).

Compatibility with S3-Compatible Solutions​

The S3 retriever is compatible with S3-compatible on-premises solutions such as MinIO.
To use an S3-compatible storage provider, ensure that you configure the following parameters:

  • Endpoint URL: Provide the endpoint URL of your S3-compatible solution.
  • Access Credentials: Use your S3-compatible solution's access key and secret key.
  • Bucket and Key: Specify the bucket name and the key where your configuration file is stored.
warning

The AWS SDK requires a region to be set, even if you are using an S3-compatible solution.

export AWS_DEFAULT_REGION=xxx
info

If you get spammed with

SDK 2025/04/25 13:07:36 WARN Response has no supported checksum.

Not validating response payload. you might want to set export AWS_RESPONSE_CHECKSUM_VALIDATION=when_required as well.

Configure the GO Module​

To configure your GO module to use the AWS S3 retriever, you need to add the following configuration to your ffclient.Config{} object:

info

The S3 Retriever v2 will use the aws-sdk-go-v2 to access your flag in an S3 bucket.

The S3 Retriever v1 will use the deprecated aws-sdk-go to access your flag in an S3 bucket.

AWS has announce end-of-support for AWS SDK for Go v1, and it's recommended to migrate from S3 Retriever v1 to v2.

example.go
awsConfig, _ := config.LoadDefaultConfig(context.Background())
err := ffclient.Init(ffclient.Config{
PollingInterval: 3 * time.Second,
Retriever: &s3retrieverv2.Retriever{
Bucket: "my-featureflag-bucket",
Item: "flag/flags.goff.yaml",
AwsConfig: &awsConfig,
},
})
defer ffclient.Close()
FieldMandatoryDescription
BucketThe name of your bucket.
ItemThe location of your file in the bucket.
AwsConfigAn instance of aws.Config that configure your access to AWS
check this documentation for more info.