Show / Hide Table of Contents

Class Webhook

Manages a CodeBuild webhook, which is an endpoint accepted by the CodeBuild service to trigger builds from source code repositories. Depending on the source type of the CodeBuild project, the CodeBuild service may also automatically create and delete the actual repository webhook as well.

Example Usage

Bitbucket and GitHub

using Pulumi;
using Aws = Pulumi.Aws;

class MyStack : Stack
{
public MyStack()
{
    var example = new Aws.CodeBuild.Webhook("example", new Aws.CodeBuild.WebhookArgs
    {
        FilterGroups = 
        {
            new Aws.CodeBuild.Inputs.WebhookFilterGroupArgs
            {
                Filter = 
                {

                    {
                        { "pattern", "PUSH" },
                        { "type", "EVENT" },
                    },

                    {
                        { "pattern", "master" },
                        { "type", "HEAD_REF" },
                    },
                },
            },
        },
        ProjectName = aws_codebuild_project.Example.Name,
    });
}

}

GitHub Enterprise

using Pulumi;
using Aws = Pulumi.Aws;
using Github = Pulumi.Github;

class MyStack : Stack
{
public MyStack()
{
    var exampleWebhook = new Aws.CodeBuild.Webhook("exampleWebhook", new Aws.CodeBuild.WebhookArgs
    {
        ProjectName = aws_codebuild_project.Example.Name,
    });
    var exampleRepositoryWebhook = new Github.RepositoryWebhook("exampleRepositoryWebhook", new Github.RepositoryWebhookArgs
    {
        Active = true,
        Configuration = new Github.Inputs.RepositoryWebhookConfigurationArgs
        {
            ContentType = "json",
            InsecureSsl = false,
            Secret = exampleWebhook.Secret,
            Url = exampleWebhook.PayloadUrl,
        },
        Events = 
        {
            "push",
        },
        Repository = github_repository.Example.Name,
    });
}

}
Inheritance
System.Object
Resource
CustomResource
Webhook
Inherited Members
CustomResource.Id
Resource.GetResourceType()
Resource.GetResourceName()
Resource.Urn
System.Object.Equals(System.Object)
System.Object.Equals(System.Object, System.Object)
System.Object.GetHashCode()
System.Object.GetType()
System.Object.MemberwiseClone()
System.Object.ReferenceEquals(System.Object, System.Object)
System.Object.ToString()
Namespace: Pulumi.Aws.CodeBuild
Assembly: Pulumi.Aws.dll
Syntax
public class Webhook : CustomResource

Constructors

View Source

Webhook(String, WebhookArgs, CustomResourceOptions)

Create a Webhook resource with the given unique name, arguments, and options.

Declaration
public Webhook(string name, WebhookArgs args, CustomResourceOptions options = null)
Parameters
Type Name Description
System.String name

The unique name of the resource

WebhookArgs args

The arguments used to populate this resource's properties

CustomResourceOptions options

A bag of options that control this resource's behavior

Properties

View Source

BranchFilter

A regular expression used to determine which branches get built. Default is all branches are built. It is recommended to use filter_group over branch_filter.

Declaration
public Output<string> BranchFilter { get; }
Property Value
Type Description
Output<System.String>
View Source

FilterGroups

Information about the webhook's trigger. Filter group blocks are documented below.

Declaration
public Output<ImmutableArray<WebhookFilterGroup>> FilterGroups { get; }
Property Value
Type Description
Output<System.Collections.Immutable.ImmutableArray<WebhookFilterGroup>>
View Source

PayloadUrl

The CodeBuild endpoint where webhook events are sent.

Declaration
public Output<string> PayloadUrl { get; }
Property Value
Type Description
Output<System.String>
View Source

ProjectName

The name of the build project.

Declaration
public Output<string> ProjectName { get; }
Property Value
Type Description
Output<System.String>
View Source

Secret

The secret token of the associated repository. Not returned by the CodeBuild API for all source types.

Declaration
public Output<string> Secret { get; }
Property Value
Type Description
Output<System.String>
View Source

Url

The URL to the webhook.

Declaration
public Output<string> Url { get; }
Property Value
Type Description
Output<System.String>

Methods

View Source

Get(String, Input<String>, WebhookState, CustomResourceOptions)

Get an existing Webhook resource's state with the given name, ID, and optional extra properties used to qualify the lookup.

Declaration
public static Webhook Get(string name, Input<string> id, WebhookState state = null, CustomResourceOptions options = null)
Parameters
Type Name Description
System.String name

The unique name of the resulting resource.

Input<System.String> id

The unique provider ID of the resource to lookup.

WebhookState state

Any extra arguments used during the lookup.

CustomResourceOptions options

A bag of options that control this resource's behavior

Returns
Type Description
Webhook
  • View Source
Back to top Copyright 2016-2020, Pulumi Corporation.