Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Timestream: ExAws: HTTP ERROR: :nxdomain for URL: "https:/" #31

Closed
lugomateo opened this issue Mar 9, 2023 · 2 comments
Closed

Timestream: ExAws: HTTP ERROR: :nxdomain for URL: "https:/" #31

lugomateo opened this issue Mar 9, 2023 · 2 comments

Comments

@lugomateo
Copy link

Environment

  • Erlang/OTP 25 [erts-13.1.5] [source] [64-bit] [smp:4:4] [ds:4:4:10] [async-threads:1] [jit:ns]
  • Elixir (1.13.4)
  • {:ex_aws, "~> 2.3.2"},
  • {:ex_aws_timestream, "~> 0.5.1"},
  • {:hackney, "~> 1.9"},
  • {:jason, "~> 1.2"},

Current configuration

config :ex_aws,
  access_key_id: [{:system, "AWS_ACCESS_KEY_ID"}, :instance_role],
  secret_access_key: [{:system, "AWS_SECRET_ACCESS_KEY"}, :instance_role],
  region: "aws-us-gov-west-1",
  debug_requests: true

When I run ExAws.Config.new(:timestream) on production environment, I get (with credentials omitted):

%{
  debug_requests: true,
  host: nil,
  http_client: ExAws.Request.Hackney,
  json_codec: Jason,
  normalize_path: true,
  port: 443,
  region: "aws-us-gov-west-1",
  require_imds_v2: false,
  retries: [max_attempts: 10, base_backoff_in_ms: 10, max_backoff_in_ms: 10000],
  scheme: "https://",
}

I removed the credentials for this post but access_key_id, secret_access_key, and security_token do appear so I am led to think configuration might not be the issue.

Then when I test a simple request
ExAws.Timestream.list_databases() |> ExAws.request()
I see the following:

14:01:19.105 [warning] ExAws: HTTP ERROR: :nxdomain for URL: "https:/" ATTEMPT: 1
14:01:19.159 [warning] ExAws: HTTP ERROR: :nxdomain for URL: "https:/" ATTEMPT: 2
14:01:19.204 [warning] ExAws: HTTP ERROR: :nxdomain for URL: "https:/" ATTEMPT: 3
14:01:19.291 [warning] ExAws: HTTP ERROR: :nxdomain for URL: "https:/" ATTEMPT: 4
14:01:19.402 [warning] ExAws: HTTP ERROR: :nxdomain for URL: "https:/" ATTEMPT: 5
14:01:19.482 [warning] ExAws: HTTP ERROR: :nxdomain for URL: "https:/" ATTEMPT: 6
14:01:20.117 [warning] ExAws: HTTP ERROR: :nxdomain for URL: "https:/" ATTEMPT: 7
14:01:20.934 [warning] ExAws: HTTP ERROR: :nxdomain for URL: "https:/" ATTEMPT: 8
14:01:21.591 [warning] ExAws: HTTP ERROR: :nxdomain for URL: "https:/" ATTEMPT: 9
** (MatchError) no match of right hand side value: {:error, :nxdomain}
    (ex_aws_timestream 0.5.1) lib/ex_aws/operation/endpoint_discovery.ex:32: ExAws.Operation.ExAws.Operation.EndpointDiscovery.handle_endpoint_operation/2
    (ex_aws_timestream 0.5.1) lib/ex_aws/operation/endpoint_discovery.ex:19: ExAws.Operation.ExAws.Operation.EndpointDiscovery.perform/2
14:01:26.490 [warning] ExAws: HTTP ERROR: :nxdomain for URL: "https:/" ATTEMPT: 10
@lugomateo
Copy link
Author

Found the problem.
Just need to add timestream to the aws-us-gov partition in endpoints.exs

In the services for…

"partition" => "aws-us-gov",
"partitionName" => "AWS GovCloud (US)",

add…

"ingest.timestream" => %{"endpoints" => %{"us-gov-west-1" => %{}}},
"query.timestream" => %{"endpoints" => %{"us-gov-west-1" => %{}}},

To see your databases then call...
ExAws.Timestream.list_databases() |> ExAws.request(region: "us-gov-west-1")

Opened an issue in exaws to add the endpoint

@lpender
Copy link

lpender commented Mar 15, 2023

ex-aws/ex_aws#939

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants