AcceleratorManufacturer

class aws_cdk.aws_ec2.AcceleratorManufacturer(*values)

Bases: Enum

Supported hardware accelerator manufacturers.

Restricts instance selection to accelerators from a particular vendor. Useful for choosing specific ecosystems (e.g., NVIDIA CUDA, AWS chips).

ExampleMetadata:

infused

Example:

# vpc: ec2.Vpc
# infrastructure_role: iam.Role
# instance_profile: iam.InstanceProfile


cluster = ecs.Cluster(self, "Cluster", vpc=vpc)

# Create a Managed Instances Capacity Provider
mi_capacity_provider = ecs.ManagedInstancesCapacityProvider(self, "MICapacityProvider",
    infrastructure_role=infrastructure_role,
    ec2_instance_profile=instance_profile,
    subnets=vpc.private_subnets,
    security_groups=[ec2.SecurityGroup(self, "MISecurityGroup", vpc=vpc)],
    instance_requirements=ec2.InstanceRequirementsConfig(
        v_cpu_count_min=1,
        memory_min=Size.gibibytes(2),
        cpu_manufacturers=[ec2.CpuManufacturer.INTEL],
        accelerator_manufacturers=[ec2.AcceleratorManufacturer.NVIDIA]
    ),
    propagate_tags=ecs.PropagateManagedInstancesTags.CAPACITY_PROVIDER
)

# Optionally configure security group rules using IConnectable interface
mi_capacity_provider.connections.allow_from(ec2.Peer.ipv4(vpc.vpc_cidr_block), ec2.Port.tcp(80))

# Add the capacity provider to the cluster
cluster.add_managed_instances_capacity_provider(mi_capacity_provider)

task_definition = ecs.TaskDefinition(self, "TaskDef",
    memory_mi_b="512",
    cpu="256",
    network_mode=ecs.NetworkMode.AWS_VPC,
    compatibility=ecs.Compatibility.MANAGED_INSTANCES
)

task_definition.add_container("web",
    image=ecs.ContainerImage.from_registry("amazon/amazon-ecs-sample"),
    memory_reservation_mi_b=256
)

ecs.FargateService(self, "FargateService",
    cluster=cluster,
    task_definition=task_definition,
    min_healthy_percent=100,
    capacity_provider_strategies=[ecs.CapacityProviderStrategy(
        capacity_provider=mi_capacity_provider.capacity_provider_name,
        weight=1
    )
    ]
)

Attributes

AMD

AMD (e.g., Radeon Pro V520 GPU).

AWS

Amazon Web Services (e.g., Inferentia, Trainium accelerators).

HABANA

Habana Labs(e.g, Gaudi accelerator).

NVIDIA

NVIDIA (e.g., A100, V100, T4, K80, M60 GPUs).

XILINX

Xilinx (e.g., VU9P FPGA).