ServiceProps

class aws_cdk.aws_servicediscovery.ServiceProps(*, custom_health_check=None, description=None, health_check=None, name=None, dns_record_type=None, dns_ttl=None, load_balancer=None, routing_policy=None, namespace)

Bases: DnsServiceProps

Parameters:
  • custom_health_check (Union[HealthCheckCustomConfig, Dict[str, Any], None]) – Structure containing failure threshold for a custom health checker. Only one of healthCheckConfig or healthCheckCustomConfig can be specified. See: https://docs.aws.amazon.com/cloud-map/latest/api/API_HealthCheckCustomConfig.html Default: none

  • description (Optional[str]) – A description of the service. Default: none

  • health_check (Union[HealthCheckConfig, Dict[str, Any], None]) – Settings for an optional health check. If you specify health check settings, AWS Cloud Map associates the health check with the records that you specify in DnsConfig. Only one of healthCheckConfig or healthCheckCustomConfig can be specified. Not valid for PrivateDnsNamespaces. If you use healthCheck, you can only register IP instances to this service. Default: none

  • name (Optional[str]) – A name for the Service. Default: CloudFormation-generated name

  • dns_record_type (Optional[DnsRecordType]) – The DNS type of the record that you want AWS Cloud Map to create. Supported record types include A, AAAA, A and AAAA (A_AAAA), CNAME, and SRV. Default: A

  • dns_ttl (Optional[Duration]) – The amount of time, in seconds, that you want DNS resolvers to cache the settings for this record. Default: Duration.minutes(1)

  • load_balancer (Optional[bool]) – Whether or not this service will have an Elastic LoadBalancer registered to it as an AliasTargetInstance. Setting this to true correctly configures the routingPolicy and performs some additional validation. Default: false

  • routing_policy (Optional[RoutingPolicy]) – The routing policy that you want to apply to all DNS records that AWS Cloud Map creates when you register an instance and specify this service. Default: WEIGHTED for CNAME records and when loadBalancer is true, MULTIVALUE otherwise

  • namespace (INamespace) – The namespace that you want to use for DNS configuration.

ExampleMetadata:

fixture=_generated

Example:

# The code below shows an example of how to instantiate this type.
# The values are placeholders you should change.
import aws_cdk.aws_servicediscovery as servicediscovery
import aws_cdk.core as cdk

# namespace: servicediscovery.INamespace

service_props = servicediscovery.ServiceProps(
    namespace=namespace,

    # the properties below are optional
    custom_health_check=servicediscovery.HealthCheckCustomConfig(
        failure_threshold=123
    ),
    description="description",
    dns_record_type=servicediscovery.DnsRecordType.A,
    dns_ttl=cdk.Duration.minutes(30),
    health_check=servicediscovery.HealthCheckConfig(
        failure_threshold=123,
        resource_path="resourcePath",
        type=servicediscovery.HealthCheckType.HTTP
    ),
    load_balancer=False,
    name="name",
    routing_policy=servicediscovery.RoutingPolicy.WEIGHTED
)

Attributes

custom_health_check

Structure containing failure threshold for a custom health checker.

Only one of healthCheckConfig or healthCheckCustomConfig can be specified. See: https://docs.aws.amazon.com/cloud-map/latest/api/API_HealthCheckCustomConfig.html

Default:

none

description

A description of the service.

Default:

none

dns_record_type

The DNS type of the record that you want AWS Cloud Map to create.

Supported record types include A, AAAA, A and AAAA (A_AAAA), CNAME, and SRV.

Default:

A

dns_ttl

The amount of time, in seconds, that you want DNS resolvers to cache the settings for this record.

Default:

Duration.minutes(1)

health_check

Settings for an optional health check.

If you specify health check settings, AWS Cloud Map associates the health check with the records that you specify in DnsConfig. Only one of healthCheckConfig or healthCheckCustomConfig can be specified. Not valid for PrivateDnsNamespaces. If you use healthCheck, you can only register IP instances to this service.

Default:

none

load_balancer

Whether or not this service will have an Elastic LoadBalancer registered to it as an AliasTargetInstance.

Setting this to true correctly configures the routingPolicy and performs some additional validation.

Default:

false

name

A name for the Service.

Default:

CloudFormation-generated name

namespace

The namespace that you want to use for DNS configuration.

routing_policy

The routing policy that you want to apply to all DNS records that AWS Cloud Map creates when you register an instance and specify this service.

Default:

WEIGHTED for CNAME records and when loadBalancer is true, MULTIVALUE otherwise