ExistingCloudMapNamespaceOptions
- class aws_cdk.aws_ecs.ExistingCloudMapNamespaceOptions(*, use_for_service_connect=None, namespace)
Bases:
CloudMapNamespaceOptionsBaseThe 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: falsenamespace (
INamespace) – The existing Cloud Map namespace to use as the cluster’s default namespace. The fullINamespaceis 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
INamespaceis 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