interface CloudMapNamespaceOptions
| Language | Type name |
|---|---|
.NET | Amazon.CDK.AWS.ECS.CloudMapNamespaceOptions |
Go | github.com/aws/aws-cdk-go/awscdk/v2/awsecs#CloudMapNamespaceOptions |
Java | software.amazon.awscdk.services.ecs.CloudMapNamespaceOptions |
Python | aws_cdk.aws_ecs.CloudMapNamespaceOptions |
TypeScript (source) | aws-cdk-lib » aws_ecs » CloudMapNamespaceOptions |
The options for creating an AWS Cloud Map namespace.
Example
declare const cluster: ecs.Cluster;
declare const taskDefinition: ecs.TaskDefinition;
declare const containerOptions: ecs.ContainerDefinitionOptions;
const container = taskDefinition.addContainer('MyContainer', containerOptions);
container.addPortMappings({
name: 'api',
containerPort: 8080,
});
cluster.addDefaultCloudMapNamespace({
name: 'local',
});
const service = new ecs.FargateService(this, 'Service', {
cluster,
taskDefinition,
minHealthyPercent: 100,
serviceConnectConfiguration: {
services: [
{
portMappingName: 'api',
dnsName: 'http-api',
port: 80,
},
],
},
});
Properties
| Name | Type | Description |
|---|---|---|
| name | string | The name of the namespace, such as example.com. |
| type? | Namespace | The type of CloudMap Namespace to create. |
| use | boolean | This property specifies whether to set the provided namespace as the service connect default in the cluster properties. |
| vpc? | IVpc | The VPC to associate the namespace with. |
name
Type:
string
The name of the namespace, such as example.com.
type?
Type:
Namespace
(optional, default: PrivateDns)
The type of CloudMap Namespace to create.
useForServiceConnect?
Type:
boolean
(optional, default: false)
This property specifies whether to set the provided namespace as the service connect default in the cluster properties.
vpc?
Type:
IVpc
(optional, default: VPC of the cluster for Private DNS Namespace, otherwise none)
The VPC to associate the namespace with.
This property is required for private DNS namespaces.

.NET
Go
Java
Python
TypeScript (