@Generated(value="jsii-pacmak/1.67.0 (build 2c027f5)", date="2022-09-19T20:26:37.463Z") @Stability(value=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 Configure Your GitHub Pipelines to Use Webhooks for 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();
| Modifier and Type | Class and Description |
|---|---|
static class |
CfnWebhook.Builder
A fluent builder for
CfnWebhook. |
static interface |
CfnWebhook.WebhookAuthConfigurationProperty
The authentication applied to incoming webhook trigger requests.
|
static interface |
CfnWebhook.WebhookFilterRuleProperty
The event criteria that specify when a webhook notification is sent to your URL.
|
software.amazon.jsii.JsiiObject.InitializationModeIInspectable.Jsii$Default, IInspectable.Jsii$Proxy| Modifier and Type | Field and Description |
|---|---|
static String |
CFN_RESOURCE_TYPE_NAME
The CloudFormation resource type name for this resource class.
|
| Modifier | Constructor and Description |
|---|---|
|
CfnWebhook(software.constructs.Construct scope,
String id,
CfnWebhookProps props)
Create a new `AWS::CodePipeline::Webhook`.
|
protected |
CfnWebhook(software.amazon.jsii.JsiiObject.InitializationMode initializationMode) |
protected |
CfnWebhook(software.amazon.jsii.JsiiObjectRef objRef) |
| Modifier and Type | Method and Description |
|---|---|
String |
getAttrUrl()
The webhook URL generated by AWS CodePipeline , such as `https://eu-central-1.webhooks.aws/trigger123456` .
|
String |
getAuthentication()
Supported options are GITHUB_HMAC, IP, and UNAUTHENTICATED.
|
Object |
getAuthenticationConfiguration()
Properties that configure the authentication applied to incoming webhook trigger requests.
|
protected Map<String,Object> |
getCfnProperties() |
Object |
getFilters()
A list of rules applied to the body/payload sent in the POST request to a webhook URL.
|
String |
getName()
The name of the webhook.
|
Object |
getRegisterWithThirdParty()
Configures a connection between the webhook that was created and the external tool with events to be detected.
|
String |
getTargetAction()
The name of the action in a pipeline you want to connect to the webhook.
|
String |
getTargetPipeline()
The name of the pipeline you want to connect to the webhook.
|
Number |
getTargetPipelineVersion()
The version number of the pipeline to be connected to the trigger request.
|
void |
inspect(TreeInspector inspector)
Examines the CloudFormation resource and discloses attributes.
|
protected Map<String,Object> |
renderProperties(Map<String,Object> props) |
void |
setAuthentication(String value)
Supported options are GITHUB_HMAC, IP, and UNAUTHENTICATED.
|
void |
setAuthenticationConfiguration(CfnWebhook.WebhookAuthConfigurationProperty value)
Properties that configure the authentication applied to incoming webhook trigger requests.
|
void |
setAuthenticationConfiguration(IResolvable value)
Properties that configure the authentication applied to incoming webhook trigger requests.
|
void |
setFilters(IResolvable value)
A list of rules applied to the body/payload sent in the POST request to a webhook URL.
|
void |
setFilters(List<Object> value)
A list of rules applied to the body/payload sent in the POST request to a webhook URL.
|
void |
setName(String value)
The name of the webhook.
|
void |
setRegisterWithThirdParty(Boolean value)
Configures a connection between the webhook that was created and the external tool with events to be detected.
|
void |
setRegisterWithThirdParty(IResolvable value)
Configures a connection between the webhook that was created and the external tool with events to be detected.
|
void |
setTargetAction(String value)
The name of the action in a pipeline you want to connect to the webhook.
|
void |
setTargetPipeline(String value)
The name of the pipeline you want to connect to the webhook.
|
void |
setTargetPipelineVersion(Number value)
The version number of the pipeline to be connected to the trigger request.
|
addDeletionOverride, addDependsOn, addMetadata, addOverride, addPropertyDeletionOverride, addPropertyOverride, applyRemovalPolicy, applyRemovalPolicy, applyRemovalPolicy, getAtt, getCfnOptions, getCfnResourceType, getMetadata, getUpdatedProperites, getUpdatedProperties, isCfnResource, shouldSynthesize, toString, validatePropertiesgetRefgetCreationStack, getLogicalId, getStack, isCfnElement, overrideLogicalIdjsiiAsyncCall, jsiiAsyncCall, jsiiCall, jsiiCall, jsiiGet, jsiiGet, jsiiSet, jsiiStaticCall, jsiiStaticCall, jsiiStaticGet, jsiiStaticGet, jsiiStaticSet, jsiiStaticSet@Stability(value=Stable) public static final String CFN_RESOURCE_TYPE_NAME
protected CfnWebhook(software.amazon.jsii.JsiiObjectRef objRef)
protected CfnWebhook(software.amazon.jsii.JsiiObject.InitializationMode initializationMode)
@Stability(value=Stable)
public CfnWebhook(@NotNull
software.constructs.Construct scope,
@NotNull
String id,
@NotNull
CfnWebhookProps props)
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.@Stability(value=Stable)
public void inspect(@NotNull
TreeInspector inspector)
inspect in interface IInspectableinspector - - tree inspector to collect and process attributes. This parameter is required.@Stability(value=Stable) @NotNull protected Map<String,Object> renderProperties(@NotNull Map<String,Object> props)
renderProperties in class CfnResourceprops - This parameter is required.@Stability(value=Stable) @NotNull public String getAttrUrl()
@Stability(value=Stable) @NotNull protected Map<String,Object> getCfnProperties()
getCfnProperties in class CfnResource@Stability(value=Stable) @NotNull public String getAuthentication()
@Stability(value=Stable)
public void setAuthentication(@NotNull
String value)
@Stability(value=Stable) @NotNull public Object getAuthenticationConfiguration()
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.
@Stability(value=Stable)
public void setAuthenticationConfiguration(@NotNull
CfnWebhook.WebhookAuthConfigurationProperty value)
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.
@Stability(value=Stable)
public void setAuthenticationConfiguration(@NotNull
IResolvable value)
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.
@Stability(value=Stable) @NotNull public Object getFilters()
All defined rules must pass for the request to be accepted and the pipeline started.
@Stability(value=Stable)
public void setFilters(@NotNull
IResolvable value)
All defined rules must pass for the request to be accepted and the pipeline started.
@Stability(value=Stable)
public void setFilters(@NotNull
List<Object> value)
All defined rules must pass for the request to be accepted and the pipeline started.
@Stability(value=Stable) @NotNull public String getTargetAction()
The action must be from the source (first) stage of the pipeline.
@Stability(value=Stable)
public void setTargetAction(@NotNull
String value)
The action must be from the source (first) stage of the pipeline.
@Stability(value=Stable) @NotNull public String getTargetPipeline()
@Stability(value=Stable)
public void setTargetPipeline(@NotNull
String value)
@Stability(value=Stable) @NotNull public Number getTargetPipelineVersion()
Required: Yes
Type: Integer
Update requires: No interruption
@Stability(value=Stable)
public void setTargetPipelineVersion(@NotNull
Number value)
Required: Yes
Type: Integer
Update requires: No interruption
@Stability(value=Stable) @Nullable public String getName()
@Stability(value=Stable)
public void setName(@Nullable
String value)
@Stability(value=Stable) @Nullable public Object getRegisterWithThirdParty()
@Stability(value=Stable)
public void setRegisterWithThirdParty(@Nullable
Boolean value)
@Stability(value=Stable)
public void setRegisterWithThirdParty(@Nullable
IResolvable value)
Copyright © 2022. All rights reserved.