CommonProjectProps Struct
Example
// The code below shows an example of how to instantiate this type.
// The values are placeholders you should change.
import * as cdk from 'aws-cdk-lib';
import { aws_codebuild as codebuild } from 'aws-cdk-lib';
import { aws_ec2 as ec2 } from 'aws-cdk-lib';
import { aws_iam as iam } from 'aws-cdk-lib';
import { aws_kms as kms } from 'aws-cdk-lib';
import { aws_logs as logs } from 'aws-cdk-lib';
import { aws_s3 as s3 } from 'aws-cdk-lib';
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 fleet: codebuild.Fleet;
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,
autoRetryLimit: 123,
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,
dockerServer: {
computeType: codebuild.DockerServerComputeType.SMALL,
// the properties below are optional
securityGroups: [securityGroup],
},
environmentVariables: {
environmentVariablesKey: {
value: value,
// the properties below are optional
type: codebuild.BuildEnvironmentVariableType.PLAINTEXT,
},
},
fleet: fleet,
hostKernel: codebuild.HostKernel.LINUX_KERNEL_4,
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],
ssmSessionPermissions: false,
subnetSelection: {
availabilityZones: ['availabilityZones'],
onePerAz: false,
subnetFilters: [subnetFilter],
subnetGroupName: 'subnetGroupName',
subnets: [subnet],
subnetType: ec2.SubnetType.PRIVATE_ISOLATED,
},
timeout: cdk.Duration.minutes(30),
visibility: codebuild.ProjectVisibility.PUBLIC_READ,
vpc: vpc,
};
Properties
allowAllOutboundbooleanallow_all_outboundboolallowAllOutboundBooleanAllowAllOutboundboolAllowAllOutbound*bool= true#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.
autoRetryLimitnumberauto_retry_limitint | floatautoRetryLimitNumberAutoRetryLimitdoubleAutoRetryLimit*float64= no retry#autoRetryLimit must be between 0 and 10.
For more information, see Build Badges Sample in the AWS CodeBuild User Guide.
buildSpecBuildSpecbuild_specBuildSpecbuildSpecBuildSpecBuildSpecBuildSpecBuildSpecBuildSpec= Empty buildspec.#checkSecretsInPlainTextEnvVariablesbooleancheck_secrets_in_plain_text_env_variablesboolcheckSecretsInPlainTextEnvVariablesBooleanCheckSecretsInPlainTextEnvVariablesboolCheckSecretsInPlainTextEnvVariables*bool= true#concurrentBuildLimitnumberconcurrent_build_limitint | floatconcurrentBuildLimitNumberConcurrentBuildLimitdoubleConcurrentBuildLimit*float64= no explicit limit is set#Minimum value is 1 and maximum is account build limit.
descriptionstringdescriptionstrdescriptionStringDescriptionstringDescription*string= No description.#Use the description to identify the purpose of the project.
encryptionKeyIKeyencryption_keyIKeyencryptionKeyIKeyEncryptionKeyIKeyEncryptionKeyIKey= The AWS-managed CMK for Amazon S…#default
Default: The AWS-managed CMK for Amazon Simple Storage Service (Amazon S3) is used.
environmentBuildEnvironmentenvironmentBuildEnvironmentenvironmentBuildEnvironmentEnvironmentBuildEnvironmentEnvironmentBuildEnvironment= BuildEnvironment.LinuxBuildImage…#default
Default: BuildEnvironment.LinuxBuildImage.STANDARD_7_0
environmentVariables{ [key: string]: BuildEnvironmentVariable }environment_variablestyping.Mapping[str, BuildEnvironmentVariable]environmentVariablesMap<String, BuildEnvironmentVariable>EnvironmentVariablesIDictionary<string, BuildEnvironmentVariable>EnvironmentVariables*map[string]BuildEnvironmentVariable= No additional environment variab…#default
Default: No additional environment variables are specified.
fileSystemLocationsIFileSystemLocation[]file_system_locationstyping.List[IFileSystemLocation]fileSystemLocationsList<IFileSystemLocation>FileSystemLocationsIFileSystemLocation[]FileSystemLocations*[]IFileSystemLocation= 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.
grantReportGroupPermissionsbooleangrant_report_group_permissionsboolgrantReportGroupPermissionsBooleanGrantReportGroupPermissionsboolGrantReportGroupPermissions*bool= true#notes
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.
loggingLoggingOptionsloggingLoggingOptionsloggingLoggingOptionsLoggingLoggingOptionsLoggingLoggingOptions= no log configuration is set#A project can create logs in Amazon CloudWatch Logs, an S3 bucket, or both.
projectNamestringproject_namestrprojectNameStringProjectNamestringProjectName*string= Name is automatically generated.#queuedTimeoutDurationqueued_timeoutDurationqueuedTimeoutDurationQueuedTimeoutDurationQueuedTimeoutDuration= no queue timeout is set#For valid values, see the timeoutInMinutes field in the AWS CodeBuild User Guide.
securityGroupsISecurityGroup[]security_groupstyping.List[ISecurityGroup]securityGroupsList<ISecurityGroup>SecurityGroupsISecurityGroup[]SecurityGroups*[]ISecurityGroup= Security group will be automatic…#If no security group is identified, one will be created automatically.
Only used if 'vpc' is supplied.
default
Default: Security group will be automatically created.
ssmSessionPermissionsbooleanssm_session_permissionsboolssmSessionPermissionsBooleanSsmSessionPermissionsboolSsmSessionPermissions*bool= false#notes
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 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.
subnetSelectionSubnetSelectionsubnet_selectionSubnetSelectionsubnetSelectionSubnetSelectionSubnetSelectionSubnetSelectionSubnetSelectionSubnetSelection= private subnets if available els…#notes · default
To access AWS services, your CodeBuild project needs to be in one of the following types of subnets:
- Subnets with access to the internet (of type PRIVATE_WITH_EGRESS).
- Private subnets unconnected to the internet, but with VPC endpoints 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.
Default: private subnets if available else public subnets
For valid values, see the timeoutInMinutes field in the AWS CodeBuild User Guide.
visibilityProjectVisibilityvisibilityProjectVisibilityvisibilityProjectVisibilityVisibilityProjectVisibilityVisibilityProjectVisibility= no visibility is set#