Show / Hide Table of Contents

Class PipelineProject

A convenience class for CodeBuild Projects that are used in CodePipeline.

Inheritance
System.Object
Construct
Resource
Project
PipelineProject
Implements
IProject
IResource
IConstruct
Constructs.IConstruct
IDependable
IGrantable
IConnectable
INotificationRuleSource
Inherited Members
Project.FromProjectArn(Construct, String, String)
Project.FromProjectName(Construct, String, String)
Project.SerializeEnvVariables(IDictionary<String, IBuildEnvironmentVariable>, Nullable<Boolean>, IGrantable)
Project.AddFileSystemLocation(IFileSystemLocation)
Project.AddSecondaryArtifact(IArtifacts)
Project.AddSecondarySource(ISource)
Project.AddToRolePolicy(PolicyStatement)
Project.BindAsNotificationRuleSource(Construct)
Project.BindToCodePipeline(Construct, IBindToCodePipelineOptions)
Project.EnableBatchBuilds()
Project.Metric(String, IMetricOptions)
Project.MetricBuilds(IMetricOptions)
Project.MetricDuration(IMetricOptions)
Project.MetricFailedBuilds(IMetricOptions)
Project.MetricSucceededBuilds(IMetricOptions)
Project.NotifyOn(String, INotificationRuleTarget, IProjectNotifyOnOptions)
Project.NotifyOnBuildFailed(String, INotificationRuleTarget, INotificationRuleOptions)
Project.NotifyOnBuildSucceeded(String, INotificationRuleTarget, INotificationRuleOptions)
Project.OnBuildFailed(String, IOnEventOptions)
Project.OnBuildStarted(String, IOnEventOptions)
Project.OnBuildSucceeded(String, IOnEventOptions)
Project.OnEvent(String, IOnEventOptions)
Project.OnPhaseChange(String, IOnEventOptions)
Project.OnStateChange(String, IOnEventOptions)
Project.Validate()
Project.Connections
Project.GrantPrincipal
Project.ProjectArn
Project.ProjectName
Project.Role
Resource.IsResource(IConstruct)
Resource.ApplyRemovalPolicy(RemovalPolicy)
Resource.GeneratePhysicalName()
Resource.GetResourceArnAttribute(String, IArnComponents)
Resource.GetResourceNameAttribute(String)
Resource.Env
Resource.PhysicalName
Resource.Stack
Construct.IsConstruct(Object)
Construct.OnPrepare()
Construct.OnSynthesize(ISynthesisSession)
Construct.OnValidate()
Construct.Prepare()
Construct.Synthesize(ISynthesisSession)
Construct.Node
Namespace: Amazon.CDK.AWS.CodeBuild
Assembly: Amazon.CDK.AWS.CodeBuild.dll
Syntax (csharp)
public class PipelineProject : Project, IProject, IResource, IConstruct, IDependable, IGrantable, IConnectable, INotificationRuleSource
Syntax (vb)
Public Class PipelineProject
    Inherits Project
    Implements IProject, IResource, IConstruct, IDependable, IGrantable, IConnectable, INotificationRuleSource
Remarks

ExampleMetadata: infused

Examples
// Create a Cloudfront Web Distribution
using Amazon.CDK.AWS.CloudFront;
Distribution distribution;


// Create the build project that will invalidate the cache
var invalidateBuildProject = new PipelineProject(this, "InvalidateProject", new PipelineProjectProps {
    BuildSpec = BuildSpec.FromObject(new Dictionary<string, object> {
        { "version", "0.2" },
        { "phases", new Dictionary<string, IDictionary<string, string[]>> {
            { "build", new Struct {
                Commands = new [] { "aws cloudfront create-invalidation --distribution-id ${CLOUDFRONT_ID} --paths \"/*\"" }
            } }
        } }
    }),
    EnvironmentVariables = new Dictionary<string, BuildEnvironmentVariable> {
        { "CLOUDFRONT_ID", new BuildEnvironmentVariable { Value = distribution.DistributionId } }
    }
});

// Add Cloudfront invalidation permissions to the project
var distributionArn = $"arn:aws:cloudfront::{this.account}:distribution/{distribution.distributionId}";
invalidateBuildProject.AddToRolePolicy(new PolicyStatement(new PolicyStatementProps {
    Resources = new [] { distributionArn },
    Actions = new [] { "cloudfront:CreateInvalidation" }
}));

// Create the pipeline (here only the S3 deploy and Invalidate cache build)
var deployBucket = new Bucket(this, "DeployBucket");
var deployInput = new Artifact();
new Pipeline(this, "Pipeline", new PipelineProps {
    Stages = new [] { new StageProps {
        StageName = "Deploy",
        Actions = new [] {
            new S3DeployAction(new S3DeployActionProps {
                ActionName = "S3Deploy",
                Bucket = deployBucket,
                Input = deployInput,
                RunOrder = 1
            }),
            new CodeBuildAction(new CodeBuildActionProps {
                ActionName = "InvalidateCache",
                Project = invalidateBuildProject,
                Input = deployInput,
                RunOrder = 2
            }) }
    } }
});

Synopsis

Constructors

PipelineProject(ByRefValue)

Used by jsii to construct an instance of this class from a Javascript-owned object reference

PipelineProject(DeputyBase.DeputyProps)

Used by jsii to construct an instance of this class from DeputyProps

PipelineProject(Construct, String, IPipelineProjectProps)

Constructors

PipelineProject(ByRefValue)

Used by jsii to construct an instance of this class from a Javascript-owned object reference

protected PipelineProject(ByRefValue reference)
Parameters
reference Amazon.JSII.Runtime.Deputy.ByRefValue

The Javascript-owned object reference

PipelineProject(DeputyBase.DeputyProps)

Used by jsii to construct an instance of this class from DeputyProps

protected PipelineProject(DeputyBase.DeputyProps props)
Parameters
props Amazon.JSII.Runtime.Deputy.DeputyBase.DeputyProps

The deputy props

PipelineProject(Construct, String, IPipelineProjectProps)

public PipelineProject(Construct scope, string id, IPipelineProjectProps props = null)
Parameters
scope Constructs.Construct
id System.String
props IPipelineProjectProps

Implements

IProject
IResource
IConstruct
Constructs.IConstruct
IDependable
IGrantable
IConnectable
INotificationRuleSource
Back to top Generated by DocFX