Class Webhook
Provides a CodePipeline Webhook.
Example Usage
using Pulumi;
using Aws = Pulumi.Aws;
using Github = Pulumi.Github;
class MyStack : Stack
{
public MyStack()
{
var barPipeline = new Aws.CodePipeline.Pipeline("barPipeline", new Aws.CodePipeline.PipelineArgs
{
ArtifactStore = new Aws.CodePipeline.Inputs.PipelineArtifactStoreArgs
{
EncryptionKey = new Aws.CodePipeline.Inputs.PipelineArtifactStoreEncryptionKeyArgs
{
Id = data.Aws_kms_alias.S3kmskey.Arn,
Type = "KMS",
},
Location = aws_s3_bucket.Bar.Bucket,
Type = "S3",
},
RoleArn = aws_iam_role.Bar.Arn,
Stages =
{
new Aws.CodePipeline.Inputs.PipelineStageArgs
{
Action =
{
{
{ "category", "Source" },
{ "configuration",
{
{ "Branch", "master" },
{ "Owner", "my-organization" },
{ "Repo", "test" },
} },
{ "name", "Source" },
{ "outputArtifacts",
{
"test",
} },
{ "owner", "ThirdParty" },
{ "provider", "GitHub" },
{ "version", "1" },
},
},
Name = "Source",
},
new Aws.CodePipeline.Inputs.PipelineStageArgs
{
Action =
{
{
{ "category", "Build" },
{ "configuration",
{
{ "ProjectName", "test" },
} },
{ "inputArtifacts",
{
"test",
} },
{ "name", "Build" },
{ "owner", "AWS" },
{ "provider", "CodeBuild" },
{ "version", "1" },
},
},
Name = "Build",
},
},
});
var webhookSecret = "super-secret";
var barWebhook = new Aws.CodePipeline.Webhook("barWebhook", new Aws.CodePipeline.WebhookArgs
{
Authentication = "GITHUB_HMAC",
AuthenticationConfiguration = new Aws.CodePipeline.Inputs.WebhookAuthenticationConfigurationArgs
{
SecretToken = webhookSecret,
},
Filters =
{
new Aws.CodePipeline.Inputs.WebhookFilterArgs
{
JsonPath = "$$.ref",
MatchEquals = "refs/heads/{Branch}",
},
},
TargetAction = "Source",
TargetPipeline = barPipeline.Name,
});
// Wire the CodePipeline webhook into a GitHub repository.
var barRepositoryWebhook = new Github.RepositoryWebhook("barRepositoryWebhook", new Github.RepositoryWebhookArgs
{
Configuration = new Github.Inputs.RepositoryWebhookConfigurationArgs
{
ContentType = "json",
InsecureSsl = true,
Secret = webhookSecret,
Url = barWebhook.Url,
},
Events =
{
"push",
},
Repository = github_repository.Repo.Name,
});
}
}
Inherited Members
Namespace: Pulumi.Aws.CodePipeline
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 SourceAuthentication
The type of authentication to use. One of IP, GITHUB_HMAC, or UNAUTHENTICATED.
Declaration
public Output<string> Authentication { get; }
Property Value
| Type | Description |
|---|---|
| Output<System.String> |
AuthenticationConfiguration
An auth block. Required for IP and GITHUB_HMAC. Auth blocks are documented below.
Declaration
public Output<WebhookAuthenticationConfiguration> AuthenticationConfiguration { get; }
Property Value
| Type | Description |
|---|---|
| Output<WebhookAuthenticationConfiguration> |
Filters
One or more filter blocks. Filter blocks are documented below.
Declaration
public Output<ImmutableArray<WebhookFilter>> Filters { get; }
Property Value
| Type | Description |
|---|---|
| Output<System.Collections.Immutable.ImmutableArray<WebhookFilter>> |
Name
The name of the webhook.
Declaration
public Output<string> Name { get; }
Property Value
| Type | Description |
|---|---|
| Output<System.String> |
Tags
A map of tags to assign to the resource.
Declaration
public Output<ImmutableDictionary<string, object>> Tags { get; }
Property Value
| Type | Description |
|---|---|
| Output<System.Collections.Immutable.ImmutableDictionary<System.String, System.Object>> |
TargetAction
The name of the action in a pipeline you want to connect to the webhook. The action must be from the source (first) stage of the pipeline.
Declaration
public Output<string> TargetAction { get; }
Property Value
| Type | Description |
|---|---|
| Output<System.String> |
TargetPipeline
The name of the pipeline.
Declaration
public Output<string> TargetPipeline { get; }
Property Value
| Type | Description |
|---|---|
| Output<System.String> |
Url
The CodePipeline webhook's URL. POST events to this endpoint to trigger the target.
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 |