@Generated(value="jsii-pacmak/1.67.0 (build 2c027f5)", date="2022-09-19T20:26:37.524Z") @Stability(value=Stable) public interface CodeBuildActionProps extends software.amazon.jsii.JsiiSerializable, CommonAwsActionProps
CodeBuild build CodePipeline action.
Example:
// Example automatically generated from non-compiling source. May contain errors.
// Create a Cloudfront Web Distribution
import software.amazon.awscdk.services.cloudfront.*;
Distribution distribution;
// Create the build project that will invalidate the cache
PipelineProject invalidateBuildProject = PipelineProject.Builder.create(this, "InvalidateProject")
.buildSpec(BuildSpec.fromObject(Map.of(
"version", "0.2",
"phases", Map.of(
"build", Map.of(
"commands", List.of("aws cloudfront create-invalidation --distribution-id ${CLOUDFRONT_ID} --paths \"/*\""))))))
.environmentVariables(Map.of(
"CLOUDFRONT_ID", BuildEnvironmentVariable.builder().value(distribution.getDistributionId()).build()))
.build();
// Add Cloudfront invalidation permissions to the project
String distributionArn = String.format("arn:aws:cloudfront::%s:distribution/%s", this.account, distribution.getDistributionId());
invalidateBuildProject.addToRolePolicy(PolicyStatement.Builder.create()
.resources(List.of(distributionArn))
.actions(List.of("cloudfront:CreateInvalidation"))
.build());
// Create the pipeline (here only the S3 deploy and Invalidate cache build)
Bucket deployBucket = new Bucket(this, "DeployBucket");
Artifact deployInput = new Artifact();
Pipeline.Builder.create(this, "Pipeline")
.stages(List.of(StageProps.builder()
.stageName("Deploy")
.actions(List.of(
S3DeployAction.Builder.create()
.actionName("S3Deploy")
.bucket(deployBucket)
.input(deployInput)
.runOrder(1)
.build(),
CodeBuildAction.Builder.create()
.actionName("InvalidateCache")
.project(invalidateBuildProject)
.input(deployInput)
.runOrder(2)
.build()))
.build()))
.build();
| Modifier and Type | Interface and Description |
|---|---|
static class |
CodeBuildActionProps.Builder
A builder for
CodeBuildActionProps |
static class |
CodeBuildActionProps.Jsii$Proxy
An implementation for
CodeBuildActionProps |
| Modifier and Type | Method and Description |
|---|---|
static CodeBuildActionProps.Builder |
builder() |
default Boolean |
getCheckSecretsInPlainTextEnvVariables()
Whether to check for the presence of any secrets in the environment variables of the default type, BuildEnvironmentVariableType.PLAINTEXT.
|
default Boolean |
getCombineBatchBuildArtifacts()
Combine the build artifacts for a batch builds.
|
default Map<String,BuildEnvironmentVariable> |
getEnvironmentVariables()
The environment variables to pass to the CodeBuild project when this action executes.
|
default Boolean |
getExecuteBatchBuild()
Trigger a batch build.
|
default List<Artifact> |
getExtraInputs()
The list of additional input Artifacts for this action.
|
Artifact |
getInput()
The source to use as input for this action.
|
default List<Artifact> |
getOutputs()
The list of output Artifacts for this action.
|
IProject |
getProject()
The action's Project.
|
default CodeBuildActionType |
getType()
The type of the action that determines its CodePipeline Category - Build, or Test.
|
getRolegetActionName, getRunOrder, getVariablesNamespace@Stability(value=Stable) @NotNull Artifact getInput()
@Stability(value=Stable) @NotNull IProject getProject()
@Stability(value=Stable) @Nullable default Boolean getCheckSecretsInPlainTextEnvVariables()
Default: true
@Stability(value=Stable) @Nullable default Boolean getCombineBatchBuildArtifacts()
Enabling this will combine the build artifacts into the same location for batch builds.
If executeBatchBuild is not set to true, this property is ignored.
Default: false
@Stability(value=Stable) @Nullable default Map<String,BuildEnvironmentVariable> getEnvironmentVariables()
If a variable with the same name was set both on the project level, and here, this value will take precedence.
Default: - No additional environment variables are specified.
@Stability(value=Stable) @Nullable default Boolean getExecuteBatchBuild()
Enabling this will enable batch builds on the CodeBuild project.
Default: false
@Stability(value=Stable) @Nullable default List<Artifact> getExtraInputs()
The directories the additional inputs will be available at are available
during the project's build in the CODEBUILD_SRC_DIR_
@Stability(value=Stable) @Nullable default List<Artifact> getOutputs()
Note: if you specify more than one output Artifact here, you cannot use the primary 'artifacts' section of the buildspec; you have to use the 'secondary-artifacts' section instead. See https://docs.aws.amazon.com/codebuild/latest/userguide/sample-multi-in-out.html for details.
Default: the action will not have any outputs
@Stability(value=Stable) @Nullable default CodeBuildActionType getType()
Default: CodeBuildActionType.BUILD
@Stability(value=Stable) static CodeBuildActionProps.Builder builder()
builder in interface CommonActionPropsbuilder in interface CommonAwsActionPropsCodeBuildActionProps.Builder of CodeBuildActionPropsCopyright © 2022. All rights reserved.