Class: AWSCDK::ECS::CloudMapOptions

Inherits:
Jsii::Struct
  • Object
show all
Defined in:
ecs/cloud_map_options.rb

Overview

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

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(cloud_map_namespace: nil, container: nil, container_port: nil, dns_record_type: nil, dns_ttl: nil, failure_threshold: nil, name: nil) ⇒ CloudMapOptions

Returns a new instance of CloudMapOptions.

Parameters:

  • cloud_map_namespace (AWSCDK::ServiceDiscovery::INamespace, nil) (defaults to: nil)

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

  • container (AWSCDK::ECS::ContainerDefinition, nil) (defaults to: nil)

    The container to point to for a SRV record.

  • container_port (Numeric, nil) (defaults to: nil)

    The port to point to for a SRV record.

  • dns_record_type (AWSCDK::ServiceDiscovery::DNSRecordType, nil) (defaults to: nil)

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

  • dns_ttl (AWSCDK::Duration, nil) (defaults to: nil)

    The amount of time that you want DNS resolvers to cache the settings for this record.

  • failure_threshold (Numeric, nil) (defaults to: nil)

    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, nil) (defaults to: nil)

    The name of the Cloud Map service to attach to the ECS service.



14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
# File 'ecs/cloud_map_options.rb', line 14

def initialize(cloud_map_namespace: nil, container: nil, container_port: nil, dns_record_type: nil, dns_ttl: nil, failure_threshold: nil, name: nil)
  @cloud_map_namespace = cloud_map_namespace
  Jsii::Type.check_type(@cloud_map_namespace, JSON.parse(Base64.strict_decode64("eyJmcW4iOiJhd3MtY2RrLWxpYi5hd3Nfc2VydmljZWRpc2NvdmVyeS5JTmFtZXNwYWNlIn0=")), "cloudMapNamespace") unless @cloud_map_namespace.nil?
  @container = container
  Jsii::Type.check_type(@container, JSON.parse(Base64.strict_decode64("eyJmcW4iOiJhd3MtY2RrLWxpYi5hd3NfZWNzLkNvbnRhaW5lckRlZmluaXRpb24ifQ==")), "container") unless @container.nil?
  @container_port = container_port
  Jsii::Type.check_type(@container_port, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJudW1iZXIifQ==")), "containerPort") unless @container_port.nil?
  @dns_record_type = dns_record_type
  Jsii::Type.check_type(@dns_record_type, JSON.parse(Base64.strict_decode64("eyJmcW4iOiJhd3MtY2RrLWxpYi5hd3Nfc2VydmljZWRpc2NvdmVyeS5EbnNSZWNvcmRUeXBlIn0=")), "dnsRecordType") unless @dns_record_type.nil?
  @dns_ttl = dns_ttl
  Jsii::Type.check_type(@dns_ttl, JSON.parse(Base64.strict_decode64("eyJmcW4iOiJhd3MtY2RrLWxpYi5EdXJhdGlvbiJ9")), "dnsTtl") unless @dns_ttl.nil?
  @failure_threshold = failure_threshold
  Jsii::Type.check_type(@failure_threshold, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJudW1iZXIifQ==")), "failureThreshold") unless @failure_threshold.nil?
  @name = name
  Jsii::Type.check_type(@name, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJzdHJpbmcifQ==")), "name") unless @name.nil?
end

Instance Attribute Details

#cloud_map_namespaceAWSCDK::ServiceDiscovery::INamespace? (readonly)

Note:

Default: - the defaultCloudMapNamespace associated to the cluster

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



35
36
37
# File 'ecs/cloud_map_options.rb', line 35

def cloud_map_namespace
  @cloud_map_namespace
end

#containerAWSCDK::ECS::ContainerDefinition? (readonly)

Note:

Default: - the task definition's default container

The container to point to for a SRV record.



40
41
42
# File 'ecs/cloud_map_options.rb', line 40

def container
  @container
end

#container_portNumeric? (readonly)

Note:

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

The port to point to for a SRV record.

Returns:

  • (Numeric, nil)


45
46
47
# File 'ecs/cloud_map_options.rb', line 45

def container_port
  @container_port
end

#dns_record_typeAWSCDK::ServiceDiscovery::DNSRecordType? (readonly)

Note:

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.



52
53
54
# File 'ecs/cloud_map_options.rb', line 52

def dns_record_type
  @dns_record_type
end

#dns_ttlAWSCDK::Duration? (readonly)

Note:

Default: Duration.minutes(1)

The amount of time that you want DNS resolvers to cache the settings for this record.

Returns:



57
58
59
# File 'ecs/cloud_map_options.rb', line 57

def dns_ttl
  @dns_ttl
end

#failure_thresholdNumeric? (readonly)

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

Returns:

  • (Numeric, nil)


63
64
65
# File 'ecs/cloud_map_options.rb', line 63

def failure_threshold
  @failure_threshold
end

#nameString? (readonly)

Note:

Default: CloudFormation-generated name

The name of the Cloud Map service to attach to the ECS service.

Returns:

  • (String, nil)


68
69
70
# File 'ecs/cloud_map_options.rb', line 68

def name
  @name
end

Class Method Details

.jsii_propertiesObject



70
71
72
73
74
75
76
77
78
79
80
# File 'ecs/cloud_map_options.rb', line 70

def self.jsii_properties
  {
    :cloud_map_namespace => "cloudMapNamespace",
    :container => "container",
    :container_port => "containerPort",
    :dns_record_type => "dnsRecordType",
    :dns_ttl => "dnsTtl",
    :failure_threshold => "failureThreshold",
    :name => "name",
  }
end

Instance Method Details

#to_jsiiObject



82
83
84
85
86
87
88
89
90
91
92
93
94
# File 'ecs/cloud_map_options.rb', line 82

def to_jsii
  result = {}
  result.merge!({
    "cloudMapNamespace" => @cloud_map_namespace,
    "container" => @container,
    "containerPort" => @container_port,
    "dnsRecordType" => @dns_record_type,
    "dnsTtl" => @dns_ttl,
    "failureThreshold" => @failure_threshold,
    "name" => @name,
  })
  result.compact
end