/* * Copyright 2018-2023 Amazon.com, Inc. or its affiliates. All Rights Reserved. * * Licensed under the Apache License, Version 2.0 (the "License"). You may not use this file except in compliance with * the License. A copy of the License is located at * * http://aws.amazon.com/apache2.0 * * or in the "license" file accompanying this file. This file is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR * CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions * and limitations under the License. */ package com.amazonaws.services.cloudwatchevents.model; import java.io.Serializable; import javax.annotation.Generated; import com.amazonaws.protocol.StructuredPojo; import com.amazonaws.protocol.ProtocolMarshaller; /** *
* The custom parameters to be used when the target is an Amazon ECS task. *
* * @see AWS API * Documentation */ @Generated("com.amazonaws:aws-java-sdk-code-generator") public class EcsParameters implements Serializable, Cloneable, StructuredPojo { /** ** The ARN of the task definition to use if the event target is an Amazon ECS task. *
*/ private String taskDefinitionArn; /** *
* The number of tasks to create based on TaskDefinition
. The default is 1.
*
* Specifies the launch type on which your task is running. The launch type that you specify here must match one of
* the launch type (compatibilities) of the target task. The FARGATE
value is supported only in the
* Regions where Fargate witt Amazon ECS is supported. For more information, see Fargate on Amazon ECS in
* the Amazon Elastic Container Service Developer Guide.
*
* Use this structure if the Amazon ECS task uses the awsvpc
network mode. This structure specifies the
* VPC subnets and security groups associated with the task, and whether a public IP address is to be used. This
* structure is required if LaunchType
is FARGATE
because the awsvpc
mode is
* required for Fargate tasks.
*
* If you specify NetworkConfiguration
when the target ECS task does not use the awsvpc
* network mode, the task fails.
*
* Specifies the platform version for the task. Specify only the numeric portion of the platform version, such as
* 1.1.0
.
*
* This structure is used only if LaunchType
is FARGATE
. For more information about valid
* platform versions, see Fargate Platform
* Versions in the Amazon Elastic Container Service Developer Guide.
*
* Specifies an ECS task group for the task. The maximum length is 255 characters. *
*/ private String group; /** ** The capacity provider strategy to use for the task. *
*
* If a capacityProviderStrategy
is specified, the launchType
parameter must be omitted.
* If no capacityProviderStrategy
or launchType is specified, the
* defaultCapacityProviderStrategy
for the cluster is used.
*
* Specifies whether to enable Amazon ECS managed tags for the task. For more information, see Tagging Your Amazon ECS * Resources in the Amazon Elastic Container Service Developer Guide. *
*/ private Boolean enableECSManagedTags; /** ** Whether or not to enable the execute command functionality for the containers in this task. If true, this enables * execute command functionality on all containers in the task. *
*/ private Boolean enableExecuteCommand; /** ** An array of placement constraint objects to use for the task. You can specify up to 10 constraints per task * (including constraints in the task definition and those specified at runtime). *
*/ private java.util.List* The placement strategy objects to use for the task. You can specify a maximum of five strategy rules per task. *
*/ private java.util.List* Specifies whether to propagate the tags from the task definition to the task. If no value is specified, the tags * are not propagated. Tags can only be propagated to the task during task creation. To add tags to a task after * task creation, use the TagResource API action. *
*/ private String propagateTags; /** ** The reference ID to use for the task. *
*/ private String referenceId; /** ** The metadata that you apply to the task to help you categorize and organize them. Each tag consists of a key and * an optional value, both of which you define. To learn more, see RunTask in the Amazon ECS API Reference. *
*/ private java.util.List* The ARN of the task definition to use if the event target is an Amazon ECS task. *
* * @param taskDefinitionArn * The ARN of the task definition to use if the event target is an Amazon ECS task. */ public void setTaskDefinitionArn(String taskDefinitionArn) { this.taskDefinitionArn = taskDefinitionArn; } /** ** The ARN of the task definition to use if the event target is an Amazon ECS task. *
* * @return The ARN of the task definition to use if the event target is an Amazon ECS task. */ public String getTaskDefinitionArn() { return this.taskDefinitionArn; } /** ** The ARN of the task definition to use if the event target is an Amazon ECS task. *
* * @param taskDefinitionArn * The ARN of the task definition to use if the event target is an Amazon ECS task. * @return Returns a reference to this object so that method calls can be chained together. */ public EcsParameters withTaskDefinitionArn(String taskDefinitionArn) { setTaskDefinitionArn(taskDefinitionArn); return this; } /** *
* The number of tasks to create based on TaskDefinition
. The default is 1.
*
TaskDefinition
. The default is 1.
*/
public void setTaskCount(Integer taskCount) {
this.taskCount = taskCount;
}
/**
*
* The number of tasks to create based on TaskDefinition
. The default is 1.
*
TaskDefinition
. The default is 1.
*/
public Integer getTaskCount() {
return this.taskCount;
}
/**
*
* The number of tasks to create based on TaskDefinition
. The default is 1.
*
TaskDefinition
. The default is 1.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public EcsParameters withTaskCount(Integer taskCount) {
setTaskCount(taskCount);
return this;
}
/**
*
* Specifies the launch type on which your task is running. The launch type that you specify here must match one of
* the launch type (compatibilities) of the target task. The FARGATE
value is supported only in the
* Regions where Fargate witt Amazon ECS is supported. For more information, see Fargate on Amazon ECS in
* the Amazon Elastic Container Service Developer Guide.
*
FARGATE
value is supported
* only in the Regions where Fargate witt Amazon ECS is supported. For more information, see Fargate on Amazon
* ECS in the Amazon Elastic Container Service Developer Guide.
* @see LaunchType
*/
public void setLaunchType(String launchType) {
this.launchType = launchType;
}
/**
*
* Specifies the launch type on which your task is running. The launch type that you specify here must match one of
* the launch type (compatibilities) of the target task. The FARGATE
value is supported only in the
* Regions where Fargate witt Amazon ECS is supported. For more information, see Fargate on Amazon ECS in
* the Amazon Elastic Container Service Developer Guide.
*
FARGATE
value is supported
* only in the Regions where Fargate witt Amazon ECS is supported. For more information, see Fargate on Amazon
* ECS in the Amazon Elastic Container Service Developer Guide.
* @see LaunchType
*/
public String getLaunchType() {
return this.launchType;
}
/**
*
* Specifies the launch type on which your task is running. The launch type that you specify here must match one of
* the launch type (compatibilities) of the target task. The FARGATE
value is supported only in the
* Regions where Fargate witt Amazon ECS is supported. For more information, see Fargate on Amazon ECS in
* the Amazon Elastic Container Service Developer Guide.
*
FARGATE
value is supported
* only in the Regions where Fargate witt Amazon ECS is supported. For more information, see Fargate on Amazon
* ECS in the Amazon Elastic Container Service Developer Guide.
* @return Returns a reference to this object so that method calls can be chained together.
* @see LaunchType
*/
public EcsParameters withLaunchType(String launchType) {
setLaunchType(launchType);
return this;
}
/**
*
* Specifies the launch type on which your task is running. The launch type that you specify here must match one of
* the launch type (compatibilities) of the target task. The FARGATE
value is supported only in the
* Regions where Fargate witt Amazon ECS is supported. For more information, see Fargate on Amazon ECS in
* the Amazon Elastic Container Service Developer Guide.
*
FARGATE
value is supported
* only in the Regions where Fargate witt Amazon ECS is supported. For more information, see Fargate on Amazon
* ECS in the Amazon Elastic Container Service Developer Guide.
* @return Returns a reference to this object so that method calls can be chained together.
* @see LaunchType
*/
public EcsParameters withLaunchType(LaunchType launchType) {
this.launchType = launchType.toString();
return this;
}
/**
*
* Use this structure if the Amazon ECS task uses the awsvpc
network mode. This structure specifies the
* VPC subnets and security groups associated with the task, and whether a public IP address is to be used. This
* structure is required if LaunchType
is FARGATE
because the awsvpc
mode is
* required for Fargate tasks.
*
* If you specify NetworkConfiguration
when the target ECS task does not use the awsvpc
* network mode, the task fails.
*
awsvpc
network mode. This structure
* specifies the VPC subnets and security groups associated with the task, and whether a public IP address is
* to be used. This structure is required if LaunchType
is FARGATE
because the
* awsvpc
mode is required for Fargate tasks.
*
* If you specify NetworkConfiguration
when the target ECS task does not use the
* awsvpc
network mode, the task fails.
*/
public void setNetworkConfiguration(NetworkConfiguration networkConfiguration) {
this.networkConfiguration = networkConfiguration;
}
/**
*
* Use this structure if the Amazon ECS task uses the awsvpc
network mode. This structure specifies the
* VPC subnets and security groups associated with the task, and whether a public IP address is to be used. This
* structure is required if LaunchType
is FARGATE
because the awsvpc
mode is
* required for Fargate tasks.
*
* If you specify NetworkConfiguration
when the target ECS task does not use the awsvpc
* network mode, the task fails.
*
awsvpc
network mode. This structure
* specifies the VPC subnets and security groups associated with the task, and whether a public IP address
* is to be used. This structure is required if LaunchType
is FARGATE
because the
* awsvpc
mode is required for Fargate tasks.
*
* If you specify NetworkConfiguration
when the target ECS task does not use the
* awsvpc
network mode, the task fails.
*/
public NetworkConfiguration getNetworkConfiguration() {
return this.networkConfiguration;
}
/**
*
* Use this structure if the Amazon ECS task uses the awsvpc
network mode. This structure specifies the
* VPC subnets and security groups associated with the task, and whether a public IP address is to be used. This
* structure is required if LaunchType
is FARGATE
because the awsvpc
mode is
* required for Fargate tasks.
*
* If you specify NetworkConfiguration
when the target ECS task does not use the awsvpc
* network mode, the task fails.
*
awsvpc
network mode. This structure
* specifies the VPC subnets and security groups associated with the task, and whether a public IP address is
* to be used. This structure is required if LaunchType
is FARGATE
because the
* awsvpc
mode is required for Fargate tasks.
*
* If you specify NetworkConfiguration
when the target ECS task does not use the
* awsvpc
network mode, the task fails.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public EcsParameters withNetworkConfiguration(NetworkConfiguration networkConfiguration) {
setNetworkConfiguration(networkConfiguration);
return this;
}
/**
*
* Specifies the platform version for the task. Specify only the numeric portion of the platform version, such as
* 1.1.0
.
*
* This structure is used only if LaunchType
is FARGATE
. For more information about valid
* platform versions, see Fargate Platform
* Versions in the Amazon Elastic Container Service Developer Guide.
*
1.1.0
.
*
* This structure is used only if LaunchType
is FARGATE
. For more information about
* valid platform versions, see Fargate Platform
* Versions in the Amazon Elastic Container Service Developer Guide.
*/
public void setPlatformVersion(String platformVersion) {
this.platformVersion = platformVersion;
}
/**
*
* Specifies the platform version for the task. Specify only the numeric portion of the platform version, such as
* 1.1.0
.
*
* This structure is used only if LaunchType
is FARGATE
. For more information about valid
* platform versions, see Fargate Platform
* Versions in the Amazon Elastic Container Service Developer Guide.
*
1.1.0
.
*
* This structure is used only if LaunchType
is FARGATE
. For more information
* about valid platform versions, see Fargate
* Platform Versions in the Amazon Elastic Container Service Developer Guide.
*/
public String getPlatformVersion() {
return this.platformVersion;
}
/**
*
* Specifies the platform version for the task. Specify only the numeric portion of the platform version, such as
* 1.1.0
.
*
* This structure is used only if LaunchType
is FARGATE
. For more information about valid
* platform versions, see Fargate Platform
* Versions in the Amazon Elastic Container Service Developer Guide.
*
1.1.0
.
*
* This structure is used only if LaunchType
is FARGATE
. For more information about
* valid platform versions, see Fargate Platform
* Versions in the Amazon Elastic Container Service Developer Guide.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public EcsParameters withPlatformVersion(String platformVersion) {
setPlatformVersion(platformVersion);
return this;
}
/**
*
* Specifies an ECS task group for the task. The maximum length is 255 characters. *
* * @param group * Specifies an ECS task group for the task. The maximum length is 255 characters. */ public void setGroup(String group) { this.group = group; } /** ** Specifies an ECS task group for the task. The maximum length is 255 characters. *
* * @return Specifies an ECS task group for the task. The maximum length is 255 characters. */ public String getGroup() { return this.group; } /** ** Specifies an ECS task group for the task. The maximum length is 255 characters. *
* * @param group * Specifies an ECS task group for the task. The maximum length is 255 characters. * @return Returns a reference to this object so that method calls can be chained together. */ public EcsParameters withGroup(String group) { setGroup(group); return this; } /** ** The capacity provider strategy to use for the task. *
*
* If a capacityProviderStrategy
is specified, the launchType
parameter must be omitted.
* If no capacityProviderStrategy
or launchType is specified, the
* defaultCapacityProviderStrategy
for the cluster is used.
*
* If a
* The capacity provider strategy to use for the task.
*
* If a capacityProviderStrategy
is specified, the launchType
parameter must be
* omitted. If no capacityProviderStrategy
or launchType is specified, the
* defaultCapacityProviderStrategy
for the cluster is used.
*/
public java.util.ListcapacityProviderStrategy
is specified, the launchType
parameter must be omitted.
* If no capacityProviderStrategy
or launchType is specified, the
* defaultCapacityProviderStrategy
for the cluster is used.
*
* If a
* The capacity provider strategy to use for the task.
*
* If a
* NOTE: This method appends the values to the existing list (if any). Use
* {@link #setCapacityProviderStrategy(java.util.Collection)} or
* {@link #withCapacityProviderStrategy(java.util.Collection)} if you want to override the existing values.
* capacityProviderStrategy
is specified, the launchType
parameter must be
* omitted. If no capacityProviderStrategy
or launchType is specified, the
* defaultCapacityProviderStrategy
for the cluster is used.
*/
public void setCapacityProviderStrategy(java.util.CollectioncapacityProviderStrategy
is specified, the launchType
parameter must be omitted.
* If no capacityProviderStrategy
or launchType is specified, the
* defaultCapacityProviderStrategy
for the cluster is used.
*
* If a
* The capacity provider strategy to use for the task.
*
* If a capacityProviderStrategy
is specified, the launchType
parameter must be
* omitted. If no capacityProviderStrategy
or launchType is specified, the
* defaultCapacityProviderStrategy
for the cluster is used.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public EcsParameters withCapacityProviderStrategy(CapacityProviderStrategyItem... capacityProviderStrategy) {
if (this.capacityProviderStrategy == null) {
setCapacityProviderStrategy(new java.util.ArrayListcapacityProviderStrategy
is specified, the launchType
parameter must be omitted.
* If no capacityProviderStrategy
or launchType is specified, the
* defaultCapacityProviderStrategy
for the cluster is used.
*
* If a
* Specifies whether to enable Amazon ECS managed tags for the task. For more information, see Tagging Your Amazon ECS
* Resources in the Amazon Elastic Container Service Developer Guide.
*
* Specifies whether to enable Amazon ECS managed tags for the task. For more information, see Tagging Your Amazon ECS
* Resources in the Amazon Elastic Container Service Developer Guide.
*
* Specifies whether to enable Amazon ECS managed tags for the task. For more information, see Tagging Your Amazon ECS
* Resources in the Amazon Elastic Container Service Developer Guide.
*
* Specifies whether to enable Amazon ECS managed tags for the task. For more information, see Tagging Your Amazon ECS
* Resources in the Amazon Elastic Container Service Developer Guide.
*
* Whether or not to enable the execute command functionality for the containers in this task. If true, this enables
* execute command functionality on all containers in the task.
*
* Whether or not to enable the execute command functionality for the containers in this task. If true, this enables
* execute command functionality on all containers in the task.
*
* Whether or not to enable the execute command functionality for the containers in this task. If true, this enables
* execute command functionality on all containers in the task.
*
* Whether or not to enable the execute command functionality for the containers in this task. If true, this enables
* execute command functionality on all containers in the task.
*
* An array of placement constraint objects to use for the task. You can specify up to 10 constraints per task
* (including constraints in the task definition and those specified at runtime).
*
* An array of placement constraint objects to use for the task. You can specify up to 10 constraints per task
* (including constraints in the task definition and those specified at runtime).
*
* An array of placement constraint objects to use for the task. You can specify up to 10 constraints per task
* (including constraints in the task definition and those specified at runtime).
*
* NOTE: This method appends the values to the existing list (if any). Use
* {@link #setPlacementConstraints(java.util.Collection)} or {@link #withPlacementConstraints(java.util.Collection)}
* if you want to override the existing values.
*
* An array of placement constraint objects to use for the task. You can specify up to 10 constraints per task
* (including constraints in the task definition and those specified at runtime).
*
* The placement strategy objects to use for the task. You can specify a maximum of five strategy rules per task.
*
* The placement strategy objects to use for the task. You can specify a maximum of five strategy rules per task.
*
* The placement strategy objects to use for the task. You can specify a maximum of five strategy rules per task.
*
* NOTE: This method appends the values to the existing list (if any). Use
* {@link #setPlacementStrategy(java.util.Collection)} or {@link #withPlacementStrategy(java.util.Collection)} if
* you want to override the existing values.
*
* The placement strategy objects to use for the task. You can specify a maximum of five strategy rules per task.
*
* Specifies whether to propagate the tags from the task definition to the task. If no value is specified, the tags
* are not propagated. Tags can only be propagated to the task during task creation. To add tags to a task after
* task creation, use the TagResource API action.
*
* Specifies whether to propagate the tags from the task definition to the task. If no value is specified, the tags
* are not propagated. Tags can only be propagated to the task during task creation. To add tags to a task after
* task creation, use the TagResource API action.
*
* Specifies whether to propagate the tags from the task definition to the task. If no value is specified, the tags
* are not propagated. Tags can only be propagated to the task during task creation. To add tags to a task after
* task creation, use the TagResource API action.
*
* Specifies whether to propagate the tags from the task definition to the task. If no value is specified, the tags
* are not propagated. Tags can only be propagated to the task during task creation. To add tags to a task after
* task creation, use the TagResource API action.
*
* The reference ID to use for the task.
*
* The reference ID to use for the task.
*
* The reference ID to use for the task.
*
* The metadata that you apply to the task to help you categorize and organize them. Each tag consists of a key and
* an optional value, both of which you define. To learn more, see RunTask in the Amazon ECS API Reference.
*
* The metadata that you apply to the task to help you categorize and organize them. Each tag consists of a key and
* an optional value, both of which you define. To learn more, see RunTask in the Amazon ECS API Reference.
*
* The metadata that you apply to the task to help you categorize and organize them. Each tag consists of a key and
* an optional value, both of which you define. To learn more, see RunTask in the Amazon ECS API Reference.
*
* NOTE: This method appends the values to the existing list (if any). Use
* {@link #setTags(java.util.Collection)} or {@link #withTags(java.util.Collection)} if you want to override the
* existing values.
*
* The metadata that you apply to the task to help you categorize and organize them. Each tag consists of a key and
* an optional value, both of which you define. To learn more, see RunTask in the Amazon ECS API Reference.
* capacityProviderStrategy
is specified, the launchType
parameter must be
* omitted. If no capacityProviderStrategy
or launchType is specified, the
* defaultCapacityProviderStrategy
for the cluster is used.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public EcsParameters withCapacityProviderStrategy(java.util.Collection