Class: AWSCDK::CodePipelineActions::CodeCommitSourceActionProps

Inherits:
AWSCDK::Codepipeline::CommonAWSActionProps
  • Object
show all
Defined in:
code_pipeline_actions/code_commit_source_action_props.rb

Overview

Construction properties of the CodeCommitSourceAction CodeCommit source CodePipeline Action.

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(action_name:, run_order: nil, variables_namespace: nil, role: nil, output:, repository:, branch: nil, code_build_clone_output: nil, custom_event_rule: nil, event_role: nil, trigger: nil) ⇒ CodeCommitSourceActionProps

Returns a new instance of CodeCommitSourceActionProps.

Parameters:

  • action_name (String)

    The physical, human-readable name of the Action.

  • run_order (Numeric, nil) (defaults to: nil)

    The runOrder property for this Action.

  • variables_namespace (String, nil) (defaults to: nil)

    The name of the namespace to use for variables emitted by this action.

  • role (AWSCDK::IAM::IRole, nil) (defaults to: nil)

    The Role in which context's this Action will be executing in.

  • output (AWSCDK::Codepipeline::Artifact)
  • repository (AWSCDK::Codecommit::IRepository)

    The CodeCommit repository.

  • branch (String, nil) (defaults to: nil)
  • code_build_clone_output (Boolean, nil) (defaults to: nil)

    Whether the output should be the contents of the repository (which is the default), or a link that allows CodeBuild to clone the repository before building.

  • custom_event_rule (AWSCDK::CodePipelineActions::ICustomEventRule, nil) (defaults to: nil)

    You can pass a customEventRule to set up a custom event rule for the CodeCommit source action.

  • event_role (AWSCDK::IAM::IRole, nil) (defaults to: nil)

    Role to be used by on commit event rule.

  • trigger (AWSCDK::CodePipelineActions::CodeCommitTrigger, nil) (defaults to: nil)

    How should CodePipeline detect source changes for this Action.



18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
# File 'code_pipeline_actions/code_commit_source_action_props.rb', line 18

def initialize(action_name:, run_order: nil, variables_namespace: nil, role: nil, output:, repository:, branch: nil, code_build_clone_output: nil, custom_event_rule: nil, event_role: nil, trigger: nil)
  @action_name = action_name
  Jsii::Type.check_type(@action_name, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJzdHJpbmcifQ==")), "actionName")
  @run_order = run_order
  Jsii::Type.check_type(@run_order, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJudW1iZXIifQ==")), "runOrder") unless @run_order.nil?
  @variables_namespace = variables_namespace
  Jsii::Type.check_type(@variables_namespace, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJzdHJpbmcifQ==")), "variablesNamespace") unless @variables_namespace.nil?
  @role = role
  Jsii::Type.check_type(@role, JSON.parse(Base64.strict_decode64("eyJmcW4iOiJhd3MtY2RrLWxpYi5hd3NfaWFtLklSb2xlIn0=")), "role") unless @role.nil?
  @output = output
  Jsii::Type.check_type(@output, JSON.parse(Base64.strict_decode64("eyJmcW4iOiJhd3MtY2RrLWxpYi5hd3NfY29kZXBpcGVsaW5lLkFydGlmYWN0In0=")), "output")
  @repository = repository
  Jsii::Type.check_type(@repository, JSON.parse(Base64.strict_decode64("eyJmcW4iOiJhd3MtY2RrLWxpYi5hd3NfY29kZWNvbW1pdC5JUmVwb3NpdG9yeSJ9")), "repository")
  @branch = branch
  Jsii::Type.check_type(@branch, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJzdHJpbmcifQ==")), "branch") unless @branch.nil?
  @code_build_clone_output = code_build_clone_output
  Jsii::Type.check_type(@code_build_clone_output, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJib29sZWFuIn0=")), "codeBuildCloneOutput") unless @code_build_clone_output.nil?
  @custom_event_rule = custom_event_rule
  Jsii::Type.check_type(@custom_event_rule, JSON.parse(Base64.strict_decode64("eyJmcW4iOiJhd3MtY2RrLWxpYi5hd3NfY29kZXBpcGVsaW5lX2FjdGlvbnMuSUN1c3RvbUV2ZW50UnVsZSJ9")), "customEventRule") unless @custom_event_rule.nil?
  @event_role = event_role
  Jsii::Type.check_type(@event_role, JSON.parse(Base64.strict_decode64("eyJmcW4iOiJhd3MtY2RrLWxpYi5hd3NfaWFtLklSb2xlIn0=")), "eventRole") unless @event_role.nil?
  @trigger = trigger
  Jsii::Type.check_type(@trigger, JSON.parse(Base64.strict_decode64("eyJmcW4iOiJhd3MtY2RrLWxpYi5hd3NfY29kZXBpcGVsaW5lX2FjdGlvbnMuQ29kZUNvbW1pdFRyaWdnZXIifQ==")), "trigger") unless @trigger.nil?
end

Instance Attribute Details

#action_nameString (readonly)

The physical, human-readable name of the Action.

Note that Action names must be unique within a single Stage.

Returns:

  • (String)


48
49
50
# File 'code_pipeline_actions/code_commit_source_action_props.rb', line 48

def action_name
  @action_name
end

#branchString? (readonly)

Note:

Default: 'master'

Returns:

  • (String, nil)


81
82
83
# File 'code_pipeline_actions/code_commit_source_action_props.rb', line 81

def branch
  @branch
end

#code_build_clone_outputBoolean? (readonly)

Note:

Default: false

Whether the output should be the contents of the repository (which is the default), or a link that allows CodeBuild to clone the repository before building.

Note: if this option is true, then only CodeBuild actions can use the resulting output.



90
91
92
# File 'code_pipeline_actions/code_commit_source_action_props.rb', line 90

def code_build_clone_output
  @code_build_clone_output
end

#custom_event_ruleAWSCDK::CodePipelineActions::ICustomEventRule? (readonly)

Note:

Default: Event rule which is triggered by CodeCommit repository on commit

You can pass a customEventRule to set up a custom event rule for the CodeCommit source action.

You must provide the event_pattern and target properties in the custom_event_rule object. Check which event_pattern to use: https://docs.aws.amazon.com/codecommit/latest/userguide/monitoring-events.html



98
99
100
# File 'code_pipeline_actions/code_commit_source_action_props.rb', line 98

def custom_event_rule
  @custom_event_rule
end

#event_roleAWSCDK::IAM::IRole? (readonly)

Note:

Default: a new role will be created.

Role to be used by on commit event rule.

Used only when trigger value is CodeCommitTrigger.EVENTS.

Returns:



105
106
107
# File 'code_pipeline_actions/code_commit_source_action_props.rb', line 105

def event_role
  @event_role
end

#outputAWSCDK::Codepipeline::Artifact (readonly)



74
75
76
# File 'code_pipeline_actions/code_commit_source_action_props.rb', line 74

def output
  @output
end

#repositoryAWSCDK::Codecommit::IRepository (readonly)

The CodeCommit repository.



78
79
80
# File 'code_pipeline_actions/code_commit_source_action_props.rb', line 78

def repository
  @repository
end

#roleAWSCDK::IAM::IRole? (readonly)

Note:

Default: a new Role will be generated

The Role in which context's this Action will be executing in.

The Pipeline's Role will assume this Role (the required permissions for that will be granted automatically) right before executing this Action. This Action will be passed into your IAction.bind method in the ActionBindOptions.role property.

Returns:



72
73
74
# File 'code_pipeline_actions/code_commit_source_action_props.rb', line 72

def role
  @role
end

#run_orderNumeric? (readonly)

Note:

Default: 1

The runOrder property for this Action.

RunOrder determines the relative order in which multiple Actions in the same Stage execute.



56
57
58
# File 'code_pipeline_actions/code_commit_source_action_props.rb', line 56

def run_order
  @run_order
end

#triggerAWSCDK::CodePipelineActions::CodeCommitTrigger? (readonly)

Note:

Default: CodeCommitTrigger.EVENTS

How should CodePipeline detect source changes for this Action.



110
111
112
# File 'code_pipeline_actions/code_commit_source_action_props.rb', line 110

def trigger
  @trigger
end

#variables_namespaceString? (readonly)

Note:

Default: - a name will be generated, based on the stage and action names, if any of the action's variables were referenced - otherwise, no namespace will be set

The name of the namespace to use for variables emitted by this action.

Returns:

  • (String, nil)


61
62
63
# File 'code_pipeline_actions/code_commit_source_action_props.rb', line 61

def variables_namespace
  @variables_namespace
end

Class Method Details

.jsii_propertiesObject



112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
# File 'code_pipeline_actions/code_commit_source_action_props.rb', line 112

def self.jsii_properties
  {
    :action_name => "actionName",
    :run_order => "runOrder",
    :variables_namespace => "variablesNamespace",
    :role => "role",
    :output => "output",
    :repository => "repository",
    :branch => "branch",
    :code_build_clone_output => "codeBuildCloneOutput",
    :custom_event_rule => "customEventRule",
    :event_role => "eventRole",
    :trigger => "trigger",
  }
end

Instance Method Details

#to_jsiiObject



128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
# File 'code_pipeline_actions/code_commit_source_action_props.rb', line 128

def to_jsii
  result = {}
  result.merge!(super)
  result.merge!({
    "actionName" => @action_name,
    "runOrder" => @run_order,
    "variablesNamespace" => @variables_namespace,
    "role" => @role,
    "output" => @output,
    "repository" => @repository,
    "branch" => @branch,
    "codeBuildCloneOutput" => @code_build_clone_output,
    "customEventRule" => @custom_event_rule,
    "eventRole" => @event_role,
    "trigger" => @trigger,
  })
  result.compact
end