Skip to main content

webhooks

Creates, updates, deletes, gets or lists a webhooks resource.

Overview

Namewebhooks
TypeResource
Idaws.codepipeline.webhooks

Fields

The following fields are returned by SELECT queries:

NameDatatypeDescription
arnstringThe Amazon Resource Name (ARN) of the webhook.
definitionobjectThe detail returned for each webhook, such as the webhook authentication type and filter rules.
error_codestringThe number code of the error.
error_messagestringThe text of the error message about the webhook.
last_triggeredstring (date-time)The date and time a webhook was last successfully triggered, in timestamp format.
tagsarraySpecifies the tags applied to the webhook.
urlstringA unique URL generated by CodePipeline. When a POST request is made to this URL, the defined pipeline is started as long as the body of the post request satisfies the defined authentication and filtering conditions. Deleting and re-creating a webhook makes the old URL invalid and generates a new one.

Methods

The following methods are available for this resource:

NameAccessible byRequired ParamsOptional ParamsDescription
list_webhooksselectregionGets a listing of all the webhooks in this Amazon Web Services Region for this account. The output lists all webhooks and includes the webhook URL and ARN and the configuration for each webhook. If a secret token was provided, it will be redacted in the response.
register_webhook_with_third_partyinsertregionConfigures a connection between the webhook that was created and the external tool with events to be detected.
put_webhookreplaceregion, webhookDefines a webhook and returns a unique webhook URL generated by CodePipeline. This URL can be supplied to third party source hosting providers to call every time there's a code change. When CodePipeline receives a POST request on this URL, the pipeline defined in the webhook is started as long as the POST request satisfied the authentication and filtering requirements supplied when defining the webhook. RegisterWebhookWithThirdParty and DeregisterWebhookWithThirdParty APIs can be used to automatically configure supported third parties to call the generated webhook URL. When creating CodePipeline webhooks, do not use your own credentials or reuse the same secret token across multiple webhooks. For optimal security, generate a unique secret token for each webhook you create. The secret token is an arbitrary string that you provide, which GitHub uses to compute and sign the webhook payloads sent to CodePipeline, for protecting the integrity and authenticity of the webhook payloads. Using your own credentials or reusing the same token across multiple webhooks can lead to security vulnerabilities. If a secret token was provided, it will be redacted in the response.
delete_webhookdeleteregionDeletes a previously created webhook by name. Deleting the webhook stops CodePipeline from starting a pipeline every time an external event occurs. The API returns successfully when trying to delete a webhook that is already deleted. If a deleted webhook is re-created by calling PutWebhook with the same name, it will have a different URL.
deregister_webhook_with_third_partydeleteregionRemoves the connection between the webhook that was created by CodePipeline and the external tool with events to be detected. Currently supported only for webhooks that target an action type of GitHub.

Parameters

Parameters can be passed in the WHERE clause of a query. Check the Methods section to see which parameters are required or optional for each operation.

NameDatatypeDescription
regionstringAWS region (default: us-east-1)

SELECT examples

Gets a listing of all the webhooks in this Amazon Web Services Region for this account. The output lists all webhooks and includes the webhook URL and ARN and the configuration for each webhook. If a secret token was provided, it will be redacted in the response.

SELECT
arn,
definition,
error_code,
error_message,
last_triggered,
tags,
url
FROM aws.codepipeline.webhooks
WHERE region = '{{ region }}' -- required
;

INSERT examples

Configures a connection between the webhook that was created and the external tool with events to be detected.

INSERT INTO aws.codepipeline.webhooks (
webhookName,
region
)
SELECT
'{{ webhookName }}',
'{{ region }}'
;

REPLACE examples

Defines a webhook and returns a unique webhook URL generated by CodePipeline. This URL can be supplied to third party source hosting providers to call every time there's a code change. When CodePipeline receives a POST request on this URL, the pipeline defined in the webhook is started as long as the POST request satisfied the authentication and filtering requirements supplied when defining the webhook. RegisterWebhookWithThirdParty and DeregisterWebhookWithThirdParty APIs can be used to automatically configure supported third parties to call the generated webhook URL. When creating CodePipeline webhooks, do not use your own credentials or reuse the same secret token across multiple webhooks. For optimal security, generate a unique secret token for each webhook you create. The secret token is an arbitrary string that you provide, which GitHub uses to compute and sign the webhook payloads sent to CodePipeline, for protecting the integrity and authenticity of the webhook payloads. Using your own credentials or reusing the same token across multiple webhooks can lead to security vulnerabilities. If a secret token was provided, it will be redacted in the response.

REPLACE aws.codepipeline.webhooks
SET
webhook = '{{ webhook }}',
tags = '{{ tags }}'
WHERE
region = '{{ region }}' --required
AND webhook = '{{ webhook }}' --required
RETURNING
webhook;

DELETE examples

Deletes a previously created webhook by name. Deleting the webhook stops CodePipeline from starting a pipeline every time an external event occurs. The API returns successfully when trying to delete a webhook that is already deleted. If a deleted webhook is re-created by calling PutWebhook with the same name, it will have a different URL.

DELETE FROM aws.codepipeline.webhooks
WHERE region = '{{ region }}' --required
;