@Generated(value="jsii-pacmak/1.74.0 (build 6d08790)", date="2023-03-22T19:35:41.873Z") 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.
|
IInspectable.Jsii$Default, IInspectable.Jsii$Proxy
IConstruct.Jsii$Default
Modifier and Type | Field and Description |
---|---|
static java.lang.String |
CFN_RESOURCE_TYPE_NAME
The CloudFormation resource type name for this resource class.
|
Modifier | Constructor and Description |
---|---|
|
CfnWebhook(Construct scope,
java.lang.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 |
---|---|
java.lang.String |
getAttrUrl()
The webhook URL generated by AWS CodePipeline , such as `https://eu-central-1.webhooks.aws/trigger123456` .
|
java.lang.String |
getAuthentication()
Supported options are GITHUB_HMAC, IP, and UNAUTHENTICATED.
|
java.lang.Object |
getAuthenticationConfiguration()
Properties that configure the authentication applied to incoming webhook trigger requests.
|
protected java.util.Map<java.lang.String,java.lang.Object> |
getCfnProperties() |
java.lang.Object |
getFilters()
A list of rules applied to the body/payload sent in the POST request to a webhook URL.
|
java.lang.String |
getName()
The name of the webhook.
|
java.lang.Object |
getRegisterWithThirdParty()
Configures a connection between the webhook that was created and the external tool with events to be detected.
|
java.lang.String |
getTargetAction()
The name of the action in a pipeline you want to connect to the webhook.
|
java.lang.String |
getTargetPipeline()
The name of the pipeline you want to connect to the webhook.
|
java.lang.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 java.util.Map<java.lang.String,java.lang.Object> |
renderProperties(java.util.Map<java.lang.String,java.lang.Object> props) |
void |
setAuthentication(java.lang.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(java.util.List<java.lang.Object> value)
A list of rules applied to the body/payload sent in the POST request to a webhook URL.
|
void |
setName(java.lang.String value)
The name of the webhook.
|
void |
setRegisterWithThirdParty(java.lang.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(java.lang.String value)
The name of the action in a pipeline you want to connect to the webhook.
|
void |
setTargetPipeline(java.lang.String value)
The name of the pipeline you want to connect to the webhook.
|
void |
setTargetPipelineVersion(java.lang.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, isCfnResource, shouldSynthesize, toString, validateProperties
getRef
getCreationStack, getLogicalId, getStack, isCfnElement, overrideLogicalId
getNode, isConstruct, onPrepare, onSynthesize, onValidate, prepare, synthesize, validate
public static final java.lang.String CFN_RESOURCE_TYPE_NAME
protected CfnWebhook(software.amazon.jsii.JsiiObjectRef objRef)
protected CfnWebhook(software.amazon.jsii.JsiiObject.InitializationMode initializationMode)
public CfnWebhook(Construct scope, java.lang.String id, 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.public void inspect(TreeInspector inspector)
inspect
in interface IInspectable
inspector
- - tree inspector to collect and process attributes. This parameter is required.protected java.util.Map<java.lang.String,java.lang.Object> renderProperties(java.util.Map<java.lang.String,java.lang.Object> props)
renderProperties
in class CfnResource
props
- This parameter is required.public java.lang.String getAttrUrl()
protected java.util.Map<java.lang.String,java.lang.Object> getCfnProperties()
getCfnProperties
in class CfnResource
public java.lang.String getAuthentication()
public void setAuthentication(java.lang.String value)
public java.lang.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.
public void setAuthenticationConfiguration(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.
public void setAuthenticationConfiguration(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.
public java.lang.Object getFilters()
All defined rules must pass for the request to be accepted and the pipeline started.
public void setFilters(IResolvable value)
All defined rules must pass for the request to be accepted and the pipeline started.
public void setFilters(java.util.List<java.lang.Object> value)
All defined rules must pass for the request to be accepted and the pipeline started.
public java.lang.String getTargetAction()
The action must be from the source (first) stage of the pipeline.
public void setTargetAction(java.lang.String value)
The action must be from the source (first) stage of the pipeline.
public java.lang.String getTargetPipeline()
public void setTargetPipeline(java.lang.String value)
public java.lang.Number getTargetPipelineVersion()
Required: Yes
Type: Integer
Update requires: No interruption
public void setTargetPipelineVersion(java.lang.Number value)
Required: Yes
Type: Integer
Update requires: No interruption
public java.lang.String getName()
public void setName(java.lang.String value)
public java.lang.Object getRegisterWithThirdParty()
public void setRegisterWithThirdParty(java.lang.Boolean value)
public void setRegisterWithThirdParty(IResolvable value)