interface CloudMapOptions
Language | Type name |
---|---|
.NET | Amazon.CDK.AWS.ECS.CloudMapOptions |
Java | software.amazon.awscdk.services.ecs.CloudMapOptions |
Python | aws_cdk.aws_ecs.CloudMapOptions |
TypeScript (source) | @aws-cdk/aws-ecs » CloudMapOptions |
The options to enabling AWS Cloud Map for an Amazon ECS service.
Example
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
Name | Type | Description |
---|---|---|
cloud | INamespace | The service discovery namespace for the Cloud Map service to attach to the ECS service. |
container? | Container | The container to point to for a SRV record. |
container | number | The port to point to for a SRV record. |
dns | Dns | The DNS record type that you want AWS Cloud Map to create. |
dns | Duration | The amount of time that you want DNS resolvers to cache the settings for this record. |
failure | number | 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. |
name? | string | The name of the Cloud Map service to attach to the ECS service. |
cloudMapNamespace?
Type:
INamespace
(optional, default: the defaultCloudMapNamespace associated to the cluster)
The service discovery namespace for the Cloud Map service to attach to the ECS service.
container?
Type:
Container
(optional, default: the task definition's default container)
The container to point to for a SRV record.
containerPort?
Type:
number
(optional, default: the default port of the task definition's default container)
The port to point to for a SRV record.
dnsRecordType?
Type:
Dns
(optional, default: DnsRecordType.A if TaskDefinition.networkMode = AWS_VPC, otherwise DnsRecordType.SRV)
The DNS record type that you want AWS Cloud Map to create.
The supported record types are A or SRV.
dnsTtl?
Type:
Duration
(optional, default: Duration.minutes(1))
The amount of time that you want DNS resolvers to cache the settings for this record.
failureThreshold?
Type:
number
(optional)
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
name?
Type:
string
(optional, default: CloudFormation-generated name)
The name of the Cloud Map service to attach to the ECS service.