Class: AWSCDK::CodePipelineActions::LambdaInvokeActionProps

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

Overview

Construction properties of the LambdaInvokeAction Lambda invoke 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, lambda:, inputs: nil, outputs: nil, user_parameters: nil, user_parameters_string: nil) ⇒ LambdaInvokeActionProps

Returns a new instance of LambdaInvokeActionProps.

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.

  • lambda (AWSCDK::Lambda::IFunction)

    The lambda function to invoke.

  • inputs (Array<AWSCDK::Codepipeline::Artifact>, nil) (defaults to: nil)

    The optional input Artifacts of the Action.

  • outputs (Array<AWSCDK::Codepipeline::Artifact>, nil) (defaults to: nil)

    The optional names of the output Artifacts of the Action.

  • user_parameters (Hash{String => Object}, nil) (defaults to: nil)

    A set of key-value pairs that will be accessible to the invoked Lambda inside the event that the Pipeline will call it with.

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

    The string representation of the user parameters that will be accessible to the invoked Lambda inside the event that the Pipeline will call it with.



16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
# File 'code_pipeline_actions/lambda_invoke_action_props.rb', line 16

def initialize(action_name:, run_order: nil, variables_namespace: nil, role: nil, lambda:, inputs: nil, outputs: nil, user_parameters: nil, user_parameters_string: 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?
  @lambda = lambda
  Jsii::Type.check_type(@lambda, JSON.parse(Base64.strict_decode64("eyJmcW4iOiJhd3MtY2RrLWxpYi5hd3NfbGFtYmRhLklGdW5jdGlvbiJ9")), "lambda")
  @inputs = inputs
  Jsii::Type.check_type(@inputs, JSON.parse(Base64.strict_decode64("eyJjb2xsZWN0aW9uIjp7ImVsZW1lbnR0eXBlIjp7ImZxbiI6ImF3cy1jZGstbGliLmF3c19jb2RlcGlwZWxpbmUuQXJ0aWZhY3QifSwia2luZCI6ImFycmF5In19")), "inputs") unless @inputs.nil?
  @outputs = outputs
  Jsii::Type.check_type(@outputs, JSON.parse(Base64.strict_decode64("eyJjb2xsZWN0aW9uIjp7ImVsZW1lbnR0eXBlIjp7ImZxbiI6ImF3cy1jZGstbGliLmF3c19jb2RlcGlwZWxpbmUuQXJ0aWZhY3QifSwia2luZCI6ImFycmF5In19")), "outputs") unless @outputs.nil?
  @user_parameters = user_parameters
  Jsii::Type.check_type(@user_parameters, JSON.parse(Base64.strict_decode64("eyJjb2xsZWN0aW9uIjp7ImVsZW1lbnR0eXBlIjp7InByaW1pdGl2ZSI6ImFueSJ9LCJraW5kIjoibWFwIn19")), "userParameters") unless @user_parameters.nil?
  @user_parameters_string = user_parameters_string
  Jsii::Type.check_type(@user_parameters_string, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJzdHJpbmcifQ==")), "userParametersString") unless @user_parameters_string.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)


42
43
44
# File 'code_pipeline_actions/lambda_invoke_action_props.rb', line 42

def action_name
  @action_name
end

#inputsArray<AWSCDK::Codepipeline::Artifact>? (readonly)

Note:

Default: the Action will not have any inputs

The optional input Artifacts of the Action.

A Lambda Action can have up to 5 inputs. The inputs will appear in the event passed to the Lambda, under the 'CodePipeline.job'.data.inputArtifacts path.



80
81
82
# File 'code_pipeline_actions/lambda_invoke_action_props.rb', line 80

def inputs
  @inputs
end

#lambdaAWSCDK::Lambda::IFunction (readonly)

The lambda function to invoke.



70
71
72
# File 'code_pipeline_actions/lambda_invoke_action_props.rb', line 70

def lambda
  @lambda
end

#outputsArray<AWSCDK::Codepipeline::Artifact>? (readonly)

Note:

Default: the Action will not have any outputs

The optional names of the output Artifacts of the Action.

A Lambda Action can have up to 5 outputs. The outputs will appear in the event passed to the Lambda, under the 'CodePipeline.job'.data.outputArtifacts path. It is the responsibility of the Lambda to upload ZIP files with the Artifact contents to the provided locations.

Returns:



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

def outputs
  @outputs
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:



66
67
68
# File 'code_pipeline_actions/lambda_invoke_action_props.rb', line 66

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.



50
51
52
# File 'code_pipeline_actions/lambda_invoke_action_props.rb', line 50

def run_order
  @run_order
end

#user_parametersHash{String => Object}? (readonly)

Note:

Default: - no user parameters will be passed

A set of key-value pairs that will be accessible to the invoked Lambda inside the event that the Pipeline will call it with.

Only one of user_parameters or user_parameters_string can be specified.



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

def user_parameters
  @user_parameters
end

#user_parameters_stringString? (readonly)

Note:

Default: - no user parameters will be passed

The string representation of the user parameters that will be accessible to the invoked Lambda inside the event that the Pipeline will call it with.

Only one of user_parameters_string or user_parameters can be specified.

Returns:

  • (String, nil)


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

def user_parameters_string
  @user_parameters_string
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)


55
56
57
# File 'code_pipeline_actions/lambda_invoke_action_props.rb', line 55

def variables_namespace
  @variables_namespace
end

Class Method Details

.jsii_propertiesObject



107
108
109
110
111
112
113
114
115
116
117
118
119
# File 'code_pipeline_actions/lambda_invoke_action_props.rb', line 107

def self.jsii_properties
  {
    :action_name => "actionName",
    :run_order => "runOrder",
    :variables_namespace => "variablesNamespace",
    :role => "role",
    :lambda => "lambda",
    :inputs => "inputs",
    :outputs => "outputs",
    :user_parameters => "userParameters",
    :user_parameters_string => "userParametersString",
  }
end

Instance Method Details

#to_jsiiObject



121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
# File 'code_pipeline_actions/lambda_invoke_action_props.rb', line 121

def to_jsii
  result = {}
  result.merge!(super)
  result.merge!({
    "actionName" => @action_name,
    "runOrder" => @run_order,
    "variablesNamespace" => @variables_namespace,
    "role" => @role,
    "lambda" => @lambda,
    "inputs" => @inputs,
    "outputs" => @outputs,
    "userParameters" => @user_parameters,
    "userParametersString" => @user_parameters_string,
  })
  result.compact
end