@Generated(value="jsii-pacmak/1.50.0 (build d1830a4)", date="2022-01-04T15:39:07.345Z") @Stability(value=Experimental) public class Cluster extends Resource implements ICluster
Example:
Vpc vpc = Vpc.Builder.create(this, "Vpc").maxAzs(1).build();
Cluster cluster = Cluster.Builder.create(this, "EcsCluster").vpc(vpc).build();
SecurityGroup securityGroup = SecurityGroup.Builder.create(this, "SG").vpc(vpc).build();
ScheduledFargateTask scheduledFargateTask = ScheduledFargateTask.Builder.create(this, "ScheduledFargateTask")
.cluster(cluster)
.scheduledFargateTaskImageOptions(ScheduledFargateTaskImageOptions.builder()
.image(ContainerImage.fromRegistry("amazon/amazon-ecs-sample"))
.memoryLimitMiB(512)
.build())
.schedule(Schedule.expression("rate(1 minute)"))
.securityGroups(List.of(securityGroup))
.build();
| Modifier and Type | Class and Description |
|---|---|
static class |
Cluster.Builder
(experimental) A fluent builder for
Cluster. |
software.amazon.jsii.JsiiObject.InitializationModeICluster.Jsii$Default, ICluster.Jsii$Proxy| Modifier | Constructor and Description |
|---|---|
|
Cluster(software.constructs.Construct scope,
String id)
(experimental) Constructs a new instance of the Cluster class.
|
|
Cluster(software.constructs.Construct scope,
String id,
ClusterProps props)
(experimental) Constructs a new instance of the Cluster class.
|
protected |
Cluster(software.amazon.jsii.JsiiObject.InitializationMode initializationMode) |
protected |
Cluster(software.amazon.jsii.JsiiObjectRef objRef) |
| Modifier and Type | Method and Description |
|---|---|
void |
addAsgCapacityProvider(AsgCapacityProvider provider)
(experimental) This method adds an Auto Scaling Group Capacity Provider to a cluster.
|
void |
addAsgCapacityProvider(AsgCapacityProvider provider,
AddAutoScalingGroupCapacityOptions options)
(experimental) This method adds an Auto Scaling Group Capacity Provider to a cluster.
|
void |
addAutoScalingGroup(AutoScalingGroup autoScalingGroup)
Deprecated.
Use
Cluster.addAsgCapacityProvider instead. |
void |
addAutoScalingGroup(AutoScalingGroup autoScalingGroup,
AddAutoScalingGroupCapacityOptions options)
Deprecated.
Use
Cluster.addAsgCapacityProvider instead. |
AutoScalingGroup |
addCapacity(String id,
AddCapacityOptions options)
(experimental) It is highly recommended to use
Cluster.addAsgCapacityProvider instead of this method. |
void |
addCapacityProvider(String provider)
Deprecated.
Use
enableFargateCapacityProviders instead. |
INamespace |
addDefaultCloudMapNamespace(CloudMapNamespaceOptions options)
(experimental) Add an AWS Cloud Map DNS namespace for this cluster.
|
void |
enableFargateCapacityProviders()
(experimental) Enable the Fargate capacity providers for this cluster.
|
static ICluster |
fromClusterAttributes(software.constructs.Construct scope,
String id,
ClusterAttributes attrs)
(experimental) Import an existing cluster to the stack from its attributes.
|
IAutoScalingGroup |
getAutoscalingGroup()
(experimental) Getter for autoscaling group added to cluster.
|
String |
getClusterArn()
(experimental) The Amazon Resource Name (ARN) that identifies the cluster.
|
String |
getClusterName()
(experimental) The name of the cluster.
|
Connections |
getConnections()
(experimental) Manage the allowed network connections for the cluster with Security Groups.
|
INamespace |
getDefaultCloudMapNamespace()
(experimental) Getter for namespace added to cluster.
|
ExecuteCommandConfiguration |
getExecuteCommandConfiguration()
(experimental) Getter for execute command configuration associated with the cluster.
|
Boolean |
getHasEc2Capacity()
(experimental) Whether the cluster has EC2 capacity associated with it.
|
IVpc |
getVpc()
(experimental) The VPC associated with the cluster.
|
Metric |
metric(String metricName)
(experimental) This method returns the specifed CloudWatch metric for this cluster.
|
Metric |
metric(String metricName,
MetricOptions props)
(experimental) This method returns the specifed CloudWatch metric for this cluster.
|
Metric |
metricCpuReservation()
(experimental) This method returns the CloudWatch metric for this clusters CPU reservation.
|
Metric |
metricCpuReservation(MetricOptions props)
(experimental) This method returns the CloudWatch metric for this clusters CPU reservation.
|
Metric |
metricCpuUtilization()
(experimental) This method returns the CloudWatch metric for this clusters CPU utilization.
|
Metric |
metricCpuUtilization(MetricOptions props)
(experimental) This method returns the CloudWatch metric for this clusters CPU utilization.
|
Metric |
metricMemoryReservation()
(experimental) This method returns the CloudWatch metric for this clusters memory reservation.
|
Metric |
metricMemoryReservation(MetricOptions props)
(experimental) This method returns the CloudWatch metric for this clusters memory reservation.
|
Metric |
metricMemoryUtilization()
(experimental) This method returns the CloudWatch metric for this clusters memory utilization.
|
Metric |
metricMemoryUtilization(MetricOptions props)
(experimental) This method returns the CloudWatch metric for this clusters memory utilization.
|
applyRemovalPolicy, generatePhysicalName, getEnv, getPhysicalName, getResourceArnAttribute, getResourceNameAttribute, getStack, isResourcegetNode, isConstruct, onPrepare, onSynthesize, onValidate, prepare, synthesize, validatejsiiAsyncCall, jsiiAsyncCall, jsiiCall, jsiiCall, jsiiGet, jsiiGet, jsiiSet, jsiiStaticCall, jsiiStaticCall, jsiiStaticGet, jsiiStaticGet, jsiiStaticSet, jsiiStaticSetclone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitapplyRemovalPolicy, getEnv, getStackgetNodeprotected Cluster(software.amazon.jsii.JsiiObjectRef objRef)
protected Cluster(software.amazon.jsii.JsiiObject.InitializationMode initializationMode)
@Stability(value=Experimental)
public Cluster(@NotNull
software.constructs.Construct scope,
@NotNull
String id,
@Nullable
ClusterProps props)
scope - This parameter is required.id - This parameter is required.props - @Stability(value=Experimental)
public Cluster(@NotNull
software.constructs.Construct scope,
@NotNull
String id)
scope - This parameter is required.id - This parameter is required.@Stability(value=Experimental) @NotNull public static ICluster fromClusterAttributes(@NotNull software.constructs.Construct scope, @NotNull String id, @NotNull ClusterAttributes attrs)
scope - This parameter is required.id - This parameter is required.attrs - This parameter is required.@Stability(value=Experimental)
public void addAsgCapacityProvider(@NotNull
AsgCapacityProvider provider,
@Nullable
AddAutoScalingGroupCapacityOptions options)
provider - the capacity provider to add to this cluster. This parameter is required.options - @Stability(value=Experimental)
public void addAsgCapacityProvider(@NotNull
AsgCapacityProvider provider)
provider - the capacity provider to add to this cluster. This parameter is required.@Stability(value=Deprecated) @Deprecated public void addAutoScalingGroup(@NotNull AutoScalingGroup autoScalingGroup, @Nullable AddAutoScalingGroupCapacityOptions options)
Cluster.addAsgCapacityProvider instead.autoScalingGroup - the ASG to add to this cluster. This parameter is required.options - @Stability(value=Deprecated) @Deprecated public void addAutoScalingGroup(@NotNull AutoScalingGroup autoScalingGroup)
Cluster.addAsgCapacityProvider instead.autoScalingGroup - the ASG to add to this cluster. This parameter is required.@Stability(value=Experimental) @NotNull public AutoScalingGroup addCapacity(@NotNull String id, @NotNull AddCapacityOptions options)
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.
id - This parameter is required.options - This parameter is required.@Stability(value=Deprecated) @Deprecated public void addCapacityProvider(@NotNull String provider)
enableFargateCapacityProviders instead.provider - the capacity provider to add to this cluster. This parameter is required.addAsgCapacityProvider} to add an Auto Scaling Group capacity provider to the cluster.@Stability(value=Experimental) @NotNull public INamespace addDefaultCloudMapNamespace(@NotNull CloudMapNamespaceOptions options)
NOTE: HttpNamespaces are not supported, as ECS always requires a DNSConfig when registering an instance to a Cloud Map service.
options - This parameter is required.@Stability(value=Experimental) public void enableFargateCapacityProviders()
@Stability(value=Experimental) @NotNull public Metric metric(@NotNull String metricName, @Nullable MetricOptions props)
metricName - This parameter is required.props - @Stability(value=Experimental) @NotNull public Metric metric(@NotNull String metricName)
metricName - This parameter is required.@Stability(value=Experimental) @NotNull public Metric metricCpuReservation(@Nullable MetricOptions props)
Default: average over 5 minutes
props - @Stability(value=Experimental) @NotNull public Metric metricCpuReservation()
Default: average over 5 minutes
@Stability(value=Experimental) @NotNull public Metric metricCpuUtilization(@Nullable MetricOptions props)
Default: average over 5 minutes
props - @Stability(value=Experimental) @NotNull public Metric metricCpuUtilization()
Default: average over 5 minutes
@Stability(value=Experimental) @NotNull public Metric metricMemoryReservation(@Nullable MetricOptions props)
Default: average over 5 minutes
props - @Stability(value=Experimental) @NotNull public Metric metricMemoryReservation()
Default: average over 5 minutes
@Stability(value=Experimental) @NotNull public Metric metricMemoryUtilization(@Nullable MetricOptions props)
Default: average over 5 minutes
props - @Stability(value=Experimental) @NotNull public Metric metricMemoryUtilization()
Default: average over 5 minutes
@Stability(value=Experimental) @NotNull public String getClusterArn()
getClusterArn in interface ICluster@Stability(value=Experimental) @NotNull public String getClusterName()
getClusterName in interface ICluster@Stability(value=Experimental) @NotNull public Connections getConnections()
getConnections in interface ICluster@Stability(value=Experimental) @NotNull public Boolean getHasEc2Capacity()
getHasEc2Capacity in interface ICluster@Stability(value=Experimental) @NotNull public IVpc getVpc()
@Stability(value=Experimental) @Nullable public IAutoScalingGroup getAutoscalingGroup()
getAutoscalingGroup in interface ICluster@Stability(value=Experimental) @Nullable public INamespace getDefaultCloudMapNamespace()
getDefaultCloudMapNamespace in interface ICluster@Stability(value=Experimental) @Nullable public ExecuteCommandConfiguration getExecuteCommandConfiguration()
getExecuteCommandConfiguration in interface IClusterCopyright © 2022. All rights reserved.