From aaedf255c3f675fabfd41d2722fa9661f12a499a Mon Sep 17 00:00:00 2001 From: Sander van Harmelen Date: Tue, 5 Dec 2017 20:19:36 +0100 Subject: [PATCH] backend/s3: allow skipping the region check (#16757) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Without the possibility to skip this check, it’s not possible to use a custom region with a third-party service that mimicks the S3 API. --- backend/remote-state/s3/backend.go | 8 ++++++++ website/docs/backends/types/s3.html.md | 3 ++- 2 files changed, 10 insertions(+), 1 deletion(-) diff --git a/backend/remote-state/s3/backend.go b/backend/remote-state/s3/backend.go index a9018fd27..f5607e623 100644 --- a/backend/remote-state/s3/backend.go +++ b/backend/remote-state/s3/backend.go @@ -136,6 +136,13 @@ func New() backend.Backend { Default: false, }, + "skip_region_validation": { + Type: schema.TypeBool, + Optional: true, + Description: "Skip static validation of region name.", + Default: false, + }, + "skip_requesting_account_id": { Type: schema.TypeBool, Optional: true, @@ -243,6 +250,7 @@ func (b *Backend) configure(ctx context.Context) error { Token: data.Get("token").(string), SkipCredsValidation: data.Get("skip_credentials_validation").(bool), SkipGetEC2Platforms: data.Get("skip_get_ec2_platforms").(bool), + SkipRegionValidation: data.Get("skip_region_validation").(bool), SkipRequestingAccountId: data.Get("skip_requesting_account_id").(bool), SkipMetadataApiCheck: data.Get("skip_metadata_api_check").(bool), } diff --git a/website/docs/backends/types/s3.html.md b/website/docs/backends/types/s3.html.md index 24ffc95d1..893fb11a8 100644 --- a/website/docs/backends/types/s3.html.md +++ b/website/docs/backends/types/s3.html.md @@ -110,10 +110,11 @@ The following configuration options or environment variables are supported: * `assume_role_policy` - (Optional) The permissions applied when assuming a role. * `external_id` - (Optional) The external ID to use when assuming the role. * `session_name` - (Optional) The session name to use when assuming the role. - * `workspace_key_prefix` - (Optional) The prefix applied to the state path + * `workspace_key_prefix` - (Optional) The prefix applied to the state path inside the bucket. This is only relevant when using a non-default workspace. This defaults to "env:" * `skip_credentials_validation` - (Optional) Skip the credentials validation via the STS API. * `skip_get_ec2_platforms` - (Optional) Skip getting the supported EC2 platforms. + * `skip_region_validation` - (Optional) Skip validation of provided region name. * `skip_requesting_account_id` - (Optional) Skip requesting the account ID. * `skip_metadata_api_check` - (Optional) Skip the AWS Metadata API check.