Class: AWSCDK::ECSPatterns::ApplicationLoadBalancedFargateService
- Inherits:
-
ApplicationLoadBalancedServiceBase
- Object
- ApplicationLoadBalancedServiceBase
- AWSCDK::ECSPatterns::ApplicationLoadBalancedFargateService
- Defined in:
- ecs_patterns/application_load_balanced_fargate_service.rb
Overview
A Fargate service running on an ECS cluster fronted by an application load balancer.
Class Method Summary collapse
- .jsii_overridable_methods ⇒ Object
-
.PROPERTY_INJECTION_ID ⇒ String
Uniquely identifies this class.
Instance Method Summary collapse
-
#add_service_as_target(service) ⇒ void
Adds service as a target of the target group.
-
#assign_public_ip ⇒ Boolean
Determines whether the service will be assigned a public IP address.
-
#certificate ⇒ AWSCDK::CertificateManager::ICertificate?
Certificate Manager certificate to associate with the load balancer.
-
#cluster ⇒ AWSCDK::ECS::ICluster
The cluster that hosts the service.
- #create_aws_log_driver(prefix) ⇒ AWSCDK::ECS::AWSLogDriver
-
#get_default_cluster(scope, vpc = nil) ⇒ AWSCDK::ECS::Cluster
Returns the default cluster.
-
#initialize(scope, id, props = nil) ⇒ ApplicationLoadBalancedFargateService
constructor
Constructs a new instance of the ApplicationLoadBalancedFargateService class.
-
#internal_desired_count ⇒ Numeric?
The desired number of instantiations of the task definition to keep running on the service.
-
#listener ⇒ AWSCDK::ElasticLoadBalancingv2::ApplicationListener
The listener for the service.
-
#load_balancer ⇒ AWSCDK::ElasticLoadBalancingv2::ApplicationLoadBalancer
The Application Load Balancer for the service.
-
#node ⇒ Constructs::Node
The tree node.
-
#redirect_listener ⇒ AWSCDK::ElasticLoadBalancingv2::ApplicationListener?
The redirect listener for the service if redirectHTTP is enabled.
-
#service ⇒ AWSCDK::ECS::FargateService
The Fargate service in this construct.
-
#target_group ⇒ AWSCDK::ElasticLoadBalancingv2::ApplicationTargetGroup
The target group for the service.
-
#task_definition ⇒ AWSCDK::ECS::FargateTaskDefinition
The Fargate task definition in this construct.
-
#to_string ⇒ String
Returns a string representation of this construct.
-
#with(*mixins) ⇒ Constructs::IConstruct
Applies one or more mixins to this construct.
Constructor Details
#initialize(scope, id, props = nil) ⇒ ApplicationLoadBalancedFargateService
Constructs a new instance of the ApplicationLoadBalancedFargateService class.
13 14 15 16 17 18 19 |
# File 'ecs_patterns/application_load_balanced_fargate_service.rb', line 13 def initialize(scope, id, props = nil) props = props.is_a?(Hash) ? ::AWSCDK::ECSPatterns::ApplicationLoadBalancedFargateServiceProps.new(**props.transform_keys(&:to_sym)) : props Jsii::Type.check_type(scope, JSON.parse(Base64.strict_decode64("eyJmcW4iOiJjb25zdHJ1Y3RzLkNvbnN0cnVjdCJ9")), "scope") Jsii::Type.check_type(id, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJzdHJpbmcifQ==")), "id") Jsii::Type.check_type(props, JSON.parse(Base64.strict_decode64("eyJmcW4iOiJhd3MtY2RrLWxpYi5hd3NfZWNzX3BhdHRlcm5zLkFwcGxpY2F0aW9uTG9hZEJhbGFuY2VkRmFyZ2F0ZVNlcnZpY2VQcm9wcyJ9")), "props") unless props.nil? Jsii::Object.instance_method(:initialize).bind(self).call(scope, id, props) end |
Class Method Details
.jsii_overridable_methods ⇒ Object
21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 |
# File 'ecs_patterns/application_load_balanced_fargate_service.rb', line 21 def self.jsii_overridable_methods { :node => { kind: :property, name: "node", is_optional: false }, :cluster => { kind: :property, name: "cluster", is_optional: false }, :listener => { kind: :property, name: "listener", is_optional: false }, :load_balancer => { kind: :property, name: "loadBalancer", is_optional: false }, :target_group => { kind: :property, name: "targetGroup", is_optional: false }, :certificate => { kind: :property, name: "certificate", is_optional: true }, :internal_desired_count => { kind: :property, name: "internalDesiredCount", is_optional: true }, :redirect_listener => { kind: :property, name: "redirectListener", is_optional: true }, :assign_public_ip => { kind: :property, name: "assignPublicIp", is_optional: false }, :service => { kind: :property, name: "service", is_optional: false }, :task_definition => { kind: :property, name: "taskDefinition", is_optional: false }, :to_string => { kind: :method, name: "toString", is_optional: false }, :with => { kind: :method, name: "with", is_optional: false }, :add_service_as_target => { kind: :method, name: "addServiceAsTarget", is_optional: false }, :create_aws_log_driver => { kind: :method, name: "createAWSLogDriver", is_optional: false }, :get_default_cluster => { kind: :method, name: "getDefaultCluster", is_optional: false }, } end |
.PROPERTY_INJECTION_ID ⇒ String
Uniquely identifies this class.
104 105 106 |
# File 'ecs_patterns/application_load_balanced_fargate_service.rb', line 104 def self.PROPERTY_INJECTION_ID() Jsii::Kernel.instance.get_static("aws-cdk-lib.aws_ecs_patterns.ApplicationLoadBalancedFargateService", "PROPERTY_INJECTION_ID") end |
Instance Method Details
#add_service_as_target(service) ⇒ void
This method returns an undefined value.
Adds service as a target of the target group.
156 157 158 159 |
# File 'ecs_patterns/application_load_balanced_fargate_service.rb', line 156 def add_service_as_target(service) Jsii::Type.check_type(service, JSON.parse(Base64.strict_decode64("eyJmcW4iOiJhd3MtY2RrLWxpYi5hd3NfZWNzLkJhc2VTZXJ2aWNlIn0=")), "service") jsii_call_method("addServiceAsTarget", [service]) end |
#assign_public_ip ⇒ Boolean
Determines whether the service will be assigned a public IP address.
111 112 113 |
# File 'ecs_patterns/application_load_balanced_fargate_service.rb', line 111 def assign_public_ip() jsii_get_property("assignPublicIp") end |
#certificate ⇒ AWSCDK::CertificateManager::ICertificate?
Certificate Manager certificate to associate with the load balancer.
80 81 82 |
# File 'ecs_patterns/application_load_balanced_fargate_service.rb', line 80 def certificate() jsii_get_property("certificate") end |
#cluster ⇒ AWSCDK::ECS::ICluster
The cluster that hosts the service.
52 53 54 |
# File 'ecs_patterns/application_load_balanced_fargate_service.rb', line 52 def cluster() jsii_get_property("cluster") end |
#create_aws_log_driver(prefix) ⇒ AWSCDK::ECS::AWSLogDriver
163 164 165 166 |
# File 'ecs_patterns/application_load_balanced_fargate_service.rb', line 163 def create_aws_log_driver(prefix) Jsii::Type.check_type(prefix, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJzdHJpbmcifQ==")), "prefix") jsii_call_method("createAWSLogDriver", [prefix]) end |
#get_default_cluster(scope, vpc = nil) ⇒ AWSCDK::ECS::Cluster
Returns the default cluster.
173 174 175 176 177 |
# File 'ecs_patterns/application_load_balanced_fargate_service.rb', line 173 def get_default_cluster(scope, vpc = nil) Jsii::Type.check_type(scope, JSON.parse(Base64.strict_decode64("eyJmcW4iOiJjb25zdHJ1Y3RzLkNvbnN0cnVjdCJ9")), "scope") Jsii::Type.check_type(vpc, JSON.parse(Base64.strict_decode64("eyJmcW4iOiJhd3MtY2RrLWxpYi5hd3NfZWMyLklWcGMifQ==")), "vpc") unless vpc.nil? jsii_call_method("getDefaultCluster", [scope, vpc]) end |
#internal_desired_count ⇒ Numeric?
The desired number of instantiations of the task definition to keep running on the service.
The default is 1 for all new services and uses the existing services desired count when updating an existing service if one is not provided.
90 91 92 |
# File 'ecs_patterns/application_load_balanced_fargate_service.rb', line 90 def internal_desired_count() jsii_get_property("internalDesiredCount") end |
#listener ⇒ AWSCDK::ElasticLoadBalancingv2::ApplicationListener
The listener for the service.
59 60 61 |
# File 'ecs_patterns/application_load_balanced_fargate_service.rb', line 59 def listener() jsii_get_property("listener") end |
#load_balancer ⇒ AWSCDK::ElasticLoadBalancingv2::ApplicationLoadBalancer
The Application Load Balancer for the service.
66 67 68 |
# File 'ecs_patterns/application_load_balanced_fargate_service.rb', line 66 def load_balancer() jsii_get_property("loadBalancer") end |
#node ⇒ Constructs::Node
The tree node.
45 46 47 |
# File 'ecs_patterns/application_load_balanced_fargate_service.rb', line 45 def node() jsii_get_property("node") end |
#redirect_listener ⇒ AWSCDK::ElasticLoadBalancingv2::ApplicationListener?
The redirect listener for the service if redirectHTTP is enabled.
97 98 99 |
# File 'ecs_patterns/application_load_balanced_fargate_service.rb', line 97 def redirect_listener() jsii_get_property("redirectListener") end |
#service ⇒ AWSCDK::ECS::FargateService
The Fargate service in this construct.
118 119 120 |
# File 'ecs_patterns/application_load_balanced_fargate_service.rb', line 118 def service() jsii_get_property("service") end |
#target_group ⇒ AWSCDK::ElasticLoadBalancingv2::ApplicationTargetGroup
The target group for the service.
73 74 75 |
# File 'ecs_patterns/application_load_balanced_fargate_service.rb', line 73 def target_group() jsii_get_property("targetGroup") end |
#task_definition ⇒ AWSCDK::ECS::FargateTaskDefinition
The Fargate task definition in this construct.
125 126 127 |
# File 'ecs_patterns/application_load_balanced_fargate_service.rb', line 125 def task_definition() jsii_get_property("taskDefinition") end |
#to_string ⇒ String
Returns a string representation of this construct.
132 133 134 |
# File 'ecs_patterns/application_load_balanced_fargate_service.rb', line 132 def to_string() jsii_call_method("toString", []) end |
#with(*mixins) ⇒ Constructs::IConstruct
Applies one or more mixins to this construct.
Mixins are applied in order. The list of constructs is captured at the
start of the call, so constructs added by a mixin will not be visited.
Use multiple with() calls if subsequent mixins should apply to added
constructs.
145 146 147 148 149 150 |
# File 'ecs_patterns/application_load_balanced_fargate_service.rb', line 145 def with(*mixins) mixins.each_with_index do |item, index| Jsii::Type.check_type(item, JSON.parse(Base64.strict_decode64("eyJmcW4iOiJjb25zdHJ1Y3RzLklNaXhpbiJ9")), "mixins[#{index}]") end jsii_call_method("with", [*mixins]) end |