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<Webhook
Filter> - One or more
filter
blocks. Filter blocks are documented below. - Target
Action 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.
- Target
Pipeline string - The name of the pipeline.
- Authentication
Configuration WebhookAuthentication Configuration - An
auth
block. Required forIP
andGITHUB_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_tags
configuration 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
[]Webhook
Filter Args - One or more
filter
blocks. Filter blocks are documented below. - Target
Action 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.
- Target
Pipeline string - The name of the pipeline.
- Authentication
Configuration WebhookAuthentication Configuration Args - An
auth
block. Required forIP
andGITHUB_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_tags
configuration 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<Webhook
Filter> - One or more
filter
blocks. Filter blocks are documented below. - target
Action 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.
- target
Pipeline String - The name of the pipeline.
- authentication
Configuration WebhookAuthentication Configuration - An
auth
block. Required forIP
andGITHUB_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_tags
configuration 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
Webhook
Filter[] - One or more
filter
blocks. Filter blocks are documented below. - target
Action 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.
- target
Pipeline string - The name of the pipeline.
- authentication
Configuration WebhookAuthentication Configuration - An
auth
block. Required forIP
andGITHUB_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_tags
configuration 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[Webhook
Filter Args] - One or more
filter
blocks. 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
auth
block. Required forIP
andGITHUB_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_tags
configuration 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
filter
blocks. Filter blocks are documented below. - target
Action 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.
- target
Pipeline String - The name of the pipeline.
- authentication
Configuration Property Map - An
auth
block. Required forIP
andGITHUB_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_tags
configuration 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_tags
configuration 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_tags
configuration 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_tags
configuration 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_tags
configuration 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_tags
configuration 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_tags
configuration 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) -> Webhook
func 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)
Resource lookup is not supported in YAML
- 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
. - Authentication
Configuration WebhookAuthentication Configuration - An
auth
block. Required forIP
andGITHUB_HMAC
. Auth blocks are documented below. - Filters
List<Webhook
Filter> - One or more
filter
blocks. 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_tags
configuration 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_tags
configuration block. - Target
Action 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.
- Target
Pipeline 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
. - Authentication
Configuration WebhookAuthentication Configuration Args - An
auth
block. Required forIP
andGITHUB_HMAC
. Auth blocks are documented below. - Filters
[]Webhook
Filter Args - One or more
filter
blocks. 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_tags
configuration 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_tags
configuration block. - Target
Action 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.
- Target
Pipeline 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
. - authentication
Configuration WebhookAuthentication Configuration - An
auth
block. Required forIP
andGITHUB_HMAC
. Auth blocks are documented below. - filters
List<Webhook
Filter> - One or more
filter
blocks. 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_tags
configuration 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_tags
configuration block. - target
Action 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.
- target
Pipeline 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
. - authentication
Configuration WebhookAuthentication Configuration - An
auth
block. Required forIP
andGITHUB_HMAC
. Auth blocks are documented below. - filters
Webhook
Filter[] - One or more
filter
blocks. 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_tags
configuration 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_tags
configuration block. - target
Action 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.
- target
Pipeline 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
auth
block. Required forIP
andGITHUB_HMAC
. Auth blocks are documented below. - filters
Sequence[Webhook
Filter Args] - One or more
filter
blocks. 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_tags
configuration 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_tags
configuration 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
. - authentication
Configuration Property Map - An
auth
block. Required forIP
andGITHUB_HMAC
. Auth blocks are documented below. - filters List<Property Map>
- One or more
filter
blocks. 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_tags
configuration 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_tags
configuration block. - target
Action 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.
- target
Pipeline 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
- Allowed
Ip stringRange - A valid CIDR block for
IP
filtering. Required forIP
. - Secret
Token string - The shared secret for the GitHub repository webhook. Set this as
secret
in yourgithub_repository_webhook
'sconfiguration
block. Required forGITHUB_HMAC
.
- Allowed
Ip stringRange - A valid CIDR block for
IP
filtering. Required forIP
. - Secret
Token string - The shared secret for the GitHub repository webhook. Set this as
secret
in yourgithub_repository_webhook
'sconfiguration
block. Required forGITHUB_HMAC
.
- allowed
Ip StringRange - A valid CIDR block for
IP
filtering. Required forIP
. - secret
Token String - The shared secret for the GitHub repository webhook. Set this as
secret
in yourgithub_repository_webhook
'sconfiguration
block. Required forGITHUB_HMAC
.
- allowed
Ip stringRange - A valid CIDR block for
IP
filtering. Required forIP
. - secret
Token string - The shared secret for the GitHub repository webhook. Set this as
secret
in yourgithub_repository_webhook
'sconfiguration
block. Required forGITHUB_HMAC
.
- allowed_
ip_ strrange - A valid CIDR block for
IP
filtering. Required forIP
. - secret_
token str - The shared secret for the GitHub repository webhook. Set this as
secret
in yourgithub_repository_webhook
'sconfiguration
block. Required forGITHUB_HMAC
.
- allowed
Ip StringRange - A valid CIDR block for
IP
filtering. Required forIP
. - secret
Token String - The shared secret for the GitHub repository webhook. Set this as
secret
in yourgithub_repository_webhook
'sconfiguration
block. Required forGITHUB_HMAC
.
WebhookFilter, WebhookFilterArgs
- Json
Path string - The JSON path to filter on.
- Match
Equals string - The value to match on (e.g.,
refs/heads/{Branch}
). See AWS docs for details.
- Json
Path string - The JSON path to filter on.
- Match
Equals string - The value to match on (e.g.,
refs/heads/{Branch}
). See AWS docs for details.
- json
Path String - The JSON path to filter on.
- match
Equals String - The value to match on (e.g.,
refs/heads/{Branch}
). See AWS docs for details.
- json
Path string - The JSON path to filter on.
- match
Equals 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.
- json
Path String - The JSON path to filter on.
- match
Equals 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
aws
Terraform Provider.