From 9767dfa4598b8bf54c21d622248b1f98a7079e44 Mon Sep 17 00:00:00 2001 From: Victor Covalski Date: Mon, 4 Jul 2022 18:03:04 -0300 Subject: [PATCH 1/4] fix: including AssumeRoleWithWebIdentity config parameter in Client method --- internal/conns/config.go | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/internal/conns/config.go b/internal/conns/config.go index 7bfd3100fdf..d48c0b9f250 100644 --- a/internal/conns/config.go +++ b/internal/conns/config.go @@ -86,6 +86,7 @@ func (c *Config) Client(ctx context.Context) (interface{}, diag.Diagnostics) { CallerDocumentationURL: "https://registry.terraform.io/providers/hashicorp/aws", CallerName: "Terraform AWS Provider", EC2MetadataServiceEnableState: c.EC2MetadataServiceEnableState, + AssumeRoleWithWebIdentity: c.AssumeRoleWithWebIdentity, IamEndpoint: c.Endpoints[names.IAM], Insecure: c.Insecure, HTTPProxy: c.HTTPProxy, @@ -127,9 +128,10 @@ func (c *Config) Client(ctx context.Context) (interface{}, diag.Diagnostics) { awsbaseConfig.StsRegion = c.STSRegion } + // A zica esta aqui cfg, err := awsbase.GetAwsConfig(ctx, &awsbaseConfig) if err != nil { - return nil, diag.Errorf("error configuring Terraform AWS Provider: %s", err) + return nil, diag.Errorf("Victor Aqui: error configuring Terraform AWS Provider: %s", err) } if !c.SkipRegionValidation { From 2cd0cdc9a86f00128fc5b199d27a5d6364d916c0 Mon Sep 17 00:00:00 2001 From: Victor Covalski Date: Mon, 4 Jul 2022 18:05:30 -0300 Subject: [PATCH 2/4] removing comments --- internal/conns/config.go | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/internal/conns/config.go b/internal/conns/config.go index d48c0b9f250..e34786998a4 100644 --- a/internal/conns/config.go +++ b/internal/conns/config.go @@ -128,10 +128,9 @@ func (c *Config) Client(ctx context.Context) (interface{}, diag.Diagnostics) { awsbaseConfig.StsRegion = c.STSRegion } - // A zica esta aqui cfg, err := awsbase.GetAwsConfig(ctx, &awsbaseConfig) if err != nil { - return nil, diag.Errorf("Victor Aqui: error configuring Terraform AWS Provider: %s", err) + return nil, diag.Errorf("error configuring Terraform AWS Provider: %s", err) } if !c.SkipRegionValidation { From bea7e38065be3e3a72a901b8711b9ef68a96cb61 Mon Sep 17 00:00:00 2001 From: Kit Ewbank Date: Tue, 5 Jul 2022 10:52:58 -0400 Subject: [PATCH 3/4] Cosmetics. --- internal/conns/config.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/internal/conns/config.go b/internal/conns/config.go index e34786998a4..23713b73155 100644 --- a/internal/conns/config.go +++ b/internal/conns/config.go @@ -83,10 +83,10 @@ func (c *Config) Client(ctx context.Context) (interface{}, diag.Diagnostics) { awsbaseConfig := awsbase.Config{ AccessKey: c.AccessKey, APNInfo: StdUserAgentProducts(c.TerraformVersion), + AssumeRoleWithWebIdentity: c.AssumeRoleWithWebIdentity, CallerDocumentationURL: "https://registry.terraform.io/providers/hashicorp/aws", CallerName: "Terraform AWS Provider", EC2MetadataServiceEnableState: c.EC2MetadataServiceEnableState, - AssumeRoleWithWebIdentity: c.AssumeRoleWithWebIdentity, IamEndpoint: c.Endpoints[names.IAM], Insecure: c.Insecure, HTTPProxy: c.HTTPProxy, From 40d5f7b05af7a29b266c31ccb556346ae6c9ced0 Mon Sep 17 00:00:00 2001 From: Kit Ewbank Date: Tue, 5 Jul 2022 10:55:00 -0400 Subject: [PATCH 4/4] Add CHANGELOG entry. --- .changelog/25681.txt | 3 +++ 1 file changed, 3 insertions(+) create mode 100644 .changelog/25681.txt diff --git a/.changelog/25681.txt b/.changelog/25681.txt new file mode 100644 index 00000000000..49fc64a8792 --- /dev/null +++ b/.changelog/25681.txt @@ -0,0 +1,3 @@ +```release-note:bug +provider: Ensure that the configured `assume_role_with_web_identity` value is used +``` \ No newline at end of file