Class: AWSCDK::ECS::Cluster

Inherits:
Resource
  • Object
show all
Includes:
ICluster
Defined in:
ecs/cluster.rb

Overview

A regional grouping of one or more container instances on which you can run tasks and services.

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

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

Constructs a new instance of the Cluster class.

Parameters:



14
15
16
17
18
19
20
# File 'ecs/cluster.rb', line 14

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

Class Method Details

.from_cluster_arn(scope, id, cluster_arn) ⇒ AWSCDK::ECS::ICluster

Import an existing cluster to the stack from the cluster ARN.

This does not provide access to the vpc, hasEc2Capacity, or connections - use the from_cluster_attributes method to access those properties.

Parameters:

  • scope (Constructs::Construct)
  • id (String)
  • cluster_arn (String)

Returns:



73
74
75
76
77
78
# File 'ecs/cluster.rb', line 73

def self.from_cluster_arn(scope, id, cluster_arn)
  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(cluster_arn, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJzdHJpbmcifQ==")), "clusterArn")
  Jsii::Kernel.instance.call_static("aws-cdk-lib.aws_ecs.Cluster", "fromClusterArn", [scope, id, cluster_arn])
end

.from_cluster_attributes(scope, id, attrs) ⇒ AWSCDK::ECS::ICluster

Import an existing cluster to the stack from its attributes.

Parameters:

Returns:



86
87
88
89
90
91
92
# File 'ecs/cluster.rb', line 86

def self.from_cluster_attributes(scope, id, attrs)
  Jsii::Type.check_type(scope, JSON.parse(Base64.strict_decode64("eyJmcW4iOiJjb25zdHJ1Y3RzLkNvbnN0cnVjdCJ9")), "scope")
  Jsii::Type.check_type(id, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJzdHJpbmcifQ==")), "id")
  attrs = attrs.is_a?(Hash) ? ::AWSCDK::ECS::ClusterAttributes.new(**attrs.transform_keys(&:to_sym)) : attrs
  Jsii::Type.check_type(attrs, JSON.parse(Base64.strict_decode64("eyJmcW4iOiJhd3MtY2RrLWxpYi5hd3NfZWNzLkNsdXN0ZXJBdHRyaWJ1dGVzIn0=")), "attrs")
  Jsii::Kernel.instance.call_static("aws-cdk-lib.aws_ecs.Cluster", "fromClusterAttributes", [scope, id, attrs])
end

.is_cluster(x) ⇒ Boolean

Return whether the given object is a Cluster.

Parameters:

  • x (Object)

Returns:

  • (Boolean)


98
99
100
101
# File 'ecs/cluster.rb', line 98

def self.is_cluster(x)
  Jsii::Type.check_type(x, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJhbnkifQ==")), "x")
  Jsii::Kernel.instance.call_static("aws-cdk-lib.aws_ecs.Cluster", "isCluster", [x])
end

.jsii_overridable_methodsObject



22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
# File 'ecs/cluster.rb', line 22

def self.jsii_overridable_methods
  {
    :node => { kind: :property, name: "node", is_optional: false },
    :env => { kind: :property, name: "env", is_optional: false },
    :physical_name => { kind: :property, name: "physicalName", is_optional: false },
    :stack => { kind: :property, name: "stack", is_optional: false },
    :capacity_provider_names => { kind: :property, name: "capacityProviderNames", is_optional: false },
    :cluster_arn => { kind: :property, name: "clusterArn", is_optional: false },
    :cluster_name => { kind: :property, name: "clusterName", is_optional: false },
    :cluster_ref => { kind: :property, name: "clusterRef", is_optional: false },
    :cluster_scoped_capacity_provider_names => { kind: :property, name: "clusterScopedCapacityProviderNames", is_optional: false },
    :connections => { kind: :property, name: "connections", is_optional: false },
    :default_capacity_provider_strategy => { kind: :property, name: "defaultCapacityProviderStrategy", is_optional: false },
    :grants => { kind: :property, name: "grants", is_optional: false },
    :has_ec2_capacity => { kind: :property, name: "hasEc2Capacity", is_optional: false },
    :vpc => { kind: :property, name: "vpc", is_optional: false },
    :autoscaling_group => { kind: :property, name: "autoscalingGroup", is_optional: true },
    :default_cloud_map_namespace => { kind: :property, name: "defaultCloudMapNamespace", is_optional: true },
    :execute_command_configuration => { kind: :property, name: "executeCommandConfiguration", is_optional: true },
    :to_string => { kind: :method, name: "toString", is_optional: false },
    :with => { kind: :method, name: "with", is_optional: false },
    :apply_cross_stack_reference_strength => { kind: :method, name: "applyCrossStackReferenceStrength", is_optional: false },
    :apply_removal_policy => { kind: :method, name: "applyRemovalPolicy", is_optional: false },
    :generate_physical_name => { kind: :method, name: "generatePhysicalName", is_optional: false },
    :get_resource_arn_attribute => { kind: :method, name: "getResourceArnAttribute", is_optional: false },
    :get_resource_name_attribute => { kind: :method, name: "getResourceNameAttribute", is_optional: false },
    :add_asg_capacity_provider => { kind: :method, name: "addAsgCapacityProvider", is_optional: false },
    :add_capacity => { kind: :method, name: "addCapacity", is_optional: false },
    :add_default_capacity_provider_strategy => { kind: :method, name: "addDefaultCapacityProviderStrategy", is_optional: false },
    :add_default_cloud_map_namespace => { kind: :method, name: "addDefaultCloudMapNamespace", is_optional: false },
    :add_managed_instances_capacity_provider => { kind: :method, name: "addManagedInstancesCapacityProvider", is_optional: false },
    :arn_for_tasks => { kind: :method, name: "arnForTasks", is_optional: false },
    :enable_fargate_capacity_providers => { kind: :method, name: "enableFargateCapacityProviders", is_optional: false },
    :grant_task_protection => { kind: :method, name: "grantTaskProtection", is_optional: false },
    :metric => { kind: :method, name: "metric", is_optional: false },
    :metric_cpu_reservation => { kind: :method, name: "metricCpuReservation", is_optional: false },
    :metric_cpu_utilization => { kind: :method, name: "metricCpuUtilization", is_optional: false },
    :metric_memory_reservation => { kind: :method, name: "metricMemoryReservation", is_optional: false },
    :metric_memory_utilization => { kind: :method, name: "metricMemoryUtilization", is_optional: false },
  }
end

.PROPERTY_INJECTION_IDString

Uniquely identifies this class.

Returns:

  • (String)


149
150
151
# File 'ecs/cluster.rb', line 149

def self.PROPERTY_INJECTION_ID()
  Jsii::Kernel.instance.get_static("aws-cdk-lib.aws_ecs.Cluster", "PROPERTY_INJECTION_ID")
end

Instance Method Details

#add_asg_capacity_provider(provider, options = nil) ⇒ void

This method returns an undefined value.

This method adds an Auto Scaling Group Capacity Provider to a cluster.

Parameters:



341
342
343
344
345
346
# File 'ecs/cluster.rb', line 341

def add_asg_capacity_provider(provider, options = nil)
  Jsii::Type.check_type(provider, JSON.parse(Base64.strict_decode64("eyJmcW4iOiJhd3MtY2RrLWxpYi5hd3NfZWNzLkFzZ0NhcGFjaXR5UHJvdmlkZXIifQ==")), "provider")
  options = options.is_a?(Hash) ? ::AWSCDK::ECS::AddAutoScalingGroupCapacityOptions.new(**options.transform_keys(&:to_sym)) : options
  Jsii::Type.check_type(options, JSON.parse(Base64.strict_decode64("eyJmcW4iOiJhd3MtY2RrLWxpYi5hd3NfZWNzLkFkZEF1dG9TY2FsaW5nR3JvdXBDYXBhY2l0eU9wdGlvbnMifQ==")), "options") unless options.nil?
  jsii_call_method("addAsgCapacityProvider", [provider, options])
end

#add_capacity(id, options) ⇒ AWSCDK::Autoscaling::AutoScalingGroup

It is highly recommended to use Cluster.addAsgCapacityProvider instead of this method.

This method adds compute capacity to a cluster by creating an AutoScalingGroup with the specified options.

Returns the AutoScalingGroup so you can add autoscaling settings to it.

Parameters:

Returns:



357
358
359
360
361
362
# File 'ecs/cluster.rb', line 357

def add_capacity(id, options)
  Jsii::Type.check_type(id, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJzdHJpbmcifQ==")), "id")
  options = options.is_a?(Hash) ? ::AWSCDK::ECS::AddCapacityOptions.new(**options.transform_keys(&:to_sym)) : options
  Jsii::Type.check_type(options, JSON.parse(Base64.strict_decode64("eyJmcW4iOiJhd3MtY2RrLWxpYi5hd3NfZWNzLkFkZENhcGFjaXR5T3B0aW9ucyJ9")), "options")
  jsii_call_method("addCapacity", [id, options])
end

#add_default_capacity_provider_strategy(default_capacity_provider_strategy) ⇒ void

This method returns an undefined value.

Add default capacity provider strategy for this cluster.

Parameters:

  • default_capacity_provider_strategy (Array<AWSCDK::ECS::CapacityProviderStrategy>)

    cluster default capacity provider strategy. This takes the form of a list of CapacityProviderStrategy objects.



368
369
370
371
372
# File 'ecs/cluster.rb', line 368

def add_default_capacity_provider_strategy(default_capacity_provider_strategy)
  default_capacity_provider_strategy = default_capacity_provider_strategy.is_a?(Array) ? default_capacity_provider_strategy.map { |jsii_v0| jsii_v0.is_a?(Hash) ? ::AWSCDK::ECS::CapacityProviderStrategy.new(**jsii_v0.transform_keys(&:to_sym)) : jsii_v0 } : default_capacity_provider_strategy
  Jsii::Type.check_type(default_capacity_provider_strategy, JSON.parse(Base64.strict_decode64("eyJjb2xsZWN0aW9uIjp7ImVsZW1lbnR0eXBlIjp7ImZxbiI6ImF3cy1jZGstbGliLmF3c19lY3MuQ2FwYWNpdHlQcm92aWRlclN0cmF0ZWd5In0sImtpbmQiOiJhcnJheSJ9fQ==")), "defaultCapacityProviderStrategy")
  jsii_call_method("addDefaultCapacityProviderStrategy", [default_capacity_provider_strategy])
end

#add_default_cloud_map_namespace(options) ⇒ AWSCDK::ServiceDiscovery::INamespace

Add an AWS Cloud Map DNS namespace for this cluster.

NOTE: HttpNamespaces are supported only for use cases involving Service Connect. For use cases involving both Service- Discovery and Service Connect, customers should manage the HttpNamespace outside of the Cluster.addDefaultCloudMapNamespace method.



381
382
383
384
385
# File 'ecs/cluster.rb', line 381

def add_default_cloud_map_namespace(options)
  options = options.is_a?(Hash) ? ::AWSCDK::ECS::CloudMapNamespaceOptions.new(**options.transform_keys(&:to_sym)) : options
  Jsii::Type.check_type(options, JSON.parse(Base64.strict_decode64("eyJmcW4iOiJhd3MtY2RrLWxpYi5hd3NfZWNzLkNsb3VkTWFwTmFtZXNwYWNlT3B0aW9ucyJ9")), "options")
  jsii_call_method("addDefaultCloudMapNamespace", [options])
end

#add_managed_instances_capacity_provider(provider) ⇒ void

This method returns an undefined value.

This method adds a Managed Instances Capacity Provider to a cluster.

Parameters:



391
392
393
394
# File 'ecs/cluster.rb', line 391

def add_managed_instances_capacity_provider(provider)
  Jsii::Type.check_type(provider, JSON.parse(Base64.strict_decode64("eyJmcW4iOiJhd3MtY2RrLWxpYi5hd3NfZWNzLk1hbmFnZWRJbnN0YW5jZXNDYXBhY2l0eVByb3ZpZGVyIn0=")), "provider")
  jsii_call_method("addManagedInstancesCapacityProvider", [provider])
end

#apply_cross_stack_reference_strength(strength) ⇒ void

This method returns an undefined value.

Override the cross-stack reference strength for this resource.

When set, any cross-stack reference to this resource will use the specified mechanism instead of the global default determined by the @aws-cdk/core:defaultCrossStackReferences context key. This is useful for selectively weakening specific references to avoid the "deadly embrace" problem without changing the app-wide default.

Parameters:



279
280
281
282
# File 'ecs/cluster.rb', line 279

def apply_cross_stack_reference_strength(strength)
  Jsii::Type.check_type(strength, JSON.parse(Base64.strict_decode64("eyJmcW4iOiJhd3MtY2RrLWxpYi5SZWZlcmVuY2VTdHJlbmd0aCJ9")), "strength")
  jsii_call_method("applyCrossStackReferenceStrength", [strength])
end

#apply_removal_policy(policy) ⇒ void

This method returns an undefined value.

Apply the given removal policy to this resource.

The Removal Policy controls what happens to this resource when it stops being managed by CloudFormation, either because you've removed it from the CDK application or because you've made a change that requires the resource to be replaced.

The resource can be deleted (RemovalPolicy.DESTROY), or left in your AWS account for data recovery and cleanup later (RemovalPolicy.RETAIN).

Parameters:



296
297
298
299
# File 'ecs/cluster.rb', line 296

def apply_removal_policy(policy)
  Jsii::Type.check_type(policy, JSON.parse(Base64.strict_decode64("eyJmcW4iOiJhd3MtY2RrLWxpYi5SZW1vdmFsUG9saWN5In0=")), "policy")
  jsii_call_method("applyRemovalPolicy", [policy])
end

#arn_for_tasks(key_pattern) ⇒ String

Returns an ARN that represents all tasks within the cluster that match the task pattern specified.

To represent all tasks, specify "*".

Parameters:

  • key_pattern (String)

    Task id pattern.

Returns:

  • (String)


402
403
404
405
# File 'ecs/cluster.rb', line 402

def arn_for_tasks(key_pattern)
  Jsii::Type.check_type(key_pattern, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJzdHJpbmcifQ==")), "keyPattern")
  jsii_call_method("arnForTasks", [key_pattern])
end

#autoscaling_groupAWSCDK::Autoscaling::IAutoScalingGroup?

Getter for autoscaling group added to cluster.



228
229
230
# File 'ecs/cluster.rb', line 228

def autoscaling_group()
  jsii_get_property("autoscalingGroup")
end

#capacity_provider_namesArray<String>

Getter for _capacityProviderNames added to cluster.

Returns:

  • (Array<String>)


156
157
158
# File 'ecs/cluster.rb', line 156

def capacity_provider_names()
  jsii_get_property("capacityProviderNames")
end

#cluster_arnString

The Amazon Resource Name (ARN) that identifies the cluster.

Returns:

  • (String)


163
164
165
# File 'ecs/cluster.rb', line 163

def cluster_arn()
  jsii_get_property("clusterArn")
end

#cluster_nameString

The name of the cluster.

Returns:

  • (String)


170
171
172
# File 'ecs/cluster.rb', line 170

def cluster_name()
  jsii_get_property("clusterName")
end

#cluster_refAWSCDK::Interfaces::AWSECS::ClusterReference

A reference to a Cluster resource.



177
178
179
# File 'ecs/cluster.rb', line 177

def cluster_ref()
  jsii_get_property("clusterRef")
end

#cluster_scoped_capacity_provider_namesArray<String>

Getter for _clusterScopedCapacityProviderNames.

Returns:

  • (Array<String>)


184
185
186
# File 'ecs/cluster.rb', line 184

def cluster_scoped_capacity_provider_names()
  jsii_get_property("clusterScopedCapacityProviderNames")
end

#connectionsAWSCDK::EC2::Connections

Manage the allowed network connections for the cluster with Security Groups.



191
192
193
# File 'ecs/cluster.rb', line 191

def connections()
  jsii_get_property("connections")
end

#default_capacity_provider_strategyArray<AWSCDK::ECS::CapacityProviderStrategy>

Getter for _defaultCapacityProviderStrategy.

This is necessary to correctly create Capacity Provider Associations.



200
201
202
# File 'ecs/cluster.rb', line 200

def default_capacity_provider_strategy()
  jsii_get_property("defaultCapacityProviderStrategy")
end

#default_cloud_map_namespaceAWSCDK::ServiceDiscovery::INamespace?

Getter for namespace added to cluster.



235
236
237
# File 'ecs/cluster.rb', line 235

def default_cloud_map_namespace()
  jsii_get_property("defaultCloudMapNamespace")
end

#enable_fargate_capacity_providersvoid

This method returns an undefined value.

Enable the Fargate capacity providers for this cluster.



410
411
412
# File 'ecs/cluster.rb', line 410

def enable_fargate_capacity_providers()
  jsii_call_method("enableFargateCapacityProviders", [])
end

#envAWSCDK::Interfaces::ResourceEnvironment

The environment this resource belongs to.

For resources that are created and managed in a Stack (those created by creating new class instances like new Role(), new Bucket(), etc.), this is always the same as the environment of the stack they belong to.

For referenced resources (those obtained from referencing methods like Role.fromRoleArn(), Bucket.fromBucketName(), etc.), they might be different than the stack they were imported into.



121
122
123
# File 'ecs/cluster.rb', line 121

def env()
  jsii_get_property("env")
end

#execute_command_configurationAWSCDK::ECS::ExecuteCommandConfiguration?

Getter for execute command configuration associated with the cluster.



242
243
244
# File 'ecs/cluster.rb', line 242

def execute_command_configuration()
  jsii_get_property("executeCommandConfiguration")
end

#generate_physical_nameString

Returns:

  • (String)


302
303
304
# File 'ecs/cluster.rb', line 302

def generate_physical_name()
  jsii_call_method("generatePhysicalName", [])
end

#get_resource_arn_attribute(arn_attr, arn_components) ⇒ String

Returns an environment-sensitive token that should be used for the resource's "ARN" attribute (e.g. bucket.bucketArn).

Normally, this token will resolve to arn_attr, but if the resource is referenced across environments, arn_components will be used to synthesize a concrete ARN with the resource's physical name. Make sure to reference this.physicalName in arn_components.

Parameters:

  • arn_attr (String)

    The CFN attribute which resolves to the ARN of the resource.

  • arn_components (AWSCDK::ARNComponents)

    The format of the ARN of this resource.

Returns:

  • (String)


316
317
318
319
320
321
# File 'ecs/cluster.rb', line 316

def get_resource_arn_attribute(arn_attr, arn_components)
  Jsii::Type.check_type(arn_attr, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJzdHJpbmcifQ==")), "arnAttr")
  arn_components = arn_components.is_a?(Hash) ? ::AWSCDK::ARNComponents.new(**arn_components.transform_keys(&:to_sym)) : arn_components
  Jsii::Type.check_type(arn_components, JSON.parse(Base64.strict_decode64("eyJmcW4iOiJhd3MtY2RrLWxpYi5Bcm5Db21wb25lbnRzIn0=")), "arnComponents")
  jsii_call_method("getResourceArnAttribute", [arn_attr, arn_components])
end

#get_resource_name_attribute(name_attr) ⇒ String

Returns an environment-sensitive token that should be used for the resource's "name" attribute (e.g. bucket.bucketName).

Normally, this token will resolve to name_attr, but if the resource is referenced across environments, it will be resolved to this.physicalName, which will be a concrete name.

Parameters:

  • name_attr (String)

    The CFN attribute which resolves to the resource's name.

Returns:

  • (String)


331
332
333
334
# File 'ecs/cluster.rb', line 331

def get_resource_name_attribute(name_attr)
  Jsii::Type.check_type(name_attr, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJzdHJpbmcifQ==")), "nameAttr")
  jsii_call_method("getResourceNameAttribute", [name_attr])
end

#grant_task_protection(grantee) ⇒ AWSCDK::IAM::Grant

Grants an ECS Task Protection API permission to the specified grantee.

This method provides a streamlined way to assign the 'ecs:UpdateTaskProtection' permission, enabling the grantee to manage task protection in the ECS cluster. [disable-awslint:no-grants]

Parameters:

Returns:



422
423
424
425
# File 'ecs/cluster.rb', line 422

def grant_task_protection(grantee)
  Jsii::Type.check_type(grantee, JSON.parse(Base64.strict_decode64("eyJmcW4iOiJhd3MtY2RrLWxpYi5hd3NfaWFtLklHcmFudGFibGUifQ==")), "grantee")
  jsii_call_method("grantTaskProtection", [grantee])
end

#grantsAWSCDK::ECS::ClusterGrants

Collection of grant methods for a Cluster.



207
208
209
# File 'ecs/cluster.rb', line 207

def grants()
  jsii_get_property("grants")
end

#has_ec2_capacityBoolean

Whether the cluster has EC2 capacity associated with it.

Returns:

  • (Boolean)


214
215
216
# File 'ecs/cluster.rb', line 214

def has_ec2_capacity()
  jsii_get_property("hasEc2Capacity")
end

#metric(metric_name, props = nil) ⇒ AWSCDK::CloudWatch::Metric

This method returns the specified CloudWatch metric for this cluster.

Parameters:

Returns:



432
433
434
435
436
437
# File 'ecs/cluster.rb', line 432

def metric(metric_name, props = nil)
  Jsii::Type.check_type(metric_name, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJzdHJpbmcifQ==")), "metricName")
  props = props.is_a?(Hash) ? ::AWSCDK::CloudWatch::MetricOptions.new(**props.transform_keys(&:to_sym)) : props
  Jsii::Type.check_type(props, JSON.parse(Base64.strict_decode64("eyJmcW4iOiJhd3MtY2RrLWxpYi5hd3NfY2xvdWR3YXRjaC5NZXRyaWNPcHRpb25zIn0=")), "props") unless props.nil?
  jsii_call_method("metric", [metric_name, props])
end

#metric_cpu_reservation(props = nil) ⇒ AWSCDK::CloudWatch::Metric

Note:

Default: average over 5 minutes

This method returns the CloudWatch metric for this clusters CPU reservation.

Parameters:

Returns:



444
445
446
447
448
# File 'ecs/cluster.rb', line 444

def metric_cpu_reservation(props = nil)
  props = props.is_a?(Hash) ? ::AWSCDK::CloudWatch::MetricOptions.new(**props.transform_keys(&:to_sym)) : props
  Jsii::Type.check_type(props, JSON.parse(Base64.strict_decode64("eyJmcW4iOiJhd3MtY2RrLWxpYi5hd3NfY2xvdWR3YXRjaC5NZXRyaWNPcHRpb25zIn0=")), "props") unless props.nil?
  jsii_call_method("metricCpuReservation", [props])
end

#metric_cpu_utilization(props = nil) ⇒ AWSCDK::CloudWatch::Metric

Note:

Default: average over 5 minutes

This method returns the CloudWatch metric for this clusters CPU utilization.

Parameters:

Returns:



455
456
457
458
459
# File 'ecs/cluster.rb', line 455

def metric_cpu_utilization(props = nil)
  props = props.is_a?(Hash) ? ::AWSCDK::CloudWatch::MetricOptions.new(**props.transform_keys(&:to_sym)) : props
  Jsii::Type.check_type(props, JSON.parse(Base64.strict_decode64("eyJmcW4iOiJhd3MtY2RrLWxpYi5hd3NfY2xvdWR3YXRjaC5NZXRyaWNPcHRpb25zIn0=")), "props") unless props.nil?
  jsii_call_method("metricCpuUtilization", [props])
end

#metric_memory_reservation(props = nil) ⇒ AWSCDK::CloudWatch::Metric

Note:

Default: average over 5 minutes

This method returns the CloudWatch metric for this clusters memory reservation.

Parameters:

Returns:



466
467
468
469
470
# File 'ecs/cluster.rb', line 466

def metric_memory_reservation(props = nil)
  props = props.is_a?(Hash) ? ::AWSCDK::CloudWatch::MetricOptions.new(**props.transform_keys(&:to_sym)) : props
  Jsii::Type.check_type(props, JSON.parse(Base64.strict_decode64("eyJmcW4iOiJhd3MtY2RrLWxpYi5hd3NfY2xvdWR3YXRjaC5NZXRyaWNPcHRpb25zIn0=")), "props") unless props.nil?
  jsii_call_method("metricMemoryReservation", [props])
end

#metric_memory_utilization(props = nil) ⇒ AWSCDK::CloudWatch::Metric

Note:

Default: average over 5 minutes

This method returns the CloudWatch metric for this clusters memory utilization.

Parameters:

Returns:



477
478
479
480
481
# File 'ecs/cluster.rb', line 477

def metric_memory_utilization(props = nil)
  props = props.is_a?(Hash) ? ::AWSCDK::CloudWatch::MetricOptions.new(**props.transform_keys(&:to_sym)) : props
  Jsii::Type.check_type(props, JSON.parse(Base64.strict_decode64("eyJmcW4iOiJhd3MtY2RrLWxpYi5hd3NfY2xvdWR3YXRjaC5NZXRyaWNPcHRpb25zIn0=")), "props") unless props.nil?
  jsii_call_method("metricMemoryUtilization", [props])
end

#nodeConstructs::Node

The tree node.

Returns:

  • (Constructs::Node)


106
107
108
# File 'ecs/cluster.rb', line 106

def node()
  jsii_get_property("node")
end

#physical_nameString

Returns a string-encoded token that resolves to the physical name that should be passed to the CloudFormation resource.

This value will resolve to one of the following:

  • a concrete value (e.g. "my-awesome-bucket")
  • undefined, when a name should be generated by CloudFormation
  • a concrete name generated automatically during synthesis, in cross-environment scenarios.

Returns:

  • (String)


135
136
137
# File 'ecs/cluster.rb', line 135

def physical_name()
  jsii_get_property("physicalName")
end

#stackAWSCDK::Stack

The stack in which this resource is defined.

Returns:



142
143
144
# File 'ecs/cluster.rb', line 142

def stack()
  jsii_get_property("stack")
end

#to_stringString

Returns a string representation of this construct.

Returns:

  • (String)


249
250
251
# File 'ecs/cluster.rb', line 249

def to_string()
  jsii_call_method("toString", [])
end

#vpcAWSCDK::EC2::IVPC

The VPC associated with the cluster.

Returns:



221
222
223
# File 'ecs/cluster.rb', line 221

def vpc()
  jsii_get_property("vpc")
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>)

Returns:

  • (Constructs::IConstruct)


262
263
264
265
266
267
# File 'ecs/cluster.rb', line 262

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