Class: AWSCDK::Codepipeline::PipelineProps

Inherits:
Jsii::Struct
  • Object
show all
Defined in:
codepipeline/pipeline_props.rb

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(artifact_bucket: nil, cross_account_keys: nil, cross_region_replication_buckets: nil, enable_key_rotation: nil, execution_mode: nil, pipeline_name: nil, pipeline_type: nil, restart_execution_on_update: nil, reuse_cross_region_support_stacks: nil, role: nil, stages: nil, triggers: nil, use_pipeline_role_for_actions: nil, variables: nil) ⇒ PipelineProps

Returns a new instance of PipelineProps.

Parameters:

  • artifact_bucket (AWSCDK::S3::IBucket, nil) (defaults to: nil)

    The S3 bucket used by this Pipeline to store artifacts.

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

    Create KMS keys for cross-account deployments.

  • cross_region_replication_buckets (Hash{String => AWSCDK::S3::IBucket}, nil) (defaults to: nil)

    A map of region to S3 bucket name used for cross-region CodePipeline.

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

    Enable KMS key rotation for the generated KMS keys.

  • execution_mode (AWSCDK::Codepipeline::ExecutionMode, nil) (defaults to: nil)

    The method that the pipeline will use to handle multiple executions.

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

    Name of the pipeline.

  • pipeline_type (AWSCDK::Codepipeline::PipelineType, nil) (defaults to: nil)

    Type of the pipeline.

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

    Indicates whether to rerun the AWS CodePipeline pipeline after you update it.

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

    Reuse the same cross region support stack for all pipelines in the App.

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

    The IAM role to be assumed by this Pipeline.

  • stages (Array<AWSCDK::Codepipeline::StageProps>, nil) (defaults to: nil)

    The list of Stages, in order, to create this Pipeline with.

  • triggers (Array<AWSCDK::Codepipeline::TriggerProps>, nil) (defaults to: nil)

    The trigger configuration specifying a type of event, such as Git tags, that starts the pipeline.

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

    Use pipeline service role for actions if no action role configured.

  • variables (Array<AWSCDK::Codepipeline::Variable>, nil) (defaults to: nil)

    A list that defines the pipeline variables for a pipeline resource.



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
# File 'codepipeline/pipeline_props.rb', line 20

def initialize(artifact_bucket: nil, cross_account_keys: nil, cross_region_replication_buckets: nil, enable_key_rotation: nil, execution_mode: nil, pipeline_name: nil, pipeline_type: nil, restart_execution_on_update: nil, reuse_cross_region_support_stacks: nil, role: nil, stages: nil, triggers: nil, use_pipeline_role_for_actions: nil, variables: nil)
  @artifact_bucket = artifact_bucket
  Jsii::Type.check_type(@artifact_bucket, JSON.parse(Base64.strict_decode64("eyJmcW4iOiJhd3MtY2RrLWxpYi5hd3NfczMuSUJ1Y2tldCJ9")), "artifactBucket") unless @artifact_bucket.nil?
  @cross_account_keys = 
  Jsii::Type.check_type(@cross_account_keys, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJib29sZWFuIn0=")), "crossAccountKeys") unless @cross_account_keys.nil?
  @cross_region_replication_buckets = cross_region_replication_buckets
  Jsii::Type.check_type(@cross_region_replication_buckets, JSON.parse(Base64.strict_decode64("eyJjb2xsZWN0aW9uIjp7ImVsZW1lbnR0eXBlIjp7ImZxbiI6ImF3cy1jZGstbGliLmF3c19zMy5JQnVja2V0In0sImtpbmQiOiJtYXAifX0=")), "crossRegionReplicationBuckets") unless @cross_region_replication_buckets.nil?
  @enable_key_rotation = enable_key_rotation
  Jsii::Type.check_type(@enable_key_rotation, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJib29sZWFuIn0=")), "enableKeyRotation") unless @enable_key_rotation.nil?
  @execution_mode = execution_mode
  Jsii::Type.check_type(@execution_mode, JSON.parse(Base64.strict_decode64("eyJmcW4iOiJhd3MtY2RrLWxpYi5hd3NfY29kZXBpcGVsaW5lLkV4ZWN1dGlvbk1vZGUifQ==")), "executionMode") unless @execution_mode.nil?
  @pipeline_name = pipeline_name
  Jsii::Type.check_type(@pipeline_name, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJzdHJpbmcifQ==")), "pipelineName") unless @pipeline_name.nil?
  @pipeline_type = pipeline_type
  Jsii::Type.check_type(@pipeline_type, JSON.parse(Base64.strict_decode64("eyJmcW4iOiJhd3MtY2RrLWxpYi5hd3NfY29kZXBpcGVsaW5lLlBpcGVsaW5lVHlwZSJ9")), "pipelineType") unless @pipeline_type.nil?
  @restart_execution_on_update = restart_execution_on_update
  Jsii::Type.check_type(@restart_execution_on_update, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJib29sZWFuIn0=")), "restartExecutionOnUpdate") unless @restart_execution_on_update.nil?
  @reuse_cross_region_support_stacks = reuse_cross_region_support_stacks
  Jsii::Type.check_type(@reuse_cross_region_support_stacks, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJib29sZWFuIn0=")), "reuseCrossRegionSupportStacks") unless @reuse_cross_region_support_stacks.nil?
  @role = role
  Jsii::Type.check_type(@role, JSON.parse(Base64.strict_decode64("eyJmcW4iOiJhd3MtY2RrLWxpYi5hd3NfaWFtLklSb2xlIn0=")), "role") unless @role.nil?
  @stages = stages.is_a?(Array) ? stages.map { |jsii_v0| jsii_v0.is_a?(Hash) ? ::AWSCDK::Codepipeline::StageProps.new(**jsii_v0.transform_keys(&:to_sym)) : jsii_v0 } : stages
  Jsii::Type.check_type(@stages, JSON.parse(Base64.strict_decode64("eyJjb2xsZWN0aW9uIjp7ImVsZW1lbnR0eXBlIjp7ImZxbiI6ImF3cy1jZGstbGliLmF3c19jb2RlcGlwZWxpbmUuU3RhZ2VQcm9wcyJ9LCJraW5kIjoiYXJyYXkifX0=")), "stages") unless @stages.nil?
  @triggers = triggers.is_a?(Array) ? triggers.map { |jsii_v0| jsii_v0.is_a?(Hash) ? ::AWSCDK::Codepipeline::TriggerProps.new(**jsii_v0.transform_keys(&:to_sym)) : jsii_v0 } : triggers
  Jsii::Type.check_type(@triggers, JSON.parse(Base64.strict_decode64("eyJjb2xsZWN0aW9uIjp7ImVsZW1lbnR0eXBlIjp7ImZxbiI6ImF3cy1jZGstbGliLmF3c19jb2RlcGlwZWxpbmUuVHJpZ2dlclByb3BzIn0sImtpbmQiOiJhcnJheSJ9fQ==")), "triggers") unless @triggers.nil?
  @use_pipeline_role_for_actions = use_pipeline_role_for_actions
  Jsii::Type.check_type(@use_pipeline_role_for_actions, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJib29sZWFuIn0=")), "usePipelineRoleForActions") unless @use_pipeline_role_for_actions.nil?
  @variables = variables
  Jsii::Type.check_type(@variables, JSON.parse(Base64.strict_decode64("eyJjb2xsZWN0aW9uIjp7ImVsZW1lbnR0eXBlIjp7ImZxbiI6ImF3cy1jZGstbGliLmF3c19jb2RlcGlwZWxpbmUuVmFyaWFibGUifSwia2luZCI6ImFycmF5In19")), "variables") unless @variables.nil?
end

Instance Attribute Details

#artifact_bucketAWSCDK::S3::IBucket? (readonly)

Note:

Default: - A new S3 bucket will be created.

The S3 bucket used by this Pipeline to store artifacts.

Returns:



55
56
57
# File 'codepipeline/pipeline_props.rb', line 55

def artifact_bucket
  @artifact_bucket
end

#cross_account_keysBoolean? (readonly)

Note:

Default: false - false if the feature flag CODEPIPELINE_CROSS_ACCOUNT_KEYS_DEFAULT_VALUE_TO_FALSE is true, true otherwise

Create KMS keys for cross-account deployments.

This controls whether the pipeline is enabled for cross-account deployments.

By default cross-account deployments are enabled, but this feature requires that KMS Customer Master Keys are created which have a cost of $1/month.

If you do not need cross-account deployments, you can set this to false to not create those keys and save on that cost (the artifact bucket will be encrypted with an AWS-managed key). However, cross-account deployments will no longer be possible.

Returns:

  • (Boolean, nil)


70
71
72
# File 'codepipeline/pipeline_props.rb', line 70

def 
  @cross_account_keys
end

#cross_region_replication_bucketsHash{String => AWSCDK::S3::IBucket}? (readonly)

Note:

Default: - None.

A map of region to S3 bucket name used for cross-region CodePipeline.

For every Action that you specify targeting a different region than the Pipeline itself, if you don't provide an explicit Bucket for that region using this property, the construct will automatically create a Stack containing an S3 Bucket in that region.

Returns:



79
80
81
# File 'codepipeline/pipeline_props.rb', line 79

def cross_region_replication_buckets
  @cross_region_replication_buckets
end

#enable_key_rotationBoolean? (readonly)

Note:

Default: - false (key rotation is disabled)

Enable KMS key rotation for the generated KMS keys.

By default KMS key rotation is disabled, but will add an additional $1/month for each year the key exists when enabled.

Returns:

  • (Boolean, nil)


87
88
89
# File 'codepipeline/pipeline_props.rb', line 87

def enable_key_rotation
  @enable_key_rotation
end

#execution_modeAWSCDK::Codepipeline::ExecutionMode? (readonly)

Note:

Default: - ExecutionMode.SUPERSEDED

The method that the pipeline will use to handle multiple executions.



92
93
94
# File 'codepipeline/pipeline_props.rb', line 92

def execution_mode
  @execution_mode
end

#pipeline_nameString? (readonly)

Note:

Default: - AWS CloudFormation generates an ID and uses that for the pipeline name.

Name of the pipeline.

Returns:

  • (String, nil)


97
98
99
# File 'codepipeline/pipeline_props.rb', line 97

def pipeline_name
  @pipeline_name
end

#pipeline_typeAWSCDK::Codepipeline::PipelineType? (readonly)

Note:

Default: - PipelineType.V2 if the feature flag CODEPIPELINE_DEFAULT_PIPELINE_TYPE_TO_V2 is true, PipelineType.V1 otherwise

Type of the pipeline.



103
104
105
# File 'codepipeline/pipeline_props.rb', line 103

def pipeline_type
  @pipeline_type
end

#restart_execution_on_updateBoolean? (readonly)

Note:

Default: false

Indicates whether to rerun the AWS CodePipeline pipeline after you update it.

Returns:

  • (Boolean, nil)


108
109
110
# File 'codepipeline/pipeline_props.rb', line 108

def restart_execution_on_update
  @restart_execution_on_update
end

#reuse_cross_region_support_stacksBoolean? (readonly)

Note:

Default: - true (Use the same support stack for all pipelines in App)

Reuse the same cross region support stack for all pipelines in the App.

Returns:

  • (Boolean, nil)


113
114
115
# File 'codepipeline/pipeline_props.rb', line 113

def reuse_cross_region_support_stacks
  @reuse_cross_region_support_stacks
end

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

Note:

Default: a new IAM role will be created.

The IAM role to be assumed by this Pipeline.

Returns:



118
119
120
# File 'codepipeline/pipeline_props.rb', line 118

def role
  @role
end

#stagesArray<AWSCDK::Codepipeline::StageProps>? (readonly)

Note:

Default: - None.

The list of Stages, in order, to create this Pipeline with.

You can always add more Stages later by calling Pipeline#addStage.

Returns:



125
126
127
# File 'codepipeline/pipeline_props.rb', line 125

def stages
  @stages
end

#triggersArray<AWSCDK::Codepipeline::TriggerProps>? (readonly)

Note:

Default: - No triggers

The trigger configuration specifying a type of event, such as Git tags, that starts the pipeline.

When a trigger configuration is specified, default change detection for repository and branch commits is disabled.

triggers can only be used when pipeline_type is set to PipelineType.V2. You can always add more triggers later by calling Pipeline#addTrigger.

Returns:



136
137
138
# File 'codepipeline/pipeline_props.rb', line 136

def triggers
  @triggers
end

#use_pipeline_role_for_actionsBoolean? (readonly)

Note:

Default: - false

Use pipeline service role for actions if no action role configured.

Returns:

  • (Boolean, nil)


141
142
143
# File 'codepipeline/pipeline_props.rb', line 141

def use_pipeline_role_for_actions
  @use_pipeline_role_for_actions
end

#variablesArray<AWSCDK::Codepipeline::Variable>? (readonly)

Note:

Default: - No variables

A list that defines the pipeline variables for a pipeline resource.

variables can only be used when pipeline_type is set to PipelineType.V2. You can always add more variables later by calling Pipeline#addVariable.

Returns:



149
150
151
# File 'codepipeline/pipeline_props.rb', line 149

def variables
  @variables
end

Class Method Details

.jsii_propertiesObject



151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
# File 'codepipeline/pipeline_props.rb', line 151

def self.jsii_properties
  {
    :artifact_bucket => "artifactBucket",
    :cross_account_keys => "crossAccountKeys",
    :cross_region_replication_buckets => "crossRegionReplicationBuckets",
    :enable_key_rotation => "enableKeyRotation",
    :execution_mode => "executionMode",
    :pipeline_name => "pipelineName",
    :pipeline_type => "pipelineType",
    :restart_execution_on_update => "restartExecutionOnUpdate",
    :reuse_cross_region_support_stacks => "reuseCrossRegionSupportStacks",
    :role => "role",
    :stages => "stages",
    :triggers => "triggers",
    :use_pipeline_role_for_actions => "usePipelineRoleForActions",
    :variables => "variables",
  }
end

Instance Method Details

#to_jsiiObject



170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
# File 'codepipeline/pipeline_props.rb', line 170

def to_jsii
  result = {}
  result.merge!({
    "artifactBucket" => @artifact_bucket,
    "crossAccountKeys" => @cross_account_keys,
    "crossRegionReplicationBuckets" => @cross_region_replication_buckets,
    "enableKeyRotation" => @enable_key_rotation,
    "executionMode" => @execution_mode,
    "pipelineName" => @pipeline_name,
    "pipelineType" => @pipeline_type,
    "restartExecutionOnUpdate" => @restart_execution_on_update,
    "reuseCrossRegionSupportStacks" => @reuse_cross_region_support_stacks,
    "role" => @role,
    "stages" => @stages,
    "triggers" => @triggers,
    "usePipelineRoleForActions" => @use_pipeline_role_for_actions,
    "variables" => @variables,
  })
  result.compact
end