Class: AWSCDK::CodeBuild::PipelineProject

Inherits:
Project
  • Object
show all
Defined in:
code_build/pipeline_project.rb

Overview

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

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(scope, id, props = nil) ⇒ PipelineProject

Returns a new instance of PipelineProject.

Parameters:



11
12
13
14
15
16
17
# File 'code_build/pipeline_project.rb', line 11

def initialize(scope, id, props = nil)
  props = props.is_a?(Hash) ? ::AWSCDK::CodeBuild::PipelineProjectProps.new(**props.transform_keys(&:to_sym)) : props
  Jsii::Type.check_type(scope, JSON.parse(Base64.strict_decode64("eyJmcW4iOiJjb25zdHJ1Y3RzLkNvbnN0cnVjdCJ9")), "scope")
  Jsii::Type.check_type(id, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJzdHJpbmcifQ==")), "id")
  Jsii::Type.check_type(props, JSON.parse(Base64.strict_decode64("eyJmcW4iOiJhd3MtY2RrLWxpYi5hd3NfY29kZWJ1aWxkLlBpcGVsaW5lUHJvamVjdFByb3BzIn0=")), "props") unless props.nil?
  Jsii::Object.instance_method(:initialize).bind(self).call(scope, id, props)
end

Class Method Details

.jsii_overridable_methodsObject



19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
# File 'code_build/pipeline_project.rb', line 19

def self.jsii_overridable_methods
  {
    :node => { kind: :property, name: "node", is_optional: false },
    :env => { kind: :property, name: "env", is_optional: false },
    :physical_name => { kind: :property, name: "physicalName", is_optional: false },
    :stack => { kind: :property, name: "stack", is_optional: false },
    :connections => { kind: :property, name: "connections", is_optional: false },
    :grant_principal => { kind: :property, name: "grantPrincipal", is_optional: false },
    :project_arn => { kind: :property, name: "projectArn", is_optional: false },
    :project_name => { kind: :property, name: "projectName", is_optional: false },
    :project_ref => { kind: :property, name: "projectRef", is_optional: false },
    :role => { kind: :property, name: "role", is_optional: true },
    :to_string => { kind: :method, name: "toString", is_optional: false },
    :with => { kind: :method, name: "with", is_optional: false },
    :apply_cross_stack_reference_strength => { kind: :method, name: "applyCrossStackReferenceStrength", is_optional: false },
    :apply_removal_policy => { kind: :method, name: "applyRemovalPolicy", is_optional: false },
    :generate_physical_name => { kind: :method, name: "generatePhysicalName", is_optional: false },
    :get_resource_arn_attribute => { kind: :method, name: "getResourceArnAttribute", is_optional: false },
    :get_resource_name_attribute => { kind: :method, name: "getResourceNameAttribute", is_optional: false },
    :add_file_system_location => { kind: :method, name: "addFileSystemLocation", is_optional: false },
    :add_secondary_artifact => { kind: :method, name: "addSecondaryArtifact", is_optional: false },
    :add_secondary_source => { kind: :method, name: "addSecondarySource", is_optional: false },
    :add_to_role_policy => { kind: :method, name: "addToRolePolicy", is_optional: false },
    :bind_as_notification_rule_source => { kind: :method, name: "bindAsNotificationRuleSource", is_optional: false },
    :bind_to_code_pipeline => { kind: :method, name: "bindToCodePipeline", is_optional: false },
    :enable_batch_builds => { kind: :method, name: "enableBatchBuilds", is_optional: false },
    :metric => { kind: :method, name: "metric", is_optional: false },
    :metric_builds => { kind: :method, name: "metricBuilds", is_optional: false },
    :metric_duration => { kind: :method, name: "metricDuration", is_optional: false },
    :metric_failed_builds => { kind: :method, name: "metricFailedBuilds", is_optional: false },
    :metric_succeeded_builds => { kind: :method, name: "metricSucceededBuilds", is_optional: false },
    :notify_on => { kind: :method, name: "notifyOn", is_optional: false },
    :notify_on_build_failed => { kind: :method, name: "notifyOnBuildFailed", is_optional: false },
    :notify_on_build_succeeded => { kind: :method, name: "notifyOnBuildSucceeded", is_optional: false },
    :on_build_failed => { kind: :method, name: "onBuildFailed", is_optional: false },
    :on_build_started => { kind: :method, name: "onBuildStarted", is_optional: false },
    :on_build_succeeded => { kind: :method, name: "onBuildSucceeded", is_optional: false },
    :on_event => { kind: :method, name: "onEvent", is_optional: false },
    :on_phase_change => { kind: :method, name: "onPhaseChange", is_optional: false },
    :on_state_change => { kind: :method, name: "onStateChange", is_optional: false },
  }
end

.PROPERTY_INJECTION_IDString

Uniquely identifies this class.

Returns:

  • (String)


108
109
110
# File 'code_build/pipeline_project.rb', line 108

def self.PROPERTY_INJECTION_ID()
  Jsii::Kernel.instance.get_static("aws-cdk-lib.aws_codebuild.PipelineProject", "PROPERTY_INJECTION_ID")
end

Instance Method Details

#add_file_system_location(file_system_location) ⇒ void

This method returns an undefined value.

Adds a fileSystemLocation to the Project.

Parameters:



250
251
252
253
# File 'code_build/pipeline_project.rb', line 250

def add_file_system_location(file_system_location)
  Jsii::Type.check_type(file_system_location, JSON.parse(Base64.strict_decode64("eyJmcW4iOiJhd3MtY2RrLWxpYi5hd3NfY29kZWJ1aWxkLklGaWxlU3lzdGVtTG9jYXRpb24ifQ==")), "fileSystemLocation")
  jsii_call_method("addFileSystemLocation", [file_system_location])
end

#add_secondary_artifact(secondary_artifact) ⇒ void

This method returns an undefined value.

Adds a secondary artifact to the Project.

Parameters:

See Also:



260
261
262
263
# File 'code_build/pipeline_project.rb', line 260

def add_secondary_artifact(secondary_artifact)
  Jsii::Type.check_type(secondary_artifact, JSON.parse(Base64.strict_decode64("eyJmcW4iOiJhd3MtY2RrLWxpYi5hd3NfY29kZWJ1aWxkLklBcnRpZmFjdHMifQ==")), "secondaryArtifact")
  jsii_call_method("addSecondaryArtifact", [secondary_artifact])
end

#add_secondary_source(secondary_source) ⇒ void

This method returns an undefined value.

Adds a secondary source to the Project.

Parameters:

See Also:



270
271
272
273
# File 'code_build/pipeline_project.rb', line 270

def add_secondary_source(secondary_source)
  Jsii::Type.check_type(secondary_source, JSON.parse(Base64.strict_decode64("eyJmcW4iOiJhd3MtY2RrLWxpYi5hd3NfY29kZWJ1aWxkLklTb3VyY2UifQ==")), "secondarySource")
  jsii_call_method("addSecondarySource", [secondary_source])
end

#add_to_role_policy(statement) ⇒ void

This method returns an undefined value.

Add a permission only if there's a policy attached.

Parameters:



279
280
281
282
# File 'code_build/pipeline_project.rb', line 279

def add_to_role_policy(statement)
  Jsii::Type.check_type(statement, JSON.parse(Base64.strict_decode64("eyJmcW4iOiJhd3MtY2RrLWxpYi5hd3NfaWFtLlBvbGljeVN0YXRlbWVudCJ9")), "statement")
  jsii_call_method("addToRolePolicy", [statement])
end

#apply_cross_stack_reference_strength(strength) ⇒ void

This method returns an undefined value.

Override the cross-stack reference strength for this resource.

When set, any cross-stack reference to this resource will use the specified mechanism instead of the global default determined by the @aws-cdk/core:defaultCrossStackReferences context key. This is useful for selectively weakening specific references to avoid the "deadly embrace" problem without changing the app-wide default.

Parameters:



189
190
191
192
# File 'code_build/pipeline_project.rb', line 189

def apply_cross_stack_reference_strength(strength)
  Jsii::Type.check_type(strength, JSON.parse(Base64.strict_decode64("eyJmcW4iOiJhd3MtY2RrLWxpYi5SZWZlcmVuY2VTdHJlbmd0aCJ9")), "strength")
  jsii_call_method("applyCrossStackReferenceStrength", [strength])
end

#apply_removal_policy(policy) ⇒ void

This method returns an undefined value.

Apply the given removal policy to this resource.

The Removal Policy controls what happens to this resource when it stops being managed by CloudFormation, either because you've removed it from the CDK application or because you've made a change that requires the resource to be replaced.

The resource can be deleted (RemovalPolicy.DESTROY), or left in your AWS account for data recovery and cleanup later (RemovalPolicy.RETAIN).

Parameters:



206
207
208
209
# File 'code_build/pipeline_project.rb', line 206

def apply_removal_policy(policy)
  Jsii::Type.check_type(policy, JSON.parse(Base64.strict_decode64("eyJmcW4iOiJhd3MtY2RrLWxpYi5SZW1vdmFsUG9saWN5In0=")), "policy")
  jsii_call_method("applyRemovalPolicy", [policy])
end

#bind_as_notification_rule_source(_scope) ⇒ AWSCDK::CodeStarNotifications::NotificationRuleSourceConfig

Returns a source configuration for notification rule.

Parameters:

  • _scope (Constructs::Construct)

Returns:



288
289
290
291
# File 'code_build/pipeline_project.rb', line 288

def bind_as_notification_rule_source(_scope)
  Jsii::Type.check_type(_scope, JSON.parse(Base64.strict_decode64("eyJmcW4iOiJjb25zdHJ1Y3RzLkNvbnN0cnVjdCJ9")), "_scope")
  jsii_call_method("bindAsNotificationRuleSource", [_scope])
end

#bind_to_code_pipeline(_scope, options) ⇒ void

This method returns an undefined value.

A callback invoked when the given project is added to a CodePipeline.

Parameters:



298
299
300
301
302
303
# File 'code_build/pipeline_project.rb', line 298

def bind_to_code_pipeline(_scope, options)
  Jsii::Type.check_type(_scope, JSON.parse(Base64.strict_decode64("eyJmcW4iOiJjb25zdHJ1Y3RzLkNvbnN0cnVjdCJ9")), "_scope")
  options = options.is_a?(Hash) ? ::AWSCDK::CodeBuild::BindToCodePipelineOptions.new(**options.transform_keys(&:to_sym)) : options
  Jsii::Type.check_type(options, JSON.parse(Base64.strict_decode64("eyJmcW4iOiJhd3MtY2RrLWxpYi5hd3NfY29kZWJ1aWxkLkJpbmRUb0NvZGVQaXBlbGluZU9wdGlvbnMifQ==")), "options")
  jsii_call_method("bindToCodePipeline", [_scope, options])
end

#connectionsAWSCDK::EC2::Connections

Access the Connections object.

Will fail if this Project does not have a VPC set.



117
118
119
# File 'code_build/pipeline_project.rb', line 117

def connections()
  jsii_get_property("connections")
end

#enable_batch_buildsAWSCDK::CodeBuild::BatchBuildConfig?

Enable batch builds.

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



311
312
313
# File 'code_build/pipeline_project.rb', line 311

def enable_batch_builds()
  jsii_call_method("enableBatchBuilds", [])
end

#envAWSCDK::Interfaces::ResourceEnvironment

The environment this resource belongs to.

For resources that are created and managed in a Stack (those created by creating new class instances like new Role(), new Bucket(), etc.), this is always the same as the environment of the stack they belong to.

For referenced resources (those obtained from referencing methods like Role.fromRoleArn(), Bucket.fromBucketName(), etc.), they might be different than the stack they were imported into.



80
81
82
# File 'code_build/pipeline_project.rb', line 80

def env()
  jsii_get_property("env")
end

#generate_physical_nameString

Returns:

  • (String)


212
213
214
# File 'code_build/pipeline_project.rb', line 212

def generate_physical_name()
  jsii_call_method("generatePhysicalName", [])
end

#get_resource_arn_attribute(arn_attr, arn_components) ⇒ String

Returns an environment-sensitive token that should be used for the resource's "ARN" attribute (e.g. bucket.bucketArn).

Normally, this token will resolve to arn_attr, but if the resource is referenced across environments, arn_components will be used to synthesize a concrete ARN with the resource's physical name. Make sure to reference this.physicalName in arn_components.

Parameters:

  • arn_attr (String)

    The CFN attribute which resolves to the ARN of the resource.

  • arn_components (AWSCDK::ARNComponents)

    The format of the ARN of this resource.

Returns:

  • (String)


226
227
228
229
230
231
# File 'code_build/pipeline_project.rb', line 226

def get_resource_arn_attribute(arn_attr, arn_components)
  Jsii::Type.check_type(arn_attr, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJzdHJpbmcifQ==")), "arnAttr")
  arn_components = arn_components.is_a?(Hash) ? ::AWSCDK::ARNComponents.new(**arn_components.transform_keys(&:to_sym)) : arn_components
  Jsii::Type.check_type(arn_components, JSON.parse(Base64.strict_decode64("eyJmcW4iOiJhd3MtY2RrLWxpYi5Bcm5Db21wb25lbnRzIn0=")), "arnComponents")
  jsii_call_method("getResourceArnAttribute", [arn_attr, arn_components])
end

#get_resource_name_attribute(name_attr) ⇒ String

Returns an environment-sensitive token that should be used for the resource's "name" attribute (e.g. bucket.bucketName).

Normally, this token will resolve to name_attr, but if the resource is referenced across environments, it will be resolved to this.physicalName, which will be a concrete name.

Parameters:

  • name_attr (String)

    The CFN attribute which resolves to the resource's name.

Returns:

  • (String)


241
242
243
244
# File 'code_build/pipeline_project.rb', line 241

def get_resource_name_attribute(name_attr)
  Jsii::Type.check_type(name_attr, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJzdHJpbmcifQ==")), "nameAttr")
  jsii_call_method("getResourceNameAttribute", [name_attr])
end

#grant_principalAWSCDK::IAM::IPrincipal

The principal to grant permissions to.



124
125
126
# File 'code_build/pipeline_project.rb', line 124

def grant_principal()
  jsii_get_property("grantPrincipal")
end

#metric(metric_name, props = nil) ⇒ AWSCDK::CloudWatch::Metric

Returns a CloudWatch metric associated with this build project.

Parameters:

Returns:



318
319
320
321
322
323
# File 'code_build/pipeline_project.rb', line 318

def metric(metric_name, props = nil)
  Jsii::Type.check_type(metric_name, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJzdHJpbmcifQ==")), "metricName")
  props = props.is_a?(Hash) ? ::AWSCDK::CloudWatch::MetricOptions.new(**props.transform_keys(&:to_sym)) : props
  Jsii::Type.check_type(props, JSON.parse(Base64.strict_decode64("eyJmcW4iOiJhd3MtY2RrLWxpYi5hd3NfY2xvdWR3YXRjaC5NZXRyaWNPcHRpb25zIn0=")), "props") unless props.nil?
  jsii_call_method("metric", [metric_name, props])
end

#metric_builds(props = nil) ⇒ AWSCDK::CloudWatch::Metric

Note:

Default: sum over 5 minutes

Measures the number of builds triggered.

Units: Count

Valid CloudWatch statistics: Sum

Parameters:

Returns:



334
335
336
337
338
# File 'code_build/pipeline_project.rb', line 334

def metric_builds(props = nil)
  props = props.is_a?(Hash) ? ::AWSCDK::CloudWatch::MetricOptions.new(**props.transform_keys(&:to_sym)) : props
  Jsii::Type.check_type(props, JSON.parse(Base64.strict_decode64("eyJmcW4iOiJhd3MtY2RrLWxpYi5hd3NfY2xvdWR3YXRjaC5NZXRyaWNPcHRpb25zIn0=")), "props") unless props.nil?
  jsii_call_method("metricBuilds", [props])
end

#metric_duration(props = nil) ⇒ AWSCDK::CloudWatch::Metric

Note:

Default: average over 5 minutes

Measures the duration of all builds over time.

Units: Seconds

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

Parameters:

Returns:



349
350
351
352
353
# File 'code_build/pipeline_project.rb', line 349

def metric_duration(props = nil)
  props = props.is_a?(Hash) ? ::AWSCDK::CloudWatch::MetricOptions.new(**props.transform_keys(&:to_sym)) : props
  Jsii::Type.check_type(props, JSON.parse(Base64.strict_decode64("eyJmcW4iOiJhd3MtY2RrLWxpYi5hd3NfY2xvdWR3YXRjaC5NZXRyaWNPcHRpb25zIn0=")), "props") unless props.nil?
  jsii_call_method("metricDuration", [props])
end

#metric_failed_builds(props = nil) ⇒ AWSCDK::CloudWatch::Metric

Note:

Default: sum over 5 minutes

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

Units: Count

Valid CloudWatch statistics: Sum

Parameters:

Returns:



364
365
366
367
368
# File 'code_build/pipeline_project.rb', line 364

def metric_failed_builds(props = nil)
  props = props.is_a?(Hash) ? ::AWSCDK::CloudWatch::MetricOptions.new(**props.transform_keys(&:to_sym)) : props
  Jsii::Type.check_type(props, JSON.parse(Base64.strict_decode64("eyJmcW4iOiJhd3MtY2RrLWxpYi5hd3NfY2xvdWR3YXRjaC5NZXRyaWNPcHRpb25zIn0=")), "props") unless props.nil?
  jsii_call_method("metricFailedBuilds", [props])
end

#metric_succeeded_builds(props = nil) ⇒ AWSCDK::CloudWatch::Metric

Note:

Default: sum over 5 minutes

Measures the number of successful builds.

Units: Count

Valid CloudWatch statistics: Sum

Parameters:

Returns:



379
380
381
382
383
# File 'code_build/pipeline_project.rb', line 379

def metric_succeeded_builds(props = nil)
  props = props.is_a?(Hash) ? ::AWSCDK::CloudWatch::MetricOptions.new(**props.transform_keys(&:to_sym)) : props
  Jsii::Type.check_type(props, JSON.parse(Base64.strict_decode64("eyJmcW4iOiJhd3MtY2RrLWxpYi5hd3NfY2xvdWR3YXRjaC5NZXRyaWNPcHRpb25zIn0=")), "props") unless props.nil?
  jsii_call_method("metricSucceededBuilds", [props])
end

#nodeConstructs::Node

The tree node.

Returns:

  • (Constructs::Node)


65
66
67
# File 'code_build/pipeline_project.rb', line 65

def node()
  jsii_get_property("node")
end

#notify_on(id, target, options) ⇒ AWSCDK::CodeStarNotifications::INotificationRule

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

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



394
395
396
397
398
399
400
# File 'code_build/pipeline_project.rb', line 394

def notify_on(id, target, options)
  Jsii::Type.check_type(id, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJzdHJpbmcifQ==")), "id")
  Jsii::Type.check_type(target, JSON.parse(Base64.strict_decode64("eyJmcW4iOiJhd3MtY2RrLWxpYi5hd3NfY29kZXN0YXJub3RpZmljYXRpb25zLklOb3RpZmljYXRpb25SdWxlVGFyZ2V0In0=")), "target")
  options = options.is_a?(Hash) ? ::AWSCDK::CodeBuild::ProjectNotifyOnOptions.new(**options.transform_keys(&:to_sym)) : options
  Jsii::Type.check_type(options, JSON.parse(Base64.strict_decode64("eyJmcW4iOiJhd3MtY2RrLWxpYi5hd3NfY29kZWJ1aWxkLlByb2plY3ROb3RpZnlPbk9wdGlvbnMifQ==")), "options")
  jsii_call_method("notifyOn", [id, target, options])
end

#notify_on_build_failed(id, target, options = nil) ⇒ AWSCDK::CodeStarNotifications::INotificationRule

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



408
409
410
411
412
413
414
# File 'code_build/pipeline_project.rb', line 408

def notify_on_build_failed(id, target, options = nil)
  Jsii::Type.check_type(id, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJzdHJpbmcifQ==")), "id")
  Jsii::Type.check_type(target, JSON.parse(Base64.strict_decode64("eyJmcW4iOiJhd3MtY2RrLWxpYi5hd3NfY29kZXN0YXJub3RpZmljYXRpb25zLklOb3RpZmljYXRpb25SdWxlVGFyZ2V0In0=")), "target")
  options = options.is_a?(Hash) ? ::AWSCDK::CodeStarNotifications::NotificationRuleOptions.new(**options.transform_keys(&:to_sym)) : options
  Jsii::Type.check_type(options, JSON.parse(Base64.strict_decode64("eyJmcW4iOiJhd3MtY2RrLWxpYi5hd3NfY29kZXN0YXJub3RpZmljYXRpb25zLk5vdGlmaWNhdGlvblJ1bGVPcHRpb25zIn0=")), "options") unless options.nil?
  jsii_call_method("notifyOnBuildFailed", [id, target, options])
end

#notify_on_build_succeeded(id, target, options = nil) ⇒ AWSCDK::CodeStarNotifications::INotificationRule

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



422
423
424
425
426
427
428
# File 'code_build/pipeline_project.rb', line 422

def notify_on_build_succeeded(id, target, options = nil)
  Jsii::Type.check_type(id, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJzdHJpbmcifQ==")), "id")
  Jsii::Type.check_type(target, JSON.parse(Base64.strict_decode64("eyJmcW4iOiJhd3MtY2RrLWxpYi5hd3NfY29kZXN0YXJub3RpZmljYXRpb25zLklOb3RpZmljYXRpb25SdWxlVGFyZ2V0In0=")), "target")
  options = options.is_a?(Hash) ? ::AWSCDK::CodeStarNotifications::NotificationRuleOptions.new(**options.transform_keys(&:to_sym)) : options
  Jsii::Type.check_type(options, JSON.parse(Base64.strict_decode64("eyJmcW4iOiJhd3MtY2RrLWxpYi5hd3NfY29kZXN0YXJub3RpZmljYXRpb25zLk5vdGlmaWNhdGlvblJ1bGVPcHRpb25zIn0=")), "options") unless options.nil?
  jsii_call_method("notifyOnBuildSucceeded", [id, target, options])
end

#on_build_failed(id, options = nil) ⇒ AWSCDK::Events::Rule

Defines an event rule which triggers when a build fails.

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

Parameters:

Returns:



438
439
440
441
442
443
# File 'code_build/pipeline_project.rb', line 438

def on_build_failed(id, options = nil)
  Jsii::Type.check_type(id, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJzdHJpbmcifQ==")), "id")
  options = options.is_a?(Hash) ? ::AWSCDK::Events::OnEventOptions.new(**options.transform_keys(&:to_sym)) : options
  Jsii::Type.check_type(options, JSON.parse(Base64.strict_decode64("eyJmcW4iOiJhd3MtY2RrLWxpYi5hd3NfZXZlbnRzLk9uRXZlbnRPcHRpb25zIn0=")), "options") unless options.nil?
  jsii_call_method("onBuildFailed", [id, options])
end

#on_build_started(id, options = nil) ⇒ AWSCDK::Events::Rule

Defines an event rule which triggers when a build starts.

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

Parameters:

Returns:



453
454
455
456
457
458
# File 'code_build/pipeline_project.rb', line 453

def on_build_started(id, options = nil)
  Jsii::Type.check_type(id, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJzdHJpbmcifQ==")), "id")
  options = options.is_a?(Hash) ? ::AWSCDK::Events::OnEventOptions.new(**options.transform_keys(&:to_sym)) : options
  Jsii::Type.check_type(options, JSON.parse(Base64.strict_decode64("eyJmcW4iOiJhd3MtY2RrLWxpYi5hd3NfZXZlbnRzLk9uRXZlbnRPcHRpb25zIn0=")), "options") unless options.nil?
  jsii_call_method("onBuildStarted", [id, options])
end

#on_build_succeeded(id, options = nil) ⇒ AWSCDK::Events::Rule

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

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

Parameters:

Returns:



468
469
470
471
472
473
# File 'code_build/pipeline_project.rb', line 468

def on_build_succeeded(id, options = nil)
  Jsii::Type.check_type(id, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJzdHJpbmcifQ==")), "id")
  options = options.is_a?(Hash) ? ::AWSCDK::Events::OnEventOptions.new(**options.transform_keys(&:to_sym)) : options
  Jsii::Type.check_type(options, JSON.parse(Base64.strict_decode64("eyJmcW4iOiJhd3MtY2RrLWxpYi5hd3NfZXZlbnRzLk9uRXZlbnRPcHRpb25zIn0=")), "options") unless options.nil?
  jsii_call_method("onBuildSucceeded", [id, options])
end

#on_event(id, options = nil) ⇒ AWSCDK::Events::Rule

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



481
482
483
484
485
486
# File 'code_build/pipeline_project.rb', line 481

def on_event(id, options = nil)
  Jsii::Type.check_type(id, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJzdHJpbmcifQ==")), "id")
  options = options.is_a?(Hash) ? ::AWSCDK::Events::OnEventOptions.new(**options.transform_keys(&:to_sym)) : options
  Jsii::Type.check_type(options, JSON.parse(Base64.strict_decode64("eyJmcW4iOiJhd3MtY2RrLWxpYi5hd3NfZXZlbnRzLk9uRXZlbnRPcHRpb25zIn0=")), "options") unless options.nil?
  jsii_call_method("onEvent", [id, options])
end

#on_phase_change(id, options = nil) ⇒ AWSCDK::Events::Rule

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



494
495
496
497
498
499
# File 'code_build/pipeline_project.rb', line 494

def on_phase_change(id, options = nil)
  Jsii::Type.check_type(id, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJzdHJpbmcifQ==")), "id")
  options = options.is_a?(Hash) ? ::AWSCDK::Events::OnEventOptions.new(**options.transform_keys(&:to_sym)) : options
  Jsii::Type.check_type(options, JSON.parse(Base64.strict_decode64("eyJmcW4iOiJhd3MtY2RrLWxpYi5hd3NfZXZlbnRzLk9uRXZlbnRPcHRpb25zIn0=")), "options") unless options.nil?
  jsii_call_method("onPhaseChange", [id, options])
end

#on_state_change(id, options = nil) ⇒ AWSCDK::Events::Rule

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

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 on_build_failed and on_build_succeeded 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.



528
529
530
531
532
533
# File 'code_build/pipeline_project.rb', line 528

def on_state_change(id, options = nil)
  Jsii::Type.check_type(id, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJzdHJpbmcifQ==")), "id")
  options = options.is_a?(Hash) ? ::AWSCDK::Events::OnEventOptions.new(**options.transform_keys(&:to_sym)) : options
  Jsii::Type.check_type(options, JSON.parse(Base64.strict_decode64("eyJmcW4iOiJhd3MtY2RrLWxpYi5hd3NfZXZlbnRzLk9uRXZlbnRPcHRpb25zIn0=")), "options") unless options.nil?
  jsii_call_method("onStateChange", [id, options])
end

#physical_nameString

Returns a string-encoded token that resolves to the physical name that should be passed to the CloudFormation resource.

This value will resolve to one of the following:

  • a concrete value (e.g. "my-awesome-bucket")
  • undefined, when a name should be generated by CloudFormation
  • a concrete name generated automatically during synthesis, in cross-environment scenarios.

Returns:

  • (String)


94
95
96
# File 'code_build/pipeline_project.rb', line 94

def physical_name()
  jsii_get_property("physicalName")
end

#project_arnString

The ARN of the project.

Returns:

  • (String)


131
132
133
# File 'code_build/pipeline_project.rb', line 131

def project_arn()
  jsii_get_property("projectArn")
end

#project_nameString

The name of the project.

Returns:

  • (String)


138
139
140
# File 'code_build/pipeline_project.rb', line 138

def project_name()
  jsii_get_property("projectName")
end

#project_refAWSCDK::Interfaces::AWSCodebuild::ProjectReference

A reference to a Project resource.



145
146
147
# File 'code_build/pipeline_project.rb', line 145

def project_ref()
  jsii_get_property("projectRef")
end

#roleAWSCDK::IAM::IRole?

The IAM role for this project.

Returns:



152
153
154
# File 'code_build/pipeline_project.rb', line 152

def role()
  jsii_get_property("role")
end

#stackAWSCDK::Stack

The stack in which this resource is defined.

Returns:



101
102
103
# File 'code_build/pipeline_project.rb', line 101

def stack()
  jsii_get_property("stack")
end

#to_stringString

Returns a string representation of this construct.

Returns:

  • (String)


159
160
161
# File 'code_build/pipeline_project.rb', line 159

def to_string()
  jsii_call_method("toString", [])
end

#with(*mixins) ⇒ Constructs::IConstruct

Applies one or more mixins to this construct.

Mixins are applied in order. The list of constructs is captured at the start of the call, so constructs added by a mixin will not be visited. Use multiple with() calls if subsequent mixins should apply to added constructs.

Parameters:

  • mixins (Array<Constructs::IMixin>)

Returns:

  • (Constructs::IConstruct)


172
173
174
175
176
177
# File 'code_build/pipeline_project.rb', line 172

def with(*mixins)
  mixins.each_with_index do |item, index|
    Jsii::Type.check_type(item, JSON.parse(Base64.strict_decode64("eyJmcW4iOiJjb25zdHJ1Y3RzLklNaXhpbiJ9")), "mixins[#{index}]")
  end
  jsii_call_method("with", [*mixins])
end