Trigger
Provides a CodeCommit Trigger Resource.
Example Usage
using Pulumi;
using Aws = Pulumi.Aws;
class MyStack : Stack
{
public MyStack()
{
var testRepository = new Aws.CodeCommit.Repository("testRepository", new Aws.CodeCommit.RepositoryArgs
{
RepositoryName = "test",
});
var testTrigger = new Aws.CodeCommit.Trigger("testTrigger", new Aws.CodeCommit.TriggerArgs
{
RepositoryName = testRepository.RepositoryName,
Triggers =
{
new Aws.CodeCommit.Inputs.TriggerTriggerArgs
{
DestinationArn = aws_sns_topic.Test.Arn,
Events =
{
"all",
},
Name = "all",
},
},
});
}
}
package main
import (
"github.com/pulumi/pulumi-aws/sdk/v2/go/aws/codecommit"
"github.com/pulumi/pulumi/sdk/v2/go/pulumi"
)
func main() {
pulumi.Run(func(ctx *pulumi.Context) error {
testRepository, err := codecommit.NewRepository(ctx, "testRepository", &codecommit.RepositoryArgs{
RepositoryName: pulumi.String("test"),
})
if err != nil {
return err
}
_, err = codecommit.NewTrigger(ctx, "testTrigger", &codecommit.TriggerArgs{
RepositoryName: testRepository.RepositoryName,
Triggers: codecommit.TriggerTriggerArray{
&codecommit.TriggerTriggerArgs{
DestinationArn: pulumi.String(aws_sns_topic.Test.Arn),
Events: pulumi.StringArray{
pulumi.String("all"),
},
Name: pulumi.String("all"),
},
},
})
if err != nil {
return err
}
return nil
})
}import pulumi
import pulumi_aws as aws
test_repository = aws.codecommit.Repository("testRepository", repository_name="test")
test_trigger = aws.codecommit.Trigger("testTrigger",
repository_name=test_repository.repository_name,
triggers=[{
"destination_arn": aws_sns_topic["test"]["arn"],
"events": ["all"],
"name": "all",
}])import * as pulumi from "@pulumi/pulumi";
import * as aws from "@pulumi/aws";
const testRepository = new aws.codecommit.Repository("test", {
repositoryName: "test",
});
const testTrigger = new aws.codecommit.Trigger("test", {
repositoryName: testRepository.repositoryName,
triggers: [{
destinationArn: aws_sns_topic_test.arn,
events: ["all"],
name: "all",
}],
});Create a Trigger Resource
new Trigger(name: string, args: TriggerArgs, opts?: CustomResourceOptions);def Trigger(resource_name, opts=None, repository_name=None, triggers=None, __props__=None);func NewTrigger(ctx *Context, name string, args TriggerArgs, opts ...ResourceOption) (*Trigger, error)public Trigger(string name, TriggerArgs args, CustomResourceOptions? opts = null)- name string
- The unique name of the resource.
- args TriggerArgs
- The arguments to resource properties.
- opts CustomResourceOptions
- Bag of options to control resource's behavior.
- resource_name str
- The unique name of the resource.
- opts ResourceOptions
- A bag of options that control this resource's behavior.
- ctx Context
- Context object for the current deployment.
- name string
- The unique name of the resource.
- args TriggerArgs
- The arguments to resource properties.
- opts ResourceOption
- Bag of options to control resource's behavior.
- name string
- The unique name of the resource.
- args TriggerArgs
- The arguments to resource properties.
- opts CustomResourceOptions
- Bag of options to control resource's behavior.
Trigger Resource Properties
To learn more about resource properties and how to use them, see Inputs and Outputs in the Programming Model docs.
Inputs
The Trigger resource accepts the following input properties:
- Repository
Name string The name for the repository. This needs to be less than 100 characters.
- Triggers
List<Trigger
Trigger Args>
- Repository
Name string The name for the repository. This needs to be less than 100 characters.
- Triggers
[]Trigger
Trigger
- repository
Name string The name for the repository. This needs to be less than 100 characters.
- triggers
Trigger
Trigger[]
- repository_
name str The name for the repository. This needs to be less than 100 characters.
- triggers
List[Trigger
Trigger]
Outputs
All input properties are implicitly available as output properties. Additionally, the Trigger resource produces the following output properties:
- Configuration
Id string - Id string
- The provider-assigned unique ID for this managed resource.
- Configuration
Id string - Id string
- The provider-assigned unique ID for this managed resource.
- configuration
Id string - id string
- The provider-assigned unique ID for this managed resource.
- configuration_
id str - id str
- The provider-assigned unique ID for this managed resource.
Look up an Existing Trigger Resource
Get an existing Trigger 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?: TriggerState, opts?: CustomResourceOptions): Triggerstatic get(resource_name, id, opts=None, configuration_id=None, repository_name=None, triggers=None, __props__=None);func GetTrigger(ctx *Context, name string, id IDInput, state *TriggerState, opts ...ResourceOption) (*Trigger, error)public static Trigger Get(string name, Input<string> id, TriggerState? state, CustomResourceOptions? opts = null)- 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.
The following state arguments are supported:
- Configuration
Id string - Repository
Name string The name for the repository. This needs to be less than 100 characters.
- Triggers
List<Trigger
Trigger Args>
- Configuration
Id string - Repository
Name string The name for the repository. This needs to be less than 100 characters.
- Triggers
[]Trigger
Trigger
- configuration
Id string - repository
Name string The name for the repository. This needs to be less than 100 characters.
- triggers
Trigger
Trigger[]
- configuration_
id str - repository_
name str The name for the repository. This needs to be less than 100 characters.
- triggers
List[Trigger
Trigger]
Supporting Types
TriggerTrigger
- Destination
Arn string The ARN of the resource that is the target for a trigger. For example, the ARN of a topic in Amazon Simple Notification Service (SNS).
- Events List<string>
The repository events that will cause the trigger to run actions in another service, such as sending a notification through Amazon Simple Notification Service (SNS). If no events are specified, the trigger will run for all repository events. Event types include:
all,updateReference,createReference,deleteReference.- Name string
The name of the trigger.
- Branches List<string>
The branches that will be included in the trigger configuration. If no branches are specified, the trigger will apply to all branches.
- Custom
Data string Any custom data associated with the trigger that will be included in the information sent to the target of the trigger.
- Destination
Arn string The ARN of the resource that is the target for a trigger. For example, the ARN of a topic in Amazon Simple Notification Service (SNS).
- Events []string
The repository events that will cause the trigger to run actions in another service, such as sending a notification through Amazon Simple Notification Service (SNS). If no events are specified, the trigger will run for all repository events. Event types include:
all,updateReference,createReference,deleteReference.- Name string
The name of the trigger.
- Branches []string
The branches that will be included in the trigger configuration. If no branches are specified, the trigger will apply to all branches.
- Custom
Data string Any custom data associated with the trigger that will be included in the information sent to the target of the trigger.
- destination
Arn string The ARN of the resource that is the target for a trigger. For example, the ARN of a topic in Amazon Simple Notification Service (SNS).
- events string[]
The repository events that will cause the trigger to run actions in another service, such as sending a notification through Amazon Simple Notification Service (SNS). If no events are specified, the trigger will run for all repository events. Event types include:
all,updateReference,createReference,deleteReference.- name string
The name of the trigger.
- branches string[]
The branches that will be included in the trigger configuration. If no branches are specified, the trigger will apply to all branches.
- custom
Data string Any custom data associated with the trigger that will be included in the information sent to the target of the trigger.
- destination_
arn str The ARN of the resource that is the target for a trigger. For example, the ARN of a topic in Amazon Simple Notification Service (SNS).
- events List[str]
The repository events that will cause the trigger to run actions in another service, such as sending a notification through Amazon Simple Notification Service (SNS). If no events are specified, the trigger will run for all repository events. Event types include:
all,updateReference,createReference,deleteReference.- name str
The name of the trigger.
- branches List[str]
The branches that will be included in the trigger configuration. If no branches are specified, the trigger will apply to all branches.
- custom
Data str Any custom data associated with the trigger that will be included in the information sent to the target of the trigger.
Package Details
- Repository
- https://github.com/pulumi/pulumi-aws
- License
- Apache-2.0
- Notes
- This Pulumi package is based on the
awsTerraform Provider.