# ComputeConfigurationProperty

The capacity configuration for the capacity provider.

Defines the compute resources for this capacity provider.

- Source: Generated at build time
- Type last changed: v2.268.0 · 2 Sep 2026

## Example

TypeScript:

```ts
// The code below shows an example of how to instantiate this type.
// The values are placeholders you should change.
import { aws_bedrockagentcore as bedrockagentcore } from 'aws-cdk-lib';
const computeConfigurationProperty: bedrockagentcore.CfnCapacityProvider.ComputeConfigurationProperty = {
  ec2Configuration: {
    launchTemplateSource: {
      launchParameters: {
        instanceRequirements: {
          allowedInstanceTypes: ['allowedInstanceTypes'],
        },
        operatingSystem: 'operatingSystem',

        // the properties below are optional
        capacityReservationSpecification: {
          capacityReservationPreference: 'capacityReservationPreference',
          capacityReservationTarget: {
            capacityReservationId: 'capacityReservationId',
            capacityReservationResourceGroupArn: 'capacityReservationResourceGroupArn',
          },
        },
        ephemeralVolumes: [{
          deviceName: 'deviceName',
          ebs: {
            ebsCardIndex: 123,
            encrypted: false,
            iops: 123,
            kmsKeyId: 'kmsKeyId',
            snapshotId: 'snapshotId',
            throughput: 123,
            volumeInitializationRate: 123,
            volumeSize: 123,
            volumeType: 'volumeType',
          },
          virtualName: 'virtualName',
        }],
        instanceProfileArn: 'instanceProfileArn',
        licenseSpecifications: [{
          licenseConfigurationArn: 'licenseConfigurationArn',
        }],
        monitoring: 'monitoring',
        propagatedTags: {
          propagatedTagsKey: 'propagatedTags',
        },
        sshKeyName: 'sshKeyName',
      },
    },
    vpcConfiguration: {
      securityGroups: ['securityGroups'],
      subnets: ['subnets'],
    },

    // the properties below are optional
    lifecycleConfiguration: {
      idleInstanceTimeout: 123,
      maxLifetime: 123,
    },
    rootVolume: {
      encrypted: false,
      freeSpaceGiB: 123,
      iops: 123,
      kmsKeyId: 'kmsKeyId',
      throughput: 123,
      volumeType: 'volumeType',
    },
    volumes: [{
      ebsConfiguration: {
        name: 'name',
        sizeGiB: 123,

        // the properties below are optional
        encrypted: false,
        iops: 123,
        kmsKeyId: 'kmsKeyId',
        snapshotId: 'snapshotId',
        throughput: 123,
        volumeType: 'volumeType',
      },
    }],
  },
};
```

Python:

```python
# The code below shows an example of how to instantiate this type.
# The values are placeholders you should change.
from aws_cdk import aws_bedrockagentcore as bedrockagentcore

compute_configuration_property = bedrockagentcore.CfnCapacityProvider.ComputeConfigurationProperty(
    ec2_configuration=bedrockagentcore.CfnCapacityProvider.Ec2ConfigurationProperty(
        launch_template_source=bedrockagentcore.CfnCapacityProvider.LaunchTemplateSourceProperty(
            launch_parameters=bedrockagentcore.CfnCapacityProvider.LaunchParametersProperty(
                instance_requirements=bedrockagentcore.CfnCapacityProvider.InstanceRequirementsProperty(
                    allowed_instance_types=["allowedInstanceTypes"]
                ),
                operating_system="operatingSystem",

                # the properties below are optional
                capacity_reservation_specification=bedrockagentcore.CfnCapacityProvider.CapacityReservationSpecificationProperty(
                    capacity_reservation_preference="capacityReservationPreference",
                    capacity_reservation_target=bedrockagentcore.CfnCapacityProvider.CapacityReservationTargetProperty(
                        capacity_reservation_id="capacityReservationId",
                        capacity_reservation_resource_group_arn="capacityReservationResourceGroupArn"
                    )
                ),
                ephemeral_volumes=[bedrockagentcore.CfnCapacityProvider.EphemeralBlockDeviceMappingProperty(
                    device_name="deviceName",
                    ebs=bedrockagentcore.CfnCapacityProvider.EphemeralEBSVolumeConfigurationProperty(
                        ebs_card_index=123,
                        encrypted=False,
                        iops=123,
                        kms_key_id="kmsKeyId",
                        snapshot_id="snapshotId",
                        throughput=123,
                        volume_initialization_rate=123,
                        volume_size=123,
                        volume_type="volumeType"
                    ),
                    virtual_name="virtualName"
                )],
                instance_profile_arn="instanceProfileArn",
                license_specifications=[bedrockagentcore.CfnCapacityProvider.LicenseSpecificationProperty(
                    license_configuration_arn="licenseConfigurationArn"
                )],
                monitoring="monitoring",
                propagated_tags={
                    "propagated_tags_key": "propagatedTags"
                },
                ssh_key_name="sshKeyName"
            )
        ),
        vpc_configuration=bedrockagentcore.CfnCapacityProvider.VpcConfigurationProperty(
            security_groups=["securityGroups"],
            subnets=["subnets"]
        ),

        # the properties below are optional
        lifecycle_configuration=bedrockagentcore.CfnCapacityProvider.InstanceLifecycleConfigurationProperty(
            idle_instance_timeout=123,
            max_lifetime=123
        ),
        root_volume=bedrockagentcore.CfnCapacityProvider.RootVolumeConfigurationProperty(
            encrypted=False,
            free_space_gi_b=123,
            iops=123,
            kms_key_id="kmsKeyId",
            throughput=123,
            volume_type="volumeType"
        ),
        volumes=[bedrockagentcore.CfnCapacityProvider.VolumeConfigurationProperty(
            ebs_configuration=bedrockagentcore.CfnCapacityProvider.EbsVolumeConfigurationProperty(
                name="name",
                size_gi_b=123,

                # the properties below are optional
                encrypted=False,
                iops=123,
                kms_key_id="kmsKeyId",
                snapshot_id="snapshotId",
                throughput=123,
                volume_type="volumeType"
            )
        )]
    )
)
```

Java:

```java
// The code below shows an example of how to instantiate this type.
// The values are placeholders you should change.
import software.amazon.awscdk.services.bedrockagentcore.*;

ComputeConfigurationProperty computeConfigurationProperty = ComputeConfigurationProperty.builder()
        .ec2Configuration(Ec2ConfigurationProperty.builder()
                .launchTemplateSource(LaunchTemplateSourceProperty.builder()
                        .launchParameters(LaunchParametersProperty.builder()
                                .instanceRequirements(InstanceRequirementsProperty.builder()
                                        .allowedInstanceTypes(List.of("allowedInstanceTypes"))
                                        .build())
                                .operatingSystem("operatingSystem")

                                // the properties below are optional
                                .capacityReservationSpecification(CapacityReservationSpecificationProperty.builder()
                                        .capacityReservationPreference("capacityReservationPreference")
                                        .capacityReservationTarget(CapacityReservationTargetProperty.builder()
                                                .capacityReservationId("capacityReservationId")
                                                .capacityReservationResourceGroupArn("capacityReservationResourceGroupArn")
                                                .build())
                                        .build())
                                .ephemeralVolumes(List.of(EphemeralBlockDeviceMappingProperty.builder()
                                        .deviceName("deviceName")
                                        .ebs(EphemeralEBSVolumeConfigurationProperty.builder()
                                                .ebsCardIndex(123)
                                                .encrypted(false)
                                                .iops(123)
                                                .kmsKeyId("kmsKeyId")
                                                .snapshotId("snapshotId")
                                                .throughput(123)
                                                .volumeInitializationRate(123)
                                                .volumeSize(123)
                                                .volumeType("volumeType")
                                                .build())
                                        .virtualName("virtualName")
                                        .build()))
                                .instanceProfileArn("instanceProfileArn")
                                .licenseSpecifications(List.of(LicenseSpecificationProperty.builder()
                                        .licenseConfigurationArn("licenseConfigurationArn")
                                        .build()))
                                .monitoring("monitoring")
                                .propagatedTags(Map.of(
                                        "propagatedTagsKey", "propagatedTags"))
                                .sshKeyName("sshKeyName")
                                .build())
                        .build())
                .vpcConfiguration(VpcConfigurationProperty.builder()
                        .securityGroups(List.of("securityGroups"))
                        .subnets(List.of("subnets"))
                        .build())

                // the properties below are optional
                .lifecycleConfiguration(InstanceLifecycleConfigurationProperty.builder()
                        .idleInstanceTimeout(123)
                        .maxLifetime(123)
                        .build())
                .rootVolume(RootVolumeConfigurationProperty.builder()
                        .encrypted(false)
                        .freeSpaceGiB(123)
                        .iops(123)
                        .kmsKeyId("kmsKeyId")
                        .throughput(123)
                        .volumeType("volumeType")
                        .build())
                .volumes(List.of(VolumeConfigurationProperty.builder()
                        .ebsConfiguration(EbsVolumeConfigurationProperty.builder()
                                .name("name")
                                .sizeGiB(123)

                                // the properties below are optional
                                .encrypted(false)
                                .iops(123)
                                .kmsKeyId("kmsKeyId")
                                .snapshotId("snapshotId")
                                .throughput(123)
                                .volumeType("volumeType")
                                .build())
                        .build()))
                .build())
        .build();
```

C# / .NET:

```csharp
// Install: dotnet add package Amazon.CDK.Lib
// The code below shows an example of how to instantiate this type.
// The values are placeholders you should change.
using Amazon.CDK.AWS.BedrockAgentCore;

var computeConfigurationProperty = new ComputeConfigurationProperty {
    Ec2Configuration = new Ec2ConfigurationProperty {
        LaunchTemplateSource = new LaunchTemplateSourceProperty {
            LaunchParameters = new LaunchParametersProperty {
                InstanceRequirements = new InstanceRequirementsProperty {
                    AllowedInstanceTypes = new [] { "allowedInstanceTypes" }
                },
                OperatingSystem = "operatingSystem",

                // the properties below are optional
                CapacityReservationSpecification = new CapacityReservationSpecificationProperty {
                    CapacityReservationPreference = "capacityReservationPreference",
                    CapacityReservationTarget = new CapacityReservationTargetProperty {
                        CapacityReservationId = "capacityReservationId",
                        CapacityReservationResourceGroupArn = "capacityReservationResourceGroupArn"
                    }
                },
                EphemeralVolumes = new [] { new EphemeralBlockDeviceMappingProperty {
                    DeviceName = "deviceName",
                    Ebs = new EphemeralEBSVolumeConfigurationProperty {
                        EbsCardIndex = 123,
                        Encrypted = false,
                        Iops = 123,
                        KmsKeyId = "kmsKeyId",
                        SnapshotId = "snapshotId",
                        Throughput = 123,
                        VolumeInitializationRate = 123,
                        VolumeSize = 123,
                        VolumeType = "volumeType"
                    },
                    VirtualName = "virtualName"
                } },
                InstanceProfileArn = "instanceProfileArn",
                LicenseSpecifications = new [] { new LicenseSpecificationProperty {
                    LicenseConfigurationArn = "licenseConfigurationArn"
                } },
                Monitoring = "monitoring",
                PropagatedTags = new Dictionary<string, string> {
                    { "propagatedTagsKey", "propagatedTags" }
                },
                SshKeyName = "sshKeyName"
            }
        },
        VpcConfiguration = new VpcConfigurationProperty {
            SecurityGroups = new [] { "securityGroups" },
            Subnets = new [] { "subnets" }
        },

        // the properties below are optional
        LifecycleConfiguration = new InstanceLifecycleConfigurationProperty {
            IdleInstanceTimeout = 123,
            MaxLifetime = 123
        },
        RootVolume = new RootVolumeConfigurationProperty {
            Encrypted = false,
            FreeSpaceGiB = 123,
            Iops = 123,
            KmsKeyId = "kmsKeyId",
            Throughput = 123,
            VolumeType = "volumeType"
        },
        Volumes = new [] { new VolumeConfigurationProperty {
            EbsConfiguration = new EbsVolumeConfigurationProperty {
                Name = "name",
                SizeGiB = 123,

                // the properties below are optional
                Encrypted = false,
                Iops = 123,
                KmsKeyId = "kmsKeyId",
                SnapshotId = "snapshotId",
                Throughput = 123,
                VolumeType = "volumeType"
            }
        } }
    }
};
```

Golang:

```go
// Install: go get github.com/aws/aws-cdk-go/awscdk/v2
// The code below shows an example of how to instantiate this type.
// The values are placeholders you should change.
import "github.com/aws/aws-cdk-go/awscdk"

computeConfigurationProperty := &ComputeConfigurationProperty{
	Ec2Configuration: &Ec2ConfigurationProperty{
		LaunchTemplateSource: &LaunchTemplateSourceProperty{
			LaunchParameters: &LaunchParametersProperty{
				InstanceRequirements: &InstanceRequirementsProperty{
					AllowedInstanceTypes: []*string{
						jsii.String("allowedInstanceTypes"),
					},
				},
				OperatingSystem: jsii.String("operatingSystem"),

				// the properties below are optional
				CapacityReservationSpecification: &CapacityReservationSpecificationProperty{
					CapacityReservationPreference: jsii.String("capacityReservationPreference"),
					CapacityReservationTarget: &CapacityReservationTargetProperty{
						CapacityReservationId: jsii.String("capacityReservationId"),
						CapacityReservationResourceGroupArn: jsii.String("capacityReservationResourceGroupArn"),
					},
				},
				EphemeralVolumes: []interface{}{
					&EphemeralBlockDeviceMappingProperty{
						DeviceName: jsii.String("deviceName"),
						Ebs: &EphemeralEBSVolumeConfigurationProperty{
							EbsCardIndex: jsii.Number(123),
							Encrypted: jsii.Boolean(false),
							Iops: jsii.Number(123),
							KmsKeyId: jsii.String("kmsKeyId"),
							SnapshotId: jsii.String("snapshotId"),
							Throughput: jsii.Number(123),
							VolumeInitializationRate: jsii.Number(123),
							VolumeSize: jsii.Number(123),
							VolumeType: jsii.String("volumeType"),
						},
						VirtualName: jsii.String("virtualName"),
					},
				},
				InstanceProfileArn: jsii.String("instanceProfileArn"),
				LicenseSpecifications: []interface{}{
					&LicenseSpecificationProperty{
						LicenseConfigurationArn: jsii.String("licenseConfigurationArn"),
					},
				},
				Monitoring: jsii.String("monitoring"),
				PropagatedTags: map[string]*string{
					"propagatedTagsKey": jsii.String("propagatedTags"),
				},
				SshKeyName: jsii.String("sshKeyName"),
			},
		},
		VpcConfiguration: &VpcConfigurationProperty{
			SecurityGroups: []*string{
				jsii.String("securityGroups"),
			},
			Subnets: []*string{
				jsii.String("subnets"),
			},
		},

		// the properties below are optional
		LifecycleConfiguration: &InstanceLifecycleConfigurationProperty{
			IdleInstanceTimeout: jsii.Number(123),
			MaxLifetime: jsii.Number(123),
		},
		RootVolume: &RootVolumeConfigurationProperty{
			Encrypted: jsii.Boolean(false),
			FreeSpaceGiB: jsii.Number(123),
			Iops: jsii.Number(123),
			KmsKeyId: jsii.String("kmsKeyId"),
			Throughput: jsii.Number(123),
			VolumeType: jsii.String("volumeType"),
		},
		Volumes: []interface{}{
			&VolumeConfigurationProperty{
				EbsConfiguration: &EbsVolumeConfigurationProperty{
					Name: jsii.String("name"),
					SizeGiB: jsii.Number(123),

					// the properties below are optional
					Encrypted: jsii.Boolean(false),
					Iops: jsii.Number(123),
					KmsKeyId: jsii.String("kmsKeyId"),
					SnapshotId: jsii.String("snapshotId"),
					Throughput: jsii.Number(123),
					VolumeType: jsii.String("volumeType"),
				},
			},
		},
	},
}
```

## Properties

- `ec2Configuration`: [IResolvable](https://docs.aws.amazon.com/cdk/api/v2/docs/aws-cdk-lib.IResolvable.html) | [CfnCapacityProvider.Ec2ConfigurationProperty](https://docs.aws.amazon.com/cdk/api/v2/docs/aws-cdk-lib.aws_bedrockagentcore.CfnCapacityProvider.Ec2ConfigurationProperty.html) (required) — Configuration for EC2-based capacity.
