AWS Tools for Windows PowerShell
Command Reference

AWS services or capabilities described in AWS Documentation may vary by region/location. Click Getting Started with Amazon AWS to see specific differences applicable to the China (Beijing) Region.

Synopsis

Calls the AWS Cloud Map CreateService API operation.

Syntax

New-SDService
-Name <String>
-CreatorRequestId <String>
-Description <String>
-DnsConfig <DnsConfig>
-HealthCheckConfig_FailureThreshold <Int32>
-HealthCheckCustomConfig <HealthCheckCustomConfig>
-NamespaceId <String>
-HealthCheckConfig_ResourcePath <String>
-Tag <Tag[]>
-HealthCheckConfig_Type <HealthCheckType>
-Type <ServiceTypeOption>
-Select <String>
-PassThru <SwitchParameter>
-Force <SwitchParameter>
-ClientConfig <AmazonServiceDiscoveryConfig>

Description

Creates a service. This action defines the configuration for the following entities:
  • For public and private DNS namespaces, one of the following combinations of DNS records in Amazon Route 53:
    • A
    • AAAA
    • A and AAAA
    • SRV
    • CNAME
  • Optionally, a health check
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.

Parameters

Amazon.PowerShell.Cmdlets.SD.AmazonServiceDiscoveryClientCmdlet.ClientConfig
Required?False
Position?Named
Accept pipeline input?True (ByPropertyName)
-CreatorRequestId <String>
A unique string that identifies the request and that allows failed CreateService requests to be retried without the risk of running the operation twice. CreatorRequestId can be any unique string (for example, a date/timestamp).
Required?False
Position?Named
Accept pipeline input?True (ByPropertyName)
-Description <String>
A description for the service.
Required?False
Position?Named
Accept pipeline input?True (ByPropertyName)
-DnsConfig <DnsConfig>
A complex type that contains information about the Amazon Route 53 records that you want Cloud Map to create when you register an instance.
Required?False
Position?Named
Accept pipeline input?True (ByPropertyName)
This parameter overrides confirmation prompts to force the cmdlet to continue its operation. This parameter should always be used with caution.
Required?False
Position?Named
Accept pipeline input?True (ByPropertyName)
-HealthCheckConfig_FailureThreshold <Int32>
The number of consecutive health checks that an endpoint must pass or fail for Route 53 to change the current status of the endpoint from unhealthy to healthy or the other way around. For more information, see How Route 53 Determines Whether an Endpoint Is Healthy in the Route 53 Developer Guide.
Required?False
Position?Named
Accept pipeline input?True (ByPropertyName)
-HealthCheckConfig_ResourcePath <String>
The path that you want Route 53 to request when performing health checks. The path can be any value that your endpoint returns an HTTP status code of a 2xx or 3xx format for when the endpoint is healthy. An example file is /docs/route53-health-check.html. Route 53 automatically adds the DNS name for the service. If you don't specify a value for ResourcePath, the default value is /.If you specify TCP for Type, you must not specify a value for ResourcePath.
Required?False
Position?Named
Accept pipeline input?True (ByPropertyName)
-HealthCheckConfig_Type <HealthCheckType>
The type of health check that you want to create, which indicates how Route 53 determines whether an endpoint is healthy.You can't change the value of Type after you create a health check.You can create the following types of health checks:
  • HTTP: Route 53 tries to establish a TCP connection. If successful, Route 53 submits an HTTP request and waits for an HTTP status code of 200 or greater and less than 400.
  • HTTPS: Route 53 tries to establish a TCP connection. If successful, Route 53 submits an HTTPS request and waits for an HTTP status code of 200 or greater and less than 400.If you specify HTTPS for the value of Type, the endpoint must support TLS v1.0 or later.
  • TCP: Route 53 tries to establish a TCP connection.If you specify TCP for Type, don't specify a value for ResourcePath.
For more information, see How Route 53 Determines Whether an Endpoint Is Healthy in the Route 53 Developer Guide.
Required?False
Position?Named
Accept pipeline input?True (ByPropertyName)
-HealthCheckCustomConfig <HealthCheckCustomConfig>
A complex type that contains information about an optional custom health check.If you specify a health check configuration, you can specify either HealthCheckCustomConfig or HealthCheckConfig but not both.You can't add, update, or delete a HealthCheckCustomConfig configuration from an existing service.
Required?False
Position?Named
Accept pipeline input?True (ByPropertyName)
-Name <String>
The name that you want to assign to the service.Do not include sensitive information in the name if the namespace is discoverable by public DNS queries.If you want Cloud Map to create an SRV record when you register an instance and you're using a system that requires a specific SRV format, such as HAProxy, specify the following for Name:
  • Start the name with an underscore (_), such as _exampleservice.
  • End the name with ._protocol, such as ._tcp.
When you register an instance, Cloud Map creates an SRV record and assigns a name to the record by concatenating the service name and the namespace name (for example,_exampleservice._tcp.example.com).For services that are accessible by DNS queries, you can't create multiple services with names that differ only by case (such as EXAMPLE and example). Otherwise, these services have the same DNS name and can't be distinguished. However, if you use a namespace that's only accessible by API calls, then you can create services that with names that differ only by case.
Required?True
Position?1
Accept pipeline input?True (ByValue, ByPropertyName)
-NamespaceId <String>
The ID of the namespace that you want to use to create the service. The namespace ID must be specified, but it can be specified either here or in the DnsConfig object.
Required?False
Position?Named
Accept pipeline input?True (ByPropertyName)
-PassThru <SwitchParameter>
Changes the cmdlet behavior to return the value passed to the Name parameter. The -PassThru parameter is deprecated, use -Select '^Name' instead. This parameter will be removed in a future version.
Required?False
Position?Named
Accept pipeline input?True (ByPropertyName)
-Select <String>
Use the -Select parameter to control the cmdlet output. The default value is 'Service'. Specifying -Select '*' will result in the cmdlet returning the whole service response (Amazon.ServiceDiscovery.Model.CreateServiceResponse). Specifying the name of a property of type Amazon.ServiceDiscovery.Model.CreateServiceResponse will result in that property being returned. Specifying -Select '^ParameterName' will result in the cmdlet returning the selected cmdlet parameter value.
Required?False
Position?Named
Accept pipeline input?True (ByPropertyName)
-Tag <Tag[]>
The tags to add to the service. Each tag consists of a key and an optional value that you define. Tags keys can be up to 128 characters in length, and tag values can be up to 256 characters in length.
Required?False
Position?Named
Accept pipeline input?True (ByPropertyName)
AliasesTags
If present, specifies that the service instances are only discoverable using the DiscoverInstances API operation. No DNS records is registered for the service instances. The only valid value is HTTP.
Required?False
Position?Named
Accept pipeline input?True (ByPropertyName)

Common Credential and Region Parameters

-AccessKey <String>
The AWS access key for the user account. This can be a temporary access key if the corresponding session token is supplied to the -SessionToken parameter.
Required?False
Position?Named
Accept pipeline input?True (ByPropertyName)
AliasesAK
-Credential <AWSCredentials>
An AWSCredentials object instance containing access and secret key information, and optionally a token for session-based credentials.
Required?False
Position?Named
Accept pipeline input?True (ByValue, ByPropertyName)
-EndpointUrl <String>
The endpoint to make the call against.Note: This parameter is primarily for internal AWS use and is not required/should not be specified for normal usage. The cmdlets normally determine which endpoint to call based on the region specified to the -Region parameter or set as default in the shell (via Set-DefaultAWSRegion). Only specify this parameter if you must direct the call to a specific custom endpoint.
Required?False
Position?Named
Accept pipeline input?True (ByPropertyName)
-NetworkCredential <PSCredential>
Used with SAML-based authentication when ProfileName references a SAML role profile. Contains the network credentials to be supplied during authentication with the configured identity provider's endpoint. This parameter is not required if the user's default network identity can or should be used during authentication.
Required?False
Position?Named
Accept pipeline input?True (ByValue, ByPropertyName)
-ProfileLocation <String>
Used to specify the name and location of the ini-format credential file (shared with the AWS CLI and other AWS SDKs)If this optional parameter is omitted this cmdlet will search the encrypted credential file used by the AWS SDK for .NET and AWS Toolkit for Visual Studio first. If the profile is not found then the cmdlet will search in the ini-format credential file at the default location: (user's home directory)\.aws\credentials.If this parameter is specified then this cmdlet will only search the ini-format credential file at the location given.As the current folder can vary in a shell or during script execution it is advised that you use specify a fully qualified path instead of a relative path.
Required?False
Position?Named
Accept pipeline input?True (ByPropertyName)
AliasesAWSProfilesLocation, ProfilesLocation
-ProfileName <String>
The user-defined name of an AWS credentials or SAML-based role profile containing credential information. The profile is expected to be found in the secure credential file shared with the AWS SDK for .NET and AWS Toolkit for Visual Studio. You can also specify the name of a profile stored in the .ini-format credential file used with the AWS CLI and other AWS SDKs.
Required?False
Position?Named
Accept pipeline input?True (ByPropertyName)
AliasesStoredCredentials, AWSProfileName
-Region <Object>
The system name of an AWS region or an AWSRegion instance. This governs the endpoint that will be used when calling service operations. Note that the AWS resources referenced in a call are usually region-specific.
Required?False
Position?Named
Accept pipeline input?True (ByPropertyName)
AliasesRegionToCall
-SecretKey <String>
The AWS secret key for the user account. This can be a temporary secret key if the corresponding session token is supplied to the -SessionToken parameter.
Required?False
Position?Named
Accept pipeline input?True (ByPropertyName)
AliasesSK, SecretAccessKey
-SessionToken <String>
The session token if the access and secret keys are temporary session-based credentials.
Required?False
Position?Named
Accept pipeline input?True (ByPropertyName)
AliasesST

Outputs

This cmdlet returns an Amazon.ServiceDiscovery.Model.Service object. The service call response (type Amazon.ServiceDiscovery.Model.CreateServiceResponse) can also be referenced from properties attached to the cmdlet entry in the $AWSHistory stack.

Supported Version

AWS Tools for PowerShell: 2.x.y.z