java.lang.Object
software.amazon.jsii.JsiiObject
All Implemented Interfaces:
IConstruct, IDependable, IInspectable, software.amazon.jsii.JsiiSerializable, software.constructs.IConstruct

@Generated(value="jsii-pacmak/1.84.0 (build 5404dcf)", date="2023-06-19T16:30:37.922Z") @Stability(Stable) public class CfnWebhook extends CfnResource implements IInspectable
A CloudFormation AWS::CodePipeline::Webhook.

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 .

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.

Example:

 // The code below shows an example of how to instantiate this type.
 // The values are placeholders you should change.
 import software.amazon.awscdk.services.codepipeline.*;
 CfnWebhook cfnWebhook = CfnWebhook.Builder.create(this, "MyCfnWebhook")
         .authentication("authentication")
         .authenticationConfiguration(WebhookAuthConfigurationProperty.builder()
                 .allowedIpRange("allowedIpRange")
                 .secretToken("secretToken")
                 .build())
         .filters(List.of(WebhookFilterRuleProperty.builder()
                 .jsonPath("jsonPath")
                 // the properties below are optional
                 .matchEquals("matchEquals")
                 .build()))
         .targetAction("targetAction")
         .targetPipeline("targetPipeline")
         .targetPipelineVersion(123)
         // the properties below are optional
         .name("name")
         .registerWithThirdParty(false)
         .build();
 
  • Field Details

    • CFN_RESOURCE_TYPE_NAME

      @Stability(Stable) public static final String CFN_RESOURCE_TYPE_NAME
      The CloudFormation resource type name for this resource class.
  • Constructor Details

    • CfnWebhook

      protected CfnWebhook(software.amazon.jsii.JsiiObjectRef objRef)
    • CfnWebhook

      protected CfnWebhook(software.amazon.jsii.JsiiObject.InitializationMode initializationMode)
    • CfnWebhook

      @Stability(Stable) public CfnWebhook(@NotNull Construct scope, @NotNull String id, @NotNull CfnWebhookProps props)
      Create a new AWS::CodePipeline::Webhook.

      Parameters:
      scope -
      • scope in which this resource is defined.
      This parameter is required.
      id -
      • scoped id of the resource.
      This parameter is required.
      props -
      • resource properties.
      This parameter is required.
  • Method Details

    • inspect

      @Stability(Stable) public void inspect(@NotNull TreeInspector inspector)
      Examines the CloudFormation resource and discloses attributes.

      Specified by:
      inspect in interface IInspectable
      Parameters:
      inspector -
      • tree inspector to collect and process attributes.
      This parameter is required.
    • renderProperties

      @Stability(Stable) @NotNull protected Map<String,Object> renderProperties(@NotNull Map<String,Object> props)
      Overrides:
      renderProperties in class CfnResource
      Parameters:
      props - This parameter is required.
    • getAttrUrl

      @Stability(Stable) @NotNull public String getAttrUrl()
      The webhook URL generated by AWS CodePipeline , such as https://eu-central-1.webhooks.aws/trigger123456 .
    • getCfnProperties

      @Stability(Stable) @NotNull protected Map<String,Object> getCfnProperties()
      Overrides:
      getCfnProperties in class CfnResource
    • getAuthentication

      @Stability(Stable) @NotNull public String getAuthentication()
      Supported options are GITHUB_HMAC, IP, and UNAUTHENTICATED.

      • 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.
    • setAuthentication

      @Stability(Stable) public void setAuthentication(@NotNull String value)
      Supported options are GITHUB_HMAC, IP, and UNAUTHENTICATED.

      • 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.
    • getAuthenticationConfiguration

      @Stability(Stable) @NotNull public Object getAuthenticationConfiguration()
      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.

    • setAuthenticationConfiguration

      @Stability(Stable) public void setAuthenticationConfiguration(@NotNull IResolvable value)
      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.

    • setAuthenticationConfiguration

      @Stability(Stable) public void setAuthenticationConfiguration(@NotNull CfnWebhook.WebhookAuthConfigurationProperty value)
      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.

    • getFilters

      @Stability(Stable) @NotNull public Object getFilters()
      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.

    • setFilters

      @Stability(Stable) public void setFilters(@NotNull IResolvable value)
      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.

    • setFilters

      @Stability(Stable) public void setFilters(@NotNull List<Object> value)
      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.

    • getTargetAction

      @Stability(Stable) @NotNull public String getTargetAction()
      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.

    • setTargetAction

      @Stability(Stable) public void setTargetAction(@NotNull String value)
      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.

    • getTargetPipeline

      @Stability(Stable) @NotNull public String getTargetPipeline()
      The name of the pipeline you want to connect to the webhook.
    • setTargetPipeline

      @Stability(Stable) public void setTargetPipeline(@NotNull String value)
      The name of the pipeline you want to connect to the webhook.
    • getTargetPipelineVersion

      @Stability(Stable) @NotNull public Number getTargetPipelineVersion()
      The version number of the pipeline to be connected to the trigger request.

      Required: Yes

      Type: Integer

      Update requires: No interruption

    • setTargetPipelineVersion

      @Stability(Stable) public void setTargetPipelineVersion(@NotNull Number value)
      The version number of the pipeline to be connected to the trigger request.

      Required: Yes

      Type: Integer

      Update requires: No interruption

    • getName

      @Stability(Stable) @Nullable public String getName()
      The name of the webhook.
    • setName

      @Stability(Stable) public void setName(@Nullable String value)
      The name of the webhook.
    • getRegisterWithThirdParty

      @Stability(Stable) @Nullable public Object getRegisterWithThirdParty()
      Configures a connection between the webhook that was created and the external tool with events to be detected.
    • setRegisterWithThirdParty

      @Stability(Stable) public void setRegisterWithThirdParty(@Nullable Boolean value)
      Configures a connection between the webhook that was created and the external tool with events to be detected.
    • setRegisterWithThirdParty

      @Stability(Stable) public void setRegisterWithThirdParty(@Nullable IResolvable value)
      Configures a connection between the webhook that was created and the external tool with events to be detected.