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:

RepositoryName string

The name for the repository. This needs to be less than 100 characters.

Triggers List<TriggerTriggerArgs>
RepositoryName string

The name for the repository. This needs to be less than 100 characters.

Triggers []TriggerTrigger
repositoryName string

The name for the repository. This needs to be less than 100 characters.

triggers TriggerTrigger[]
repository_name str

The name for the repository. This needs to be less than 100 characters.

triggers List[TriggerTrigger]

Outputs

All input properties are implicitly available as output properties. Additionally, the Trigger resource produces the following output properties:

ConfigurationId string
Id string
The provider-assigned unique ID for this managed resource.
ConfigurationId string
Id string
The provider-assigned unique ID for this managed resource.
configurationId 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): Trigger
static 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:

ConfigurationId string
RepositoryName string

The name for the repository. This needs to be less than 100 characters.

Triggers List<TriggerTriggerArgs>
ConfigurationId string
RepositoryName string

The name for the repository. This needs to be less than 100 characters.

Triggers []TriggerTrigger
configurationId string
repositoryName string

The name for the repository. This needs to be less than 100 characters.

triggers TriggerTrigger[]
configuration_id str
repository_name str

The name for the repository. This needs to be less than 100 characters.

triggers List[TriggerTrigger]

Supporting Types

TriggerTrigger

See the input and output API doc for this type.

See the input and output API doc for this type.

See the input and output API doc for this type.

DestinationArn 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.

CustomData string

Any custom data associated with the trigger that will be included in the information sent to the target of the trigger.

DestinationArn 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.

CustomData string

Any custom data associated with the trigger that will be included in the information sent to the target of the trigger.

destinationArn 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.

customData 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.

customData 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 aws Terraform Provider.