Show / Hide Table of Contents

Interface IProject

Inherited Members
IResource.ApplyRemovalPolicy(RemovalPolicy)
IResource.Stack
IGrantable.GrantPrincipal
IConnectable.Connections
INotificationRuleSource.BindAsNotificationRuleSource(Construct)
IProjectRef.ProjectRef
IEnvironmentAware.Env
Namespace: Amazon.CDK.AWS.CodeBuild
Assembly: Amazon.CDK.Lib.dll
Syntax (csharp)
public interface IProject : IResource, IGrantable, IConnectable, INotificationRuleSource, IProjectRef, IConstruct, IDependable, IEnvironmentAware
Syntax (vb)
Public Interface IProject Inherits IResource, IGrantable, IConnectable, INotificationRuleSource, IProjectRef, IConstruct, IDependable, IEnvironmentAware

Synopsis

Properties

ProjectArn

The ARN of this Project.

ProjectName

The human-visible name of this Project.

Role

The IAM service Role of this Project.

Methods

AddToRolePolicy(PolicyStatement)
EnableBatchBuilds()

Enable batch builds.

Metric(string, IMetricOptions?)
MetricBuilds(IMetricOptions?)

Measures the number of builds triggered.

MetricDuration(IMetricOptions?)

Measures the duration of all builds over time.

MetricFailedBuilds(IMetricOptions?)

Measures the number of builds that failed because of client error or because of a timeout.

MetricSucceededBuilds(IMetricOptions?)

Measures the number of successful builds.

NotifyOn(string, INotificationRuleTarget, IProjectNotifyOnOptions)

Defines a CodeStar Notification rule triggered when the project events emitted by you specified, it very similar to onEvent API.

NotifyOnBuildFailed(string, INotificationRuleTarget, INotificationRuleOptions?)

Defines a CodeStar notification rule which triggers when a build fails.

NotifyOnBuildSucceeded(string, INotificationRuleTarget, INotificationRuleOptions?)

Defines a CodeStar notification rule which triggers when a build completes successfully.

OnBuildFailed(string, IOnEventOptions?)

Defines an event rule which triggers when a build fails.

OnBuildStarted(string, IOnEventOptions?)

Defines an event rule which triggers when a build starts.

OnBuildSucceeded(string, IOnEventOptions?)

Defines an event rule which triggers when a build completes successfully.

OnEvent(string, IOnEventOptions?)

Defines a CloudWatch event rule triggered when something happens with this project.

OnPhaseChange(string, IOnEventOptions?)

Defines a CloudWatch event rule that triggers upon phase change of this build project.

OnStateChange(string, IOnEventOptions?)

Defines a CloudWatch event rule triggered when the build project state changes.

Properties

ProjectArn

The ARN of this Project.

string ProjectArn { get; }
Property Value

string

Remarks

Attribute: true

ProjectName

The human-visible name of this Project.

string ProjectName { get; }
Property Value

string

Remarks

Attribute: true

Role

The IAM service Role of this Project.

IRole? Role { get; }
Property Value

IRole

Remarks

Undefined for imported Projects.

Methods

AddToRolePolicy(PolicyStatement)

void AddToRolePolicy(PolicyStatement policyStatement)
Parameters
policyStatement PolicyStatement

EnableBatchBuilds()

Enable batch builds.

IBatchBuildConfig? EnableBatchBuilds()
Returns

IBatchBuildConfig

Remarks

Returns an object contining the batch service role if batch builds could be enabled.

Metric(string, IMetricOptions?)

Metric Metric(string metricName, IMetricOptions? props = null)
Parameters
metricName string

The name of the metric.

props IMetricOptions

Customization properties.

Returns

Metric

a CloudWatch metric associated with this build project.

MetricBuilds(IMetricOptions?)

Measures the number of builds triggered.

Metric MetricBuilds(IMetricOptions? props = null)
Parameters
props IMetricOptions
Returns

Metric

Remarks

Units: Count

Valid CloudWatch statistics: Sum

Default: sum over 5 minutes

MetricDuration(IMetricOptions?)

Measures the duration of all builds over time.

Metric MetricDuration(IMetricOptions? props = null)
Parameters
props IMetricOptions
Returns

Metric

Remarks

Units: Seconds

Valid CloudWatch statistics: Average (recommended), Maximum, Minimum

Default: average over 5 minutes

MetricFailedBuilds(IMetricOptions?)

Measures the number of builds that failed because of client error or because of a timeout.

Metric MetricFailedBuilds(IMetricOptions? props = null)
Parameters
props IMetricOptions
Returns

Metric

Remarks

Units: Count

Valid CloudWatch statistics: Sum

Default: sum over 5 minutes

MetricSucceededBuilds(IMetricOptions?)

Measures the number of successful builds.

Metric MetricSucceededBuilds(IMetricOptions? props = null)
Parameters
props IMetricOptions
Returns

Metric

Remarks

Units: Count

Valid CloudWatch statistics: Sum

Default: sum over 5 minutes

NotifyOn(string, INotificationRuleTarget, IProjectNotifyOnOptions)

Defines a CodeStar Notification rule triggered when the project events emitted by you specified, it very similar to onEvent API.

INotificationRule NotifyOn(string id, INotificationRuleTarget target, IProjectNotifyOnOptions options)
Parameters
id string

The logical identifier of the CodeStar Notifications rule that will be created.

target INotificationRuleTarget

The target to register for the CodeStar Notifications destination.

options IProjectNotifyOnOptions

Customization options for CodeStar Notifications rule.

Returns

INotificationRule

CodeStar Notifications rule associated with this build project.

Remarks

You can also use the methods notifyOnBuildSucceeded and notifyOnBuildFailed to define rules for these specific event emitted.

NotifyOnBuildFailed(string, INotificationRuleTarget, INotificationRuleOptions?)

Defines a CodeStar notification rule which triggers when a build fails.

INotificationRule NotifyOnBuildFailed(string id, INotificationRuleTarget target, INotificationRuleOptions? options = null)
Parameters
id string
target INotificationRuleTarget
options INotificationRuleOptions
Returns

INotificationRule

NotifyOnBuildSucceeded(string, INotificationRuleTarget, INotificationRuleOptions?)

Defines a CodeStar notification rule which triggers when a build completes successfully.

INotificationRule NotifyOnBuildSucceeded(string id, INotificationRuleTarget target, INotificationRuleOptions? options = null)
Parameters
id string
target INotificationRuleTarget
options INotificationRuleOptions
Returns

INotificationRule

OnBuildFailed(string, IOnEventOptions?)

Defines an event rule which triggers when a build fails.

Rule OnBuildFailed(string id, IOnEventOptions? options = null)
Parameters
id string
options IOnEventOptions
Returns

Rule

OnBuildStarted(string, IOnEventOptions?)

Defines an event rule which triggers when a build starts.

Rule OnBuildStarted(string id, IOnEventOptions? options = null)
Parameters
id string
options IOnEventOptions
Returns

Rule

OnBuildSucceeded(string, IOnEventOptions?)

Defines an event rule which triggers when a build completes successfully.

Rule OnBuildSucceeded(string id, IOnEventOptions? options = null)
Parameters
id string
options IOnEventOptions
Returns

Rule

OnEvent(string, IOnEventOptions?)

Defines a CloudWatch event rule triggered when something happens with this project.

Rule OnEvent(string id, IOnEventOptions? options = null)
Parameters
id string
options IOnEventOptions
Returns

Rule

Remarks

See: https://docs.aws.amazon.com/codebuild/latest/userguide/sample-build-notifications.html

OnPhaseChange(string, IOnEventOptions?)

Defines a CloudWatch event rule that triggers upon phase change of this build project.

Rule OnPhaseChange(string id, IOnEventOptions? options = null)
Parameters
id string
options IOnEventOptions
Returns

Rule

Remarks

See: https://docs.aws.amazon.com/codebuild/latest/userguide/sample-build-notifications.html

OnStateChange(string, IOnEventOptions?)

Defines a CloudWatch event rule triggered when the build project state changes.

Rule OnStateChange(string id, IOnEventOptions? options = null)
Parameters
id string
options IOnEventOptions
Returns

Rule

Remarks

You can filter specific build status events using an event pattern filter on the build-status detail field:

const rule = project.onStateChange('OnBuildStarted', { target }); rule.addEventPattern({ detail: { 'build-status': [ "IN_PROGRESS", "SUCCEEDED", "FAILED", "STOPPED" ] } });

You can also use the methods onBuildFailed and onBuildSucceeded to define rules for these specific state changes.

To access fields from the event in the event target input, use the static fields on the StateChangeEvent class.

See: https://docs.aws.amazon.com/codebuild/latest/userguide/sample-build-notifications.html

Back to top Generated by DocFX