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 classA fluent builder forCfnWebhook.static interfaceThe authentication applied to incoming webhook trigger requests.static interfaceThe 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.InitializationModeNested classes/interfaces inherited from interface software.amazon.awscdk.core.IConstruct
IConstruct.Jsii$DefaultNested classes/interfaces inherited from interface software.constructs.IConstruct
software.constructs.IConstruct.Jsii$DefaultNested classes/interfaces inherited from interface software.amazon.awscdk.core.IInspectable
IInspectable.Jsii$Default, IInspectable.Jsii$Proxy -
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final StringThe CloudFormation resource type name for this resource class. -
Constructor Summary
ConstructorsModifierConstructorDescriptionCfnWebhook(Construct scope, String id, CfnWebhookProps props) Create a newAWS::CodePipeline::Webhook.protectedCfnWebhook(software.amazon.jsii.JsiiObject.InitializationMode initializationMode) protectedCfnWebhook(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.voidinspect(TreeInspector inspector) Examines the CloudFormation resource and discloses attributes.renderProperties(Map<String, Object> props) voidsetAuthentication(String value) Supported options are GITHUB_HMAC, IP, and UNAUTHENTICATED.voidProperties that configure the authentication applied to incoming webhook trigger requests.voidProperties that configure the authentication applied to incoming webhook trigger requests.voidsetFilters(List<Object> value) A list of rules applied to the body/payload sent in the POST request to a webhook URL.voidsetFilters(IResolvable value) A list of rules applied to the body/payload sent in the POST request to a webhook URL.voidThe name of the webhook.voidsetRegisterWithThirdParty(Boolean value) Configures a connection between the webhook that was created and the external tool with events to be detected.voidConfigures a connection between the webhook that was created and the external tool with events to be detected.voidsetTargetAction(String value) The name of the action in a pipeline you want to connect to the webhook.voidsetTargetPipeline(String value) The name of the pipeline you want to connect to the webhook.voidsetTargetPipelineVersion(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, validatePropertiesMethods inherited from class software.amazon.awscdk.core.CfnRefElement
getRefMethods inherited from class software.amazon.awscdk.core.CfnElement
getCreationStack, getLogicalId, getStack, isCfnElement, overrideLogicalIdMethods inherited from class software.amazon.awscdk.core.Construct
getNode, isConstruct, onPrepare, onSynthesize, onValidate, prepare, synthesize, validateMethods inherited from class software.amazon.jsii.JsiiObject
jsiiAsyncCall, jsiiAsyncCall, jsiiCall, jsiiCall, jsiiGet, jsiiGet, jsiiSet, jsiiStaticCall, jsiiStaticCall, jsiiStaticGet, jsiiStaticGet, jsiiStaticSet, jsiiStaticSetMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitMethods 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:
inspectin 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:
renderPropertiesin 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:
getCfnPropertiesin 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
SecretTokenproperty must be set. For IP, only theAllowedIPRangeproperty 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
SecretTokenproperty must be set. For IP, only theAllowedIPRangeproperty 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
SecretTokenproperty must be set. For IP, only theAllowedIPRangeproperty 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.
-