import type { MetadataBearer as __MetadataBearer } from "@smithy/types"; import type { CreateServiceRequest, CreateServiceResponse } from "../models/models_0"; /** * @public */ export type { __MetadataBearer }; /** * @public * * The input for {@link CreateServiceCommand}. */ export interface CreateServiceCommandInput extends CreateServiceRequest { } /** * @public * * The output of {@link CreateServiceCommand}. */ export interface CreateServiceCommandOutput extends CreateServiceResponse, __MetadataBearer { } declare const CreateServiceCommand_base: { new (input: CreateServiceCommandInput): import("@smithy/core/client").CommandImpl; new (input: CreateServiceCommandInput): import("@smithy/core/client").CommandImpl; getEndpointParameterInstructions(): import("@smithy/types").EndpointParameterInstructions; }; /** *

Creates a service. This action defines the configuration for the following entities:

* *

After you create the service, you can submit a RegisterInstance request, and * Cloud Map uses the values in the configuration to create the specified entities.

*

For the current quota on the number of instances that you can register using the same * namespace and using the same service, see Cloud Map quotas in the * Cloud Map Developer Guide.

* @example * Use a bare-bones client and the command you need to make an API call. * ```javascript * import { ServiceDiscoveryClient, CreateServiceCommand } from "@aws-sdk/client-servicediscovery"; // ES Modules import * // const { ServiceDiscoveryClient, CreateServiceCommand } = require("@aws-sdk/client-servicediscovery"); // CommonJS import * // import type { ServiceDiscoveryClientConfig } from "@aws-sdk/client-servicediscovery"; * const config = {}; // type is ServiceDiscoveryClientConfig * const client = new ServiceDiscoveryClient(config); * const input = { // CreateServiceRequest * Name: "STRING_VALUE", // required * NamespaceId: "STRING_VALUE", * CreatorRequestId: "STRING_VALUE", * Description: "STRING_VALUE", * DnsConfig: { // DnsConfig * NamespaceId: "STRING_VALUE", * RoutingPolicy: "MULTIVALUE" || "WEIGHTED", * DnsRecords: [ // DnsRecordList // required * { // DnsRecord * Type: "SRV" || "A" || "AAAA" || "CNAME", // required * TTL: Number("long"), // required * }, * ], * }, * HealthCheckConfig: { // HealthCheckConfig * Type: "HTTP" || "HTTPS" || "TCP", // required * ResourcePath: "STRING_VALUE", * FailureThreshold: Number("int"), * }, * HealthCheckCustomConfig: { // HealthCheckCustomConfig * FailureThreshold: Number("int"), * }, * Tags: [ // TagList * { // Tag * Key: "STRING_VALUE", // required * Value: "STRING_VALUE", // required * }, * ], * Type: "HTTP", * }; * const command = new CreateServiceCommand(input); * const response = await client.send(command); * // { // CreateServiceResponse * // Service: { // Service * // Id: "STRING_VALUE", * // Arn: "STRING_VALUE", * // ResourceOwner: "STRING_VALUE", * // Name: "STRING_VALUE", * // NamespaceId: "STRING_VALUE", * // Description: "STRING_VALUE", * // InstanceCount: Number("int"), * // DnsConfig: { // DnsConfig * // NamespaceId: "STRING_VALUE", * // RoutingPolicy: "MULTIVALUE" || "WEIGHTED", * // DnsRecords: [ // DnsRecordList // required * // { // DnsRecord * // Type: "SRV" || "A" || "AAAA" || "CNAME", // required * // TTL: Number("long"), // required * // }, * // ], * // }, * // Type: "HTTP" || "DNS_HTTP" || "DNS", * // HealthCheckConfig: { // HealthCheckConfig * // Type: "HTTP" || "HTTPS" || "TCP", // required * // ResourcePath: "STRING_VALUE", * // FailureThreshold: Number("int"), * // }, * // HealthCheckCustomConfig: { // HealthCheckCustomConfig * // FailureThreshold: Number("int"), * // }, * // CreateDate: new Date("TIMESTAMP"), * // CreatorRequestId: "STRING_VALUE", * // CreatedByAccount: "STRING_VALUE", * // }, * // }; * * ``` * * @param CreateServiceCommandInput - {@link CreateServiceCommandInput} * @returns {@link CreateServiceCommandOutput} * @see {@link CreateServiceCommandInput} for command's `input` shape. * @see {@link CreateServiceCommandOutput} for command's `response` shape. * @see {@link ServiceDiscoveryClientResolvedConfig | config} for ServiceDiscoveryClient's `config` shape. * * @throws {@link InvalidInput} (client fault) *

One or more specified values aren't valid. For example, a required value might be missing, a * numeric value might be outside the allowed range, or a string value might exceed length * constraints.

* * @throws {@link NamespaceNotFound} (client fault) *

No namespace exists with the specified ID.

* * @throws {@link ResourceLimitExceeded} (client fault) *

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

* * @throws {@link ServiceAlreadyExists} (client fault) *

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

* * @throws {@link TooManyTagsException} (client fault) *

The list of tags on the resource is over the quota. The maximum number of tags that can be * applied to a resource is 50.

* * @throws {@link ServiceDiscoveryServiceException} *

Base exception class for all service exceptions from ServiceDiscovery service.

* * * @example Example: Create service * ```javascript * // Example: Create service * const input = { * CreatorRequestId: "567c1193-6b00-4308-bd57-ad38a8822d25", * DnsConfig: { * DnsRecords: [ * { * TTL: 60, * Type: "A" * } * ], * NamespaceId: "ns-ylexjili4cdxy3xm", * RoutingPolicy: "MULTIVALUE" * }, * Name: "myservice", * NamespaceId: "ns-ylexjili4cdxy3xm" * }; * const command = new CreateServiceCommand(input); * const response = await client.send(command); * /* response is * { * Service: { * Arn: "arn:aws:servicediscovery:us-west-2:123456789012:service/srv-p5zdwlg5uvvzjita", * CreateDate: 1.587081768334E9, * CreatedByAccount: "123456789012", * CreatorRequestId: "567c1193-6b00-4308-bd57-ad38a8822d25", * DnsConfig: { * DnsRecords: [ * { * TTL: 60, * Type: "A" * } * ], * NamespaceId: "ns-ylexjili4cdxy3xm", * RoutingPolicy: "MULTIVALUE" * }, * Id: "srv-p5zdwlg5uvvzjita", * InstanceCount: 0, * Name: "myservice", * NamespaceId: "ns-ylexjili4cdxy3xm", * ResourceOwner: "123456789012", * Type: "DNS_HTTP" * } * } * *\/ * ``` * * @example Create service using namespace ARN * ```javascript * // Namespace sharee creates a service using a namespace ARN instead of namespace ID, useful when working with shared namespaces. * const input = { * Description: "Example service using namespace ARN", * DnsConfig: { * DnsRecords: [ * { * TTL: 300, * Type: "A" * } * ], * RoutingPolicy: "MULTIVALUE" * }, * Name: "example-service", * NamespaceId: "arn:aws:servicediscovery:us-west-2:123456789012:namespace/ns-abcd1234xmpl5678" * }; * const command = new CreateServiceCommand(input); * const response = await client.send(command); * /* response is * { * Service: { * Arn: "arn:aws:servicediscovery:us-west-2:123456789012:service/srv-abcd1234xmpl5678", * CreateDate: 1.7051616E9, * CreatedByAccount: "111122223333", * CreatorRequestId: "abcd1234-xmpl-5678-9012-abcd1234xmpl", * Description: "Example service using namespace ARN", * DnsConfig: { * DnsRecords: [ * { * TTL: 300, * Type: "A" * } * ], * NamespaceId: "ns-abcd1234xmpl5678", * RoutingPolicy: "MULTIVALUE" * }, * Id: "srv-abcd1234xmpl5678", * InstanceCount: 0, * Name: "example-service", * NamespaceId: "ns-abcd1234xmpl5678", * ResourceOwner: "123456789012", * Type: "DNS_HTTP" * } * } * *\/ * ``` * * @public */ export declare class CreateServiceCommand extends CreateServiceCommand_base { /** @internal type navigation helper, not in runtime. */ protected static __types: { api: { input: CreateServiceRequest; output: CreateServiceResponse; }; sdk: { input: CreateServiceCommandInput; output: CreateServiceCommandOutput; }; }; }