aws.codecommit.Trigger
Explore with Pulumi AI
Provides a CodeCommit Trigger Resource.
Example Usage
import * as pulumi from "@pulumi/pulumi";
import * as aws from "@pulumi/aws";
const test = new aws.codecommit.Repository("test", {repositoryName: "test"});
const testTrigger = new aws.codecommit.Trigger("test", {
    repositoryName: test.repositoryName,
    triggers: [{
        name: "all",
        events: ["all"],
        destinationArn: testAwsSnsTopic.arn,
    }],
});
import pulumi
import pulumi_aws as aws
test = aws.codecommit.Repository("test", repository_name="test")
test_trigger = aws.codecommit.Trigger("test",
    repository_name=test.repository_name,
    triggers=[{
        "name": "all",
        "events": ["all"],
        "destination_arn": test_aws_sns_topic["arn"],
    }])
package main
import (
	"github.com/pulumi/pulumi-aws/sdk/v6/go/aws/codecommit"
	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)
func main() {
	pulumi.Run(func(ctx *pulumi.Context) error {
		test, err := codecommit.NewRepository(ctx, "test", &codecommit.RepositoryArgs{
			RepositoryName: pulumi.String("test"),
		})
		if err != nil {
			return err
		}
		_, err = codecommit.NewTrigger(ctx, "test", &codecommit.TriggerArgs{
			RepositoryName: test.RepositoryName,
			Triggers: codecommit.TriggerTriggerArray{
				&codecommit.TriggerTriggerArgs{
					Name: pulumi.String("all"),
					Events: pulumi.StringArray{
						pulumi.String("all"),
					},
					DestinationArn: pulumi.Any(testAwsSnsTopic.Arn),
				},
			},
		})
		if err != nil {
			return err
		}
		return nil
	})
}
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using Aws = Pulumi.Aws;
return await Deployment.RunAsync(() => 
{
    var test = new Aws.CodeCommit.Repository("test", new()
    {
        RepositoryName = "test",
    });
    var testTrigger = new Aws.CodeCommit.Trigger("test", new()
    {
        RepositoryName = test.RepositoryName,
        Triggers = new[]
        {
            new Aws.CodeCommit.Inputs.TriggerTriggerArgs
            {
                Name = "all",
                Events = new[]
                {
                    "all",
                },
                DestinationArn = testAwsSnsTopic.Arn,
            },
        },
    });
});
package generated_program;
import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.aws.codecommit.Repository;
import com.pulumi.aws.codecommit.RepositoryArgs;
import com.pulumi.aws.codecommit.Trigger;
import com.pulumi.aws.codecommit.TriggerArgs;
import com.pulumi.aws.codecommit.inputs.TriggerTriggerArgs;
import java.util.List;
import java.util.ArrayList;
import java.util.Map;
import java.io.File;
import java.nio.file.Files;
import java.nio.file.Paths;
public class App {
    public static void main(String[] args) {
        Pulumi.run(App::stack);
    }
    public static void stack(Context ctx) {
        var test = new Repository("test", RepositoryArgs.builder()
            .repositoryName("test")
            .build());
        var testTrigger = new Trigger("testTrigger", TriggerArgs.builder()
            .repositoryName(test.repositoryName())
            .triggers(TriggerTriggerArgs.builder()
                .name("all")
                .events("all")
                .destinationArn(testAwsSnsTopic.arn())
                .build())
            .build());
    }
}
resources:
  test:
    type: aws:codecommit:Repository
    properties:
      repositoryName: test
  testTrigger:
    type: aws:codecommit:Trigger
    name: test
    properties:
      repositoryName: ${test.repositoryName}
      triggers:
        - name: all
          events:
            - all
          destinationArn: ${testAwsSnsTopic.arn}
Create Trigger Resource
Resources are created with functions called constructors. To learn more about declaring and configuring resources, see Resources.
Constructor syntax
new Trigger(name: string, args: TriggerArgs, opts?: CustomResourceOptions);@overload
def Trigger(resource_name: str,
            args: TriggerArgs,
            opts: Optional[ResourceOptions] = None)
@overload
def Trigger(resource_name: str,
            opts: Optional[ResourceOptions] = None,
            repository_name: Optional[str] = None,
            triggers: Optional[Sequence[TriggerTriggerArgs]] = None)func NewTrigger(ctx *Context, name string, args TriggerArgs, opts ...ResourceOption) (*Trigger, error)public Trigger(string name, TriggerArgs args, CustomResourceOptions? opts = null)
public Trigger(String name, TriggerArgs args)
public Trigger(String name, TriggerArgs args, CustomResourceOptions options)
type: aws:codecommit:Trigger
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 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.
- args TriggerArgs
- 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 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.
- name String
- The unique name of the resource.
- args TriggerArgs
- 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 triggerResource = new Aws.CodeCommit.Trigger("triggerResource", new()
{
    RepositoryName = "string",
    Triggers = new[]
    {
        new Aws.CodeCommit.Inputs.TriggerTriggerArgs
        {
            DestinationArn = "string",
            Events = new[]
            {
                "string",
            },
            Name = "string",
            Branches = new[]
            {
                "string",
            },
            CustomData = "string",
        },
    },
});
example, err := codecommit.NewTrigger(ctx, "triggerResource", &codecommit.TriggerArgs{
	RepositoryName: pulumi.String("string"),
	Triggers: codecommit.TriggerTriggerArray{
		&codecommit.TriggerTriggerArgs{
			DestinationArn: pulumi.String("string"),
			Events: pulumi.StringArray{
				pulumi.String("string"),
			},
			Name: pulumi.String("string"),
			Branches: pulumi.StringArray{
				pulumi.String("string"),
			},
			CustomData: pulumi.String("string"),
		},
	},
})
var triggerResource = new Trigger("triggerResource", TriggerArgs.builder()
    .repositoryName("string")
    .triggers(TriggerTriggerArgs.builder()
        .destinationArn("string")
        .events("string")
        .name("string")
        .branches("string")
        .customData("string")
        .build())
    .build());
trigger_resource = aws.codecommit.Trigger("triggerResource",
    repository_name="string",
    triggers=[{
        "destination_arn": "string",
        "events": ["string"],
        "name": "string",
        "branches": ["string"],
        "custom_data": "string",
    }])
const triggerResource = new aws.codecommit.Trigger("triggerResource", {
    repositoryName: "string",
    triggers: [{
        destinationArn: "string",
        events: ["string"],
        name: "string",
        branches: ["string"],
        customData: "string",
    }],
});
type: aws:codecommit:Trigger
properties:
    repositoryName: string
    triggers:
        - branches:
            - string
          customData: string
          destinationArn: string
          events:
            - string
          name: string
Trigger 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 Trigger resource accepts the following input properties:
- RepositoryName string
- The name for the repository. This needs to be less than 100 characters.
- Triggers
List<TriggerTrigger> 
- The name of the trigger.
- RepositoryName string
- The name for the repository. This needs to be less than 100 characters.
- Triggers
[]TriggerTrigger Args 
- The name of the trigger.
- repositoryName String
- The name for the repository. This needs to be less than 100 characters.
- triggers
List<TriggerTrigger> 
- The name of the trigger.
- repositoryName string
- The name for the repository. This needs to be less than 100 characters.
- triggers
TriggerTrigger[] 
- The name of the trigger.
- repository_name str
- The name for the repository. This needs to be less than 100 characters.
- triggers
Sequence[TriggerTrigger Args] 
- The name of the trigger.
- repositoryName String
- The name for the repository. This needs to be less than 100 characters.
- triggers List<Property Map>
- The name of the trigger.
Outputs
All input properties are implicitly available as output properties. Additionally, the Trigger resource produces the following output properties:
- ConfigurationId string
- System-generated unique identifier.
- Id string
- The provider-assigned unique ID for this managed resource.
- ConfigurationId string
- System-generated unique identifier.
- Id string
- The provider-assigned unique ID for this managed resource.
- configurationId String
- System-generated unique identifier.
- id String
- The provider-assigned unique ID for this managed resource.
- configurationId string
- System-generated unique identifier.
- id string
- The provider-assigned unique ID for this managed resource.
- configuration_id str
- System-generated unique identifier.
- id str
- The provider-assigned unique ID for this managed resource.
- configurationId String
- System-generated unique identifier.
- id String
- The provider-assigned unique ID for this managed resource.
Look up 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@staticmethod
def get(resource_name: str,
        id: str,
        opts: Optional[ResourceOptions] = None,
        configuration_id: Optional[str] = None,
        repository_name: Optional[str] = None,
        triggers: Optional[Sequence[TriggerTriggerArgs]] = None) -> Triggerfunc 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)public static Trigger get(String name, Output<String> id, TriggerState state, CustomResourceOptions options)resources:  _:    type: aws:codecommit:Trigger    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.
- ConfigurationId string
- System-generated unique identifier.
- RepositoryName string
- The name for the repository. This needs to be less than 100 characters.
- Triggers
List<TriggerTrigger> 
- The name of the trigger.
- ConfigurationId string
- System-generated unique identifier.
- RepositoryName string
- The name for the repository. This needs to be less than 100 characters.
- Triggers
[]TriggerTrigger Args 
- The name of the trigger.
- configurationId String
- System-generated unique identifier.
- repositoryName String
- The name for the repository. This needs to be less than 100 characters.
- triggers
List<TriggerTrigger> 
- The name of the trigger.
- configurationId string
- System-generated unique identifier.
- repositoryName string
- The name for the repository. This needs to be less than 100 characters.
- triggers
TriggerTrigger[] 
- The name of the trigger.
- configuration_id str
- System-generated unique identifier.
- repository_name str
- The name for the repository. This needs to be less than 100 characters.
- triggers
Sequence[TriggerTrigger Args] 
- The name of the trigger.
- configurationId String
- System-generated unique identifier.
- repositoryName String
- The name for the repository. This needs to be less than 100 characters.
- triggers List<Property Map>
- The name of the trigger.
Supporting Types
TriggerTrigger, TriggerTriggerArgs    
- 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 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.
- 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 Sequence[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 Sequence[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.
- 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.
Package Details
- Repository
- AWS Classic pulumi/pulumi-aws
- License
- Apache-2.0
- Notes
- This Pulumi package is based on the awsTerraform Provider.