BedrockAgentCoreControl / Client / create_capacity_provider
create_capacity_provider¶
- BedrockAgentCoreControl.Client.create_capacity_provider(**kwargs)¶
Creates a capacity provider. A capacity provider defines the Amazon EC2 infrastructure for AgentCore Runtime, including the operating system, allowed instance types, networking, and storage. It also specifies the IAM permissions that AgentCore uses to manage those instances.
The capacity provider name must be unique within your account. After you create the capacity provider, it enters a
CREATINGstate and transitions toREADYwhen it is available for use.See also: AWS API Documentation
Request Syntax
response = client.create_capacity_provider( name='string', description='string', permissionsConfiguration={ 'capacityProviderOperatorRoleArn': 'string' }, clientToken='string', tags={ 'string': 'string' }, computeConfiguration={ 'ec2Configuration': { 'launchTemplateSource': { 'launchParameters': { 'operatingSystem': 'LINUX_X86_64'|'LINUX_ARM64', 'instanceRequirements': { 'allowedInstanceTypes': [ 'string', ] }, 'ephemeralVolumes': [ { 'deviceName': 'string', 'virtualName': 'string', 'ebs': { 'volumeType': 'standard'|'io1'|'io2'|'gp2'|'sc1'|'st1'|'gp3', 'iops': 123, 'throughput': 123, 'encrypted': True|False, 'kmsKeyId': 'string', 'snapshotId': 'string', 'volumeSize': 123, 'volumeInitializationRate': 123, 'ebsCardIndex': 123 } }, ], 'monitoring': 'BASIC'|'DETAILED', 'licenseSpecifications': [ { 'licenseConfigurationArn': 'string' }, ], 'capacityReservationSpecification': { 'capacityReservationPreference': 'capacity-reservations-only'|'open'|'none', 'capacityReservationTarget': { 'capacityReservationId': 'string', 'capacityReservationResourceGroupArn': 'string' } }, 'sshKeyName': 'string', 'instanceProfileArn': 'string', 'propagatedTags': { 'string': 'string' } } }, 'vpcConfiguration': { 'subnets': [ 'string', ], 'securityGroups': [ 'string', ] }, 'volumes': [ { 'ebsConfiguration': { 'name': 'string', 'sizeGiB': 123, 'volumeType': 'standard'|'io1'|'io2'|'gp2'|'sc1'|'st1'|'gp3', 'iops': 123, 'throughput': 123, 'encrypted': True|False, 'kmsKeyId': 'string', 'snapshotId': 'string' } }, ], 'lifecycleConfiguration': { 'idleInstanceTimeout': 123, 'maxLifetime': 123 }, 'rootVolume': { 'volumeType': 'standard'|'io1'|'io2'|'gp2'|'sc1'|'st1'|'gp3', 'iops': 123, 'throughput': 123, 'encrypted': True|False, 'kmsKeyId': 'string', 'freeSpaceGiB': 123 } } } )
- Parameters:
name (string) –
[REQUIRED]
The name of the capacity provider. The name must be unique within your account.
description (string) – An optional description of the capacity provider. If you don’t specify a description, the service creates the capacity provider without one.
permissionsConfiguration (dict) –
[REQUIRED]
The permissions configuration for the capacity provider. This specifies the IAM role that AgentCore uses to manage the Amazon EC2 instances on your behalf.
capacityProviderOperatorRoleArn (string) – [REQUIRED]
The Amazon Resource Name (ARN) of the IAM role that AgentCore assumes to manage the capacity provider, including launching, tagging, and terminating instances and their network interfaces. We recommend scoping this role to the minimum permissions that your workloads require.
clientToken (string) –
A unique, case-sensitive identifier to ensure that the API request completes no more than one time. If you don’t specify this field, a value is randomly generated for you. If this token matches a previous request, the service ignores the request, but doesn’t return an error. For more information, see Ensuring idempotency.
This field is autopopulated if not provided.
tags (dict) –
A map of tag keys and values to associate with the capacity provider. If you don’t specify tags, the capacity provider is created with no tags.
(string) –
(string) –
computeConfiguration (dict) –
[REQUIRED]
The compute configuration for the capacity provider. This defines the Amazon EC2 compute resources used to launch instances: the operating system, allowed instance types, networking, and storage.
Note
This is a Tagged Union structure. Only one of the following top level keys can be set:
ec2Configuration.ec2Configuration (dict) –
The Amazon EC2 compute configuration for the capacity provider.
launchTemplateSource (dict) – [REQUIRED]
The source of the launch template configuration that defines how instances are launched.
Note
This is a Tagged Union structure. Only one of the following top level keys can be set:
launchParameters.launchParameters (dict) –
The parameters that AgentCore uses to create the launch template.
operatingSystem (string) – [REQUIRED]
The operating system and CPU architecture for the instances.
instanceRequirements (dict) – [REQUIRED]
The requirements that determine which instance types can be launched.
allowedInstanceTypes (list) – [REQUIRED]
The list of allowed instance types. You can specify up to 30 instance types.
(string) –
ephemeralVolumes (list) –
The block device mappings for instance store (ephemeral) volumes. You can specify up to five mappings.
(dict) –
A block device mapping for an instance store (ephemeral) volume.
deviceName (string) –
The device name, for example
/dev/sdhorxvdh.virtualName (string) –
The virtual device name (
ephemeralN). Instance store volumes are numbered starting from 0. The number of available instance store volumes depends on the instance type. After you connect to the instance, you must mount the volume.ebs (dict) –
The shared Amazon EBS performance and encryption properties for a volume. These properties are common across the different volume configurations for a capacity provider.
volumeType (string) –
The Amazon EBS volume type. If you do not specify a type, the default is
gp3.iops (integer) –
The number of IOPS to provision. For
gp3,io1, andio2volumes, this is the number of IOPS provisioned for the volume. Forgp2volumes, this sets the baseline IOPS performance. It also controls the rate at which the volume accumulates I/O credits for bursting. Supported values:gp3, 3,000–80,000;io1, 100–64,000;io2, 100–256,000.throughput (integer) –
The throughput to provision, in MiB/s. Valid only for
gp3volumes. Valid range: 125–2,000 MiB/s.encrypted (boolean) –
Specifies whether to encrypt the volume. Encrypted volumes can be attached only to instances that support Amazon EBS encryption. If you create a volume from a snapshot, you cannot specify an encryption value.
kmsKeyId (string) –
The identifier (key ID, key alias, key ARN, or alias ARN) of the customer managed KMS key to use for Amazon EBS encryption.
snapshotId (string) –
The ID of the snapshot.
volumeSize (integer) –
The size of the volume, in GiB. You must specify either a snapshot ID or a volume size. Supported sizes:
gp2, 1–16,384;gp3, 1–65,536;io1, 4–16,384;io2, 4–65,536.volumeInitializationRate (integer) –
The rate at which the volume is initialized after creation, in MiB/s. Supported only for volumes created from snapshots. Valid range: 100–300 MiB/s.
ebsCardIndex (integer) –
The index of the Amazon EBS card. Applies to instances with multiple Amazon EBS cards.
monitoring (string) –
The monitoring level for the instances.
licenseSpecifications (list) –
The license configurations to associate with the instances. You can specify up to five configurations.
(dict) –
A license configuration to associate with the instances.
licenseConfigurationArn (string) – [REQUIRED]
The Amazon Resource Name (ARN) of the license configuration.
capacityReservationSpecification (dict) –
The Capacity Reservation targeting option for the instances.
capacityReservationPreference (string) –
The Capacity Reservation preference for the instances.
capacityReservationTarget (dict) –
The target Capacity Reservation or Capacity Reservation group for the instances.
capacityReservationId (string) –
The ID of the Capacity Reservation in which to run the instances.
capacityReservationResourceGroupArn (string) –
The Amazon Resource Name (ARN) of the Capacity Reservation resource group in which to run the instances.
sshKeyName (string) –
The name of the SSH key pair to configure on the instances for SSH connectivity.
instanceProfileArn (string) –
The Amazon Resource Name (ARN) of the IAM instance profile to associate with launched instances. If provided, this overrides the default instance profile.
propagatedTags (dict) –
The tags to propagate to all Amazon EC2 resources (instances, volumes, and network interfaces) that the capacity provider creates.
(string) –
(string) –
vpcConfiguration (dict) – [REQUIRED]
The VPC configuration for launching instances, including subnets and security groups.
subnets (list) – [REQUIRED]
The IDs of the subnets in which to launch instances. You must specify at least one subnet.
(string) –
securityGroups (list) – [REQUIRED]
The IDs of the security groups to associate with the instances. You must specify at least one security group.
(string) –
volumes (list) –
The named persistent Amazon EBS volumes for the capacity provider. A capacity provider can define up to five volumes.
(dict) –
The configuration for a persistent volume attached to a capacity provider. This structure defines the storage backing for the persistent volumes used by agents that run on capacity provider instances.
Note
This is a Tagged Union structure. Only one of the following top level keys can be set:
ebsConfiguration.ebsConfiguration (dict) –
The configuration for an Amazon EBS-backed persistent volume.
name (string) – [REQUIRED]
The logical name of the volume. Use this name to reference the volume when you mount it into an agent runtime.
sizeGiB (integer) – [REQUIRED]
The size of the volume, in GiB.
volumeType (string) –
The Amazon EBS volume type. If you do not specify a type, the default is
gp3.iops (integer) –
The number of IOPS to provision. Valid only for
gp3,io1, andio2volumes.throughput (integer) –
The throughput, in MiB/s. Valid only for
gp3volumes.encrypted (boolean) –
Specifies whether to encrypt the volume. If
true, the service encrypts the volume with the KMS key that you specify inkmsKeyId, or the default KMS key for Amazon EBS if you do not specify one. The default istrue.kmsKeyId (string) –
The identifier of the KMS key to use for encryption.
snapshotId (string) –
An optional Amazon EBS snapshot ID. If provided, the volume is initialized from this snapshot the first time it is created. On subsequent restarts, the existing volume is used and the snapshot is ignored.
lifecycleConfiguration (dict) –
The lifecycle configuration for instances in the capacity provider.
idleInstanceTimeout (integer) –
The number of seconds an instance can remain idle before it is stopped. An instance is considered idle when all of its agents are idle. The default is 900 seconds (15 minutes).
maxLifetime (integer) –
The maximum lifetime of an instance, in seconds. When an instance reaches this limit, the service terminates it regardless of activity. The default is 28800 seconds (8 hours). The maximum is 1209600 seconds (14 days).
rootVolume (dict) –
The configuration for the instance root volume. Specify the amount of free space to guarantee and, optionally, the Amazon EBS performance and encryption settings. The device name and delete-on-termination behavior are not configurable.
volumeType (string) –
The Amazon EBS volume type. If you do not specify a type, the default is
gp3.iops (integer) –
The number of IOPS to provision. For
gp3,io1, andio2volumes, this is the number of IOPS provisioned for the volume. Forgp2volumes, this sets the baseline IOPS performance. It also controls the rate at which the volume accumulates I/O credits for bursting. Supported values:gp3, 3,000–80,000;io1, 100–64,000;io2, 100–256,000.throughput (integer) –
The throughput to provision, in MiB/s. Valid only for
gp3volumes. Valid range: 125–2,000 MiB/s.encrypted (boolean) –
Specifies whether to encrypt the volume. Encrypted volumes can be attached only to instances that support Amazon EBS encryption. If you create a volume from a snapshot, you cannot specify an encryption value.
kmsKeyId (string) –
The identifier (key ID, key alias, key ARN, or alias ARN) of the customer managed KMS key to use for Amazon EBS encryption.
freeSpaceGiB (integer) –
The free space guaranteed on the root volume, in GiB. AgentCore adds the operating system overhead on top of this value. The default is 8 GiB.
- Return type:
dict
- Returns:
Response Syntax
{ 'capacityProviderId': 'string', 'capacityProviderArn': 'string', 'name': 'string', 'status': 'CREATING'|'CREATE_FAILED'|'UPDATING'|'UPDATE_FAILED'|'READY'|'DELETING'|'DELETE_FAILED' }
Response Structure
(dict) –
capacityProviderId (string) –
The unique identifier of the created capacity provider.
capacityProviderArn (string) –
The Amazon Resource Name (ARN) of the capacity provider.
name (string) –
The name of the capacity provider.
status (string) –
The current status of the capacity provider. For possible values, see
CapacityProviderStatus.
Exceptions
BedrockAgentCoreControl.Client.exceptions.ServiceQuotaExceededExceptionBedrockAgentCoreControl.Client.exceptions.RetryableConflictExceptionBedrockAgentCoreControl.Client.exceptions.ValidationExceptionBedrockAgentCoreControl.Client.exceptions.AccessDeniedExceptionBedrockAgentCoreControl.Client.exceptions.ConflictExceptionBedrockAgentCoreControl.Client.exceptions.ThrottlingExceptionBedrockAgentCoreControl.Client.exceptions.ResourceNotFoundExceptionBedrockAgentCoreControl.Client.exceptions.InternalServerException