CfnWebhookPropsMixin
- class aws_cdk.mixins_preview.aws_codepipeline.mixins.CfnWebhookPropsMixin(props, *, strategy=None)
Bases:
MixinThe
AWS::CodePipeline::Webhookresource 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:
- 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
xis a Mixin.- Parameters:
x (
Any) – Any object.- Return type:
bool- Returns:
true if
xis an object created from a class which extendsMixin.- Stability:
experimental
WebhookAuthConfigurationProperty
- class CfnWebhookPropsMixin.WebhookAuthConfigurationProperty(*, allowed_ip_range=None, secret_token=None)
Bases:
objectThe 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 theAllowedIPRangeproperty 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 theSecretTokenproperty 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:
- 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
AllowedIPRangeproperty must be set. This property must be set to a valid CIDR range.
- secret_token
The property used to configure GitHub authentication. For GITHUB_HMAC, only the
SecretTokenproperty 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.
WebhookFilterRuleProperty
- class CfnWebhookPropsMixin.WebhookFilterRuleProperty(*, json_path=None, match_equals=None)
Bases:
objectThe 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 theMatchEqualsfield. Otherwise, the request is ignored. For more information, see Java JsonPath implementation in GitHub.match_equals (
Optional[str]) – The value selected by theJsonPathexpression must match what is supplied in theMatchEqualsfield. 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”, theMatchEqualsvalue 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:
- 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
MatchEqualsfield. Otherwise, the request is ignored. For more information, see Java JsonPath implementation in GitHub.
- match_equals
The value selected by the
JsonPathexpression must match what is supplied in theMatchEqualsfield.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
MatchEqualsvalue is evaluated as “refs/heads/main”. For a list of action configuration properties for built-in action types, see Pipeline Structure Reference Action Requirements .