Skip to content
v2.278.0

Ec2ConfigurationProperty Struct ​

Configuration for EC2-based capacity.

Example ​

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 ec2ConfigurationProperty: bedrockagentcore.CfnCapacityProvider.Ec2ConfigurationProperty = {
  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
# 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

ec2_configuration_property = 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
// 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.*;

Ec2ConfigurationProperty ec2ConfigurationProperty = 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();
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 ec2ConfigurationProperty = 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"
        }
    } }
};
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"

ec2ConfigurationProperty := &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 ​

launchTemplateSourceIResolvable | CfnCapacityProvider.LaunchTemplateSourcePropertylaunch_template_sourcetyping.Union[IResolvable, LaunchTemplateSourceProperty]launchTemplateSourceIResolvableLaunchTemplateSourceIResolvableLaunchTemplateSourceinterface{} required #
How the launch template is specified.
lifecycleConfigurationoptionalIResolvable | CfnCapacityProvider.InstanceLifecycleConfigurationPropertylifecycle_configurationoptionaltyping.Union[IResolvable, InstanceLifecycleConfigurationProperty]lifecycleConfigurationoptionalIResolvableLifecycleConfigurationoptionalIResolvableLifecycleConfigurationoptionalinterface{} #
Configuration for managing the lifecycle of instances in a capacity provider.
rootVolumeoptionalIResolvable | CfnCapacityProvider.RootVolumeConfigurationPropertyroot_volumeoptionaltyping.Union[IResolvable, RootVolumeConfigurationProperty]rootVolumeoptionalIResolvableRootVolumeoptionalIResolvableRootVolumeoptionalinterface{} #
Customer-facing configuration for the (service-managed) root volume.
notes

The service provisions the root volume at its own AMI size estimate plus FreeSpaceGiB, and pins the visible free space to FreeSpaceGiB with a filler file, so the space you are guaranteed does not change as the underlying AMI grows. The device name and the delete-on-termination behavior are service-owned and are not configurable.

volumesoptionalIResolvable | IResolvable | CfnCapacityProvider.VolumeConfigurationProperty[]volumesoptionaltyping.Union[IResolvable, typing.List[typing.Union[IResolvable, VolumeConfigurationProperty]]]volumesoptionalIResolvableVolumesoptionalIResolvableVolumesoptionalinterface{} #
Named persistent EBS volumes for this capacity provider.
vpcConfigurationIResolvable | CfnCapacityProvider.VpcConfigurationPropertyvpc_configurationtyping.Union[IResolvable, VpcConfigurationProperty]vpcConfigurationIResolvableVpcConfigurationIResolvableVpcConfigurationinterface{} required #
VPC configuration for launching EC2 instances.