Add skip_requesting_account_id Parameter to S3 Backend

Signed-off-by: Jonas Wagner <jwagner@knoppiks.de>
pull/34002/head
Jonas Wagner 3 years ago
parent 3cb32ec2de
commit 09df2213f9
No known key found for this signature in database
GPG Key ID: A0FB41120B7C5B42

@ -185,6 +185,11 @@ func (b *Backend) ConfigSchema() *configschema.Block {
Optional: true,
Description: "Skip the credentials validation via STS API.",
},
"skip_requesting_account_id": {
Type: cty.Bool,
Optional: true,
Description: "Skip the requesting account ID. Useful for AWS API implementations that do not have the IAM, STS API, or metadata API.",
},
"skip_metadata_api_check": {
Type: cty.Bool,
Optional: true,
@ -956,17 +961,18 @@ func (b *Backend) Configure(obj cty.Value) tfdiags.Diagnostics {
ctx, baselog := baselogging.NewHcLogger(ctx, log)
cfg := &awsbase.Config{
AccessKey: stringAttr(obj, "access_key"),
APNInfo: stdUserAgentProducts(),
CallerDocumentationURL: "https://www.terraform.io/docs/language/settings/backends/s3.html",
CallerName: "S3 Backend",
Logger: baselog,
MaxRetries: intAttrDefault(obj, "max_retries", 5),
Profile: stringAttr(obj, "profile"),
Region: stringAttr(obj, "region"),
SecretKey: stringAttr(obj, "secret_key"),
SkipCredsValidation: boolAttr(obj, "skip_credentials_validation"),
Token: stringAttr(obj, "token"),
AccessKey: stringAttr(obj, "access_key"),
APNInfo: stdUserAgentProducts(),
CallerDocumentationURL: "https://www.terraform.io/docs/language/settings/backends/s3.html",
CallerName: "S3 Backend",
Logger: baselog,
MaxRetries: intAttrDefault(obj, "max_retries", 5),
Profile: stringAttr(obj, "profile"),
Region: stringAttr(obj, "region"),
SecretKey: stringAttr(obj, "secret_key"),
SkipCredsValidation: boolAttr(obj, "skip_credentials_validation"),
SkipRequestingAccountId: boolAttr(obj, "skip_requesting_account_id"),
Token: stringAttr(obj, "token"),
}
// The "legacy" authentication workflow used in aws-sdk-go-base V1 will be

@ -174,6 +174,7 @@ The following configuration is optional:
* `shared_credentials_files` - (Optional) List of paths to AWS shared credentials files. Defaults to `~/.aws/credentials`.
* `skip_credentials_validation` - (Optional) Skip credentials validation via the STS API.
* `skip_region_validation` - (Optional) Skip validation of provided region name.
* `skip_requesting_account_id` - (Optional) Whether to skip requesting the account ID. Useful for AWS API implementations that do not have the IAM, STS API, or metadata API.
* `skip_metadata_api_check` - (Optional) Skip usage of EC2 Metadata API.
* `sts_endpoint` - (Optional, **Deprecated**) Custom endpoint URL for the AWS Security Token Service (STS) API.
Use `endpoints.sts` instead.

Loading…
Cancel
Save