AWS CodePipeline Webhook

This page shows how to write Terraform and CloudFormation for CodePipeline Webhook and write them securely.

aws_codepipeline_webhook (Terraform)

The Webhook in CodePipeline can be configured in Terraform with the resource name aws_codepipeline_webhook. The following sections describe 5 examples of how to use the resource and its parameters.

Example Usage from GitHub

hooks.tf#L1
resource "aws_codepipeline_webhook" "codepipeline_webhook" {
  authentication  = "GITHUB_HMAC"
  name            = "codepipeline-webhook"
  target_action   = "Source"
  target_pipeline = aws_codepipeline.static_web_pipeline.name

hooks.tf#L1
resource "aws_codepipeline_webhook" "codepipeline_webhook" {
  authentication  = "GITHUB_HMAC"
  name            = "codepipeline-webhook"
  target_action   = "Source"
  target_pipeline = aws_codepipeline.codepipeline.name

14.12.tf#L1
resource "aws_codepipeline_webhook" "example" {
  name            = "example"
  target_pipeline = aws_codepipeline.example.name
  target_action   = "Source"
  authentication  = "GITHUB_HMAC"

aws_codepipeline_webhook.tf#L1
resource "aws_codepipeline_webhook" "example" {
  name            = "example"
  target_pipeline = aws_codepipeline.example.name
  target_action   = "Source"
  authentication  = "GITHUB_HMAC"

12.tf#L1
resource "aws_codepipeline_webhook" "example" {
  name            = "example"
  target_pipeline = aws_codepipeline.example.name
  target_action   = "Source"
  authentication  = "GITHUB_HMAC"

Review your Terraform file for AWS best practices

Shisho Cloud, our free checker to make sure your Terraform configuration follows best practices, is available (beta).

Parameters

Explanation in Terraform Registry

Provides a CodePipeline Webhook.

AWS::CodePipeline::Webhook (CloudFormation)

The Webhook in CodePipeline can be configured in CloudFormation with the resource name AWS::CodePipeline::Webhook. The following sections describe how to use the resource and its parameters.

Example Usage from GitHub

An example could not be found in GitHub.

Parameters

Explanation in CloudFormation Registry

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 Configure Your GitHub Pipelines to Use Webhooks for 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. Important 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.

Frequently asked questions

What is AWS CodePipeline Webhook?

AWS CodePipeline Webhook is a resource for CodePipeline of Amazon Web Service. Settings can be wrote in Terraform and CloudFormation.

Where can I find the example code for the AWS CodePipeline Webhook?

For Terraform, the srinin01/cicdterraformpipeline, HemantTomar/pipe0 and mida-hub/hobby source code examples are useful. See the Terraform Example section for further details.