Skip to content
v2.275.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 ​

cloudMapNamespaceoptionalINamespacecloud_map_namespaceoptionalINamespacecloudMapNamespaceoptionalINamespaceCloudMapNamespaceoptionalINamespaceCloudMapNamespaceoptionalINamespace#
The service discovery namespace for the Cloud Map service to attach to the ECS service.

Default: the defaultCloudMapNamespace associated to the cluster

containeroptionalContainerDefinitioncontaineroptionalContainerDefinitioncontaineroptionalContainerDefinitionContaineroptionalContainerDefinitionContaineroptionalContainerDefinition#
The container to point to for a SRV record.

Default: the task definition's default container

containerPortoptionalnumbercontainer_portoptionalint | floatcontainerPortoptionalNumberContainerPortoptionaldoubleContainerPortoptional*float64#
The port to point to for a SRV record.

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

dnsRecordTypeoptionalDnsRecordTypedns_record_typeoptionalDnsRecordTypednsRecordTypeoptionalDnsRecordTypeDnsRecordTypeoptionalDnsRecordTypeDnsRecordTypeoptionalDnsRecordType#
The DNS record type that you want AWS Cloud Map to create.

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

The supported record types are A or SRV.

dnsTtloptionalDurationdns_ttloptionalDurationdnsTtloptionalDurationDnsTtloptionalDurationDnsTtloptionalDuration= Duration.minutes(1)#
The amount of time that you want DNS resolvers to cache the settings for this record.
failureThresholdoptionalnumberfailure_thresholdoptionalint | floatfailureThresholdoptionalNumberFailureThresholdoptionaldoubleFailureThresholdoptional*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

nameoptionalstringnameoptionalstrnameoptionalStringNameoptionalstringNameoptional*string#
The name of the Cloud Map service to attach to the ECS service.

Default: CloudFormation-generated name