# ExistingCloudMapNamespaceOptions

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

Extends: ExistingCloudMapNamespaceOptions
Extends: CloudMapNamespaceOptionsBase

- Source: [`aws-ecs/lib/cluster.ts`](https://github.com/aws/aws-cdk/blob/v2.275.0/packages/aws-cdk-lib/aws-ecs/lib/cluster.ts#L1277)
- Type last changed: v2.263.0 · 31 Jul 2026

## Example

```ts
declare const vpc: ec2.Vpc;

// Create or reference an existing namespace
const existingNamespace = new cloudmap.PrivateDnsNamespace(this, 'Namespace', {
  name: 'example.local',
  vpc,
});

const cluster = new ecs.Cluster(this, 'Cluster', { vpc });

// Use the existing namespace as the default
cluster.addExistingDefaultCloudMapNamespace({
  namespace: existingNamespace,
  useForServiceConnect: true,
});
```

## Properties

- `namespace`: [INamespace](/cdk/api/v2/docs/aws-cdk-lib.aws_servicediscovery.INamespace.html) (required) — 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]

- `useForServiceConnect`: boolean = false — This property specifies whether to set the provided namespace as the service connect default in the cluster properties.
