Menu
Amazon Route 53
API Reference

CreateService

Creates a service, which defines a template for the following entities:

  • One to five resource record sets

  • Optionally, a health check

After you create the service, you can submit a RegisterInstance request, and Amazon Route 53 uses the values in the template to create the specified entities.

Request Syntax

{
   "CreatorRequestId": "string",
   "Description": "string",
   "DnsConfig": { 
      "DnsRecords": [ 
         { 
            "TTL": number,
            "Type": "string"
         }
      ],
      "NamespaceId": "string"
   },
   "HealthCheckConfig": { 
      "FailureThreshold": number,
      "ResourcePath": "string",
      "Type": "string"
   },
   "Name": "string"
}

Request Parameters

For information about the parameters that are common to all actions, see Common Parameters.

The request accepts the following data in JSON format.

CreatorRequestId

An optional parameter that you can use to resolve concurrent creation requests. CreatorRequestId helps to determine if a specific client owns the namespace.

Type: String

Length Constraints: Maximum length of 64.

Required: No

Description

A description for the service.

Type: String

Length Constraints: Maximum length of 1024.

Required: No

DnsConfig

A complex type that contains information about the resource record sets that you want Amazon Route 53 to create when you register an instance.

Type: DnsConfig object

Required: Yes

HealthCheckConfig

Public DNS namespaces only. A complex type that contains settings for an optional health check. If you specify settings for a health check, Amazon Route 53 associates the health check with all the resource record sets that you specify in DnsConfig.

Note

The health check uses 30 seconds as the request interval. This is the number of seconds between the time that each Amazon Route 53 health checker gets a response from your endpoint and the time that it sends the next health check request. A health checker in each data center around the world sends your endpoint a health check request every 30 seconds. On average, your endpoint receives a health check request about every two seconds. Health checkers in different data centers don't coordinate with one another, so you'll sometimes see several requests per second followed by a few seconds with no health checks at all.

For information about the charges for health checks, see Amazon Route 53 Pricing.

Type: HealthCheckConfig object

Required: No

Name

The name that you want to assign to the service.

Type: String

Pattern: ((?=^.{1,127}$)^([a-zA-Z][a-zA-Z0-9-]{0,61}[a-zA-Z0-9]|[a-zA-Z])(\.([a-z][a-zA-Z0-9-]{0,61}[a-zA-Z0-9]|[a-zA-Z]))*$)|(^\.$)

Required: Yes

Response Syntax

{
   "Service": { 
      "Arn": "string",
      "CreateDate": number,
      "CreatorRequestId": "string",
      "Description": "string",
      "DnsConfig": { 
         "DnsRecords": [ 
            { 
               "TTL": number,
               "Type": "string"
            }
         ],
         "NamespaceId": "string"
      },
      "HealthCheckConfig": { 
         "FailureThreshold": number,
         "ResourcePath": "string",
         "Type": "string"
      },
      "Id": "string",
      "InstanceCount": number,
      "Name": "string"
   }
}

Response Elements

If the action is successful, the service sends back an HTTP 200 response.

The following data is returned in JSON format by the service.

Service

A complex type that contains information about the new service.

Type: Service object

Errors

For information about the errors that are common to all actions, see Common Errors.

InvalidInput

One or more specified values aren't valid. For example, when you're creating a namespace, the value of Name might not be a valid DNS name.

HTTP Status Code: 400

NamespaceNotFound

No namespace exists with the specified ID.

HTTP Status Code: 400

ResourceLimitExceeded

The resource can't be created because you've reached the limit on the number of resources.

HTTP Status Code: 400

ServiceAlreadyExists

The service can't be created because a service with the same name already exists.

HTTP Status Code: 400

See Also

For more information about using this API in one of the language-specific AWS SDKs, see the following: