Class: AWSCDK::ECSPatterns::NetworkLoadBalancedFargateService

Inherits:
NetworkLoadBalancedServiceBase
  • Object
show all
Defined in:
ecs_patterns/network_load_balanced_fargate_service.rb

Overview

A Fargate service running on an ECS cluster fronted by a network load balancer.

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(scope, id, props = nil) ⇒ NetworkLoadBalancedFargateService

Constructs a new instance of the NetworkLoadBalancedFargateService class.

Parameters:



13
14
15
16
17
18
19
# File 'ecs_patterns/network_load_balanced_fargate_service.rb', line 13

def initialize(scope, id, props = nil)
  props = props.is_a?(Hash) ? ::AWSCDK::ECSPatterns::NetworkLoadBalancedFargateServiceProps.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("eyJmcW4iOiJhd3MtY2RrLWxpYi5hd3NfZWNzX3BhdHRlcm5zLk5ldHdvcmtMb2FkQmFsYW5jZWRGYXJnYXRlU2VydmljZVByb3BzIn0=")), "props") unless props.nil?
  Jsii::Object.instance_method(:initialize).bind(self).call(scope, id, props)
end

Class Method Details

.jsii_overridable_methodsObject



21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
# File 'ecs_patterns/network_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 },
    :internal_desired_count => { kind: :property, name: "internalDesiredCount", 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_IDString

Uniquely identifies this class.

Returns:

  • (String)


88
89
90
# File 'ecs_patterns/network_load_balanced_fargate_service.rb', line 88

def self.PROPERTY_INJECTION_ID()
  Jsii::Kernel.instance.get_static("aws-cdk-lib.aws_ecs_patterns.NetworkLoadBalancedFargateService", "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.

Parameters:



138
139
140
141
# File 'ecs_patterns/network_load_balanced_fargate_service.rb', line 138

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_ipBoolean

Returns:

  • (Boolean)


93
94
95
# File 'ecs_patterns/network_load_balanced_fargate_service.rb', line 93

def assign_public_ip()
  jsii_get_property("assignPublicIp")
end

#clusterAWSCDK::ECS::ICluster

The cluster that hosts the service.



50
51
52
# File 'ecs_patterns/network_load_balanced_fargate_service.rb', line 50

def cluster()
  jsii_get_property("cluster")
end

#create_aws_log_driver(prefix) ⇒ AWSCDK::ECS::AWSLogDriver

Parameters:

  • prefix (String)

Returns:



145
146
147
148
# File 'ecs_patterns/network_load_balanced_fargate_service.rb', line 145

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.

Parameters:

Returns:



155
156
157
158
159
# File 'ecs_patterns/network_load_balanced_fargate_service.rb', line 155

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_countNumeric?

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.

Returns:

  • (Numeric, nil)


81
82
83
# File 'ecs_patterns/network_load_balanced_fargate_service.rb', line 81

def internal_desired_count()
  jsii_get_property("internalDesiredCount")
end

#listenerAWSCDK::ElasticLoadBalancingv2::NetworkListener

The listener for the service.



57
58
59
# File 'ecs_patterns/network_load_balanced_fargate_service.rb', line 57

def listener()
  jsii_get_property("listener")
end

#load_balancerAWSCDK::ElasticLoadBalancingv2::NetworkLoadBalancer

The Network Load Balancer for the service.



64
65
66
# File 'ecs_patterns/network_load_balanced_fargate_service.rb', line 64

def load_balancer()
  jsii_get_property("loadBalancer")
end

#nodeConstructs::Node

The tree node.

Returns:

  • (Constructs::Node)


43
44
45
# File 'ecs_patterns/network_load_balanced_fargate_service.rb', line 43

def node()
  jsii_get_property("node")
end

#serviceAWSCDK::ECS::FargateService

The Fargate service in this construct.



100
101
102
# File 'ecs_patterns/network_load_balanced_fargate_service.rb', line 100

def service()
  jsii_get_property("service")
end

#target_groupAWSCDK::ElasticLoadBalancingv2::NetworkTargetGroup

The target group for the service.



71
72
73
# File 'ecs_patterns/network_load_balanced_fargate_service.rb', line 71

def target_group()
  jsii_get_property("targetGroup")
end

#task_definitionAWSCDK::ECS::FargateTaskDefinition

The Fargate task definition in this construct.



107
108
109
# File 'ecs_patterns/network_load_balanced_fargate_service.rb', line 107

def task_definition()
  jsii_get_property("taskDefinition")
end

#to_stringString

Returns a string representation of this construct.

Returns:

  • (String)


114
115
116
# File 'ecs_patterns/network_load_balanced_fargate_service.rb', line 114

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.

Parameters:

  • mixins (Array<Constructs::IMixin>)

    The mixins to apply.

Returns:

  • (Constructs::IConstruct)

    This construct for chaining



127
128
129
130
131
132
# File 'ecs_patterns/network_load_balanced_fargate_service.rb', line 127

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