ExistingCloudMapNamespaceOptions

class aws_cdk.aws_ecs.ExistingCloudMapNamespaceOptions(*, use_for_service_connect=None, namespace)

Bases: CloudMapNamespaceOptionsBase

The options for using an existing AWS Cloud Map namespace as the default namespace of a cluster.

Parameters:
  • use_for_service_connect (Optional[bool]) – This property specifies whether to set the provided namespace as the service connect default in the cluster properties. Default: false

  • namespace (INamespace) – The existing Cloud Map namespace to use as the cluster’s default namespace. The full INamespace is required (rather than a ref) because the cluster needs the namespace name, ARN and type to wire up Service Discovery and Service Connect. [disable-awslint:prefer-ref-interface]

ExampleMetadata:

infused

Example:

# vpc: ec2.Vpc


# Create or reference an existing namespace
existing_namespace = cloudmap.PrivateDnsNamespace(self, "Namespace",
    name="example.local",
    vpc=vpc
)

cluster = ecs.Cluster(self, "Cluster", vpc=vpc)

# Use the existing namespace as the default
cluster.add_existing_default_cloud_map_namespace(
    namespace=existing_namespace,
    use_for_service_connect=True
)

Attributes

namespace

The existing Cloud Map namespace to use as the cluster’s default namespace.

The full INamespace is required (rather than a ref) because the cluster needs the namespace name, ARN and type to wire up Service Discovery and Service Connect.

[disable-awslint:prefer-ref-interface]

use_for_service_connect

This property specifies whether to set the provided namespace as the service connect default in the cluster properties.

Default:

false