CnameInstanceBaseProps

class aws_cdk.aws_servicediscovery.CnameInstanceBaseProps(*, custom_attributes=None, instance_id=None, instance_cname)

Bases: BaseInstanceProps

Parameters:
  • custom_attributes (Optional[Mapping[str, str]]) – Custom attributes of the instance. Default: none

  • instance_id (Optional[str]) – The id of the instance resource. Default: Automatically generated name

  • instance_cname (str) – If the service configuration includes a CNAME record, the domain name that you want Route 53 to return in response to DNS queries, for example, example.com. This value is required if the service specified by ServiceId includes settings for an CNAME record.

ExampleMetadata:

lit=aws-servicediscovery/test/integ.service-with-cname-record.lit.ts infused

Example:

import aws_cdk as cdk
import aws_cdk as servicediscovery

app = cdk.App()
stack = cdk.Stack(app, "aws-servicediscovery-integ")

namespace = servicediscovery.PublicDnsNamespace(stack, "Namespace",
    name="foobar.com"
)

service = namespace.create_service("Service",
    name="foo",
    dns_record_type=servicediscovery.DnsRecordType.CNAME,
    dns_ttl=cdk.Duration.seconds(30)
)

service.register_cname_instance("CnameInstance",
    instance_cname="service.pizza"
)

app.synth()

Attributes

custom_attributes

Custom attributes of the instance.

Default:

none

instance_cname

If the service configuration includes a CNAME record, the domain name that you want Route 53 to return in response to DNS queries, for example, example.com. This value is required if the service specified by ServiceId includes settings for an CNAME record.

instance_id

The id of the instance resource.

Default:

Automatically generated name