aws.codepipeline.Webhook
Explore with Pulumi AI
Provides a CodePipeline Webhook.
Example Usage
Coming soon!
Coming soon!
Coming soon!
Coming soon!
Coming soon!
resources:
  bar:
    type: aws:codepipeline:Pipeline
    properties:
      name: tf-test-pipeline
      roleArn: ${barAwsIamRole.arn}
      artifactStores:
        - location: ${barAwsS3Bucket.bucket}
          type: S3
          encryptionKey:
            id: ${s3kmskey.arn}
            type: KMS
      stages:
        - name: Source
          actions:
            - name: Source
              category: Source
              owner: ThirdParty
              provider: GitHub
              version: '1'
              outputArtifacts:
                - test
              configuration:
                Owner: my-organization
                Repo: test
                Branch: master
        - name: Build
          actions:
            - name: Build
              category: Build
              owner: AWS
              provider: CodeBuild
              inputArtifacts:
                - test
              version: '1'
              configuration:
                ProjectName: test
  barWebhook:
    type: aws:codepipeline:Webhook
    name: bar
    properties:
      name: test-webhook-github-bar
      authentication: GITHUB_HMAC
      targetAction: Source
      targetPipeline: ${bar.name}
      authenticationConfiguration:
        secretToken: ${webhookSecret}
      filters:
        - jsonPath: $.ref
          matchEquals: refs/heads/{Branch}
  # Wire the CodePipeline webhook into a GitHub repository.
  barRepositoryWebhook:
    type: github:RepositoryWebhook
    name: bar
    properties:
      repository: ${repo.name}
      name: web
      configuration:
        url: ${barWebhook.url}
        contentType: json
        insecureSsl: true
        secret: ${webhookSecret}
      events:
        - push
variables:
  webhookSecret: super-secret
Create Webhook Resource
Resources are created with functions called constructors. To learn more about declaring and configuring resources, see Resources.
Constructor syntax
new Webhook(name: string, args: WebhookArgs, opts?: CustomResourceOptions);@overload
def Webhook(resource_name: str,
            args: WebhookArgs,
            opts: Optional[ResourceOptions] = None)
@overload
def Webhook(resource_name: str,
            opts: Optional[ResourceOptions] = None,
            authentication: Optional[str] = None,
            filters: Optional[Sequence[WebhookFilterArgs]] = None,
            target_action: Optional[str] = None,
            target_pipeline: Optional[str] = None,
            authentication_configuration: Optional[WebhookAuthenticationConfigurationArgs] = None,
            name: Optional[str] = None,
            tags: Optional[Mapping[str, str]] = None)func NewWebhook(ctx *Context, name string, args WebhookArgs, opts ...ResourceOption) (*Webhook, error)public Webhook(string name, WebhookArgs args, CustomResourceOptions? opts = null)
public Webhook(String name, WebhookArgs args)
public Webhook(String name, WebhookArgs args, CustomResourceOptions options)
type: aws:codepipeline:Webhook
properties: # The arguments to resource properties.
options: # Bag of options to control resource's behavior.
Parameters
- name string
- The unique name of the resource.
- args WebhookArgs
- The arguments to resource properties.
- opts CustomResourceOptions
- Bag of options to control resource's behavior.
- resource_name str
- The unique name of the resource.
- args WebhookArgs
- The arguments to resource properties.
- opts ResourceOptions
- Bag of options to control resource's behavior.
- ctx Context
- Context object for the current deployment.
- name string
- The unique name of the resource.
- args WebhookArgs
- The arguments to resource properties.
- opts ResourceOption
- Bag of options to control resource's behavior.
- name string
- The unique name of the resource.
- args WebhookArgs
- The arguments to resource properties.
- opts CustomResourceOptions
- Bag of options to control resource's behavior.
- name String
- The unique name of the resource.
- args WebhookArgs
- The arguments to resource properties.
- options CustomResourceOptions
- Bag of options to control resource's behavior.
Constructor example
The following reference example uses placeholder values for all input properties.
var examplewebhookResourceResourceFromCodepipelinewebhook = new Aws.CodePipeline.Webhook("examplewebhookResourceResourceFromCodepipelinewebhook", new()
{
    Authentication = "string",
    Filters = new[]
    {
        new Aws.CodePipeline.Inputs.WebhookFilterArgs
        {
            JsonPath = "string",
            MatchEquals = "string",
        },
    },
    TargetAction = "string",
    TargetPipeline = "string",
    AuthenticationConfiguration = new Aws.CodePipeline.Inputs.WebhookAuthenticationConfigurationArgs
    {
        AllowedIpRange = "string",
        SecretToken = "string",
    },
    Name = "string",
    Tags = 
    {
        { "string", "string" },
    },
});
example, err := codepipeline.NewWebhook(ctx, "examplewebhookResourceResourceFromCodepipelinewebhook", &codepipeline.WebhookArgs{
	Authentication: pulumi.String("string"),
	Filters: codepipeline.WebhookFilterArray{
		&codepipeline.WebhookFilterArgs{
			JsonPath:    pulumi.String("string"),
			MatchEquals: pulumi.String("string"),
		},
	},
	TargetAction:   pulumi.String("string"),
	TargetPipeline: pulumi.String("string"),
	AuthenticationConfiguration: &codepipeline.WebhookAuthenticationConfigurationArgs{
		AllowedIpRange: pulumi.String("string"),
		SecretToken:    pulumi.String("string"),
	},
	Name: pulumi.String("string"),
	Tags: pulumi.StringMap{
		"string": pulumi.String("string"),
	},
})
var examplewebhookResourceResourceFromCodepipelinewebhook = new Webhook("examplewebhookResourceResourceFromCodepipelinewebhook", WebhookArgs.builder()
    .authentication("string")
    .filters(WebhookFilterArgs.builder()
        .jsonPath("string")
        .matchEquals("string")
        .build())
    .targetAction("string")
    .targetPipeline("string")
    .authenticationConfiguration(WebhookAuthenticationConfigurationArgs.builder()
        .allowedIpRange("string")
        .secretToken("string")
        .build())
    .name("string")
    .tags(Map.of("string", "string"))
    .build());
examplewebhook_resource_resource_from_codepipelinewebhook = aws.codepipeline.Webhook("examplewebhookResourceResourceFromCodepipelinewebhook",
    authentication="string",
    filters=[{
        "json_path": "string",
        "match_equals": "string",
    }],
    target_action="string",
    target_pipeline="string",
    authentication_configuration={
        "allowed_ip_range": "string",
        "secret_token": "string",
    },
    name="string",
    tags={
        "string": "string",
    })
const examplewebhookResourceResourceFromCodepipelinewebhook = new aws.codepipeline.Webhook("examplewebhookResourceResourceFromCodepipelinewebhook", {
    authentication: "string",
    filters: [{
        jsonPath: "string",
        matchEquals: "string",
    }],
    targetAction: "string",
    targetPipeline: "string",
    authenticationConfiguration: {
        allowedIpRange: "string",
        secretToken: "string",
    },
    name: "string",
    tags: {
        string: "string",
    },
});
type: aws:codepipeline:Webhook
properties:
    authentication: string
    authenticationConfiguration:
        allowedIpRange: string
        secretToken: string
    filters:
        - jsonPath: string
          matchEquals: string
    name: string
    tags:
        string: string
    targetAction: string
    targetPipeline: string
Webhook Resource Properties
To learn more about resource properties and how to use them, see Inputs and Outputs in the Architecture and Concepts docs.
Inputs
In Python, inputs that are objects can be passed either as argument classes or as dictionary literals.
The Webhook resource accepts the following input properties:
- Authentication string
- The type of authentication to use. One of IP,GITHUB_HMAC, orUNAUTHENTICATED.
- Filters
List<WebhookFilter> 
- One or more filterblocks. Filter blocks are documented below.
- TargetAction string
- 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.
- TargetPipeline string
- The name of the pipeline.
- AuthenticationConfiguration WebhookAuthentication Configuration 
- An authblock. Required forIPandGITHUB_HMAC. Auth blocks are documented below.
- Name string
- The name of the webhook.
- Dictionary<string, string>
- A map of tags to assign to the resource. If configured with a provider default_tagsconfiguration block present, tags with matching keys will overwrite those defined at the provider-level.
- Authentication string
- The type of authentication to use. One of IP,GITHUB_HMAC, orUNAUTHENTICATED.
- Filters
[]WebhookFilter Args 
- One or more filterblocks. Filter blocks are documented below.
- TargetAction string
- 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.
- TargetPipeline string
- The name of the pipeline.
- AuthenticationConfiguration WebhookAuthentication Configuration Args 
- An authblock. Required forIPandGITHUB_HMAC. Auth blocks are documented below.
- Name string
- The name of the webhook.
- map[string]string
- A map of tags to assign to the resource. If configured with a provider default_tagsconfiguration block present, tags with matching keys will overwrite those defined at the provider-level.
- authentication String
- The type of authentication to use. One of IP,GITHUB_HMAC, orUNAUTHENTICATED.
- filters
List<WebhookFilter> 
- One or more filterblocks. Filter blocks are documented below.
- targetAction String
- 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.
- targetPipeline String
- The name of the pipeline.
- authenticationConfiguration WebhookAuthentication Configuration 
- An authblock. Required forIPandGITHUB_HMAC. Auth blocks are documented below.
- name String
- The name of the webhook.
- Map<String,String>
- A map of tags to assign to the resource. If configured with a provider default_tagsconfiguration block present, tags with matching keys will overwrite those defined at the provider-level.
- authentication string
- The type of authentication to use. One of IP,GITHUB_HMAC, orUNAUTHENTICATED.
- filters
WebhookFilter[] 
- One or more filterblocks. Filter blocks are documented below.
- targetAction string
- 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.
- targetPipeline string
- The name of the pipeline.
- authenticationConfiguration WebhookAuthentication Configuration 
- An authblock. Required forIPandGITHUB_HMAC. Auth blocks are documented below.
- name string
- The name of the webhook.
- {[key: string]: string}
- A map of tags to assign to the resource. If configured with a provider default_tagsconfiguration block present, tags with matching keys will overwrite those defined at the provider-level.
- authentication str
- The type of authentication to use. One of IP,GITHUB_HMAC, orUNAUTHENTICATED.
- filters
Sequence[WebhookFilter Args] 
- One or more filterblocks. Filter blocks are documented below.
- target_action str
- 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.
- target_pipeline str
- The name of the pipeline.
- authentication_configuration WebhookAuthentication Configuration Args 
- An authblock. Required forIPandGITHUB_HMAC. Auth blocks are documented below.
- name str
- The name of the webhook.
- Mapping[str, str]
- A map of tags to assign to the resource. If configured with a provider default_tagsconfiguration block present, tags with matching keys will overwrite those defined at the provider-level.
- authentication String
- The type of authentication to use. One of IP,GITHUB_HMAC, orUNAUTHENTICATED.
- filters List<Property Map>
- One or more filterblocks. Filter blocks are documented below.
- targetAction String
- 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.
- targetPipeline String
- The name of the pipeline.
- authenticationConfiguration Property Map
- An authblock. Required forIPandGITHUB_HMAC. Auth blocks are documented below.
- name String
- The name of the webhook.
- Map<String>
- A map of tags to assign to the resource. If configured with a provider default_tagsconfiguration block present, tags with matching keys will overwrite those defined at the provider-level.
Outputs
All input properties are implicitly available as output properties. Additionally, the Webhook resource produces the following output properties:
- Arn string
- The CodePipeline webhook's ARN.
- Id string
- The provider-assigned unique ID for this managed resource.
- Dictionary<string, string>
- A map of tags assigned to the resource, including those inherited from the provider default_tagsconfiguration block.
- Url string
- The CodePipeline webhook's URL. POST events to this endpoint to trigger the target.
- Arn string
- The CodePipeline webhook's ARN.
- Id string
- The provider-assigned unique ID for this managed resource.
- map[string]string
- A map of tags assigned to the resource, including those inherited from the provider default_tagsconfiguration block.
- Url string
- The CodePipeline webhook's URL. POST events to this endpoint to trigger the target.
- arn String
- The CodePipeline webhook's ARN.
- id String
- The provider-assigned unique ID for this managed resource.
- Map<String,String>
- A map of tags assigned to the resource, including those inherited from the provider default_tagsconfiguration block.
- url String
- The CodePipeline webhook's URL. POST events to this endpoint to trigger the target.
- arn string
- The CodePipeline webhook's ARN.
- id string
- The provider-assigned unique ID for this managed resource.
- {[key: string]: string}
- A map of tags assigned to the resource, including those inherited from the provider default_tagsconfiguration block.
- url string
- The CodePipeline webhook's URL. POST events to this endpoint to trigger the target.
- arn str
- The CodePipeline webhook's ARN.
- id str
- The provider-assigned unique ID for this managed resource.
- Mapping[str, str]
- A map of tags assigned to the resource, including those inherited from the provider default_tagsconfiguration block.
- url str
- The CodePipeline webhook's URL. POST events to this endpoint to trigger the target.
- arn String
- The CodePipeline webhook's ARN.
- id String
- The provider-assigned unique ID for this managed resource.
- Map<String>
- A map of tags assigned to the resource, including those inherited from the provider default_tagsconfiguration block.
- url String
- The CodePipeline webhook's URL. POST events to this endpoint to trigger the target.
Look up Existing Webhook Resource
Get an existing Webhook resource’s state with the given name, ID, and optional extra properties used to qualify the lookup.
public static get(name: string, id: Input<ID>, state?: WebhookState, opts?: CustomResourceOptions): Webhook@staticmethod
def get(resource_name: str,
        id: str,
        opts: Optional[ResourceOptions] = None,
        arn: Optional[str] = None,
        authentication: Optional[str] = None,
        authentication_configuration: Optional[WebhookAuthenticationConfigurationArgs] = None,
        filters: Optional[Sequence[WebhookFilterArgs]] = None,
        name: Optional[str] = None,
        tags: Optional[Mapping[str, str]] = None,
        tags_all: Optional[Mapping[str, str]] = None,
        target_action: Optional[str] = None,
        target_pipeline: Optional[str] = None,
        url: Optional[str] = None) -> Webhookfunc GetWebhook(ctx *Context, name string, id IDInput, state *WebhookState, opts ...ResourceOption) (*Webhook, error)public static Webhook Get(string name, Input<string> id, WebhookState? state, CustomResourceOptions? opts = null)public static Webhook get(String name, Output<String> id, WebhookState state, CustomResourceOptions options)resources:  _:    type: aws:codepipeline:Webhook    get:      id: ${id}- name
- The unique name of the resulting resource.
- id
- The unique provider ID of the resource to lookup.
- state
- Any extra arguments used during the lookup.
- opts
- A bag of options that control this resource's behavior.
- resource_name
- The unique name of the resulting resource.
- id
- The unique provider ID of the resource to lookup.
- name
- The unique name of the resulting resource.
- id
- The unique provider ID of the resource to lookup.
- state
- Any extra arguments used during the lookup.
- opts
- A bag of options that control this resource's behavior.
- name
- The unique name of the resulting resource.
- id
- The unique provider ID of the resource to lookup.
- state
- Any extra arguments used during the lookup.
- opts
- A bag of options that control this resource's behavior.
- name
- The unique name of the resulting resource.
- id
- The unique provider ID of the resource to lookup.
- state
- Any extra arguments used during the lookup.
- opts
- A bag of options that control this resource's behavior.
- Arn string
- The CodePipeline webhook's ARN.
- Authentication string
- The type of authentication to use. One of IP,GITHUB_HMAC, orUNAUTHENTICATED.
- AuthenticationConfiguration WebhookAuthentication Configuration 
- An authblock. Required forIPandGITHUB_HMAC. Auth blocks are documented below.
- Filters
List<WebhookFilter> 
- One or more filterblocks. Filter blocks are documented below.
- Name string
- The name of the webhook.
- Dictionary<string, string>
- A map of tags to assign to the resource. If configured with a provider default_tagsconfiguration block present, tags with matching keys will overwrite those defined at the provider-level.
- Dictionary<string, string>
- A map of tags assigned to the resource, including those inherited from the provider default_tagsconfiguration block.
- TargetAction string
- 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.
- TargetPipeline string
- The name of the pipeline.
- Url string
- The CodePipeline webhook's URL. POST events to this endpoint to trigger the target.
- Arn string
- The CodePipeline webhook's ARN.
- Authentication string
- The type of authentication to use. One of IP,GITHUB_HMAC, orUNAUTHENTICATED.
- AuthenticationConfiguration WebhookAuthentication Configuration Args 
- An authblock. Required forIPandGITHUB_HMAC. Auth blocks are documented below.
- Filters
[]WebhookFilter Args 
- One or more filterblocks. Filter blocks are documented below.
- Name string
- The name of the webhook.
- map[string]string
- A map of tags to assign to the resource. If configured with a provider default_tagsconfiguration block present, tags with matching keys will overwrite those defined at the provider-level.
- map[string]string
- A map of tags assigned to the resource, including those inherited from the provider default_tagsconfiguration block.
- TargetAction string
- 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.
- TargetPipeline string
- The name of the pipeline.
- Url string
- The CodePipeline webhook's URL. POST events to this endpoint to trigger the target.
- arn String
- The CodePipeline webhook's ARN.
- authentication String
- The type of authentication to use. One of IP,GITHUB_HMAC, orUNAUTHENTICATED.
- authenticationConfiguration WebhookAuthentication Configuration 
- An authblock. Required forIPandGITHUB_HMAC. Auth blocks are documented below.
- filters
List<WebhookFilter> 
- One or more filterblocks. Filter blocks are documented below.
- name String
- The name of the webhook.
- Map<String,String>
- A map of tags to assign to the resource. If configured with a provider default_tagsconfiguration block present, tags with matching keys will overwrite those defined at the provider-level.
- Map<String,String>
- A map of tags assigned to the resource, including those inherited from the provider default_tagsconfiguration block.
- targetAction String
- 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.
- targetPipeline String
- The name of the pipeline.
- url String
- The CodePipeline webhook's URL. POST events to this endpoint to trigger the target.
- arn string
- The CodePipeline webhook's ARN.
- authentication string
- The type of authentication to use. One of IP,GITHUB_HMAC, orUNAUTHENTICATED.
- authenticationConfiguration WebhookAuthentication Configuration 
- An authblock. Required forIPandGITHUB_HMAC. Auth blocks are documented below.
- filters
WebhookFilter[] 
- One or more filterblocks. Filter blocks are documented below.
- name string
- The name of the webhook.
- {[key: string]: string}
- A map of tags to assign to the resource. If configured with a provider default_tagsconfiguration block present, tags with matching keys will overwrite those defined at the provider-level.
- {[key: string]: string}
- A map of tags assigned to the resource, including those inherited from the provider default_tagsconfiguration block.
- targetAction string
- 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.
- targetPipeline string
- The name of the pipeline.
- url string
- The CodePipeline webhook's URL. POST events to this endpoint to trigger the target.
- arn str
- The CodePipeline webhook's ARN.
- authentication str
- The type of authentication to use. One of IP,GITHUB_HMAC, orUNAUTHENTICATED.
- authentication_configuration WebhookAuthentication Configuration Args 
- An authblock. Required forIPandGITHUB_HMAC. Auth blocks are documented below.
- filters
Sequence[WebhookFilter Args] 
- One or more filterblocks. Filter blocks are documented below.
- name str
- The name of the webhook.
- Mapping[str, str]
- A map of tags to assign to the resource. If configured with a provider default_tagsconfiguration block present, tags with matching keys will overwrite those defined at the provider-level.
- Mapping[str, str]
- A map of tags assigned to the resource, including those inherited from the provider default_tagsconfiguration block.
- target_action str
- 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.
- target_pipeline str
- The name of the pipeline.
- url str
- The CodePipeline webhook's URL. POST events to this endpoint to trigger the target.
- arn String
- The CodePipeline webhook's ARN.
- authentication String
- The type of authentication to use. One of IP,GITHUB_HMAC, orUNAUTHENTICATED.
- authenticationConfiguration Property Map
- An authblock. Required forIPandGITHUB_HMAC. Auth blocks are documented below.
- filters List<Property Map>
- One or more filterblocks. Filter blocks are documented below.
- name String
- The name of the webhook.
- Map<String>
- A map of tags to assign to the resource. If configured with a provider default_tagsconfiguration block present, tags with matching keys will overwrite those defined at the provider-level.
- Map<String>
- A map of tags assigned to the resource, including those inherited from the provider default_tagsconfiguration block.
- targetAction String
- 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.
- targetPipeline String
- The name of the pipeline.
- url String
- The CodePipeline webhook's URL. POST events to this endpoint to trigger the target.
Supporting Types
WebhookAuthenticationConfiguration, WebhookAuthenticationConfigurationArgs      
- AllowedIp stringRange 
- A valid CIDR block for IPfiltering. Required forIP.
- SecretToken string
- The shared secret for the GitHub repository webhook. Set this as secretin yourgithub_repository_webhook'sconfigurationblock. Required forGITHUB_HMAC.
- AllowedIp stringRange 
- A valid CIDR block for IPfiltering. Required forIP.
- SecretToken string
- The shared secret for the GitHub repository webhook. Set this as secretin yourgithub_repository_webhook'sconfigurationblock. Required forGITHUB_HMAC.
- allowedIp StringRange 
- A valid CIDR block for IPfiltering. Required forIP.
- secretToken String
- The shared secret for the GitHub repository webhook. Set this as secretin yourgithub_repository_webhook'sconfigurationblock. Required forGITHUB_HMAC.
- allowedIp stringRange 
- A valid CIDR block for IPfiltering. Required forIP.
- secretToken string
- The shared secret for the GitHub repository webhook. Set this as secretin yourgithub_repository_webhook'sconfigurationblock. Required forGITHUB_HMAC.
- allowed_ip_ strrange 
- A valid CIDR block for IPfiltering. Required forIP.
- secret_token str
- The shared secret for the GitHub repository webhook. Set this as secretin yourgithub_repository_webhook'sconfigurationblock. Required forGITHUB_HMAC.
- allowedIp StringRange 
- A valid CIDR block for IPfiltering. Required forIP.
- secretToken String
- The shared secret for the GitHub repository webhook. Set this as secretin yourgithub_repository_webhook'sconfigurationblock. Required forGITHUB_HMAC.
WebhookFilter, WebhookFilterArgs    
- JsonPath string
- The JSON path to filter on.
- MatchEquals string
- The value to match on (e.g., refs/heads/{Branch}). See AWS docs for details.
- JsonPath string
- The JSON path to filter on.
- MatchEquals string
- The value to match on (e.g., refs/heads/{Branch}). See AWS docs for details.
- jsonPath String
- The JSON path to filter on.
- matchEquals String
- The value to match on (e.g., refs/heads/{Branch}). See AWS docs for details.
- jsonPath string
- The JSON path to filter on.
- matchEquals string
- The value to match on (e.g., refs/heads/{Branch}). See AWS docs for details.
- json_path str
- The JSON path to filter on.
- match_equals str
- The value to match on (e.g., refs/heads/{Branch}). See AWS docs for details.
- jsonPath String
- The JSON path to filter on.
- matchEquals String
- The value to match on (e.g., refs/heads/{Branch}). See AWS docs for details.
Import
Using pulumi import, import CodePipeline Webhooks using their ARN. For example:
$ pulumi import aws:codepipeline/webhook:Webhook example arn:aws:codepipeline:us-west-2:123456789012:webhook:example
To learn more about importing existing cloud resources, see Importing resources.
Package Details
- Repository
- AWS Classic pulumi/pulumi-aws
- License
- Apache-2.0
- Notes
- This Pulumi package is based on the awsTerraform Provider.