Skip to content

[Bug]: Wrong URL for SSO in us-east-1 if use_fips is true #33952

Open
@tmccombs

Description

@tmccombs

Terraform Core Version

1.5.0

AWS Provider Version

5.21.0

Affected Resource(s)

Problem with configuring the provider for authentication with SSO

Expected Behavior

Terraform should be able to refresh the token when using a profile that uses AWS SSO.

Actual Behavior

Error when refreshing the token which results in not being able to run the specified action.

Relevant Error/Panic Output Snippet

No response

Terraform Configuration Files

provider "aws" {
  profile = var.terraform_profile # a profile that uses sso_start_url, sso_role_name, etc.
  region  = "us-east-1"
  use_fips_endpoint = true
}

Steps to Reproduce

Run a plan, apply, refresh etc. with config like above, using an AWS profile that uses AWS IAM Identity Center (previously SSO)

Debug Output

╷
│ Error: No valid credential sources found
│ 
│   with provider["registry.terraform.io/hashicorp/aws"].publiczones,
│   on config.tf line 141, in provider "aws":
│  141: provider "aws" {
│ 
│ Please see https://registry.terraform.io/providers/hashicorp/aws
│ for more information about providing credentials.
│ 
│ Error: failed to refresh cached credentials, operation error STS: AssumeRole, failed to sign request: failed to retrieve credentials: operation error STS: AssumeRole, failed to sign request: failed to retrieve
│ credentials: operation error SSO: GetRoleCredentials, https response error StatusCode: 0, RequestID: , request send failed, Get
│ "https://portal.sso-fips.us-east-1.amazonaws.com/federation/credentials?account_id=975326797713&role_name=SSO_terraform": dial tcp: lookup portal.sso-fips.us-east-1.amazonaws.com on 127.0.0.53:53: no such host
│ 
╵

Panic Output

No response

Important Factoids

If use_fips is false, then it works fine.

References

This is basically the same as #29350 but, while GovCloud regions have been fixed, it seems the issue is still there for the us-east-1 region (and possibly other regions?)

My guess is that it is likely also due to incorrect urls in the upstream aws sdk library.

Would you like to implement a fix?

None

Metadata

Metadata

Assignees

No one assigned

    Labels

    authenticationPertains to authentication; to the provider itself of otherwise.bugAddresses a defect in current functionality.fipsPertains to the Federal Information Processing Standard (FIPS).prioritizedPart of the maintainer teams immediate focus. To be addressed within the current quarter.providerPertains to the provider itself, rather than any interaction with AWS.regressionPertains to a degraded workflow resulting from an upstream patch or internal enhancement.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions