interface CommonProjectProps
Language | Type name |
---|---|
.NET | Amazon.CDK.AWS.CodeBuild.CommonProjectProps |
Java | software.amazon.awscdk.services.codebuild.CommonProjectProps |
Python | aws_cdk.aws_codebuild.CommonProjectProps |
TypeScript (source) | @aws-cdk/aws-codebuild » CommonProjectProps |
Example
// The code below shows an example of how to instantiate this type.
// The values are placeholders you should change.
import * as codebuild from '@aws-cdk/aws-codebuild';
import * as ec2 from '@aws-cdk/aws-ec2';
import * as iam from '@aws-cdk/aws-iam';
import * as kms from '@aws-cdk/aws-kms';
import * as logs from '@aws-cdk/aws-logs';
import * as s3 from '@aws-cdk/aws-s3';
import * as cdk from '@aws-cdk/core';
declare const bucket: s3.Bucket;
declare const buildImage: codebuild.IBuildImage;
declare const buildSpec: codebuild.BuildSpec;
declare const cache: codebuild.Cache;
declare const fileSystemLocation: codebuild.IFileSystemLocation;
declare const key: kms.Key;
declare const logGroup: logs.LogGroup;
declare const role: iam.Role;
declare const securityGroup: ec2.SecurityGroup;
declare const subnet: ec2.Subnet;
declare const subnetFilter: ec2.SubnetFilter;
declare const value: any;
declare const vpc: ec2.Vpc;
const commonProjectProps: codebuild.CommonProjectProps = {
allowAllOutbound: false,
badge: false,
buildSpec: buildSpec,
cache: cache,
checkSecretsInPlainTextEnvVariables: false,
concurrentBuildLimit: 123,
description: 'description',
encryptionKey: key,
environment: {
buildImage: buildImage,
certificate: {
bucket: bucket,
objectKey: 'objectKey',
},
computeType: codebuild.ComputeType.SMALL,
environmentVariables: {
environmentVariablesKey: {
value: value,
// the properties below are optional
type: codebuild.BuildEnvironmentVariableType.PLAINTEXT,
},
},
privileged: false,
},
environmentVariables: {
environmentVariablesKey: {
value: value,
// the properties below are optional
type: codebuild.BuildEnvironmentVariableType.PLAINTEXT,
},
},
fileSystemLocations: [fileSystemLocation],
grantReportGroupPermissions: false,
logging: {
cloudWatch: {
enabled: false,
logGroup: logGroup,
prefix: 'prefix',
},
s3: {
bucket: bucket,
// the properties below are optional
enabled: false,
encrypted: false,
prefix: 'prefix',
},
},
projectName: 'projectName',
queuedTimeout: cdk.Duration.minutes(30),
role: role,
securityGroups: [securityGroup],
subnetSelection: {
availabilityZones: ['availabilityZones'],
onePerAz: false,
subnetFilters: [subnetFilter],
subnetGroupName: 'subnetGroupName',
subnetName: 'subnetName',
subnets: [subnet],
subnetType: ec2.SubnetType.ISOLATED,
},
timeout: cdk.Duration.minutes(30),
vpc: vpc,
};
Properties
Name | Type | Description |
---|---|---|
allow | boolean | Whether to allow the CodeBuild to send all network traffic. |
badge? | boolean | Indicates whether AWS CodeBuild generates a publicly accessible URL for your project's build badge. |
build | Build | Filename or contents of buildspec in JSON format. |
cache? | Cache | Caching strategy to use. |
check | boolean | 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. |
concurrent | number | Maximum number of concurrent builds. |
description? | string | A description of the project. |
encryption | IKey | Encryption key to use to read and write artifacts. |
environment? | Build | Build environment to use for the build. |
environment | { [string]: Build } | Additional environment variables to add to the build environment. |
file | IFile [] | An ProjectFileSystemLocation objects for a CodeBuild build project. |
grant | boolean | Add permissions to this project's role to create and use test report groups with name starting with the name of this project. |
logging? | Logging | Information about logs for the build project. |
project | string | The physical, human-readable name of the CodeBuild Project. |
queued | Duration | The number of minutes after which AWS CodeBuild stops the build if it's still in queue. |
role? | IRole | Service Role to assume while running the build. |
security | ISecurity [] | What security group to associate with the codebuild project's network interfaces. |
subnet | Subnet | Where to place the network interfaces within the VPC. |
timeout? | Duration | The number of minutes after which AWS CodeBuild stops the build if it's not complete. |
vpc? | IVpc | VPC network to place codebuild network interfaces. |
allowAllOutbound?
Type:
boolean
(optional, default: 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.
badge?
Type:
boolean
(optional, default: 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?
Type:
Build
(optional, default: Empty buildspec.)
Filename or contents of buildspec in JSON format.
cache?
Type:
Cache
(optional, default: Cache.none)
Caching strategy to use.
checkSecretsInPlainTextEnvVariables?
Type:
boolean
(optional, default: 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?
Type:
number
(optional, default: no explicit limit is set)
Maximum number of concurrent builds.
Minimum value is 1 and maximum is account build limit.
description?
Type:
string
(optional, default: No description.)
A description of the project.
Use the description to identify the purpose of the project.
encryptionKey?
Type:
IKey
(optional, default: The AWS-managed CMK for Amazon Simple Storage Service (Amazon S3) is used.)
Encryption key to use to read and write artifacts.
environment?
Type:
Build
(optional, default: BuildEnvironment.LinuxBuildImage.STANDARD_1_0)
Build environment to use for the build.
environmentVariables?
Type:
{ [string]:
Build
}
(optional, default: No additional environment variables are specified.)
Additional environment variables to add to the build environment.
fileSystemLocations?
Type:
IFile
[]
(optional, default: no file system locations)
An ProjectFileSystemLocation objects for a CodeBuild build project.
A ProjectFileSystemLocation object specifies the identifier, location, mountOptions, mountPoint, and type of a file system created using Amazon Elastic File System.
grantReportGroupPermissions?
Type:
boolean
(optional, default: 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?
Type:
Logging
(optional, default: no log configuration is set)
Information about logs for the build project.
A project can create logs in Amazon CloudWatch Logs, an S3 bucket, or both.
projectName?
Type:
string
(optional, default: Name is automatically generated.)
The physical, human-readable name of the CodeBuild Project.
queuedTimeout?
Type:
Duration
(optional, default: no queue timeout is set)
The number of minutes after which AWS CodeBuild stops the build if it's still in queue.
For valid values, see the timeoutInMinutes field in the AWS CodeBuild User Guide.
role?
Type:
IRole
(optional, default: A role will be created.)
Service Role to assume while running the build.
securityGroups?
Type:
ISecurity
[]
(optional, default: Security group will be automatically created.)
What security group to associate with the codebuild project's network interfaces.
If no security group is identified, one will be created automatically.
Only used if 'vpc' is supplied.
subnetSelection?
Type:
Subnet
(optional, default: All private subnets.)
Where to place the network interfaces within the VPC.
Only used if 'vpc' is supplied.
timeout?
Type:
Duration
(optional, default: 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.
vpc?
Type:
IVpc
(optional, default: No VPC is specified.)
VPC network to place codebuild network interfaces.
Specify this if the codebuild project needs to access resources in a VPC.