From fb6b349e580b1cbb9053c09f97f8424d63d0716f Mon Sep 17 00:00:00 2001 From: goraxe Date: Wed, 3 Jan 2018 20:15:47 +0000 Subject: [PATCH] backend/s3: Allow forcing use of the S3 path-style API This is useful when the underlying API is an S3-workalike service, rather than official S3. --- backend/remote-state/s3/backend.go | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/backend/remote-state/s3/backend.go b/backend/remote-state/s3/backend.go index aecaf345b9..288c2043bb 100644 --- a/backend/remote-state/s3/backend.go +++ b/backend/remote-state/s3/backend.go @@ -191,6 +191,13 @@ func New() backend.Backend { Description: "The prefix applied to the non-default state path inside the bucket", Default: "env:", }, + + "force_path_style": { + Type: schema.TypeBool, + Optional: true, + Description: "Force s3 to use path style api.", + Default: false, + }, }, } @@ -253,6 +260,7 @@ func (b *Backend) configure(ctx context.Context) error { SkipRegionValidation: data.Get("skip_region_validation").(bool), SkipRequestingAccountId: data.Get("skip_requesting_account_id").(bool), SkipMetadataApiCheck: data.Get("skip_metadata_api_check").(bool), + S3ForcePathStyle: data.Get("force_path_style").(bool), } client, err := cfg.Client()