Class Ec2TaskDefinition

java.lang.Object
software.amazon.jsii.JsiiObject
software.constructs.Construct
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());
 
  • 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.