Module: AWSCDK::Codepipeline::IPipeline

Includes:
AWSCDK::CodeStarNotifications::INotificationRuleSource, IResource, Interfaces::AWSCodepipeline::IPipelineRef
Included in:
Pipeline
Defined in:
codepipeline/i_pipeline.rb

Overview

The abstract view of an AWS CodePipeline as required and used by Actions.

It extends events.IRuleTarget, so this interface can be used as a Target for CloudWatch Events.

Class Method Summary collapse

Instance Method Summary collapse

Class Method Details

.jsii_overridable_methodsObject



205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
# File 'codepipeline/i_pipeline.rb', line 205

def self.jsii_overridable_methods
  {
    :node => { kind: :property, name: "node", is_optional: false },
    :env => { kind: :property, name: "env", is_optional: false },
    :stack => { kind: :property, name: "stack", is_optional: false },
    :pipeline_ref => { kind: :property, name: "pipelineRef", is_optional: false },
    :pipeline_arn => { kind: :property, name: "pipelineArn", is_optional: false },
    :pipeline_name => { kind: :property, name: "pipelineName", is_optional: false },
    :with => { kind: :method, name: "with", is_optional: false },
    :apply_removal_policy => { kind: :method, name: "applyRemovalPolicy", is_optional: false },
    :bind_as_notification_rule_source => { kind: :method, name: "bindAsNotificationRuleSource", is_optional: false },
    :notify_on => { kind: :method, name: "notifyOn", is_optional: false },
    :notify_on_any_action_state_change => { kind: :method, name: "notifyOnAnyActionStateChange", is_optional: false },
    :notify_on_any_manual_approval_state_change => { kind: :method, name: "notifyOnAnyManualApprovalStateChange", is_optional: false },
    :notify_on_any_stage_state_change => { kind: :method, name: "notifyOnAnyStageStateChange", is_optional: false },
    :notify_on_execution_state_change => { kind: :method, name: "notifyOnExecutionStateChange", is_optional: false },
    :on_event => { kind: :method, name: "onEvent", is_optional: false },
    :on_state_change => { kind: :method, name: "onStateChange", is_optional: false },
  }
end

Instance Method Details

#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:



89
90
91
92
# File 'codepipeline/i_pipeline.rb', line 89

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:



98
99
100
101
# File 'codepipeline/i_pipeline.rb', line 98

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

#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.



31
32
33
# File 'codepipeline/i_pipeline.rb', line 31

def env()
  jsii_get_property("env")
end

#nodeConstructs::Node

The tree node.

Returns:

  • (Constructs::Node)


16
17
18
# File 'codepipeline/i_pipeline.rb', line 16

def node()
  jsii_get_property("node")
end

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

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

You can also use the methods notify_on_execution_state_change, notify_on_any_stage_state_change, notify_on_any_action_state_change and notify_on_any_manual_approval_state_change to define rules for these specific event emitted.

Parameters:

Returns:



113
114
115
116
117
118
119
# File 'codepipeline/i_pipeline.rb', line 113

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::Codepipeline::PipelineNotifyOnOptions.new(**options.transform_keys(&:to_sym)) : options
  Jsii::Type.check_type(options, JSON.parse(Base64.strict_decode64("eyJmcW4iOiJhd3MtY2RrLWxpYi5hd3NfY29kZXBpcGVsaW5lLlBpcGVsaW5lTm90aWZ5T25PcHRpb25zIn0=")), "options")
  jsii_call_method("notifyOn", [id, target, options])
end

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

Define an notification rule triggered by the set of the "Action execution" events emitted from this pipeline.

Parameters:

Returns:

See Also:



128
129
130
131
132
133
134
# File 'codepipeline/i_pipeline.rb', line 128

def notify_on_any_action_state_change(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("notifyOnAnyActionStateChange", [id, target, options])
end

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

Define an notification rule triggered by the set of the "Manual approval" events emitted from this pipeline.

Parameters:

Returns:

See Also:



143
144
145
146
147
148
149
# File 'codepipeline/i_pipeline.rb', line 143

def notify_on_any_manual_approval_state_change(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("notifyOnAnyManualApprovalStateChange", [id, target, options])
end

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

Define an notification rule triggered by the set of the "Stage execution" events emitted from this pipeline.

Parameters:

Returns:

See Also:



158
159
160
161
162
163
164
# File 'codepipeline/i_pipeline.rb', line 158

def notify_on_any_stage_state_change(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("notifyOnAnyStageStateChange", [id, target, options])
end

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

Define an notification rule triggered by the set of the "Pipeline execution" events emitted from this pipeline.

Parameters:

Returns:

See Also:



173
174
175
176
177
178
179
# File 'codepipeline/i_pipeline.rb', line 173

def notify_on_execution_state_change(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("notifyOnExecutionStateChange", [id, target, options])
end

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

Define an event rule triggered by this CodePipeline.

Parameters:

  • id (String)

    Identifier for this event handler.

  • options (AWSCDK::Events::OnEventOptions, nil) (defaults to: nil)

    Additional options to pass to the event rule.

Returns:



186
187
188
189
190
191
# File 'codepipeline/i_pipeline.rb', line 186

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_state_change(id, options = nil) ⇒ AWSCDK::Events::Rule

Define an event rule triggered by the "CodePipeline Pipeline Execution State Change" event emitted from this pipeline.

Parameters:

  • id (String)

    Identifier for this event handler.

  • options (AWSCDK::Events::OnEventOptions, nil) (defaults to: nil)

    Additional options to pass to the event rule.

Returns:



198
199
200
201
202
203
# File 'codepipeline/i_pipeline.rb', line 198

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

#pipeline_arnString

The ARN of the Pipeline.

Returns:

  • (String)


52
53
54
# File 'codepipeline/i_pipeline.rb', line 52

def pipeline_arn()
  jsii_get_property("pipelineArn")
end

#pipeline_nameString

The name of the Pipeline.

Returns:

  • (String)


59
60
61
# File 'codepipeline/i_pipeline.rb', line 59

def pipeline_name()
  jsii_get_property("pipelineName")
end

#pipeline_refAWSCDK::Interfaces::AWSCodepipeline::PipelineReference

A reference to a Pipeline resource.



45
46
47
# File 'codepipeline/i_pipeline.rb', line 45

def pipeline_ref()
  jsii_get_property("pipelineRef")
end

#stackAWSCDK::Stack

The stack in which this resource is defined.

Returns:



38
39
40
# File 'codepipeline/i_pipeline.rb', line 38

def stack()
  jsii_get_property("stack")
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.

Parameters:

  • mixins (Array<Constructs::IMixin>)

    The mixins to apply.

Returns:

  • (Constructs::IConstruct)

    This construct for chaining



70
71
72
73
74
75
# File 'codepipeline/i_pipeline.rb', line 70

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