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

@Generated(value="jsii-pacmak/1.104.0 (build e79254c)", date="2024-11-15T10:24:56.605Z") @Stability(Stable) public class CfnWebhook extends CfnResource implements IInspectable
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();
 

See Also:
  • 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 software.constructs.Construct scope, @NotNull String id, @NotNull CfnWebhookProps props)
      Parameters:
      scope - Scope in which this resource is defined. This parameter is required.
      id - Construct identifier for this resource (unique in its scope). 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.
    • getAttrId

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

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

      @Stability(Stable) @NotNull public Object getAuthenticationConfiguration()
      Properties that configure the authentication applied to incoming webhook trigger requests.
    • setAuthenticationConfiguration

      @Stability(Stable) public void setAuthenticationConfiguration(@NotNull IResolvable value)
      Properties that configure the authentication applied to incoming webhook trigger requests.
    • setAuthenticationConfiguration

      @Stability(Stable) public void setAuthenticationConfiguration(@NotNull CfnWebhook.WebhookAuthConfigurationProperty value)
      Properties that configure the authentication applied to incoming webhook trigger requests.
    • 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.
    • 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.
    • 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.
    • getTargetAction

      @Stability(Stable) @NotNull public String getTargetAction()
      The name of the action in a pipeline you want to connect to the webhook.
    • setTargetAction

      @Stability(Stable) public void setTargetAction(@NotNull String value)
      The name of the action in a pipeline you want to connect to the webhook.
    • 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.
    • setTargetPipelineVersion

      @Stability(Stable) public void setTargetPipelineVersion(@NotNull Number value)
      The version number of the pipeline to be connected to the trigger request.
    • 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.