webhooks
Creates, updates, deletes or gets a webhook resource or lists webhooks in a region
Overview
| Name | webhooks |
| Type | Resource |
| Description | Resource Type definition for AWS::CodePipeline::Webhook |
| Id | awscc.codepipeline.webhooks |
Fields
- get (all properties)
- list (identifiers only)
| Name | Datatype | Description |
|---|---|---|
authentication_configuration | object | Properties that configure the authentication applied to incoming webhook trigger requests |
filters | array | A list of rules applied to the body/payload sent in the POST request to a webhook URL |
authentication | string | Supported options are GITHUB_HMAC, IP, and UNAUTHENTICATED. |
target_pipeline | string | The name of the pipeline you want to connect to the webhook. |
target_action | string | The name of the action in a pipeline you want to connect to the webhook. |
id | string | logical id of the webhook |
url | string | The webhook URL generated by AWS CodePipeline |
name | string | The name of the webhook |
target_pipeline_version | integer | The version number of the pipeline to be connected to the trigger request. |
register_with_third_party | boolean | Configures a connection between the webhook that was created and the external tool with events to be detected. |
region | string | AWS region. |
| Name | Datatype | Description |
|---|---|---|
id | string | logical id of the webhook |
region | string | AWS region. |
For more information, see AWS::CodePipeline::Webhook.
Methods
| Name | Resource | Accessible by | Required Params |
|---|---|---|---|
create_resource | webhooks | INSERT | AuthenticationConfiguration, Filters, Authentication, TargetPipeline, TargetAction, region |
delete_resource | webhooks | DELETE | Identifier, region |
update_resource | webhooks | UPDATE | Identifier, PatchDocument, region |
list_resources | webhooks_list_only | SELECT | region |
get_resource | webhooks | SELECT | Identifier, region |
SELECT examples
- get (all properties)
- list (identifiers only)
Gets all properties from an individual webhook.
SELECT
region,
authentication_configuration,
filters,
authentication,
target_pipeline,
target_action,
id,
url,
name,
target_pipeline_version,
register_with_third_party
FROM awscc.codepipeline.webhooks
WHERE
region = '{{ region }}' AND
Identifier = '{{ id }}';
Lists all webhooks in a region.
SELECT
region,
id
FROM awscc.codepipeline.webhooks_list_only
WHERE
region = '{{ region }}';
INSERT example
Use the following StackQL query and manifest file to create a new webhook resource, using stack-deploy.
- Required Properties
- All Properties
- Manifest
/*+ create */
INSERT INTO awscc.codepipeline.webhooks (
AuthenticationConfiguration,
Filters,
Authentication,
TargetPipeline,
TargetAction,
region
)
SELECT
'{{ authentication_configuration }}',
'{{ filters }}',
'{{ authentication }}',
'{{ target_pipeline }}',
'{{ target_action }}',
'{{ region }}'
RETURNING
ErrorCode,
EventTime,
Identifier,
Operation,
OperationStatus,
RequestToken,
ResourceModel,
RetryAfter,
StatusMessage,
TypeName
;
/*+ create */
INSERT INTO awscc.codepipeline.webhooks (
AuthenticationConfiguration,
Filters,
Authentication,
TargetPipeline,
TargetAction,
Name,
TargetPipelineVersion,
RegisterWithThirdParty,
region
)
SELECT
'{{ authentication_configuration }}',
'{{ filters }}',
'{{ authentication }}',
'{{ target_pipeline }}',
'{{ target_action }}',
'{{ name }}',
'{{ target_pipeline_version }}',
'{{ register_with_third_party }}',
'{{ region }}'
RETURNING
ErrorCode,
EventTime,
Identifier,
Operation,
OperationStatus,
RequestToken,
ResourceModel,
RetryAfter,
StatusMessage,
TypeName
;
version: 1
name: stack name
description: stack description
providers:
- aws
globals:
- name: region
value: '{{ vars.AWS_REGION }}'
resources:
- name: webhook
props:
- name: authentication_configuration
value:
allowed_ip_range: '{{ allowed_ip_range }}'
secret_token: '{{ secret_token }}'
- name: filters
value:
- json_path: '{{ json_path }}'
match_equals: '{{ match_equals }}'
- name: authentication
value: '{{ authentication }}'
- name: target_pipeline
value: '{{ target_pipeline }}'
- name: target_action
value: '{{ target_action }}'
- name: name
value: '{{ name }}'
- name: target_pipeline_version
value: '{{ target_pipeline_version }}'
- name: register_with_third_party
value: '{{ register_with_third_party }}'
UPDATE example
Use the following StackQL query and manifest file to update a webhook resource, using stack-deploy.
/*+ update */
UPDATE awscc.codepipeline.webhooks
SET PatchDocument = string('{{ {
"AuthenticationConfiguration": authentication_configuration,
"Filters": filters,
"Authentication": authentication,
"TargetPipeline": target_pipeline,
"TargetAction": target_action,
"TargetPipelineVersion": target_pipeline_version,
"RegisterWithThirdParty": register_with_third_party
} | generate_patch_document }}')
WHERE
region = '{{ region }}' AND
Identifier = '{{ id }}'
RETURNING
ErrorCode,
EventTime,
Identifier,
Operation,
OperationStatus,
RequestToken,
ResourceModel,
RetryAfter,
StatusMessage,
TypeName
;
DELETE example
/*+ delete */
DELETE FROM awscc.codepipeline.webhooks
WHERE
Identifier = '{{ id }}' AND
region = '{{ region }}'
RETURNING
ErrorCode,
EventTime,
Identifier,
Operation,
OperationStatus,
RequestToken,
ResourceModel,
RetryAfter,
StatusMessage,
TypeName
;
Additional Parameters
Mutable resources in the Cloud Control provider support additional optional parameters which can be supplied with INSERT, UPDATE, or DELETE operations. These include:
| Parameter | Description |
|---|---|
ClientToken | A unique identifier to ensure the idempotency of the resource request.This allows the provider to accurately distinguish between retries and new requests.A client token is valid for 36 hours once used. After that, a resource request with the same client token is treated as a new request. If you do not specify a client token, one is generated for inclusion in the request. |
RoleArn | The ARN of the IAM role used to perform this resource operation.The role specified must have the permissions required for this operation.If you do not specify a role, a temporary session is created using your AWS user credentials. |
TypeVersionId | For private resource types, the type version to use in this resource operation.If you do not specify a resource version, the default version is used. |
Permissions
To operate on the webhooks resource, the following permissions are required:
- Create
- Read
- Update
- Delete
- List
codepipeline:ListWebhooks,
codepipeline:RegisterWebhookWithThirdParty,
codepipeline:PutWebhook
codepipeline:ListWebhooks
codepipeline:ListWebhooks,
codepipeline:RegisterWebhookWithThirdParty,
codepipeline:PutWebhook,
codepipeline:DeregisterWebhookWithThirdParty
codepipeline:ListWebhooks,
codepipeline:DeleteWebhook,
codepipeline:DeregisterWebhookWithThirdParty
codepipeline:ListWebhooks