Class PipelineProject
java.lang.Object
software.amazon.jsii.JsiiObject
software.constructs.Construct
software.amazon.awscdk.core.Construct
software.amazon.awscdk.core.Resource
software.amazon.awscdk.services.codebuild.Project
software.amazon.awscdk.services.codebuild.PipelineProject
- All Implemented Interfaces:
IConstruct
,IDependable
,IResource
,IProject
,INotificationRuleSource
,IConnectable
,IGrantable
,software.amazon.jsii.JsiiSerializable
,software.constructs.IConstruct
@Generated(value="jsii-pacmak/1.84.0 (build 5404dcf)",
date="2023-06-19T16:30:41.830Z")
@Stability(Stable)
public class PipelineProject
extends Project
A convenience class for CodeBuild Projects that are used in CodePipeline.
Example:
// 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();
-
Nested Class Summary
Nested classes/interfaces inherited from class software.amazon.jsii.JsiiObject
software.amazon.jsii.JsiiObject.InitializationMode
Nested classes/interfaces inherited from interface software.amazon.awscdk.core.IConstruct
IConstruct.Jsii$Default
Nested classes/interfaces inherited from interface software.constructs.IConstruct
software.constructs.IConstruct.Jsii$Default
Nested classes/interfaces inherited from interface software.amazon.awscdk.services.codebuild.IProject
IProject.Jsii$Default, IProject.Jsii$Proxy
Nested classes/interfaces inherited from interface software.amazon.awscdk.core.IResource
IResource.Jsii$Default
-
Constructor Summary
ModifierConstructorDescriptionprotected
PipelineProject
(software.amazon.jsii.JsiiObject.InitializationMode initializationMode) protected
PipelineProject
(software.amazon.jsii.JsiiObjectRef objRef) PipelineProject
(software.constructs.Construct scope, String id) PipelineProject
(software.constructs.Construct scope, String id, PipelineProjectProps props) -
Method Summary
Methods inherited from class software.amazon.awscdk.services.codebuild.Project
addFileSystemLocation, addSecondaryArtifact, addSecondarySource, addToRolePolicy, bindAsNotificationRuleSource, bindToCodePipeline, enableBatchBuilds, fromProjectArn, fromProjectName, getConnections, getGrantPrincipal, getProjectArn, getProjectName, getRole, metric, metric, metricBuilds, metricBuilds, metricDuration, metricDuration, metricFailedBuilds, metricFailedBuilds, metricSucceededBuilds, metricSucceededBuilds, notifyOn, notifyOnBuildFailed, notifyOnBuildFailed, notifyOnBuildSucceeded, notifyOnBuildSucceeded, onBuildFailed, onBuildFailed, onBuildStarted, onBuildStarted, onBuildSucceeded, onBuildSucceeded, onEvent, onEvent, onPhaseChange, onPhaseChange, onStateChange, onStateChange, serializeEnvVariables, serializeEnvVariables, serializeEnvVariables, validate
Methods inherited from class software.amazon.awscdk.core.Resource
applyRemovalPolicy, generatePhysicalName, getEnv, getPhysicalName, getResourceArnAttribute, getResourceNameAttribute, getStack, isResource
Methods inherited from class software.amazon.awscdk.core.Construct
getNode, isConstruct, onPrepare, onSynthesize, onValidate, prepare, synthesize
Methods inherited from class software.constructs.Construct
toString
Methods inherited from class software.amazon.jsii.JsiiObject
jsiiAsyncCall, jsiiAsyncCall, jsiiCall, jsiiCall, jsiiGet, jsiiGet, jsiiSet, jsiiStaticCall, jsiiStaticCall, jsiiStaticGet, jsiiStaticGet, jsiiStaticSet, jsiiStaticSet
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
Methods inherited from interface software.amazon.awscdk.core.IConstruct
getNode
Methods inherited from interface software.amazon.awscdk.core.IResource
applyRemovalPolicy, getEnv, getStack
Methods inherited from interface software.amazon.jsii.JsiiSerializable
$jsii$toJson
-
Constructor Details
-
PipelineProject
protected PipelineProject(software.amazon.jsii.JsiiObjectRef objRef) -
PipelineProject
protected PipelineProject(software.amazon.jsii.JsiiObject.InitializationMode initializationMode) -
PipelineProject
@Stability(Stable) public PipelineProject(@NotNull software.constructs.Construct scope, @NotNull String id, @Nullable PipelineProjectProps props) - Parameters:
scope
- This parameter is required.id
- This parameter is required.props
-
-
PipelineProject
@Stability(Stable) public PipelineProject(@NotNull software.constructs.Construct scope, @NotNull String id) - Parameters:
scope
- This parameter is required.id
- This parameter is required.
-