Back to Aws Doc Sdk Examples

Route 53 code examples for the SDK for Java

javav2/example_code/route53/README.md

latest7.9 KB
Original Source

Route 53 code examples for the SDK for Java

Overview

This README discusses how to run and test the AWS SDK for Java (v2) examples for Amazon Route 53.

Route 53 is a highly available and scalable Domain Name System (DNS) web service. Route 53 connects user requests to internet applications running on AWS or on-premises.

⚠️ Important

  • Running this code might result in charges to your AWS account. See AWS Pricing.
  • Running the tests might result in charges to your AWS account.
  • We recommend that you grant your code least privilege. At most, grant only the minimum permissions required to perform the task. For more information, see Grant least privilege.
  • This code is not tested in every AWS Region. For more information, see AWS Regional Services.

Code examples

The credential provider used in all code examples is ProfileCredentialsProvider. For more information, see Using credentials.

Get started

Single action

Code excerpts that show you how to call individual service functions.

Scenario

Code examples that show you how to accomplish a specific task by calling multiple functions within the same service.

Run the Amazon Route 53 Java files

Prerequisites

To run these examples, set up your development environment. For more information, see Get started with the SDK for Java.

Be very careful when running an operation that deletes or modifies AWS resources in your account. We recommend creating separate test-only resources when experimenting with these examples.

Test the Amazon Route 53 Java files

⚠️ Running the tests might result in charges to your AWS account.

You can test the Java code example for Amazon Route 53 by running a test file named Route53Test. This file uses JUnit 5 to run the JUnit tests and is located in the src/test/java folder. For more information, see https://junit.org/junit5/.

You can run the JUnit tests from an IDE, such as IntelliJ, or from the command line. As each test runs, you can view messages that inform you if the various tests succeed or fail. For example, the following message informs you that Test 3 passed.

Test 3 passed

WARNING: Running these JUnit tests manipulates real AWS resources and might incur charges on your account.

Properties file

Before running the JUnit tests, you must define values in the config.properties file located in the resources folder. This file contains values that are required to run the JUnit tests. If you do not define all values, the JUnit tests fail.

Define this value to successfully run the JUnit tests:

  • domainName - The fully qualified domain name.
  • domainSuggestionSc - The domain suggestion (for example, findmy.accountants).
  • domainTypeSc - The domain type (for example, com).
  • phoneNumerSc - The phone number to use (for example, +91.9966564xxx).
  • emailSc - The email address to use.
  • firstNameSc - The first name to use.
  • lastNameSc - The first name to use.
  • citySc - The city to use.

Additional resources

Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. SPDX-License-Identifier: Apache-2.0