Skip to content
v2.274.0

FargateTaskDefinitionAttributes Struct ​

Attributes used to import an existing Fargate task definition.

Example ​

ts
// The code below shows an example of how to instantiate this type.
// The values are placeholders you should change.
import { aws_ecs as ecs } from 'aws-cdk-lib';
import { aws_iam as iam } from 'aws-cdk-lib';

declare const role: iam.Role;
const fargateTaskDefinitionAttributes: ecs.FargateTaskDefinitionAttributes = {
  taskDefinitionArn: 'taskDefinitionArn',

  // the properties below are optional
  executionRole: role,
  networkMode: ecs.NetworkMode.NONE,
  taskRole: role,
};

Properties ​

executionRoleoptionalIRoleexecution_roleoptionalIRoleexecutionRoleoptionalIRoleExecutionRoleoptionalIRoleExecutionRoleoptionalIRole= undefined#
The IAM role that grants containers and Fargate agents permission to make AWS API calls on your behalf.

Some tasks do not have an execution role.

networkModeoptionalNetworkModenetwork_modeoptionalNetworkModenetworkModeoptionalNetworkModeNetworkModeoptionalNetworkModeNetworkModeoptionalNetworkMode#
The networking mode to use for the containers in the task.

Default: Network mode cannot be provided to the imported task.

taskDefinitionArnstringtask_definition_arnstrtaskDefinitionArnStringTaskDefinitionArnstringTaskDefinitionArn*stringrequired#
The arn of the task definition.
taskRoleoptionalIRoletask_roleoptionalIRoletaskRoleoptionalIRoleTaskRoleoptionalIRoleTaskRoleoptionalIRole#
The name of the IAM role that grants containers in the task permission to call AWS APIs on your behalf.

Default: Permissions cannot be granted to the imported task.