Skip to content
v2.273.0

CloudMapNamespaceOptions Struct ​

The options for creating an AWS Cloud Map namespace.

Example ​

ts
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 ​

namestringnamestrnameStringNamestringName*stringrequired#
The name of the namespace, such as example.com.
The type of CloudMap Namespace to create.
useForServiceConnectbooleanuse_for_service_connectbooluseForServiceConnectBooleanUseForServiceConnectboolUseForServiceConnect*bool= false#
This property specifies whether to set the provided namespace as the service connect default in the cluster properties.
vpcIVpcvpcIVpcvpcIVpcVpcIVpcVpcIVpc= VPC of the cluster for Private D…#
The VPC to associate the namespace with.

This property is required for private DNS namespaces.

default

Default: VPC of the cluster for Private DNS Namespace, otherwise none