Class: AWSCDK::Pipelines::ProduceActionOptions

Inherits:
Jsii::Struct
  • Object
show all
Defined in:
pipelines/produce_action_options.rb

Overview

Options for the CodePipelineActionFactory.produce() method.

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(action_name:, artifacts:, pipeline:, run_order:, scope:, stack_outputs_map:, before_self_mutation: nil, code_build_defaults: nil, fallback_artifact: nil, variables_namespace: nil) ⇒ ProduceActionOptions

Returns a new instance of ProduceActionOptions.

Parameters:

  • action_name (String)

    Name the action should get.

  • artifacts (AWSCDK::Pipelines::ArtifactMap)

    Helper object to translate FileSets to CodePipeline Artifacts.

  • pipeline (AWSCDK::Pipelines::CodePipeline)

    The pipeline the action is being generated for.

  • run_order (Numeric)

    RunOrder the action should get.

  • scope (Constructs::Construct)

    Scope in which to create constructs.

  • stack_outputs_map (AWSCDK::Pipelines::StackOutputsMap)

    Helper object to produce variables exported from stack deployments.

  • before_self_mutation (Boolean, nil) (defaults to: nil)

    Whether or not this action is inserted before self mutation.

  • code_build_defaults (AWSCDK::Pipelines::CodeBuildOptions, nil) (defaults to: nil)

    If this action factory creates a CodeBuild step, default options to inherit.

  • fallback_artifact (AWSCDK::Codepipeline::Artifact, nil) (defaults to: nil)

    An input artifact that CodeBuild projects that don't actually need an input artifact can use.

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

    If this step is producing outputs, the variables namespace assigned to it.



17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
# File 'pipelines/produce_action_options.rb', line 17

def initialize(action_name:, artifacts:, pipeline:, run_order:, scope:, stack_outputs_map:, before_self_mutation: nil, code_build_defaults: nil, fallback_artifact: nil, variables_namespace: nil)
  @action_name = action_name
  Jsii::Type.check_type(@action_name, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJzdHJpbmcifQ==")), "actionName")
  @artifacts = artifacts
  Jsii::Type.check_type(@artifacts, JSON.parse(Base64.strict_decode64("eyJmcW4iOiJhd3MtY2RrLWxpYi5waXBlbGluZXMuQXJ0aWZhY3RNYXAifQ==")), "artifacts")
  @pipeline = pipeline
  Jsii::Type.check_type(@pipeline, JSON.parse(Base64.strict_decode64("eyJmcW4iOiJhd3MtY2RrLWxpYi5waXBlbGluZXMuQ29kZVBpcGVsaW5lIn0=")), "pipeline")
  @run_order = run_order
  Jsii::Type.check_type(@run_order, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJudW1iZXIifQ==")), "runOrder")
  @scope = scope
  Jsii::Type.check_type(@scope, JSON.parse(Base64.strict_decode64("eyJmcW4iOiJjb25zdHJ1Y3RzLkNvbnN0cnVjdCJ9")), "scope")
  @stack_outputs_map = stack_outputs_map
  Jsii::Type.check_type(@stack_outputs_map, JSON.parse(Base64.strict_decode64("eyJmcW4iOiJhd3MtY2RrLWxpYi5waXBlbGluZXMuU3RhY2tPdXRwdXRzTWFwIn0=")), "stackOutputsMap")
  @before_self_mutation = before_self_mutation
  Jsii::Type.check_type(@before_self_mutation, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJib29sZWFuIn0=")), "beforeSelfMutation") unless @before_self_mutation.nil?
  @code_build_defaults = code_build_defaults.is_a?(Hash) ? ::AWSCDK::Pipelines::CodeBuildOptions.new(**code_build_defaults.transform_keys(&:to_sym)) : code_build_defaults
  Jsii::Type.check_type(@code_build_defaults, JSON.parse(Base64.strict_decode64("eyJmcW4iOiJhd3MtY2RrLWxpYi5waXBlbGluZXMuQ29kZUJ1aWxkT3B0aW9ucyJ9")), "codeBuildDefaults") unless @code_build_defaults.nil?
  @fallback_artifact = fallback_artifact
  Jsii::Type.check_type(@fallback_artifact, JSON.parse(Base64.strict_decode64("eyJmcW4iOiJhd3MtY2RrLWxpYi5hd3NfY29kZXBpcGVsaW5lLkFydGlmYWN0In0=")), "fallbackArtifact") unless @fallback_artifact.nil?
  @variables_namespace = variables_namespace
  Jsii::Type.check_type(@variables_namespace, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJzdHJpbmcifQ==")), "variablesNamespace") unless @variables_namespace.nil?
end

Instance Attribute Details

#action_nameString (readonly)

Name the action should get.

Returns:

  • (String)


43
44
45
# File 'pipelines/produce_action_options.rb', line 43

def action_name
  @action_name
end

#artifactsAWSCDK::Pipelines::ArtifactMap (readonly)

Helper object to translate FileSets to CodePipeline Artifacts.



47
48
49
# File 'pipelines/produce_action_options.rb', line 47

def artifacts
  @artifacts
end

#before_self_mutationBoolean? (readonly)

Note:

Default: false

Whether or not this action is inserted before self mutation.

If it is, the action should take care to reflect some part of its own definition in the pipeline action definition, to trigger a restart after self-mutation (if necessary).

Returns:

  • (Boolean, nil)


78
79
80
# File 'pipelines/produce_action_options.rb', line 78

def before_self_mutation
  @before_self_mutation
end

#code_build_defaultsAWSCDK::Pipelines::CodeBuildOptions? (readonly)

Note:

Default: - No CodeBuild project defaults

If this action factory creates a CodeBuild step, default options to inherit.



83
84
85
# File 'pipelines/produce_action_options.rb', line 83

def code_build_defaults
  @code_build_defaults
end

#fallback_artifactAWSCDK::Codepipeline::Artifact? (readonly)

Note:

Default: - A fallback artifact does not exist

An input artifact that CodeBuild projects that don't actually need an input artifact can use.

CodeBuild Projects MUST have an input artifact in order to be added to the Pipeline. If the Project doesn't actually care about its input (it can be anything), it can use the Artifact passed here.



92
93
94
# File 'pipelines/produce_action_options.rb', line 92

def fallback_artifact
  @fallback_artifact
end

#pipelineAWSCDK::Pipelines::CodePipeline (readonly)

The pipeline the action is being generated for.



51
52
53
# File 'pipelines/produce_action_options.rb', line 51

def pipeline
  @pipeline
end

#run_orderNumeric (readonly)

RunOrder the action should get.

Returns:

  • (Numeric)


55
56
57
# File 'pipelines/produce_action_options.rb', line 55

def run_order
  @run_order
end

#scopeConstructs::Construct (readonly)

Scope in which to create constructs.

Returns:

  • (Constructs::Construct)


59
60
61
# File 'pipelines/produce_action_options.rb', line 59

def scope
  @scope
end

#stack_outputs_mapAWSCDK::Pipelines::StackOutputsMap (readonly)

Helper object to produce variables exported from stack deployments.

If your step references outputs from a stack deployment, use this to map the output references to Codepipeline variable names.

Note - Codepipeline variables can only be referenced in action configurations.



69
70
71
# File 'pipelines/produce_action_options.rb', line 69

def stack_outputs_map
  @stack_outputs_map
end

#variables_namespaceString? (readonly)

Note:

Default: - Step doesn't produce any outputs

If this step is producing outputs, the variables namespace assigned to it.

Pass this on to the Action you are creating.

Returns:

  • (String, nil)


99
100
101
# File 'pipelines/produce_action_options.rb', line 99

def variables_namespace
  @variables_namespace
end

Class Method Details

.jsii_propertiesObject



101
102
103
104
105
106
107
108
109
110
111
112
113
114
# File 'pipelines/produce_action_options.rb', line 101

def self.jsii_properties
  {
    :action_name => "actionName",
    :artifacts => "artifacts",
    :pipeline => "pipeline",
    :run_order => "runOrder",
    :scope => "scope",
    :stack_outputs_map => "stackOutputsMap",
    :before_self_mutation => "beforeSelfMutation",
    :code_build_defaults => "codeBuildDefaults",
    :fallback_artifact => "fallbackArtifact",
    :variables_namespace => "variablesNamespace",
  }
end

Instance Method Details

#to_jsiiObject



116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
# File 'pipelines/produce_action_options.rb', line 116

def to_jsii
  result = {}
  result.merge!({
    "actionName" => @action_name,
    "artifacts" => @artifacts,
    "pipeline" => @pipeline,
    "runOrder" => @run_order,
    "scope" => @scope,
    "stackOutputsMap" => @stack_outputs_map,
    "beforeSelfMutation" => @before_self_mutation,
    "codeBuildDefaults" => @code_build_defaults,
    "fallbackArtifact" => @fallback_artifact,
    "variablesNamespace" => @variables_namespace,
  })
  result.compact
end