Skip to content
v2.274.0

CloudMapOptions Struct ​

The options to enabling AWS Cloud Map for an Amazon ECS service.

Example ​

ts
declare const taskDefinition: ecs.TaskDefinition;
declare const cluster: ecs.Cluster;

const service = new ecs.Ec2Service(this, 'Service', {
  cluster,
  taskDefinition,
  cloudMapOptions: {
    // Create A records - useful for AWSVPC network mode.
    dnsRecordType: cloudmap.DnsRecordType.A,
  },
});

Properties ​

cloudMapNamespaceINamespacecloud_map_namespaceINamespacecloudMapNamespaceINamespaceCloudMapNamespaceINamespaceCloudMapNamespaceINamespace= the defaultCloudMapNamespace ass…#
The service discovery namespace for the Cloud Map service to attach to the ECS service.
default

Default: the defaultCloudMapNamespace associated to the cluster

containerContainerDefinitioncontainerContainerDefinitioncontainerContainerDefinitionContainerContainerDefinitionContainerContainerDefinition= the task definition's default co…#
The container to point to for a SRV record.
default

Default: the task definition's default container

containerPortnumbercontainer_portint | floatcontainerPortNumberContainerPortdoubleContainerPort*float64= the default port of the task def…#
The port to point to for a SRV record.
default

Default: the default port of the task definition's default container

dnsRecordTypeDnsRecordTypedns_record_typeDnsRecordTypednsRecordTypeDnsRecordTypeDnsRecordTypeDnsRecordTypeDnsRecordTypeDnsRecordType= DnsRecordType.A if TaskDefinitio…#
The DNS record type that you want AWS Cloud Map to create.

The supported record types are A or SRV.

default

Default: DnsRecordType.A if TaskDefinition.networkMode = AWS_VPC, otherwise DnsRecordType.SRV

dnsTtlDurationdns_ttlDurationdnsTtlDurationDnsTtlDurationDnsTtlDuration= Duration.minutes(1)#
The amount of time that you want DNS resolvers to cache the settings for this record.
failureThresholdnumberfailure_thresholdint | floatfailureThresholdNumberFailureThresholddoubleFailureThreshold*float64#
The number of 30-second intervals that you want Cloud Map to wait after receiving an UpdateInstanceCustomHealthStatus request before it changes the health status of a service instance.

NOTE: This is used for HealthCheckCustomConfig

namestringnamestrnameStringNamestringName*string= CloudFormation-generated name#
The name of the Cloud Map service to attach to the ECS service.