PrivateDnsNamespaceProps

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

Bases: aws_cdk.aws_servicediscovery.BaseNamespaceProps

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

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

  • vpc (IVpc) – The Amazon VPC that you want to associate the namespace with.

ExampleMetadata

infused

Example:

# mesh is of type Mesh
# Cloud Map service discovery is currently required for host ejection by outlier detection
vpc = ec2.Vpc(self, "vpc")
namespace = cloudmap.PrivateDnsNamespace(self, "test-namespace",
    vpc=vpc,
    name="domain.local"
)
service = namespace.create_service("Svc")
node = mesh.add_virtual_node("virtual-node",
    service_discovery=appmesh.ServiceDiscovery.cloud_map(service),
    listeners=[appmesh.VirtualNodeListener.http(
        outlier_detection=appmesh.OutlierDetection(
            base_ejection_duration=cdk.Duration.seconds(10),
            interval=cdk.Duration.seconds(30),
            max_ejection_percent=50,
            max_server_errors=5
        )
    )]
)

Attributes

description

A description of the Namespace.

Default

none

Return type

Optional[str]

name

A name for the Namespace.

Return type

str

vpc

The Amazon VPC that you want to associate the namespace with.

Return type

IVpc