Class CfnWebhook
- All Implemented Interfaces:
IConstruct
,IDependable
,IInspectable
,software.amazon.jsii.JsiiSerializable
,software.constructs.IConstruct
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();
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic final class
A fluent builder forCfnWebhook
.static interface
The authentication applied to incoming webhook trigger requests.static interface
The event criteria that specify when a webhook notification is sent to your URL.Nested classes/interfaces inherited from class software.amazon.jsii.JsiiObject
software.amazon.jsii.JsiiObject.InitializationMode
Nested classes/interfaces inherited from interface software.amazon.awscdk.core.IConstruct
IConstruct.Jsii$Default
Nested classes/interfaces inherited from interface software.constructs.IConstruct
software.constructs.IConstruct.Jsii$Default
Nested classes/interfaces inherited from interface software.amazon.awscdk.core.IInspectable
IInspectable.Jsii$Default, IInspectable.Jsii$Proxy
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final String
The CloudFormation resource type name for this resource class. -
Constructor Summary
ConstructorsModifierConstructorDescriptionCfnWebhook
(Construct scope, String id, CfnWebhookProps props) Create a newAWS::CodePipeline::Webhook
.protected
CfnWebhook
(software.amazon.jsii.JsiiObject.InitializationMode initializationMode) protected
CfnWebhook
(software.amazon.jsii.JsiiObjectRef objRef) -
Method Summary
Modifier and TypeMethodDescriptionThe webhook URL generated by AWS CodePipeline , such ashttps://eu-central-1.webhooks.aws/trigger123456
.Supported options are GITHUB_HMAC, IP, and UNAUTHENTICATED.Properties that configure the authentication applied to incoming webhook trigger requests.A list of rules applied to the body/payload sent in the POST request to a webhook URL.getName()
The name of the webhook.Configures a connection between the webhook that was created and the external tool with events to be detected.The name of the action in a pipeline you want to connect to the webhook.The name of the pipeline you want to connect to the webhook.The version number of the pipeline to be connected to the trigger request.void
inspect
(TreeInspector inspector) Examines the CloudFormation resource and discloses attributes.renderProperties
(Map<String, Object> props) void
setAuthentication
(String value) Supported options are GITHUB_HMAC, IP, and UNAUTHENTICATED.void
Properties that configure the authentication applied to incoming webhook trigger requests.void
Properties that configure the authentication applied to incoming webhook trigger requests.void
setFilters
(List<Object> value) A list of rules applied to the body/payload sent in the POST request to a webhook URL.void
setFilters
(IResolvable value) A list of rules applied to the body/payload sent in the POST request to a webhook URL.void
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
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.Methods inherited from class software.amazon.awscdk.core.CfnResource
addDeletionOverride, addDependsOn, addMetadata, addOverride, addPropertyDeletionOverride, addPropertyOverride, applyRemovalPolicy, applyRemovalPolicy, applyRemovalPolicy, getAtt, getCfnOptions, getCfnResourceType, getMetadata, getUpdatedProperites, isCfnResource, shouldSynthesize, toString, validateProperties
Methods inherited from class software.amazon.awscdk.core.CfnRefElement
getRef
Methods inherited from class software.amazon.awscdk.core.CfnElement
getCreationStack, getLogicalId, getStack, isCfnElement, overrideLogicalId
Methods inherited from class software.amazon.awscdk.core.Construct
getNode, isConstruct, onPrepare, onSynthesize, onValidate, prepare, synthesize, validate
Methods inherited from class software.amazon.jsii.JsiiObject
jsiiAsyncCall, jsiiAsyncCall, jsiiCall, jsiiCall, jsiiGet, jsiiGet, jsiiSet, jsiiStaticCall, jsiiStaticCall, jsiiStaticGet, jsiiStaticGet, jsiiStaticSet, jsiiStaticSet
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
Methods inherited from interface software.amazon.jsii.JsiiSerializable
$jsii$toJson
-
Field Details
-
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 newAWS::CodePipeline::Webhook
.- Parameters:
scope
-- scope in which this resource is defined.
id
-- scoped id of the resource.
props
-- resource properties.
-
-
Method Details
-
inspect
Examines the CloudFormation resource and discloses attributes.- Specified by:
inspect
in interfaceIInspectable
- Parameters:
inspector
-- tree inspector to collect and process attributes.
-
renderProperties
@Stability(Stable) @NotNull protected Map<String,Object> renderProperties(@NotNull Map<String, Object> props) - Overrides:
renderProperties
in classCfnResource
- Parameters:
props
- This parameter is required.
-
getAttrUrl
The webhook URL generated by AWS CodePipeline , such ashttps://eu-central-1.webhooks.aws/trigger123456
. -
getCfnProperties
- Overrides:
getCfnProperties
in classCfnResource
-
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
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
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 theAllowedIPRange
property must be set to a valid CIDR range. For UNAUTHENTICATED, no properties can be set. -
setAuthenticationConfiguration
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 theAllowedIPRange
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 theAllowedIPRange
property must be set to a valid CIDR range. For UNAUTHENTICATED, no properties can be set. -
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
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
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
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
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
The name of the pipeline you want to connect to the webhook. -
setTargetPipeline
The name of the pipeline you want to connect to the webhook. -
getTargetPipelineVersion
The version number of the pipeline to be connected to the trigger request.Required: Yes
Type: Integer
Update requires: No interruption
-
setTargetPipelineVersion
The version number of the pipeline to be connected to the trigger request.Required: Yes
Type: Integer
Update requires: No interruption
-
getName
The name of the webhook. -
setName
The name of the webhook. -
getRegisterWithThirdParty
Configures a connection between the webhook that was created and the external tool with events to be detected. -
setRegisterWithThirdParty
Configures a connection between the webhook that was created and the external tool with events to be detected. -
setRegisterWithThirdParty
Configures a connection between the webhook that was created and the external tool with events to be detected.
-