webhooks
Creates, updates, deletes, gets or lists a webhooks resource.
Overview
| Name | webhooks |
| Type | Resource |
| Id | aws.codepipeline.webhooks |
Fields
The following fields are returned by SELECT queries:
- list_webhooks
| Name | Datatype | Description |
|---|---|---|
arn | string | The Amazon Resource Name (ARN) of the webhook. |
definition | object | The detail returned for each webhook, such as the webhook authentication type and filter rules. |
error_code | string | The number code of the error. |
error_message | string | The text of the error message about the webhook. |
last_triggered | string (date-time) | The date and time a webhook was last successfully triggered, in timestamp format. |
tags | array | Specifies the tags applied to the webhook. |
url | string | A 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:
| Name | Accessible by | Required Params | Optional Params | Description |
|---|---|---|---|---|
list_webhooks | select | region | 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. | |
register_webhook_with_third_party | insert | region | Configures a connection between the webhook that was created and the external tool with events to be detected. | |
put_webhook | replace | region, webhook | 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. | |
delete_webhook | delete | region | 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. | |
deregister_webhook_with_third_party | delete | region | Removes 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.
| Name | Datatype | Description |
|---|---|---|
region | string | AWS region (default: us-east-1) |
SELECT examples
- list_webhooks
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
- register_webhook_with_third_party
- Manifest
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 }}'
;
# Description fields are for documentation purposes
- name: webhooks
props:
- name: region
value: "{{ region }}"
description: Required parameter for the webhooks resource.
- name: webhookName
value: "{{ webhookName }}"
description: |
The name of an existing webhook created with PutWebhook to register with a supported third party.
REPLACE examples
- put_webhook
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
- delete_webhook
- deregister_webhook_with_third_party
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
;
Removes 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.
DELETE FROM aws.codepipeline.webhooks
WHERE region = '{{ region }}' --required
;