class CfnFleet (construct)
Language | Type name |
---|---|
![]() | Amazon.CDK.AWS.CodeBuild.CfnFleet |
![]() | github.com/aws/aws-cdk-go/awscdk/v2/awscodebuild#CfnFleet |
![]() | software.amazon.awscdk.services.codebuild.CfnFleet |
![]() | aws_cdk.aws_codebuild.CfnFleet |
![]() | aws-cdk-lib » aws_codebuild » CfnFleet |
Implements
IConstruct
, IDependable
, IInspectable
, ITaggable
The AWS::CodeBuild::Fleet
resource configures a compute fleet, a set of dedicated instances for your build environment.
See also: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-codebuild-fleet.html
Example
// The code below shows an example of how to instantiate this type.
// The values are placeholders you should change.
import { aws_codebuild as codebuild } from 'aws-cdk-lib';
const cfnFleet = new codebuild.CfnFleet(this, 'MyCfnFleet', /* all optional props */ {
baseCapacity: 123,
computeConfiguration: {
disk: 123,
machineType: 'machineType',
memory: 123,
vCpu: 123,
},
computeType: 'computeType',
environmentType: 'environmentType',
fleetProxyConfiguration: {
defaultBehavior: 'defaultBehavior',
orderedProxyRules: [{
effect: 'effect',
entities: ['entities'],
type: 'type',
}],
},
fleetServiceRole: 'fleetServiceRole',
fleetVpcConfig: {
securityGroupIds: ['securityGroupIds'],
subnets: ['subnets'],
vpcId: 'vpcId',
},
imageId: 'imageId',
name: 'name',
overflowBehavior: 'overflowBehavior',
scalingConfiguration: {
maxCapacity: 123,
scalingType: 'scalingType',
targetTrackingScalingConfigs: [{
metricType: 'metricType',
targetValue: 123,
}],
},
tags: [{
key: 'key',
value: 'value',
}],
});
Initializer
new CfnFleet(scope: Construct, id: string, props?: CfnFleetProps)
Parameters
- scope
Construct
— Scope in which this resource is defined. - id
string
— Construct identifier for this resource (unique in its scope). - props
Cfn
— Resource properties.Fleet Props
Construct Props
Name | Type | Description |
---|---|---|
base | number | The initial number of machines allocated to the compute fleet, which defines the number of builds that can run in parallel. |
compute | IResolvable | Compute | The compute configuration of the compute fleet. |
compute | string | Information about the compute resources the compute fleet uses. Available values include:. |
environment | string | The environment type of the compute fleet. |
fleet | IResolvable | Proxy | Information about the proxy configurations that apply network access control to your reserved capacity instances. |
fleet | string | The service role associated with the compute fleet. |
fleet | IResolvable | Vpc | Information about the VPC configuration that AWS CodeBuild accesses. |
image | string | The Amazon Machine Image (AMI) of the compute fleet. |
name? | string | The name of the compute fleet. |
overflow | string | The compute fleet overflow behavior. |
scaling | IResolvable | Scaling | The scaling configuration of the compute fleet. |
tags? | Cfn [] | A list of tag key and value pairs associated with this compute fleet. |
baseCapacity?
Type:
number
(optional)
The initial number of machines allocated to the compute fleet, which defines the number of builds that can run in parallel.
computeConfiguration?
Type:
IResolvable
|
Compute
(optional)
The compute configuration of the compute fleet.
This is only required if computeType
is set to ATTRIBUTE_BASED_COMPUTE
.
computeType?
Type:
string
(optional)
Information about the compute resources the compute fleet uses. Available values include:.
ATTRIBUTE_BASED_COMPUTE
: Specify the amount of vCPUs, memory, disk space, and the type of machine.
If you use
ATTRIBUTE_BASED_COMPUTE
, you must define your attributes by usingcomputeConfiguration
. AWS CodeBuild will select the cheapest instance that satisfies your specified attributes. For more information, see Reserved capacity environment types in the AWS CodeBuild User Guide .
BUILD_GENERAL1_SMALL
: Use up to 4 GiB memory and 2 vCPUs for builds.BUILD_GENERAL1_MEDIUM
: Use up to 8 GiB memory and 4 vCPUs for builds.BUILD_GENERAL1_LARGE
: Use up to 16 GiB memory and 8 vCPUs for builds, depending on your environment type.BUILD_GENERAL1_XLARGE
: Use up to 72 GiB memory and 36 vCPUs for builds, depending on your environment type.BUILD_GENERAL1_2XLARGE
: Use up to 144 GiB memory, 72 vCPUs, and 824 GB of SSD storage for builds. This compute type supports Docker images up to 100 GB uncompressed.BUILD_LAMBDA_1GB
: Use up to 1 GiB memory for builds. Only available for environment typeLINUX_LAMBDA_CONTAINER
andARM_LAMBDA_CONTAINER
.BUILD_LAMBDA_2GB
: Use up to 2 GiB memory for builds. Only available for environment typeLINUX_LAMBDA_CONTAINER
andARM_LAMBDA_CONTAINER
.BUILD_LAMBDA_4GB
: Use up to 4 GiB memory for builds. Only available for environment typeLINUX_LAMBDA_CONTAINER
andARM_LAMBDA_CONTAINER
.BUILD_LAMBDA_8GB
: Use up to 8 GiB memory for builds. Only available for environment typeLINUX_LAMBDA_CONTAINER
andARM_LAMBDA_CONTAINER
.BUILD_LAMBDA_10GB
: Use up to 10 GiB memory for builds. Only available for environment typeLINUX_LAMBDA_CONTAINER
andARM_LAMBDA_CONTAINER
.
If you use BUILD_GENERAL1_SMALL
:
- For environment type
LINUX_CONTAINER
, you can use up to 4 GiB memory and 2 vCPUs for builds. - For environment type
LINUX_GPU_CONTAINER
, you can use up to 16 GiB memory, 4 vCPUs, and 1 NVIDIA A10G Tensor Core GPU for builds. - For environment type
ARM_CONTAINER
, you can use up to 4 GiB memory and 2 vCPUs on ARM-based processors for builds.
If you use BUILD_GENERAL1_LARGE
:
- For environment type
LINUX_CONTAINER
, you can use up to 16 GiB memory and 8 vCPUs for builds. - For environment type
LINUX_GPU_CONTAINER
, you can use up to 255 GiB memory, 32 vCPUs, and 4 NVIDIA Tesla V100 GPUs for builds. - For environment type
ARM_CONTAINER
, you can use up to 16 GiB memory and 8 vCPUs on ARM-based processors for builds.
For more information, see On-demand environment types in the AWS CodeBuild User Guide.
environmentType?
Type:
string
(optional)
The environment type of the compute fleet.
- The environment type
ARM_CONTAINER
is available only in regions US East (N. Virginia), US East (Ohio), US West (Oregon), EU (Ireland), Asia Pacific (Mumbai), Asia Pacific (Tokyo), Asia Pacific (Singapore), Asia Pacific (Sydney), EU (Frankfurt), and South America (São Paulo). - The environment type
ARM_EC2
is available only in regions US East (N. Virginia), US East (Ohio), US West (Oregon), EU (Ireland), EU (Frankfurt), Asia Pacific (Tokyo), Asia Pacific (Singapore), Asia Pacific (Sydney), South America (São Paulo), and Asia Pacific (Mumbai). - The environment type
LINUX_CONTAINER
is available only in regions US East (N. Virginia), US East (Ohio), US West (Oregon), EU (Ireland), EU (Frankfurt), Asia Pacific (Tokyo), Asia Pacific (Singapore), Asia Pacific (Sydney), South America (São Paulo), and Asia Pacific (Mumbai). - The environment type
LINUX_EC2
is available only in regions US East (N. Virginia), US East (Ohio), US West (Oregon), EU (Ireland), EU (Frankfurt), Asia Pacific (Tokyo), Asia Pacific (Singapore), Asia Pacific (Sydney), South America (São Paulo), and Asia Pacific (Mumbai). - The environment type
LINUX_GPU_CONTAINER
is available only in regions US East (N. Virginia), US East (Ohio), US West (Oregon), EU (Ireland), EU (Frankfurt), Asia Pacific (Tokyo), and Asia Pacific (Sydney). - The environment type
MAC_ARM
is available only in regions US East (Ohio), US East (N. Virginia), US West (Oregon), Europe (Frankfurt), and Asia Pacific (Sydney). - The environment type
WINDOWS_EC2
is available only in regions US East (N. Virginia), US East (Ohio), US West (Oregon), EU (Ireland), EU (Frankfurt), Asia Pacific (Tokyo), Asia Pacific (Singapore), Asia Pacific (Sydney), South America (São Paulo), and Asia Pacific (Mumbai). - The environment type
WINDOWS_SERVER_2019_CONTAINER
is available only in regions US East (N. Virginia), US East (Ohio), US West (Oregon), Asia Pacific (Sydney), Asia Pacific (Tokyo), Asia Pacific (Mumbai) and EU (Ireland). - The environment type
WINDOWS_SERVER_2022_CONTAINER
is available only in regions US East (N. Virginia), US East (Ohio), US West (Oregon), EU (Ireland), EU (Frankfurt), Asia Pacific (Sydney), Asia Pacific (Singapore), Asia Pacific (Tokyo), South America (São Paulo) and Asia Pacific (Mumbai).
For more information, see Build environment compute types in the AWS CodeBuild user guide .
fleetProxyConfiguration?
Type:
IResolvable
|
Proxy
(optional)
Information about the proxy configurations that apply network access control to your reserved capacity instances.
fleetServiceRole?
Type:
string
(optional)
The service role associated with the compute fleet.
For more information, see Allow a user to add a permission policy for a fleet service role in the AWS CodeBuild User Guide .
fleetVpcConfig?
Type:
IResolvable
|
Vpc
(optional)
Information about the VPC configuration that AWS CodeBuild accesses.
imageId?
Type:
string
(optional)
The Amazon Machine Image (AMI) of the compute fleet.
name?
Type:
string
(optional)
The name of the compute fleet.
overflowBehavior?
Type:
string
(optional)
The compute fleet overflow behavior.
- For overflow behavior
QUEUE
, your overflow builds need to wait on the existing fleet instance to become available. - For overflow behavior
ON_DEMAND
, your overflow builds run on CodeBuild on-demand.
If you choose to set your overflow behavior to on-demand while creating a VPC-connected fleet, make sure that you add the required VPC permissions to your project service role. For more information, see Example policy statement to allow CodeBuild access to AWS services required to create a VPC network interface .
scalingConfiguration?
Type:
IResolvable
|
Scaling
(optional)
The scaling configuration of the compute fleet.
tags?
Type:
Cfn
[]
(optional)
A list of tag key and value pairs associated with this compute fleet.
These tags are available for use by AWS services that support AWS CodeBuild compute fleet tags.
Properties
Name | Type | Description |
---|---|---|
attr | string | The ARN of the compute fleet. |
cdk | Tag | Tag Manager which manages the tags for this resource. |
cfn | ICfn | Options for this resource, such as condition, update policy etc. |
cfn | { [string]: any } | |
cfn | string | AWS resource type. |
creation | string[] | |
logical | string | The logical ID for this CloudFormation stack element. |
node | Node | The tree node. |
ref | string | Return a string that will be resolved to a CloudFormation { Ref } for this element. |
stack | Stack | The stack in which this element is defined. |
base | number | The initial number of machines allocated to the compute fleet, which defines the number of builds that can run in parallel. |
compute | IResolvable | Compute | The compute configuration of the compute fleet. |
compute | string | Information about the compute resources the compute fleet uses. |
environment | string | The environment type of the compute fleet. |
fleet | IResolvable | Proxy | Information about the proxy configurations that apply network access control to your reserved capacity instances. |
fleet | string | The service role associated with the compute fleet. |
fleet | IResolvable | Vpc | Information about the VPC configuration that AWS CodeBuild accesses. |
image | string | The Amazon Machine Image (AMI) of the compute fleet. |
name? | string | The name of the compute fleet. |
overflow | string | The compute fleet overflow behavior. |
scaling | IResolvable | Scaling | The scaling configuration of the compute fleet. |
tags? | Cfn [] | A list of tag key and value pairs associated with this compute fleet. |
static CFN_RESOURCE_TYPE_NAME | string | The CloudFormation resource type name for this resource class. |
attrArn
Type:
string
The ARN of the compute fleet.
cdkTagManager
Type:
Tag
Tag Manager which manages the tags for this resource.
cfnOptions
Type:
ICfn
Options for this resource, such as condition, update policy etc.
cfnProperties
Type:
{ [string]: any }
cfnResourceType
Type:
string
AWS resource type.
creationStack
Type:
string[]
logicalId
Type:
string
The logical ID for this CloudFormation stack element.
The logical ID of the element is calculated from the path of the resource node in the construct tree.
To override this value, use overrideLogicalId(newLogicalId)
.
node
Type:
Node
The tree node.
ref
Type:
string
Return a string that will be resolved to a CloudFormation { Ref }
for this element.
If, by any chance, the intrinsic reference of a resource is not a string, you could
coerce it to an IResolvable through Lazy.any({ produce: resource.ref })
.
stack
Type:
Stack
The stack in which this element is defined.
CfnElements must be defined within a stack scope (directly or indirectly).
baseCapacity?
Type:
number
(optional)
The initial number of machines allocated to the compute fleet, which defines the number of builds that can run in parallel.
computeConfiguration?
Type:
IResolvable
|
Compute
(optional)
The compute configuration of the compute fleet.
computeType?
Type:
string
(optional)
Information about the compute resources the compute fleet uses.
Available values include:.
environmentType?
Type:
string
(optional)
The environment type of the compute fleet.
fleetProxyConfiguration?
Type:
IResolvable
|
Proxy
(optional)
Information about the proxy configurations that apply network access control to your reserved capacity instances.
fleetServiceRole?
Type:
string
(optional)
The service role associated with the compute fleet.
fleetVpcConfig?
Type:
IResolvable
|
Vpc
(optional)
Information about the VPC configuration that AWS CodeBuild accesses.
imageId?
Type:
string
(optional)
The Amazon Machine Image (AMI) of the compute fleet.
name?
Type:
string
(optional)
The name of the compute fleet.
overflowBehavior?
Type:
string
(optional)
The compute fleet overflow behavior.
scalingConfiguration?
Type:
IResolvable
|
Scaling
(optional)
The scaling configuration of the compute fleet.
tags?
Type:
Cfn
[]
(optional)
A list of tag key and value pairs associated with this compute fleet.
static CFN_RESOURCE_TYPE_NAME
Type:
string
The CloudFormation resource type name for this resource class.
Methods
Name | Description |
---|---|
add | Syntactic sugar for addOverride(path, undefined) . |
add | Indicates that this resource depends on another resource and cannot be provisioned unless the other resource has been successfully provisioned. |
add | Indicates that this resource depends on another resource and cannot be provisioned unless the other resource has been successfully provisioned. |
add | Add a value to the CloudFormation Resource Metadata. |
add | Adds an override to the synthesized CloudFormation resource. |
add | Adds an override that deletes the value of a property from the resource definition. |
add | Adds an override to a resource property. |
apply | Sets the deletion policy of the resource based on the removal policy specified. |
get | Returns a token for an runtime attribute of this resource. |
get | Retrieve a value value from the CloudFormation Resource Metadata. |
inspect(inspector) | Examines the CloudFormation resource and discloses attributes. |
obtain | Retrieves an array of resources this resource depends on. |
obtain | Get a shallow copy of dependencies between this resource and other resources in the same stack. |
override | Overrides the auto-generated logical ID with a specific ID. |
remove | Indicates that this resource no longer depends on another resource. |
replace | Replaces one dependency with another. |
to | Returns a string representation of this construct. |
protected render |
addDeletionOverride(path)
public addDeletionOverride(path: string): void
Parameters
- path
string
— The path of the value to delete.
Syntactic sugar for addOverride(path, undefined)
.
addDependency(target)
public addDependency(target: CfnResource): void
Parameters
- target
Cfn
Resource
Indicates that this resource depends on another resource and cannot be provisioned unless the other resource has been successfully provisioned.
This can be used for resources across stacks (or nested stack) boundaries and the dependency will automatically be transferred to the relevant scope.
addDependsOn(target)
public addDependsOn(target: CfnResource): void
⚠️ Deprecated: use addDependency
Parameters
- target
Cfn
Resource
Indicates that this resource depends on another resource and cannot be provisioned unless the other resource has been successfully provisioned.
addMetadata(key, value)
public addMetadata(key: string, value: any): void
Parameters
- key
string
- value
any
Add a value to the CloudFormation Resource Metadata.
Note that this is a different set of metadata from CDK node metadata; this metadata ends up in the stack template under the resource, whereas CDK node metadata ends up in the Cloud Assembly.](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/metadata-section-structure.html
Note that this is a different set of metadata from CDK node metadata; this metadata ends up in the stack template under the resource, whereas CDK node metadata ends up in the Cloud Assembly.)
addOverride(path, value)
public addOverride(path: string, value: any): void
Parameters
- path
string
— - The path of the property, you can use dot notation to override values in complex types. - value
any
— - The value.
Adds an override to the synthesized CloudFormation resource.
To add a
property override, either use addPropertyOverride
or prefix path
with
"Properties." (i.e. Properties.TopicName
).
If the override is nested, separate each nested level using a dot (.) in the path parameter. If there is an array as part of the nesting, specify the index in the path.
To include a literal .
in the property name, prefix with a \
. In most
programming languages you will need to write this as "\\."
because the
\
itself will need to be escaped.
For example,
cfnResource.addOverride('Properties.GlobalSecondaryIndexes.0.Projection.NonKeyAttributes', ['myattribute']);
cfnResource.addOverride('Properties.GlobalSecondaryIndexes.1.ProjectionType', 'INCLUDE');
would add the overrides
"Properties": {
"GlobalSecondaryIndexes": [
{
"Projection": {
"NonKeyAttributes": [ "myattribute" ]
...
}
...
},
{
"ProjectionType": "INCLUDE"
...
},
]
...
}
The value
argument to addOverride
will not be processed or translated
in any way. Pass raw JSON values in here with the correct capitalization
for CloudFormation. If you pass CDK classes or structs, they will be
rendered with lowercased key names, and CloudFormation will reject the
template.
addPropertyDeletionOverride(propertyPath)
public addPropertyDeletionOverride(propertyPath: string): void
Parameters
- propertyPath
string
— The path to the property.
Adds an override that deletes the value of a property from the resource definition.
addPropertyOverride(propertyPath, value)
public addPropertyOverride(propertyPath: string, value: any): void
Parameters
- propertyPath
string
— The path of the property. - value
any
— The value.
Adds an override to a resource property.
Syntactic sugar for addOverride("Properties.<...>", value)
.
applyRemovalPolicy(policy?, options?)
public applyRemovalPolicy(policy?: RemovalPolicy, options?: RemovalPolicyOptions): void
Parameters
- policy
Removal
Policy - options
Removal
Policy Options
Sets the deletion policy of the resource based on the removal policy specified.
The Removal Policy controls what happens to this resource when it stops being managed by CloudFormation, either because you've removed it from the CDK application or because you've made a change that requires the resource to be replaced.
The resource can be deleted (RemovalPolicy.DESTROY
), or left in your AWS
account for data recovery and cleanup later (RemovalPolicy.RETAIN
). In some
cases, a snapshot can be taken of the resource prior to deletion
(RemovalPolicy.SNAPSHOT
). A list of resources that support this policy
can be found in the following link:
getAtt(attributeName, typeHint?)
public getAtt(attributeName: string, typeHint?: ResolutionTypeHint): Reference
Parameters
- attributeName
string
— The name of the attribute. - typeHint
Resolution
Type Hint
Returns
Returns a token for an runtime attribute of this resource.
Ideally, use generated attribute accessors (e.g. resource.arn
), but this can be used for future compatibility
in case there is no generated attribute.
getMetadata(key)
public getMetadata(key: string): any
Parameters
- key
string
Returns
any
Retrieve a value value from the CloudFormation Resource Metadata.
Note that this is a different set of metadata from CDK node metadata; this metadata ends up in the stack template under the resource, whereas CDK node metadata ends up in the Cloud Assembly.](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/metadata-section-structure.html
Note that this is a different set of metadata from CDK node metadata; this metadata ends up in the stack template under the resource, whereas CDK node metadata ends up in the Cloud Assembly.)
inspect(inspector)
public inspect(inspector: TreeInspector): void
Parameters
- inspector
Tree
— tree inspector to collect and process attributes.Inspector
Examines the CloudFormation resource and discloses attributes.
obtainDependencies()
public obtainDependencies(): Stack | CfnResource[]
Returns
Stack
|
Cfn
Resource []
Retrieves an array of resources this resource depends on.
This assembles dependencies on resources across stacks (including nested stacks) automatically.
obtainResourceDependencies()
public obtainResourceDependencies(): CfnResource[]
Returns
Get a shallow copy of dependencies between this resource and other resources in the same stack.
overrideLogicalId(newLogicalId)
public overrideLogicalId(newLogicalId: string): void
Parameters
- newLogicalId
string
— The new logical ID to use for this stack element.
Overrides the auto-generated logical ID with a specific ID.
removeDependency(target)
public removeDependency(target: CfnResource): void
Parameters
- target
Cfn
Resource
Indicates that this resource no longer depends on another resource.
This can be used for resources across stacks (including nested stacks) and the dependency will automatically be removed from the relevant scope.
replaceDependency(target, newTarget)
public replaceDependency(target: CfnResource, newTarget: CfnResource): void
Parameters
- target
Cfn
— The dependency to replace.Resource - newTarget
Cfn
— The new dependency to add.Resource
Replaces one dependency with another.
toString()
public toString(): string
Returns
string
Returns a string representation of this construct.
protected renderProperties(props)
protected renderProperties(props: { [string]: any }): { [string]: any }
Parameters
- props
{ [string]: any }
Returns
{ [string]: any }