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,
});
}
}
Inherited Members
Namespace: Pulumi.Aws.CodeBuild
Assembly: Pulumi.Aws.dll
Syntax
public class Webhook : CustomResource
Constructors
View SourceWebhook(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 SourceBranchFilter
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> |
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>> |
PayloadUrl
The CodeBuild endpoint where webhook events are sent.
Declaration
public Output<string> PayloadUrl { get; }
Property Value
| Type | Description |
|---|---|
| Output<System.String> |
ProjectName
The name of the build project.
Declaration
public Output<string> ProjectName { get; }
Property Value
| Type | Description |
|---|---|
| Output<System.String> |
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> |
Url
The URL to the webhook.
Declaration
public Output<string> Url { get; }
Property Value
| Type | Description |
|---|---|
| Output<System.String> |
Methods
View SourceGet(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 |