PublicDnsNamespaceProps

class aws_cdk.aws_servicediscovery.PublicDnsNamespaceProps(*, name, description=None)

Bases: BaseNamespaceProps

Parameters:
  • name (str) – A name for the Namespace.

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

ExampleMetadata:

lit=aws-servicediscovery/test/integ.service-with-public-dns-namespace.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.A,
    dns_ttl=cdk.Duration.seconds(30),
    health_check=cdk.aws_servicediscovery.HealthCheckConfig(
        type=servicediscovery.HealthCheckType.HTTPS,
        resource_path="/healthcheck",
        failure_threshold=2
    )
)

service.register_ip_instance("IpInstance",
    ipv4="54.239.25.192",
    port=443
)

app.synth()

Attributes

description

A description of the Namespace.

Default:

none

name

A name for the Namespace.