Class: AWSCDK::Codepipeline::CfnWebhookProps

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

Overview

Properties for defining a CfnWebhook.

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(authentication:, authentication_configuration:, filters:, target_action:, target_pipeline:, name: nil, register_with_third_party: nil, tags: nil, target_pipeline_version: nil) ⇒ CfnWebhookProps

Returns a new instance of CfnWebhookProps.

Parameters:

  • authentication (String)

    Supported options are GITHUB_HMAC, IP, and UNAUTHENTICATED.

  • authentication_configuration (AWSCDK::IResolvable, AWSCDK::Codepipeline::CfnWebhook::WebhookAuthConfigurationProperty)

    Properties that configure the authentication applied to incoming webhook trigger requests.

  • filters (AWSCDK::IResolvable, Array<AWSCDK::IResolvable, AWSCDK::Codepipeline::CfnWebhook::WebhookFilterRuleProperty>)

    A list of rules applied to the body/payload sent in the POST request to a webhook URL.

  • target_action (String)

    The name of the action in a pipeline you want to connect to the webhook.

  • target_pipeline (String)

    The name of the pipeline you want to connect to the webhook.

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

    The name of the webhook.

  • register_with_third_party (Boolean, AWSCDK::IResolvable, nil) (defaults to: nil)

    Configures a connection between the webhook that was created and the external tool with events to be detected.

  • tags (Array<AWSCDK::CfnTag>, nil) (defaults to: nil)

    An array of key-value pairs to apply to this resource.

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

    The version number of the pipeline to be connected to the trigger request.



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

def initialize(authentication:, authentication_configuration:, filters:, target_action:, target_pipeline:, name: nil, register_with_third_party: nil, tags: nil, target_pipeline_version: nil)
  @authentication = authentication
  Jsii::Type.check_type(@authentication, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJzdHJpbmcifQ==")), "authentication")
  @authentication_configuration = authentication_configuration.is_a?(Hash) ? ::AWSCDK::Codepipeline::CfnWebhook::WebhookAuthConfigurationProperty.new(**authentication_configuration.transform_keys(&:to_sym)) : authentication_configuration
  Jsii::Type.check_type(@authentication_configuration, JSON.parse(Base64.strict_decode64("eyJ1bmlvbiI6eyJ0eXBlcyI6W3siZnFuIjoiYXdzLWNkay1saWIuSVJlc29sdmFibGUifSx7ImZxbiI6ImF3cy1jZGstbGliLmF3c19jb2RlcGlwZWxpbmUuQ2ZuV2ViaG9vay5XZWJob29rQXV0aENvbmZpZ3VyYXRpb25Qcm9wZXJ0eSJ9XX19")), "authenticationConfiguration")
  @filters = filters
  Jsii::Type.check_type(@filters, JSON.parse(Base64.strict_decode64("eyJ1bmlvbiI6eyJ0eXBlcyI6W3siZnFuIjoiYXdzLWNkay1saWIuSVJlc29sdmFibGUifSx7ImNvbGxlY3Rpb24iOnsiZWxlbWVudHR5cGUiOnsidW5pb24iOnsidHlwZXMiOlt7ImZxbiI6ImF3cy1jZGstbGliLklSZXNvbHZhYmxlIn0seyJmcW4iOiJhd3MtY2RrLWxpYi5hd3NfY29kZXBpcGVsaW5lLkNmbldlYmhvb2suV2ViaG9va0ZpbHRlclJ1bGVQcm9wZXJ0eSJ9XX19LCJraW5kIjoiYXJyYXkifX1dfX0=")), "filters")
  @target_action = target_action
  Jsii::Type.check_type(@target_action, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJzdHJpbmcifQ==")), "targetAction")
  @target_pipeline = target_pipeline
  Jsii::Type.check_type(@target_pipeline, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJzdHJpbmcifQ==")), "targetPipeline")
  @name = name
  Jsii::Type.check_type(@name, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJzdHJpbmcifQ==")), "name") unless @name.nil?
  @register_with_third_party = register_with_third_party
  Jsii::Type.check_type(@register_with_third_party, JSON.parse(Base64.strict_decode64("eyJ1bmlvbiI6eyJ0eXBlcyI6W3sicHJpbWl0aXZlIjoiYm9vbGVhbiJ9LHsiZnFuIjoiYXdzLWNkay1saWIuSVJlc29sdmFibGUifV19fQ==")), "registerWithThirdParty") unless @register_with_third_party.nil?
  @tags = tags.is_a?(Array) ? tags.map { |jsii_v0| jsii_v0.is_a?(Hash) ? ::AWSCDK::CfnTag.new(**jsii_v0.transform_keys(&:to_sym)) : jsii_v0 } : tags
  Jsii::Type.check_type(@tags, JSON.parse(Base64.strict_decode64("eyJjb2xsZWN0aW9uIjp7ImVsZW1lbnR0eXBlIjp7ImZxbiI6ImF3cy1jZGstbGliLkNmblRhZyJ9LCJraW5kIjoiYXJyYXkifX0=")), "tags") unless @tags.nil?
  @target_pipeline_version = target_pipeline_version
  Jsii::Type.check_type(@target_pipeline_version, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJudW1iZXIifQ==")), "targetPipelineVersion") unless @target_pipeline_version.nil?
end

Instance Attribute Details

#authenticationString (readonly)

Supported options are GITHUB_HMAC, IP, and UNAUTHENTICATED.

When creating CodePipeline webhooks, do not use your own credentials or reuse the same secret token across multiple webhooks. For optimal security, generate a unique secret token for each webhook you create. The secret token is an arbitrary string that you provide, which GitHub uses to compute and sign the webhook payloads sent to CodePipeline, for protecting the integrity and authenticity of the webhook payloads. Using your own credentials or reusing the same token across multiple webhooks can lead to security vulnerabilities. > If a secret token was provided, it will be redacted in the response.

  • For information about the authentication scheme implemented by GITHUB_HMAC, see Securing your webhooks on the GitHub Developer website.
  • IP rejects webhooks trigger requests unless they originate from an IP address in the IP range whitelisted in the authentication configuration.
  • UNAUTHENTICATED accepts all webhook trigger requests regardless of origin.


49
50
51
# File 'codepipeline/cfn_webhook_props.rb', line 49

def authentication
  @authentication
end

#authentication_configurationAWSCDK::IResolvable, AWSCDK::Codepipeline::CfnWebhook::WebhookAuthConfigurationProperty (readonly)

Properties that configure the authentication applied to incoming webhook trigger requests.

The required properties depend on the authentication type. For GITHUB_HMAC, only the SecretToken property must be set. For IP, only the AllowedIPRange property must be set to a valid CIDR range. For UNAUTHENTICATED, no properties can be set.



56
57
58
# File 'codepipeline/cfn_webhook_props.rb', line 56

def authentication_configuration
  @authentication_configuration
end

#filtersAWSCDK::IResolvable, Array<AWSCDK::IResolvable, AWSCDK::Codepipeline::CfnWebhook::WebhookFilterRuleProperty> (readonly)

A list of rules applied to the body/payload sent in the POST request to a webhook URL.

All defined rules must pass for the request to be accepted and the pipeline started.



63
64
65
# File 'codepipeline/cfn_webhook_props.rb', line 63

def filters
  @filters
end

#nameString? (readonly)

The name of the webhook.



80
81
82
# File 'codepipeline/cfn_webhook_props.rb', line 80

def name
  @name
end

#register_with_third_partyBoolean, ... (readonly)

Configures a connection between the webhook that was created and the external tool with events to be detected.



85
86
87
# File 'codepipeline/cfn_webhook_props.rb', line 85

def register_with_third_party
  @register_with_third_party
end

#tagsArray<AWSCDK::CfnTag>? (readonly)

An array of key-value pairs to apply to this resource.



90
91
92
# File 'codepipeline/cfn_webhook_props.rb', line 90

def tags
  @tags
end

#target_actionString (readonly)

The name of the action in a pipeline you want to connect to the webhook.

The action must be from the source (first) stage of the pipeline.



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

def target_action
  @target_action
end

#target_pipelineString (readonly)

The name of the pipeline you want to connect to the webhook.



75
76
77
# File 'codepipeline/cfn_webhook_props.rb', line 75

def target_pipeline
  @target_pipeline
end

#target_pipeline_versionNumeric? (readonly)

The version number of the pipeline to be connected to the trigger request.

Required: Yes

Type: Integer

Update requires: No interruption



101
102
103
# File 'codepipeline/cfn_webhook_props.rb', line 101

def target_pipeline_version
  @target_pipeline_version
end

Class Method Details

.jsii_propertiesObject



103
104
105
106
107
108
109
110
111
112
113
114
115
# File 'codepipeline/cfn_webhook_props.rb', line 103

def self.jsii_properties
  {
    :authentication => "authentication",
    :authentication_configuration => "authenticationConfiguration",
    :filters => "filters",
    :target_action => "targetAction",
    :target_pipeline => "targetPipeline",
    :name => "name",
    :register_with_third_party => "registerWithThirdParty",
    :tags => "tags",
    :target_pipeline_version => "targetPipelineVersion",
  }
end

Instance Method Details

#to_jsiiObject



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

def to_jsii
  result = {}
  result.merge!({
    "authentication" => @authentication,
    "authenticationConfiguration" => @authentication_configuration,
    "filters" => @filters,
    "targetAction" => @target_action,
    "targetPipeline" => @target_pipeline,
    "name" => @name,
    "registerWithThirdParty" => @register_with_third_party,
    "tags" => @tags,
    "targetPipelineVersion" => @target_pipeline_version,
  })
  result.compact
end