Class Ec2TaskDefinition
java.lang.Object
software.amazon.jsii.JsiiObject
software.constructs.Construct
software.amazon.awscdk.core.Construct
software.amazon.awscdk.core.Resource
software.amazon.awscdk.services.ecs.TaskDefinition
software.amazon.awscdk.services.ecs.Ec2TaskDefinition
- All Implemented Interfaces:
IConstruct
,IDependable
,IResource
,IEc2TaskDefinition
,ITaskDefinition
,software.amazon.jsii.JsiiSerializable
,software.constructs.IConstruct
@Generated(value="jsii-pacmak/1.84.0 (build 5404dcf)",
date="2023-06-19T16:30:47.293Z")
@Stability(Stable)
public class Ec2TaskDefinition
extends TaskDefinition
implements IEc2TaskDefinition
The details of a task definition run on an EC2 cluster.
Example:
// Create a Task Definition for the container to start Ec2TaskDefinition taskDefinition = new Ec2TaskDefinition(this, "TaskDef"); taskDefinition.addContainer("TheContainer", ContainerDefinitionOptions.builder() .image(ContainerImage.fromRegistry("example-image")) .memoryLimitMiB(256) .logging(LogDrivers.splunk(SplunkLogDriverProps.builder() .token(SecretValue.secretsManager("my-splunk-token")) .url("my-splunk-url") .build())) .build());
-
Nested Class Summary
Nested classes/interfaces inherited from class software.amazon.jsii.JsiiObject
software.amazon.jsii.JsiiObject.InitializationMode
Nested classes/interfaces inherited from interface software.amazon.awscdk.core.IConstruct
IConstruct.Jsii$Default
Nested classes/interfaces inherited from interface software.constructs.IConstruct
software.constructs.IConstruct.Jsii$Default
Nested classes/interfaces inherited from interface software.amazon.awscdk.services.ecs.IEc2TaskDefinition
IEc2TaskDefinition.Jsii$Default, IEc2TaskDefinition.Jsii$Proxy
Nested classes/interfaces inherited from interface software.amazon.awscdk.core.IResource
IResource.Jsii$Default
Nested classes/interfaces inherited from interface software.amazon.awscdk.services.ecs.ITaskDefinition
ITaskDefinition.Jsii$Default, ITaskDefinition.Jsii$Proxy
-
Constructor Summary
ModifierConstructorDescriptionprotected
Ec2TaskDefinition
(software.amazon.jsii.JsiiObject.InitializationMode initializationMode) protected
Ec2TaskDefinition
(software.amazon.jsii.JsiiObjectRef objRef) Ec2TaskDefinition
(software.constructs.Construct scope, String id) Constructs a new instance of the Ec2TaskDefinition class.Ec2TaskDefinition
(software.constructs.Construct scope, String id, Ec2TaskDefinitionProps props) Constructs a new instance of the Ec2TaskDefinition class. -
Method Summary
Modifier and TypeMethodDescriptionstatic IEc2TaskDefinition
fromEc2TaskDefinitionArn
(software.constructs.Construct scope, String id, String ec2TaskDefinitionArn) Imports a task definition from the specified task definition ARN.static IEc2TaskDefinition
fromEc2TaskDefinitionAttributes
(software.constructs.Construct scope, String id, Ec2TaskDefinitionAttributes attrs) Imports an existing Ec2 task definition from its attributes.Methods inherited from class software.amazon.awscdk.services.ecs.TaskDefinition
addContainer, addExtension, addFirelensLogRouter, addInferenceAccelerator, addPlacementConstraint, addToExecutionRolePolicy, addToTaskRolePolicy, addVolume, findContainer, fromTaskDefinitionArn, fromTaskDefinitionAttributes, getCompatibility, getContainers, getDefaultContainer, getEphemeralStorageGiB, getExecutionRole, getFamily, getInferenceAccelerators, getIsEc2Compatible, getIsExternalCompatible, getIsFargateCompatible, getNetworkMode, getReferencesSecretJsonField, getTaskDefinitionArn, getTaskRole, obtainExecutionRole, setDefaultContainer, validate
Methods inherited from class software.amazon.awscdk.core.Resource
applyRemovalPolicy, generatePhysicalName, getEnv, getPhysicalName, getResourceArnAttribute, getResourceNameAttribute, getStack, isResource
Methods inherited from class software.amazon.awscdk.core.Construct
getNode, isConstruct, onPrepare, onSynthesize, onValidate, prepare, synthesize
Methods inherited from class software.constructs.Construct
toString
Methods inherited from class software.amazon.jsii.JsiiObject
jsiiAsyncCall, jsiiAsyncCall, jsiiCall, jsiiCall, jsiiGet, jsiiGet, jsiiSet, jsiiStaticCall, jsiiStaticCall, jsiiStaticGet, jsiiStaticGet, jsiiStaticSet, jsiiStaticSet
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
Methods inherited from interface software.amazon.awscdk.core.IConstruct
getNode
Methods inherited from interface software.amazon.awscdk.core.IResource
applyRemovalPolicy, getEnv, getStack
Methods inherited from interface software.amazon.awscdk.services.ecs.ITaskDefinition
getCompatibility, getExecutionRole, getIsEc2Compatible, getIsExternalCompatible, getIsFargateCompatible, getNetworkMode, getTaskDefinitionArn, getTaskRole
Methods inherited from interface software.amazon.jsii.JsiiSerializable
$jsii$toJson
-
Constructor Details
-
Ec2TaskDefinition
protected Ec2TaskDefinition(software.amazon.jsii.JsiiObjectRef objRef) -
Ec2TaskDefinition
protected Ec2TaskDefinition(software.amazon.jsii.JsiiObject.InitializationMode initializationMode) -
Ec2TaskDefinition
@Stability(Stable) public Ec2TaskDefinition(@NotNull software.constructs.Construct scope, @NotNull String id, @Nullable Ec2TaskDefinitionProps props) Constructs a new instance of the Ec2TaskDefinition class.- Parameters:
scope
- This parameter is required.id
- This parameter is required.props
-
-
Ec2TaskDefinition
@Stability(Stable) public Ec2TaskDefinition(@NotNull software.constructs.Construct scope, @NotNull String id) Constructs a new instance of the Ec2TaskDefinition class.- Parameters:
scope
- This parameter is required.id
- This parameter is required.
-
-
Method Details
-
fromEc2TaskDefinitionArn
@Stability(Stable) @NotNull public static IEc2TaskDefinition fromEc2TaskDefinitionArn(@NotNull software.constructs.Construct scope, @NotNull String id, @NotNull String ec2TaskDefinitionArn) Imports a task definition from the specified task definition ARN.- Parameters:
scope
- This parameter is required.id
- This parameter is required.ec2TaskDefinitionArn
- This parameter is required.
-
fromEc2TaskDefinitionAttributes
@Stability(Stable) @NotNull public static IEc2TaskDefinition fromEc2TaskDefinitionAttributes(@NotNull software.constructs.Construct scope, @NotNull String id, @NotNull Ec2TaskDefinitionAttributes attrs) Imports an existing Ec2 task definition from its attributes.- Parameters:
scope
- This parameter is required.id
- This parameter is required.attrs
- This parameter is required.
-