Class CfnDaemonTaskDefinition

java.lang.Object
software.amazon.jsii.JsiiObject
software.constructs.Construct
All Implemented Interfaces:
IInspectable, IDaemonTaskDefinitionRef, IEnvironmentAware, ITaggableV2, software.amazon.jsii.JsiiSerializable, software.constructs.IConstruct, software.constructs.IDependable

@Generated(value="jsii-pacmak/1.129.0 (build eaca441)", date="2026-05-13T16:55:08.404Z") @Stability(Stable) public class CfnDaemonTaskDefinition extends CfnResource implements IInspectable, IDaemonTaskDefinitionRef, ITaggableV2
The details of a daemon task definition.

A daemon task definition is a template that describes the containers that form a daemon. Daemons deploy cross-cutting software agents independently across your Amazon ECS infrastructure.

Example:

 // The code below shows an example of how to instantiate this type.
 // The values are placeholders you should change.
 import software.amazon.awscdk.services.ecs.*;
 CfnDaemonTaskDefinition cfnDaemonTaskDefinition = CfnDaemonTaskDefinition.Builder.create(this, "MyCfnDaemonTaskDefinition")
         .containerDefinitions(List.of(DaemonContainerDefinitionProperty.builder()
                 .image("image")
                 .name("name")
                 // the properties below are optional
                 .command(List.of("command"))
                 .cpu(123)
                 .dependsOn(List.of(ContainerDependencyProperty.builder()
                         .condition("condition")
                         .containerName("containerName")
                         .build()))
                 .entryPoint(List.of("entryPoint"))
                 .environment(List.of(KeyValuePairProperty.builder()
                         .name("name")
                         .value("value")
                         .build()))
                 .environmentFiles(List.of(EnvironmentFileProperty.builder()
                         .type("type")
                         .value("value")
                         .build()))
                 .essential(false)
                 .firelensConfiguration(FirelensConfigurationProperty.builder()
                         .options(Map.of(
                                 "optionsKey", "options"))
                         .type("type")
                         .build())
                 .healthCheck(HealthCheckProperty.builder()
                         .command(List.of("command"))
                         .interval(123)
                         .retries(123)
                         .startPeriod(123)
                         .timeout(123)
                         .build())
                 .interactive(false)
                 .linuxParameters(LinuxParametersProperty.builder()
                         .capabilities(KernelCapabilitiesProperty.builder()
                                 .add(List.of("add"))
                                 .drop(List.of("drop"))
                                 .build())
                         .devices(List.of(DeviceProperty.builder()
                                 .containerPath("containerPath")
                                 .hostPath("hostPath")
                                 .permissions(List.of("permissions"))
                                 .build()))
                         .initProcessEnabled(false)
                         .tmpfs(List.of(TmpfsProperty.builder()
                                 .size(123)
                                 // the properties below are optional
                                 .containerPath("containerPath")
                                 .mountOptions(List.of("mountOptions"))
                                 .build()))
                         .build())
                 .logConfiguration(LogConfigurationProperty.builder()
                         .logDriver("logDriver")
                         // the properties below are optional
                         .options(Map.of(
                                 "optionsKey", "options"))
                         .secretOptions(List.of(SecretProperty.builder()
                                 .name("name")
                                 .valueFrom("valueFrom")
                                 .build()))
                         .build())
                 .memory(123)
                 .memoryReservation(123)
                 .mountPoints(List.of(MountPointProperty.builder()
                         .containerPath("containerPath")
                         .readOnly(false)
                         .sourceVolume("sourceVolume")
                         .build()))
                 .privileged(false)
                 .pseudoTerminal(false)
                 .readonlyRootFilesystem(false)
                 .repositoryCredentials(RepositoryCredentialsProperty.builder()
                         .credentialsParameter("credentialsParameter")
                         .build())
                 .restartPolicy(RestartPolicyProperty.builder()
                         .enabled(false)
                         .ignoredExitCodes(List.of(123))
                         .restartAttemptPeriod(123)
                         .build())
                 .secrets(List.of(SecretProperty.builder()
                         .name("name")
                         .valueFrom("valueFrom")
                         .build()))
                 .startTimeout(123)
                 .stopTimeout(123)
                 .systemControls(List.of(SystemControlProperty.builder()
                         .namespace("namespace")
                         .value("value")
                         .build()))
                 .ulimits(List.of(UlimitProperty.builder()
                         .hardLimit(123)
                         .name("name")
                         .softLimit(123)
                         .build()))
                 .user("user")
                 .workingDirectory("workingDirectory")
                 .build()))
         .cpu("cpu")
         .executionRoleArn("executionRoleArn")
         .family("family")
         .memory("memory")
         .tags(List.of(CfnTag.builder()
                 .key("key")
                 .value("value")
                 .build()))
         .taskRoleArn("taskRoleArn")
         .volumes(List.of(VolumeProperty.builder()
                 .host(HostVolumePropertiesProperty.builder()
                         .sourcePath("sourcePath")
                         .build())
                 .name("name")
                 .build()))
         .build();
 

See Also:
  • Field Details

    • CFN_RESOURCE_TYPE_NAME

      @Stability(Stable) public static final String CFN_RESOURCE_TYPE_NAME
      The CloudFormation resource type name for this resource class.
  • Constructor Details

    • CfnDaemonTaskDefinition

      protected CfnDaemonTaskDefinition(software.amazon.jsii.JsiiObjectRef objRef)
    • CfnDaemonTaskDefinition

      protected CfnDaemonTaskDefinition(software.amazon.jsii.JsiiObject.InitializationMode initializationMode)
    • CfnDaemonTaskDefinition

      @Stability(Stable) public CfnDaemonTaskDefinition(@NotNull software.constructs.Construct scope, @NotNull String id, @Nullable CfnDaemonTaskDefinitionProps props)
      Create a new AWS::ECS::DaemonTaskDefinition.

      Parameters:
      scope - Scope in which this resource is defined. This parameter is required.
      id - Construct identifier for this resource (unique in its scope). This parameter is required.
      props - Resource properties.
    • CfnDaemonTaskDefinition

      @Stability(Stable) public CfnDaemonTaskDefinition(@NotNull software.constructs.Construct scope, @NotNull String id)
      Create a new AWS::ECS::DaemonTaskDefinition.

      Parameters:
      scope - Scope in which this resource is defined. This parameter is required.
      id - Construct identifier for this resource (unique in its scope). This parameter is required.
  • Method Details

    • arnForDaemonTaskDefinition

      @Stability(Stable) @NotNull public static String arnForDaemonTaskDefinition(@NotNull IDaemonTaskDefinitionRef resource)
      Parameters:
      resource - This parameter is required.
    • isCfnDaemonTaskDefinition

      @Stability(Stable) @NotNull public static Boolean isCfnDaemonTaskDefinition(@NotNull Object x)
      Checks whether the given object is a CfnDaemonTaskDefinition.

      Parameters:
      x - This parameter is required.
    • inspect

      @Stability(Stable) public void inspect(@NotNull TreeInspector inspector)
      Examines the CloudFormation resource and discloses attributes.

      Specified by:
      inspect in interface IInspectable
      Parameters:
      inspector - tree inspector to collect and process attributes. This parameter is required.
    • renderProperties

      @Stability(Stable) @NotNull protected Map<String,Object> renderProperties(@NotNull Map<String,Object> props)
      Overrides:
      renderProperties in class CfnResource
      Parameters:
      props - This parameter is required.
    • getAttrDaemonTaskDefinitionArn

      @Stability(Stable) @NotNull public String getAttrDaemonTaskDefinitionArn()
    • getCdkTagManager

      @Stability(Stable) @NotNull public TagManager getCdkTagManager()
      Tag Manager which manages the tags for this resource.
      Specified by:
      getCdkTagManager in interface ITaggableV2
    • getCfnProperties

      @Stability(Stable) @NotNull protected Map<String,Object> getCfnProperties()
      Overrides:
      getCfnProperties in class CfnResource
    • getCfnPropertyNames

      @Stability(Stable) @NotNull protected Map<String,String> getCfnPropertyNames()
      Overrides:
      getCfnPropertyNames in class CfnResource
    • getDaemonTaskDefinitionRef

      @Stability(Stable) @NotNull public DaemonTaskDefinitionReference getDaemonTaskDefinitionRef()
      A reference to a DaemonTaskDefinition resource.
      Specified by:
      getDaemonTaskDefinitionRef in interface IDaemonTaskDefinitionRef
    • getContainerDefinitions

      @Stability(Stable) @Nullable public Object getContainerDefinitions()
      A list of container definitions in JSON format that describe the containers that make up the daemon task.

      Returns union: either IResolvable or Listinvalid input: '<'either IResolvable or CfnDaemonTaskDefinition.DaemonContainerDefinitionProperty>

    • setContainerDefinitions

      @Stability(Stable) public void setContainerDefinitions(@Nullable IResolvable value)
      A list of container definitions in JSON format that describe the containers that make up the daemon task.
    • setContainerDefinitions

      @Stability(Stable) public void setContainerDefinitions(@Nullable List<Object> value)
      A list of container definitions in JSON format that describe the containers that make up the daemon task.
    • getCpu

      @Stability(Stable) @Nullable public String getCpu()
      The number of CPU units used by the daemon task.
    • setCpu

      @Stability(Stable) public void setCpu(@Nullable String value)
      The number of CPU units used by the daemon task.
    • getExecutionRoleArn

      @Stability(Stable) @Nullable public String getExecutionRoleArn()
      The Amazon Resource Name (ARN) of the task execution role that grants the Amazon ECS container agent permission to make Amazon Web Services API calls on your behalf.
    • setExecutionRoleArn

      @Stability(Stable) public void setExecutionRoleArn(@Nullable String value)
      The Amazon Resource Name (ARN) of the task execution role that grants the Amazon ECS container agent permission to make Amazon Web Services API calls on your behalf.
    • getFamily

      @Stability(Stable) @Nullable public String getFamily()
      The name of a family that this daemon task definition is registered to.
    • setFamily

      @Stability(Stable) public void setFamily(@Nullable String value)
      The name of a family that this daemon task definition is registered to.
    • getMemory

      @Stability(Stable) @Nullable public String getMemory()
      The amount of memory (in MiB) used by the daemon task.
    • setMemory

      @Stability(Stable) public void setMemory(@Nullable String value)
      The amount of memory (in MiB) used by the daemon task.
    • getTags

      @Stability(Stable) @Nullable public List<CfnTag> getTags()
    • setTags

      @Stability(Stable) public void setTags(@Nullable List<CfnTag> value)
    • getTaskRoleArn

      @Stability(Stable) @Nullable public String getTaskRoleArn()
      The short name or full Amazon Resource Name (ARN) of the IAM role that grants containers in the daemon task permission to call Amazon Web Services APIs on your behalf.
    • setTaskRoleArn

      @Stability(Stable) public void setTaskRoleArn(@Nullable String value)
      The short name or full Amazon Resource Name (ARN) of the IAM role that grants containers in the daemon task permission to call Amazon Web Services APIs on your behalf.
    • getVolumes

      @Stability(Stable) @Nullable public Object getVolumes()
      The list of data volume definitions for the daemon task.

      Returns union: either IResolvable or Listinvalid input: '<'either IResolvable or CfnDaemonTaskDefinition.VolumeProperty>

    • setVolumes

      @Stability(Stable) public void setVolumes(@Nullable IResolvable value)
      The list of data volume definitions for the daemon task.
    • setVolumes

      @Stability(Stable) public void setVolumes(@Nullable List<Object> value)
      The list of data volume definitions for the daemon task.