Class CodeBuildStep
- All Implemented Interfaces:
- IFileSetProducer,- software.amazon.jsii.JsiiSerializable
 The BuildSpec must be available inline--it cannot reference a file
 on disk. If your current build instructions are in a file like
 buildspec.yml in your repository, extract them to a script
 (say, build.sh) and invoke that script as part of the build:
 
 CodeBuildStep.Builder.create("Synth")
         .commands(List.of("./build.sh"))
         .build();
 Example:
 CodePipeline pipeline = CodePipeline.Builder.create(this, "Pipeline")
         .synth(ShellStep.Builder.create("Synth")
                 .input(CodePipelineSource.connection("my-org/my-app", "main", ConnectionSourceOptions.builder()
                         .connectionArn("arn:aws:codestar-connections:us-east-1:222222222222:connection/7d2469ff-514a-4e4f-9003-5ca4a43cdc41")
                         .build()))
                 .commands(List.of("npm ci", "npm run build", "npx cdk synth"))
                 .build())
         // Turn this on because the pipeline uses Docker image assets
         .dockerEnabledForSelfMutation(true)
         .build();
 pipeline.addWave("MyWave", WaveOptions.builder()
         .post(List.of(
             CodeBuildStep.Builder.create("RunApproval")
                     .commands(List.of("command-from-image"))
                     .buildEnvironment(BuildEnvironment.builder()
                             // The user of a Docker image asset in the pipeline requires turning on
                             // 'dockerEnabledForSelfMutation'.
                             .buildImage(LinuxBuildImage.fromAsset(this, "Image", DockerImageAssetProps.builder()
                                     .directory("./docker-image")
                                     .build()))
                             .build())
                     .build()))
         .build());
 - 
Nested Class SummaryNested ClassesNested classes/interfaces inherited from class software.amazon.jsii.JsiiObjectsoftware.amazon.jsii.JsiiObject.InitializationModeNested classes/interfaces inherited from interface software.amazon.awscdk.pipelines.IFileSetProducerIFileSetProducer.Jsii$Default
- 
Constructor SummaryConstructorsModifierConstructorDescriptionCodeBuildStep(String id, CodeBuildStepProps props) protectedCodeBuildStep(software.amazon.jsii.JsiiObject.InitializationMode initializationMode) protectedCodeBuildStep(software.amazon.jsii.JsiiObjectRef objRef) 
- 
Method SummaryModifier and TypeMethodDescriptionexportedVariable(String variableName) Reference a CodePipeline variable defined by the CodeBuildStep.Custom execution role to be used for the Code Build Action.Build environment.getCache()Caching strategy to use.ProjectFileSystemLocation objects for CodeBuild build projects.The CodeBuild Project's principal.Information about logs for CodeBuild projects.Additional configuration that can only be configured via BuildSpec.CodeBuild Project generated for the pipeline.Name for the generated CodeBuild project.getRole()Custom execution role to be used for the CodeBuild project.Policy statements to add to role used during the synth.Which security group to associate with the script's project network interfaces.Which subnets to use.The number of minutes after which AWS CodeBuild stops the build if it's not complete.getVpc()The VPC where to execute the SimpleSynth.Methods inherited from class software.amazon.awscdk.pipelines.ShellStepaddOutputDirectory, getCommands, getConsumedStackOutputs, getEnv, getEnvFromCfnOutputs, getInputs, getInstallCommands, getOutputs, primaryOutputDirectoryMethods inherited from class software.amazon.awscdk.pipelines.StepaddDependencyFileSet, addStepDependency, configurePrimaryOutput, discoverReferencedOutputs, getDependencies, getDependencyFileSets, getId, getIsSource, getPrimaryOutput, sequence, toStringMethods inherited from class software.amazon.jsii.JsiiObjectjsiiAsyncCall, jsiiAsyncCall, jsiiCall, jsiiCall, jsiiGet, jsiiGet, jsiiSet, jsiiStaticCall, jsiiStaticCall, jsiiStaticGet, jsiiStaticGet, jsiiStaticSet, jsiiStaticSetMethods inherited from class java.lang.Objectclone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitMethods inherited from interface software.amazon.jsii.JsiiSerializable$jsii$toJson
- 
Constructor Details- 
CodeBuildStepprotected CodeBuildStep(software.amazon.jsii.JsiiObjectRef objRef) 
- 
CodeBuildStepprotected CodeBuildStep(software.amazon.jsii.JsiiObject.InitializationMode initializationMode) 
- 
CodeBuildStep- Parameters:
- id- Identifier for this step. This parameter is required.
- props- This parameter is required.
 
 
- 
- 
Method Details- 
exportedVariableReference a CodePipeline variable defined by the CodeBuildStep.The variable must be set in the shell of the CodeBuild step when it finishes its post_buildphase.Example: // Access the output of one CodeBuildStep in another CodeBuildStep CodePipeline pipeline; CodeBuildStep step1 = CodeBuildStep.Builder.create("Step1") .commands(List.of("export MY_VAR=hello")) .build(); CodeBuildStep step2 = CodeBuildStep.Builder.create("Step2") .env(Map.of( "IMPORTED_VAR", step1.exportedVariable("MY_VAR"))) .commands(List.of("echo $IMPORTED_VAR")) .build();- Parameters:
- variableName- the name of the variable for reference. This parameter is required.
 
- 
getGrantPrincipalThe CodeBuild Project's principal.
- 
getProjectCodeBuild Project generated for the pipeline.Will only be available after the pipeline has been built. 
- 
getActionRoleCustom execution role to be used for the Code Build Action.Default: - A role is automatically created 
- 
getBuildEnvironmentBuild environment.Default: - No value specified at construction time, use defaults 
- 
getCacheCaching strategy to use.Default: - No cache 
- 
getFileSystemLocationsProjectFileSystemLocation objects for CodeBuild build projects.A ProjectFileSystemLocation object specifies the identifier, location, mountOptions, mountPoint, and type of a file system created using Amazon Elastic File System. Default: - no file system locations 
- 
getLoggingInformation about logs for CodeBuild projects.A CodeBuilde project can create logs in Amazon CloudWatch Logs, an S3 bucket, or both. Default: - no log configuration is set 
- 
getPartialBuildSpecAdditional configuration that can only be configured via BuildSpec.Contains exported variables Default: - Contains the exported variables 
- 
getProjectNameName for the generated CodeBuild project.Default: - No value specified at construction time, use defaults 
- 
getRoleCustom execution role to be used for the CodeBuild project.Default: - No value specified at construction time, use defaults 
- 
getRolePolicyStatementsPolicy statements to add to role used during the synth.Default: - No value specified at construction time, use defaults 
- 
getSecurityGroupsWhich security group to associate with the script's project network interfaces.Default: - No value specified at construction time, use defaults 
- 
getSubnetSelectionWhich subnets to use.Default: - No value specified at construction time, use defaults 
- 
getTimeoutThe 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. Default: Duration.hours(1) 
- 
getVpcThe VPC where to execute the SimpleSynth.Default: - No value specified at construction time, use defaults 
 
-