# ProjectProps

Extends: ProjectProps
Extends: CommonProjectProps
Used as props by: Project

- Source: [`aws-codebuild/lib/project.ts`](https://github.com/aws/aws-cdk/blob/v2.275.0/packages/aws-cdk-lib/aws-codebuild/lib/project.ts#L767)

## Example

```ts
declare const ecrRepository: ecr.Repository;

new codebuild.Project(this, 'Project', {
  environment: {
    buildImage: codebuild.WindowsBuildImage.fromEcrRepository(ecrRepository, 'v1.0', codebuild.WindowsImageType.SERVER_2019),
    // optional certificate to include in the build image
    certificate: {
      bucket: s3.Bucket.fromBucketName(this, 'Bucket', 'amzn-s3-demo-bucket'),
      objectKey: 'path/to/cert.pem',
    },
  },
  // ...
})
```

## Properties

- `allowAllOutbound`: boolean = true — Whether to allow the CodeBuild to send all network traffic.

  If set to false, you must individually add traffic rules to allow the
  CodeBuild project to connect to network targets.

  Only used if 'vpc' is supplied.

- `artifacts`: [IArtifacts](/cdk/api/v2/docs/aws-cdk-lib.aws_codebuild.IArtifacts.html) = NoArtifacts — Defines where build artifacts will be stored.

  Could be: PipelineBuildArtifacts, NoArtifacts and S3Artifacts.

- `autoRetryLimit`: number — CodeBuild will automatically call retry build using the project's service role up to the auto-retry limit.

  **Default:** no retry

  `autoRetryLimit` must be between 0 and 10.

- `badge`: boolean = false — Indicates whether AWS CodeBuild generates a publicly accessible URL for your project's build badge.

  For more information, see Build Badges Sample
  in the AWS CodeBuild User Guide.

- `buildSpec`: [BuildSpec](/cdk/api/v2/docs/aws-cdk-lib.aws_codebuild.BuildSpec.html) — Filename or contents of buildspec in JSON format.

  **Default:** Empty buildspec.

- `cache`: [Cache](/cdk/api/v2/docs/aws-cdk-lib.aws_codebuild.Cache.html) = Cache.none — Caching strategy to use.

- `checkSecretsInPlainTextEnvVariables`: boolean = true — Whether to check for the presence of any secrets in the environment variables of the default type, BuildEnvironmentVariableType.PLAINTEXT. Since using a secret for the value of that kind of variable would result in it being displayed in plain text in the AWS Console, the construct will throw an exception if it detects a secret was passed there. Pass this property as false if you want to skip this validation, and keep using a secret in a plain text environment variable.

- `concurrentBuildLimit`: number — Maximum number of concurrent builds.

  **Default:** no explicit limit is set

  Minimum value is 1 and maximum is account build limit.

- `description`: string — A description of the project.

  **Default:** No description.

  Use the description to identify the purpose
  of the project.

- `encryptionKey`: [IKey](/cdk/api/v2/docs/aws-cdk-lib.aws_kms.IKey.html) — Encryption key to use to read and write artifacts.

  **Default:** The AWS-managed CMK for Amazon Simple Storage Service (Amazon S3) is used.

- `environment`: [BuildEnvironment](/cdk/api/v2/docs/aws-cdk-lib.aws_codebuild.BuildEnvironment.html) — Build environment to use for the build.

  **Default:** BuildEnvironment.LinuxBuildImage.STANDARD_7_0

- `environmentVariables`: { [key: string]: [BuildEnvironmentVariable](/cdk/api/v2/docs/aws-cdk-lib.aws_codebuild.BuildEnvironmentVariable.html) } — Additional environment variables to add to the build environment.

  **Default:** No additional environment variables are specified.

- `fileSystemLocations`: [IFileSystemLocation](/cdk/api/v2/docs/aws-cdk-lib.aws_codebuild.IFileSystemLocation.html)[] — An ProjectFileSystemLocation objects for a CodeBuild build project.

  **Default:** no file system locations

  A ProjectFileSystemLocation object specifies the identifier, location, mountOptions, mountPoint,
  and type of a file system created using Amazon Elastic File System.

- `grantReportGroupPermissions`: boolean = true — Add permissions to this project's role to create and use test report groups with name starting with the name of this project.

  That is the standard report group that gets created when a simple name
  (in contrast to an ARN)
  is used in the 'reports' section of the buildspec of this project.
  This is usually harmless, but you can turn these off if you don't plan on using test
  reports in this project.

- `logging`: [LoggingOptions](/cdk/api/v2/docs/aws-cdk-lib.aws_codebuild.LoggingOptions.html) — Information about logs for the build project.

  **Default:** no log configuration is set

  A project can create logs in Amazon CloudWatch Logs, an S3 bucket, or both.

- `projectName`: string — The physical, human-readable name of the CodeBuild Project.

  **Default:** Name is automatically generated.

- `queuedTimeout`: [Duration](/cdk/api/v2/docs/aws-cdk-lib.Duration.html) — The number of minutes after which AWS CodeBuild stops the build if it's still in queue.

  **Default:** no queue timeout is set

  For valid values, see the timeoutInMinutes field in the AWS
  CodeBuild User Guide.

- `role`: [IRole](/cdk/api/v2/docs/aws-cdk-lib.aws_iam.IRole.html) — Service Role to assume while running the build.

  **Default:** A role will be created.

- `secondaryArtifacts`: [IArtifacts](/cdk/api/v2/docs/aws-cdk-lib.aws_codebuild.IArtifacts.html)[] — The secondary artifacts for the Project.

  **Default:** No secondary artifacts.

  Can also be added after the Project has been created by using the `Project#addSecondaryArtifact` method.

- `secondarySources`: [ISource](/cdk/api/v2/docs/aws-cdk-lib.aws_codebuild.ISource.html)[] — The secondary sources for the Project.

  **Default:** No secondary sources.

  Can be also added after the Project has been created by using the `Project#addSecondarySource` method.

- `securityGroups`: [ISecurityGroup](/cdk/api/v2/docs/aws-cdk-lib.aws_ec2.ISecurityGroup.html)[] — What security group to associate with the codebuild project's network interfaces.

  **Default:** Security group will be automatically created.

  If no security group is identified, one will be created automatically.

  Only used if 'vpc' is supplied.

- `source`: [ISource](/cdk/api/v2/docs/aws-cdk-lib.aws_codebuild.ISource.html) = NoSource — The source of the build.

  *Note*: if `NoSource` is given as the source,
  then you need to provide an explicit `buildSpec`.

- `ssmSessionPermissions`: boolean = false — Add the permissions necessary for debugging builds with SSM Session Manager.

  If the following prerequisites have been met:

  - The necessary permissions have been added by setting this flag to true.
  - The build image has the SSM agent installed (true for default CodeBuild images).
  - The build is started with [debugSessionEnabled](https://docs.aws.amazon.com/codebuild/latest/APIReference/API_StartBuild.html#CodeBuild-StartBuild-request-debugSessionEnabled) set to true.

  Then the build container can be paused and inspected using Session Manager
  by invoking the `codebuild-breakpoint` command somewhere during the build.

  `codebuild-breakpoint` commands will be ignored if the build is not started
  with `debugSessionEnabled=true`.

- `subnetSelection`: [SubnetSelection](/cdk/api/v2/docs/aws-cdk-lib.aws_ec2.SubnetSelection.html) — Where to place the network interfaces within the VPC.

  **Default:** private subnets if available else public subnets

  To access AWS services, your CodeBuild project needs to be in one of the following types of subnets:

  1. Subnets with access to the internet (of type PRIVATE_WITH_EGRESS).
  2. Private subnets unconnected to the internet, but with [VPC endpoints](https://docs.aws.amazon.com/codebuild/latest/userguide/use-vpc-endpoints-with-codebuild.html) for the necessary services.

  If you don't specify a subnet selection, the default behavior is to use PRIVATE_WITH_EGRESS subnets first if they exist,
  then PRIVATE_WITHOUT_EGRESS, and finally PUBLIC subnets. If your VPC doesn't have PRIVATE_WITH_EGRESS subnets but you need
  AWS service access, add VPC Endpoints to your private subnets.

- `timeout`: [Duration](/cdk/api/v2/docs/aws-cdk-lib.Duration.html) = Duration.hours(1) — The number of minutes after which AWS CodeBuild stops the build if it's not complete.

  For valid values, see the timeoutInMinutes field in the AWS
  CodeBuild User Guide.

- `visibility`: [ProjectVisibility](/cdk/api/v2/docs/aws-cdk-lib.aws_codebuild.ProjectVisibility.html) — Specifies the visibility of the project's builds.

  **Default:** no visibility is set

- `vpc`: [IVpc](/cdk/api/v2/docs/aws-cdk-lib.aws_ec2.IVpc.html) — VPC network to place codebuild network interfaces.

  **Default:** No VPC is specified.

  Specify this if the codebuild project needs to access resources in a VPC.
