Class: AWSCDK::ECSPatterns::NetworkMultipleTargetGroupsServiceBaseProps
- Inherits:
-
Jsii::Struct
- Object
- Jsii::Struct
- AWSCDK::ECSPatterns::NetworkMultipleTargetGroupsServiceBaseProps
- Defined in:
- ecs_patterns/network_multiple_target_groups_service_base_props.rb
Overview
The properties for the base NetworkMultipleTargetGroupsEc2Service or NetworkMultipleTargetGroupsFargateService service.
Direct Known Subclasses
NetworkMultipleTargetGroupsEC2ServiceProps, NetworkMultipleTargetGroupsFargateServiceProps
Instance Attribute Summary collapse
-
#cloud_map_options ⇒ AWSCDK::ECS::CloudMapOptions?
readonly
The options for configuring an Amazon ECS service to use service discovery.
-
#cluster ⇒ AWSCDK::ECS::ICluster?
readonly
The name of the cluster that hosts the service.
-
#desired_count ⇒ Numeric?
readonly
The desired number of instantiations of the task definition to keep running on the service.
-
#enable_ecs_managed_tags ⇒ Boolean?
readonly
Specifies whether to enable Amazon ECS managed tags for the tasks within the service.
-
#enable_execute_command ⇒ Boolean?
readonly
Whether ECS Exec should be enabled.
-
#health_check_grace_period ⇒ AWSCDK::Duration?
readonly
The period of time, in seconds, that the Amazon ECS service scheduler ignores unhealthy Elastic Load Balancing target health checks after a task has first started.
-
#load_balancers ⇒ Array<AWSCDK::ECSPatterns::NetworkLoadBalancerProps>?
readonly
The network load balancer that will serve traffic to the service.
-
#propagate_tags ⇒ AWSCDK::ECS::PropagatedTagSource?
readonly
Specifies whether to propagate the tags from the task definition or the service to the tasks in the service.
-
#service_name ⇒ String?
readonly
Name of the service.
-
#target_groups ⇒ Array<AWSCDK::ECSPatterns::NetworkTargetProps>?
readonly
Properties to specify NLB target groups.
-
#task_image_options ⇒ AWSCDK::ECSPatterns::NetworkLoadBalancedTaskImageProps?
readonly
The properties required to create a new task definition.
-
#vpc ⇒ AWSCDK::EC2::IVPC?
readonly
The VPC where the container instances will be launched or the elastic network interfaces (ENIs) will be deployed.
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize(cloud_map_options: nil, cluster: nil, desired_count: nil, enable_ecs_managed_tags: nil, enable_execute_command: nil, health_check_grace_period: nil, load_balancers: nil, propagate_tags: nil, service_name: nil, target_groups: nil, task_image_options: nil, vpc: nil) ⇒ NetworkMultipleTargetGroupsServiceBaseProps
constructor
A new instance of NetworkMultipleTargetGroupsServiceBaseProps.
- #to_jsii ⇒ Object
Constructor Details
#initialize(cloud_map_options: nil, cluster: nil, desired_count: nil, enable_ecs_managed_tags: nil, enable_execute_command: nil, health_check_grace_period: nil, load_balancers: nil, propagate_tags: nil, service_name: nil, target_groups: nil, task_image_options: nil, vpc: nil) ⇒ NetworkMultipleTargetGroupsServiceBaseProps
Returns a new instance of NetworkMultipleTargetGroupsServiceBaseProps.
19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 |
# File 'ecs_patterns/network_multiple_target_groups_service_base_props.rb', line 19 def initialize(cloud_map_options: nil, cluster: nil, desired_count: nil, enable_ecs_managed_tags: nil, enable_execute_command: nil, health_check_grace_period: nil, load_balancers: nil, propagate_tags: nil, service_name: nil, target_groups: nil, task_image_options: nil, vpc: nil) @cloud_map_options = .is_a?(Hash) ? ::AWSCDK::ECS::CloudMapOptions.new(**.transform_keys(&:to_sym)) : Jsii::Type.check_type(@cloud_map_options, JSON.parse(Base64.strict_decode64("eyJmcW4iOiJhd3MtY2RrLWxpYi5hd3NfZWNzLkNsb3VkTWFwT3B0aW9ucyJ9")), "cloudMapOptions") unless @cloud_map_options.nil? @cluster = cluster Jsii::Type.check_type(@cluster, JSON.parse(Base64.strict_decode64("eyJmcW4iOiJhd3MtY2RrLWxpYi5hd3NfZWNzLklDbHVzdGVyIn0=")), "cluster") unless @cluster.nil? @desired_count = desired_count Jsii::Type.check_type(@desired_count, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJudW1iZXIifQ==")), "desiredCount") unless @desired_count.nil? @enable_ecs_managed_tags = Jsii::Type.check_type(@enable_ecs_managed_tags, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJib29sZWFuIn0=")), "enableECSManagedTags") unless @enable_ecs_managed_tags.nil? @enable_execute_command = enable_execute_command Jsii::Type.check_type(@enable_execute_command, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJib29sZWFuIn0=")), "enableExecuteCommand") unless @enable_execute_command.nil? @health_check_grace_period = health_check_grace_period Jsii::Type.check_type(@health_check_grace_period, JSON.parse(Base64.strict_decode64("eyJmcW4iOiJhd3MtY2RrLWxpYi5EdXJhdGlvbiJ9")), "healthCheckGracePeriod") unless @health_check_grace_period.nil? @load_balancers = load_balancers.is_a?(Array) ? load_balancers.map { |jsii_v0| jsii_v0.is_a?(Hash) ? ::AWSCDK::ECSPatterns::NetworkLoadBalancerProps.new(**jsii_v0.transform_keys(&:to_sym)) : jsii_v0 } : load_balancers Jsii::Type.check_type(@load_balancers, JSON.parse(Base64.strict_decode64("eyJjb2xsZWN0aW9uIjp7ImVsZW1lbnR0eXBlIjp7ImZxbiI6ImF3cy1jZGstbGliLmF3c19lY3NfcGF0dGVybnMuTmV0d29ya0xvYWRCYWxhbmNlclByb3BzIn0sImtpbmQiOiJhcnJheSJ9fQ==")), "loadBalancers") unless @load_balancers.nil? @propagate_tags = Jsii::Type.check_type(@propagate_tags, JSON.parse(Base64.strict_decode64("eyJmcW4iOiJhd3MtY2RrLWxpYi5hd3NfZWNzLlByb3BhZ2F0ZWRUYWdTb3VyY2UifQ==")), "propagateTags") unless @propagate_tags.nil? @service_name = service_name Jsii::Type.check_type(@service_name, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJzdHJpbmcifQ==")), "serviceName") unless @service_name.nil? @target_groups = target_groups.is_a?(Array) ? target_groups.map { |jsii_v0| jsii_v0.is_a?(Hash) ? ::AWSCDK::ECSPatterns::NetworkTargetProps.new(**jsii_v0.transform_keys(&:to_sym)) : jsii_v0 } : target_groups Jsii::Type.check_type(@target_groups, JSON.parse(Base64.strict_decode64("eyJjb2xsZWN0aW9uIjp7ImVsZW1lbnR0eXBlIjp7ImZxbiI6ImF3cy1jZGstbGliLmF3c19lY3NfcGF0dGVybnMuTmV0d29ya1RhcmdldFByb3BzIn0sImtpbmQiOiJhcnJheSJ9fQ==")), "targetGroups") unless @target_groups.nil? @task_image_options = .is_a?(Hash) ? ::AWSCDK::ECSPatterns::NetworkLoadBalancedTaskImageProps.new(**.transform_keys(&:to_sym)) : Jsii::Type.check_type(@task_image_options, JSON.parse(Base64.strict_decode64("eyJmcW4iOiJhd3MtY2RrLWxpYi5hd3NfZWNzX3BhdHRlcm5zLk5ldHdvcmtMb2FkQmFsYW5jZWRUYXNrSW1hZ2VQcm9wcyJ9")), "taskImageOptions") unless @task_image_options.nil? @vpc = vpc Jsii::Type.check_type(@vpc, JSON.parse(Base64.strict_decode64("eyJmcW4iOiJhd3MtY2RrLWxpYi5hd3NfZWMyLklWcGMifQ==")), "vpc") unless @vpc.nil? end |
Instance Attribute Details
#cloud_map_options ⇒ AWSCDK::ECS::CloudMapOptions? (readonly)
Default: - AWS Cloud Map service discovery is not enabled.
The options for configuring an Amazon ECS service to use service discovery.
50 51 52 |
# File 'ecs_patterns/network_multiple_target_groups_service_base_props.rb', line 50 def @cloud_map_options end |
#cluster ⇒ AWSCDK::ECS::ICluster? (readonly)
Default: - create a new cluster; if both cluster and vpc are omitted, a new VPC will be created for you.
The name of the cluster that hosts the service.
If a cluster is specified, the vpc construct should be omitted. Alternatively, you can omit both cluster and vpc.
57 58 59 |
# File 'ecs_patterns/network_multiple_target_groups_service_base_props.rb', line 57 def cluster @cluster end |
#desired_count ⇒ Numeric? (readonly)
Default: - The default is 1 for all new services and uses the existing service's desired count when updating an existing service.
The desired number of instantiations of the task definition to keep running on the service.
The minimum value is 1
64 65 66 |
# File 'ecs_patterns/network_multiple_target_groups_service_base_props.rb', line 64 def desired_count @desired_count end |
#enable_ecs_managed_tags ⇒ Boolean? (readonly)
Default: false
Specifies whether to enable Amazon ECS managed tags for the tasks within the service.
For more information, see Tagging Your Amazon ECS Resources
72 73 74 |
# File 'ecs_patterns/network_multiple_target_groups_service_base_props.rb', line 72 def @enable_ecs_managed_tags end |
#enable_execute_command ⇒ Boolean? (readonly)
Default: - false
Whether ECS Exec should be enabled.
77 78 79 |
# File 'ecs_patterns/network_multiple_target_groups_service_base_props.rb', line 77 def enable_execute_command @enable_execute_command end |
#health_check_grace_period ⇒ AWSCDK::Duration? (readonly)
Default: - defaults to 60 seconds if at least one load balancer is in-use and it is not already set
The period of time, in seconds, that the Amazon ECS service scheduler ignores unhealthy Elastic Load Balancing target health checks after a task has first started.
82 83 84 |
# File 'ecs_patterns/network_multiple_target_groups_service_base_props.rb', line 82 def health_check_grace_period @health_check_grace_period end |
#load_balancers ⇒ Array<AWSCDK::ECSPatterns::NetworkLoadBalancerProps>? (readonly)
Default: - a new load balancer with a listener will be created.
The network load balancer that will serve traffic to the service.
87 88 89 |
# File 'ecs_patterns/network_multiple_target_groups_service_base_props.rb', line 87 def load_balancers @load_balancers end |
#propagate_tags ⇒ AWSCDK::ECS::PropagatedTagSource? (readonly)
Default: - none
Specifies whether to propagate the tags from the task definition or the service to the tasks in the service.
Tags can only be propagated to the tasks within the service during service creation.
94 95 96 |
# File 'ecs_patterns/network_multiple_target_groups_service_base_props.rb', line 94 def @propagate_tags end |
#service_name ⇒ String? (readonly)
Default: - CloudFormation-generated name.
Name of the service.
99 100 101 |
# File 'ecs_patterns/network_multiple_target_groups_service_base_props.rb', line 99 def service_name @service_name end |
#target_groups ⇒ Array<AWSCDK::ECSPatterns::NetworkTargetProps>? (readonly)
Default: - default portMapping registered as target group and attached to the first defined listener
Properties to specify NLB target groups.
104 105 106 |
# File 'ecs_patterns/network_multiple_target_groups_service_base_props.rb', line 104 def target_groups @target_groups end |
#task_image_options ⇒ AWSCDK::ECSPatterns::NetworkLoadBalancedTaskImageProps? (readonly)
Default: - none
The properties required to create a new task definition.
Only one of TaskDefinition or TaskImageOptions must be specified.
111 112 113 |
# File 'ecs_patterns/network_multiple_target_groups_service_base_props.rb', line 111 def @task_image_options end |
#vpc ⇒ AWSCDK::EC2::IVPC? (readonly)
Default: - uses the VPC defined in the cluster or creates a new VPC.
The VPC where the container instances will be launched or the elastic network interfaces (ENIs) will be deployed.
If a vpc is specified, the cluster construct should be omitted. Alternatively, you can omit both vpc and cluster.
118 119 120 |
# File 'ecs_patterns/network_multiple_target_groups_service_base_props.rb', line 118 def vpc @vpc end |
Class Method Details
.jsii_properties ⇒ Object
120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 |
# File 'ecs_patterns/network_multiple_target_groups_service_base_props.rb', line 120 def self.jsii_properties { :cloud_map_options => "cloudMapOptions", :cluster => "cluster", :desired_count => "desiredCount", :enable_ecs_managed_tags => "enableECSManagedTags", :enable_execute_command => "enableExecuteCommand", :health_check_grace_period => "healthCheckGracePeriod", :load_balancers => "loadBalancers", :propagate_tags => "propagateTags", :service_name => "serviceName", :target_groups => "targetGroups", :task_image_options => "taskImageOptions", :vpc => "vpc", } end |
Instance Method Details
#to_jsii ⇒ Object
137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 |
# File 'ecs_patterns/network_multiple_target_groups_service_base_props.rb', line 137 def to_jsii result = {} result.merge!({ "cloudMapOptions" => @cloud_map_options, "cluster" => @cluster, "desiredCount" => @desired_count, "enableECSManagedTags" => @enable_ecs_managed_tags, "enableExecuteCommand" => @enable_execute_command, "healthCheckGracePeriod" => @health_check_grace_period, "loadBalancers" => @load_balancers, "propagateTags" => @propagate_tags, "serviceName" => @service_name, "targetGroups" => @target_groups, "taskImageOptions" => @task_image_options, "vpc" => @vpc, }) result.compact end |