# ComputeType

Build machine compute type.

- Source: [`aws-codebuild/lib/compute-type.ts`](https://github.com/aws/aws-cdk/blob/v2.274.0/packages/aws-cdk-lib/aws-codebuild/lib/compute-type.ts#L6)
- Type last changed: v2.219.0 · 1 Oct 2025

## Example

```ts
declare const vpc: ec2.Vpc;
declare const mySecurityGroup: ec2.SecurityGroup;
new pipelines.CodeBuildStep('Synth', {
  // ...standard ShellStep props...
  commands: [
    /* ... */
  ],
  env: {
    /* ... */
  },

  // If you are using a CodeBuildStep explicitly, set the 'cdk.out' directory
  // to be the synth step's output.
  primaryOutputDirectory: 'cdk.out',

  // Control the name of the project
  projectName: 'MyProject',

  // Control parts of the BuildSpec other than the regular 'build' and 'install' commands
  partialBuildSpec: codebuild.BuildSpec.fromObject({
    version: '0.2',
    // ...
  }),

  // Control the build environment
  buildEnvironment: {
    computeType: codebuild.ComputeType.LARGE,
    privileged: true,
    dockerServer: {
      computeType: codebuild.DockerServerComputeType.SMALL,
      securityGroups: [mySecurityGroup],
    },
  },
  timeout: Duration.minutes(90),
  fileSystemLocations: [
    codebuild.FileSystemLocation.efs({
      identifier: 'myidentifier2',
      location: 'myclodation.mydnsroot.com:/loc',
      mountPoint: '/media',
      mountOptions: 'opts',
    }),
  ],

  // Control Elastic Network Interface creation
  vpc: vpc,
  subnetSelection: { subnetType: ec2.SubnetType.PRIVATE_WITH_EGRESS },
  securityGroups: [mySecurityGroup],

  // Control caching
  cache: codebuild.Cache.bucket(new s3.Bucket(this, 'Cache')),

  // Additional policy statements for the execution role
  rolePolicyStatements: [
    new iam.PolicyStatement({
      /* ... */
    }),
  ],
});
```

## Members

| Member | Description |
| --- | --- |
| `SMALL` |  |
| `MEDIUM` |  |
| `LARGE` |  |
| `X_LARGE` |  |
| `X2_LARGE` |  |
| `LAMBDA_1GB` |  |
| `LAMBDA_2GB` |  |
| `LAMBDA_4GB` |  |
| `LAMBDA_8GB` |  |
| `LAMBDA_10GB` |  |
| `ATTRIBUTE_BASED` |  |
| `CUSTOM_INSTANCE_TYPE` |  |

## Referenced by

- [`BuildEnvironment`](/v2/docs/aws-cdk-lib.aws_codebuild.BuildEnvironment).computeType
- [`IBuildImage`](/v2/docs/aws-cdk-lib.aws_codebuild.IBuildImage).defaultComputeType
- [`LinuxArmBuildImage`](/v2/docs/aws-cdk-lib.aws_codebuild.LinuxArmBuildImage).defaultComputeType
- [`LinuxArmLambdaBuildImage`](/v2/docs/aws-cdk-lib.aws_codebuild.LinuxArmLambdaBuildImage).defaultComputeType
- [`LinuxBuildImage`](/v2/docs/aws-cdk-lib.aws_codebuild.LinuxBuildImage).defaultComputeType
- [`LinuxGpuBuildImage`](/v2/docs/aws-cdk-lib.aws_codebuild.LinuxGpuBuildImage).defaultComputeType
- [`LinuxLambdaBuildImage`](/v2/docs/aws-cdk-lib.aws_codebuild.LinuxLambdaBuildImage).defaultComputeType
- [`MacBuildImage`](/v2/docs/aws-cdk-lib.aws_codebuild.MacBuildImage).defaultComputeType
- [`WindowsBuildImage`](/v2/docs/aws-cdk-lib.aws_codebuild.WindowsBuildImage).defaultComputeType
