Class: AWSCDK::CodePipelineActions::S3SourceActionProps

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

Overview

Construction properties of the S3SourceAction S3 source 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, bucket:, bucket_key:, output:, trigger: nil) ⇒ S3SourceActionProps

Returns a new instance of S3SourceActionProps.

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.

  • bucket (AWSCDK::S3::IBucket)

    The Amazon S3 bucket that stores the source code.

  • bucket_key (String)

    The key within the S3 bucket that stores the source code.

  • output (AWSCDK::Codepipeline::Artifact)
  • trigger (AWSCDK::CodePipelineActions::S3Trigger, nil) (defaults to: nil)

    How should CodePipeline detect source changes for this Action.



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

def initialize(action_name:, run_order: nil, variables_namespace: nil, role: nil, bucket:, bucket_key:, output:, 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?
  @bucket = bucket
  Jsii::Type.check_type(@bucket, JSON.parse(Base64.strict_decode64("eyJmcW4iOiJhd3MtY2RrLWxpYi5hd3NfczMuSUJ1Y2tldCJ9")), "bucket")
  @bucket_key = bucket_key
  Jsii::Type.check_type(@bucket_key, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJzdHJpbmcifQ==")), "bucketKey")
  @output = output
  Jsii::Type.check_type(@output, JSON.parse(Base64.strict_decode64("eyJmcW4iOiJhd3MtY2RrLWxpYi5hd3NfY29kZXBpcGVsaW5lLkFydGlmYWN0In0=")), "output")
  @trigger = trigger
  Jsii::Type.check_type(@trigger, JSON.parse(Base64.strict_decode64("eyJmcW4iOiJhd3MtY2RrLWxpYi5hd3NfY29kZXBpcGVsaW5lX2FjdGlvbnMuUzNUcmlnZ2VyIn0=")), "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)


39
40
41
# File 'code_pipeline_actions/s3_source_action_props.rb', line 39

def action_name
  @action_name
end

#bucketAWSCDK::S3::IBucket (readonly)

The Amazon S3 bucket that stores the source code.

If you import an encrypted bucket in your stack, please specify the encryption key at import time by using Bucket.fromBucketAttributes() method.

Returns:



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

def bucket
  @bucket
end

#bucket_keyString (readonly)

The key within the S3 bucket that stores the source code.

Examples:

"path/to/file.zip"

Returns:

  • (String)


76
77
78
# File 'code_pipeline_actions/s3_source_action_props.rb', line 76

def bucket_key
  @bucket_key
end

#outputAWSCDK::Codepipeline::Artifact (readonly)



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

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



63
64
65
# File 'code_pipeline_actions/s3_source_action_props.rb', line 63

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.



47
48
49
# File 'code_pipeline_actions/s3_source_action_props.rb', line 47

def run_order
  @run_order
end

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

Note:

Default: S3Trigger.POLL

How should CodePipeline detect source changes for this Action.

Note that if this is S3Trigger.EVENTS, you need to make sure to include the source Bucket in a CloudTrail Trail, as otherwise the CloudWatch Events will not be emitted.



87
88
89
# File 'code_pipeline_actions/s3_source_action_props.rb', line 87

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)


52
53
54
# File 'code_pipeline_actions/s3_source_action_props.rb', line 52

def variables_namespace
  @variables_namespace
end

Class Method Details

.jsii_propertiesObject



89
90
91
92
93
94
95
96
97
98
99
100
# File 'code_pipeline_actions/s3_source_action_props.rb', line 89

def self.jsii_properties
  {
    :action_name => "actionName",
    :run_order => "runOrder",
    :variables_namespace => "variablesNamespace",
    :role => "role",
    :bucket => "bucket",
    :bucket_key => "bucketKey",
    :output => "output",
    :trigger => "trigger",
  }
end

Instance Method Details

#to_jsiiObject



102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
# File 'code_pipeline_actions/s3_source_action_props.rb', line 102

def to_jsii
  result = {}
  result.merge!(super)
  result.merge!({
    "actionName" => @action_name,
    "runOrder" => @run_order,
    "variablesNamespace" => @variables_namespace,
    "role" => @role,
    "bucket" => @bucket,
    "bucketKey" => @bucket_key,
    "output" => @output,
    "trigger" => @trigger,
  })
  result.compact
end