Aws-sdk-java-v2: Route53 failure: route53.us-east-2.amazonaws.com Name not known

Created on 10 Apr 2018  路  3Comments  路  Source: aws/aws-sdk-java-v2


Am I failing to assign an attribute to an object?

Expected Behavior

Attempting to create a new publicly hosted Route 53 zone.

Current Behavior

Exception in thread "main" software.amazon.awssdk.core.exception.SdkClientException: Unable to execute HTTP request: route53.us-east-2.amazonaws.com: Name or service not known

Caused by: java.net.UnknownHostException: route53.us-east-2.amazonaws.com: Name or service not known

Steps to Reproduce

Constructor and affected method

public CreateRoute53ChildZones() { 
    route53Client = Route53Client.builder()
            .credentialsProvider(ProfileCredentialsProvider.create())
            .httpConfiguration(ClientHttpConfiguration.builder()
                    .httpClientFactory(ApacheSdkHttpClientFactory.builder().build())
                    .build())
            .build();
}


public String createChildZone(String teamNumber){

    HostedZoneConfig config = HostedZoneConfig.builder()
            .privateZone(false)
            .comment("New Zone for Team" + teamNumber)
            .build();

    String referenceID = Long.toString(System.currentTimeMillis());

    CreateHostedZoneRequest zoneRequest = CreateHostedZoneRequest.builder()
            .hostedZoneConfig(config)
            .name("team" + teamNumber + ".benron.cloud.")
            .callerReference(referenceID)
            .build();

    return route53Client.createHostedZone(zoneRequest).hostedZone().id();
}

Your Environment

  • AWS Java SDK version used: 2.0.0-preview-9
  • JDK version used: 9.0.4
  • Operating System and version: Fedora 27
  • Using ProfileCredentialProvider, aws-cli is configured

Most helpful comment

To access Route53 you would currently need to specify the AWS_GLOBAL region. This was done to prevent customers from using global services and not realizing that for this service your calls are likely not staying in region and could potentially be spanning the globe.

That would be reasonable _if it were documented somewhere_. How are users of the SDK supposed to know that?

Worse still, the documentation page for Route53 endpoints makes it sounds as if I can leave the region blank or even indicate us-east-1!

When you submit requests using the AWS CLI or SDKs, either leave the Region and endpoint unspecified, or specify us-east-1 as the Region.

Please put this in the SDK API documentation. How else will users of the SDK know this "magic incantation" needed for it to work? Otherwise they will be wasting hours and opening Stack Overflow tickets.

All 3 comments

By not specifying a region in the builder, the client is defaulting to the region in your profile file, which I assume is us-east-2.

This is one area that we are looking for feedback on with global services like Route53. To access Route53 you would currently need to specify the AWS_GLOBAL region. This was done to prevent customers from using global services and not realizing that for this service your calls are likely not staying in region and could potentially be spanning the globe. Additionally, if services move from being global to regional, if we don't force customer to use AWS_GLOBAL they will never be able to take advantage of new regional endpoints as that could potentially be breaking behavior as we would switch to using the regional endpoint as soon as it was available in your SDK.

Thoughts?

I see your point. This sounds like a well thought out design decision.
A note about requirements for global services in the documentation for region in ClientBuilder.java might help, but also may be unnecessary/ overkill.

To access Route53 you would currently need to specify the AWS_GLOBAL region. This was done to prevent customers from using global services and not realizing that for this service your calls are likely not staying in region and could potentially be spanning the globe.

That would be reasonable _if it were documented somewhere_. How are users of the SDK supposed to know that?

Worse still, the documentation page for Route53 endpoints makes it sounds as if I can leave the region blank or even indicate us-east-1!

When you submit requests using the AWS CLI or SDKs, either leave the Region and endpoint unspecified, or specify us-east-1 as the Region.

Please put this in the SDK API documentation. How else will users of the SDK know this "magic incantation" needed for it to work? Otherwise they will be wasting hours and opening Stack Overflow tickets.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

ochrons picture ochrons  路  6Comments

jhovell picture jhovell  路  4Comments

tigertoes picture tigertoes  路  6Comments

fstendel picture fstendel  路  6Comments

millems picture millems  路  3Comments