CfnWebhookPropsMixin

class aws_cdk.mixins_preview.aws_codepipeline.mixins.CfnWebhookPropsMixin(props, *, strategy=None)

Bases: Mixin

The AWS::CodePipeline::Webhook resource creates and registers your webhook.

After the webhook is created and registered, it triggers your pipeline to start every time an external event occurs. For more information, see Migrate polling pipelines to use event-based change detection in the AWS CodePipeline User Guide .

We strongly recommend that you use AWS Secrets Manager to store your credentials. If you use Secrets Manager, you must have already configured and stored your secret parameters in Secrets Manager. For more information, see Using Dynamic References to Specify Template Values . .. epigraph:

When passing secret parameters, do not enter the value directly into the template. The value is rendered as plaintext and is therefore readable. For security reasons, do not use plaintext in your AWS CloudFormation template to store your credentials.
See:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-codepipeline-webhook.html

CloudformationResource:

AWS::CodePipeline::Webhook

Mixin:

true

ExampleMetadata:

fixture=_generated

Example:

# The code below shows an example of how to instantiate this type.
# The values are placeholders you should change.
from aws_cdk.mixins_preview import mixins
from aws_cdk.mixins_preview.aws_codepipeline import mixins as codepipeline_mixins

cfn_webhook_props_mixin = codepipeline_mixins.CfnWebhookPropsMixin(codepipeline_mixins.CfnWebhookMixinProps(
    authentication="authentication",
    authentication_configuration=codepipeline_mixins.CfnWebhookPropsMixin.WebhookAuthConfigurationProperty(
        allowed_ip_range="allowedIpRange",
        secret_token="secretToken"
    ),
    filters=[codepipeline_mixins.CfnWebhookPropsMixin.WebhookFilterRuleProperty(
        json_path="jsonPath",
        match_equals="matchEquals"
    )],
    name="name",
    register_with_third_party=False,
    target_action="targetAction",
    target_pipeline="targetPipeline",
    target_pipeline_version=123
),
    strategy=mixins.PropertyMergeStrategy.OVERRIDE
)

Create a mixin to apply properties to AWS::CodePipeline::Webhook.

Parameters:
  • props (Union[CfnWebhookMixinProps, Dict[str, Any]]) – L1 properties to apply.

  • strategy (Optional[PropertyMergeStrategy]) – (experimental) Strategy for merging nested properties. Default: - PropertyMergeStrategy.MERGE

Methods

apply_to(construct)

Apply the mixin properties to the construct.

Parameters:

construct (IConstruct)

Return type:

IConstruct

supports(construct)

Check if this mixin supports the given construct.

Parameters:

construct (IConstruct)

Return type:

bool

Attributes

CFN_PROPERTY_KEYS = ['authentication', 'authenticationConfiguration', 'filters', 'name', 'registerWithThirdParty', 'targetAction', 'targetPipeline', 'targetPipelineVersion']

Static Methods

classmethod is_mixin(x)

(experimental) Checks if x is a Mixin.

Parameters:

x (Any) – Any object.

Return type:

bool

Returns:

true if x is an object created from a class which extends Mixin.

Stability:

experimental

WebhookAuthConfigurationProperty

class CfnWebhookPropsMixin.WebhookAuthConfigurationProperty(*, allowed_ip_range=None, secret_token=None)

Bases: object

The authentication applied to incoming webhook trigger requests.

Parameters:
  • allowed_ip_range (Optional[str]) – The property used to configure acceptance of webhooks in an IP address range. For IP, only the AllowedIPRange property must be set. This property must be set to a valid CIDR range.

  • secret_token (Optional[str]) – The property used to configure GitHub authentication. For GITHUB_HMAC, only the SecretToken property must be set. .. epigraph:: 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.

See:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-codepipeline-webhook-webhookauthconfiguration.html

ExampleMetadata:

fixture=_generated

Example:

# The code below shows an example of how to instantiate this type.
# The values are placeholders you should change.
from aws_cdk.mixins_preview.aws_codepipeline import mixins as codepipeline_mixins

webhook_auth_configuration_property = codepipeline_mixins.CfnWebhookPropsMixin.WebhookAuthConfigurationProperty(
    allowed_ip_range="allowedIpRange",
    secret_token="secretToken"
)

Attributes

allowed_ip_range

The property used to configure acceptance of webhooks in an IP address range.

For IP, only the AllowedIPRange property must be set. This property must be set to a valid CIDR range.

See:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-codepipeline-webhook-webhookauthconfiguration.html#cfn-codepipeline-webhook-webhookauthconfiguration-allowediprange

secret_token

The property used to configure GitHub authentication. For GITHUB_HMAC, only the SecretToken property must be set.

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.

See:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-codepipeline-webhook-webhookauthconfiguration.html#cfn-codepipeline-webhook-webhookauthconfiguration-secrettoken

WebhookFilterRuleProperty

class CfnWebhookPropsMixin.WebhookFilterRuleProperty(*, json_path=None, match_equals=None)

Bases: object

The event criteria that specify when a webhook notification is sent to your URL.

Parameters:
  • json_path (Optional[str]) – A JsonPath expression that is applied to the body/payload of the webhook. The value selected by the JsonPath expression must match the value specified in the MatchEquals field. Otherwise, the request is ignored. For more information, see Java JsonPath implementation in GitHub.

  • match_equals (Optional[str]) – The value selected by the JsonPath expression must match what is supplied in the MatchEquals field. Otherwise, the request is ignored. Properties from the target action configuration can be included as placeholders in this value by surrounding the action configuration key with curly brackets. For example, if the value supplied here is “refs/heads/{Branch}” and the target action has an action configuration property called “Branch” with a value of “main”, the MatchEquals value is evaluated as “refs/heads/main”. For a list of action configuration properties for built-in action types, see Pipeline Structure Reference Action Requirements .

See:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-codepipeline-webhook-webhookfilterrule.html

ExampleMetadata:

fixture=_generated

Example:

# The code below shows an example of how to instantiate this type.
# The values are placeholders you should change.
from aws_cdk.mixins_preview.aws_codepipeline import mixins as codepipeline_mixins

webhook_filter_rule_property = codepipeline_mixins.CfnWebhookPropsMixin.WebhookFilterRuleProperty(
    json_path="jsonPath",
    match_equals="matchEquals"
)

Attributes

json_path

A JsonPath expression that is applied to the body/payload of the webhook.

The value selected by the JsonPath expression must match the value specified in the MatchEquals field. Otherwise, the request is ignored. For more information, see Java JsonPath implementation in GitHub.

See:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-codepipeline-webhook-webhookfilterrule.html#cfn-codepipeline-webhook-webhookfilterrule-jsonpath

match_equals

The value selected by the JsonPath expression must match what is supplied in the MatchEquals field.

Otherwise, the request is ignored. Properties from the target action configuration can be included as placeholders in this value by surrounding the action configuration key with curly brackets. For example, if the value supplied here is “refs/heads/{Branch}” and the target action has an action configuration property called “Branch” with a value of “main”, the MatchEquals value is evaluated as “refs/heads/main”. For a list of action configuration properties for built-in action types, see Pipeline Structure Reference Action Requirements .

See:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-codepipeline-webhook-webhookfilterrule.html#cfn-codepipeline-webhook-webhookfilterrule-matchequals