1. Packages
  2. Octopusdeploy Provider
  3. API Docs
  4. GitTrigger
octopusdeploy 0.43.1 published on Wednesday, Apr 30, 2025 by octopusdeploylabs

octopusdeploy.GitTrigger

Explore with Pulumi AI

octopusdeploy logo
octopusdeploy 0.43.1 published on Wednesday, Apr 30, 2025 by octopusdeploylabs

    This resource manages Git triggers in Octopus Deploy

    Example Usage

    import * as pulumi from "@pulumi/pulumi";
    import * as octopusdeploy from "@pulumi/octopusdeploy";
    
    const myTrigger = new octopusdeploy.GitTrigger("myTrigger", {
        channelId: "Channels-1",
        description: "My Git trigger description",
        projectId: "Projects-1",
        sources: [{
            deploymentActionSlug: "deploy-action-slug",
            excludeFilePaths: [
                "exclude/me",
                "exclude/this/too",
            ],
            gitDependencyName: "",
            includeFilePaths: [
                "include/me",
                "include/this/too",
            ],
        }],
        spaceId: "Spaces-1",
    });
    
    import pulumi
    import pulumi_octopusdeploy as octopusdeploy
    
    my_trigger = octopusdeploy.GitTrigger("myTrigger",
        channel_id="Channels-1",
        description="My Git trigger description",
        project_id="Projects-1",
        sources=[{
            "deployment_action_slug": "deploy-action-slug",
            "exclude_file_paths": [
                "exclude/me",
                "exclude/this/too",
            ],
            "git_dependency_name": "",
            "include_file_paths": [
                "include/me",
                "include/this/too",
            ],
        }],
        space_id="Spaces-1")
    
    package main
    
    import (
    	"github.com/pulumi/pulumi-terraform-provider/sdks/go/octopusdeploy/octopusdeploy"
    	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
    )
    
    func main() {
    	pulumi.Run(func(ctx *pulumi.Context) error {
    		_, err := octopusdeploy.NewGitTrigger(ctx, "myTrigger", &octopusdeploy.GitTriggerArgs{
    			ChannelId:   pulumi.String("Channels-1"),
    			Description: pulumi.String("My Git trigger description"),
    			ProjectId:   pulumi.String("Projects-1"),
    			Sources: octopusdeploy.GitTriggerSourceArray{
    				&octopusdeploy.GitTriggerSourceArgs{
    					DeploymentActionSlug: pulumi.String("deploy-action-slug"),
    					ExcludeFilePaths: pulumi.StringArray{
    						pulumi.String("exclude/me"),
    						pulumi.String("exclude/this/too"),
    					},
    					GitDependencyName: pulumi.String(""),
    					IncludeFilePaths: pulumi.StringArray{
    						pulumi.String("include/me"),
    						pulumi.String("include/this/too"),
    					},
    				},
    			},
    			SpaceId: pulumi.String("Spaces-1"),
    		})
    		if err != nil {
    			return err
    		}
    		return nil
    	})
    }
    
    using System.Collections.Generic;
    using System.Linq;
    using Pulumi;
    using Octopusdeploy = Pulumi.Octopusdeploy;
    
    return await Deployment.RunAsync(() => 
    {
        var myTrigger = new Octopusdeploy.GitTrigger("myTrigger", new()
        {
            ChannelId = "Channels-1",
            Description = "My Git trigger description",
            ProjectId = "Projects-1",
            Sources = new[]
            {
                new Octopusdeploy.Inputs.GitTriggerSourceArgs
                {
                    DeploymentActionSlug = "deploy-action-slug",
                    ExcludeFilePaths = new[]
                    {
                        "exclude/me",
                        "exclude/this/too",
                    },
                    GitDependencyName = "",
                    IncludeFilePaths = new[]
                    {
                        "include/me",
                        "include/this/too",
                    },
                },
            },
            SpaceId = "Spaces-1",
        });
    
    });
    
    package generated_program;
    
    import com.pulumi.Context;
    import com.pulumi.Pulumi;
    import com.pulumi.core.Output;
    import com.pulumi.octopusdeploy.GitTrigger;
    import com.pulumi.octopusdeploy.GitTriggerArgs;
    import com.pulumi.octopusdeploy.inputs.GitTriggerSourceArgs;
    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 myTrigger = new GitTrigger("myTrigger", GitTriggerArgs.builder()
                .channelId("Channels-1")
                .description("My Git trigger description")
                .projectId("Projects-1")
                .sources(GitTriggerSourceArgs.builder()
                    .deploymentActionSlug("deploy-action-slug")
                    .excludeFilePaths(                
                        "exclude/me",
                        "exclude/this/too")
                    .gitDependencyName("")
                    .includeFilePaths(                
                        "include/me",
                        "include/this/too")
                    .build())
                .spaceId("Spaces-1")
                .build());
    
        }
    }
    
    resources:
      myTrigger:
        type: octopusdeploy:GitTrigger
        properties:
          channelId: Channels-1
          description: My Git trigger description
          projectId: Projects-1
          sources:
            - deploymentActionSlug: deploy-action-slug
              excludeFilePaths:
                - exclude/me
                - exclude/this/too
              gitDependencyName: ""
              includeFilePaths:
                - include/me
                - include/this/too
          spaceId: Spaces-1
    

    Create GitTrigger Resource

    Resources are created with functions called constructors. To learn more about declaring and configuring resources, see Resources.

    Constructor syntax

    new GitTrigger(name: string, args: GitTriggerArgs, opts?: CustomResourceOptions);
    @overload
    def GitTrigger(resource_name: str,
                   args: GitTriggerArgs,
                   opts: Optional[ResourceOptions] = None)
    
    @overload
    def GitTrigger(resource_name: str,
                   opts: Optional[ResourceOptions] = None,
                   channel_id: Optional[str] = None,
                   project_id: Optional[str] = None,
                   sources: Optional[Sequence[GitTriggerSourceArgs]] = None,
                   description: Optional[str] = None,
                   is_disabled: Optional[bool] = None,
                   name: Optional[str] = None,
                   space_id: Optional[str] = None)
    func NewGitTrigger(ctx *Context, name string, args GitTriggerArgs, opts ...ResourceOption) (*GitTrigger, error)
    public GitTrigger(string name, GitTriggerArgs args, CustomResourceOptions? opts = null)
    public GitTrigger(String name, GitTriggerArgs args)
    public GitTrigger(String name, GitTriggerArgs args, CustomResourceOptions options)
    
    type: octopusdeploy:GitTrigger
    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 GitTriggerArgs
    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 GitTriggerArgs
    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 GitTriggerArgs
    The arguments to resource properties.
    opts ResourceOption
    Bag of options to control resource's behavior.
    name string
    The unique name of the resource.
    args GitTriggerArgs
    The arguments to resource properties.
    opts CustomResourceOptions
    Bag of options to control resource's behavior.
    name String
    The unique name of the resource.
    args GitTriggerArgs
    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 gitTriggerResource = new Octopusdeploy.GitTrigger("gitTriggerResource", new()
    {
        ChannelId = "string",
        ProjectId = "string",
        Sources = new[]
        {
            new Octopusdeploy.Inputs.GitTriggerSourceArgs
            {
                DeploymentActionSlug = "string",
                ExcludeFilePaths = new[]
                {
                    "string",
                },
                GitDependencyName = "string",
                IncludeFilePaths = new[]
                {
                    "string",
                },
            },
        },
        Description = "string",
        IsDisabled = false,
        Name = "string",
        SpaceId = "string",
    });
    
    example, err := octopusdeploy.NewGitTrigger(ctx, "gitTriggerResource", &octopusdeploy.GitTriggerArgs{
    	ChannelId: pulumi.String("string"),
    	ProjectId: pulumi.String("string"),
    	Sources: octopusdeploy.GitTriggerSourceArray{
    		&octopusdeploy.GitTriggerSourceArgs{
    			DeploymentActionSlug: pulumi.String("string"),
    			ExcludeFilePaths: pulumi.StringArray{
    				pulumi.String("string"),
    			},
    			GitDependencyName: pulumi.String("string"),
    			IncludeFilePaths: pulumi.StringArray{
    				pulumi.String("string"),
    			},
    		},
    	},
    	Description: pulumi.String("string"),
    	IsDisabled:  pulumi.Bool(false),
    	Name:        pulumi.String("string"),
    	SpaceId:     pulumi.String("string"),
    })
    
    var gitTriggerResource = new GitTrigger("gitTriggerResource", GitTriggerArgs.builder()
        .channelId("string")
        .projectId("string")
        .sources(GitTriggerSourceArgs.builder()
            .deploymentActionSlug("string")
            .excludeFilePaths("string")
            .gitDependencyName("string")
            .includeFilePaths("string")
            .build())
        .description("string")
        .isDisabled(false)
        .name("string")
        .spaceId("string")
        .build());
    
    git_trigger_resource = octopusdeploy.GitTrigger("gitTriggerResource",
        channel_id="string",
        project_id="string",
        sources=[{
            "deployment_action_slug": "string",
            "exclude_file_paths": ["string"],
            "git_dependency_name": "string",
            "include_file_paths": ["string"],
        }],
        description="string",
        is_disabled=False,
        name="string",
        space_id="string")
    
    const gitTriggerResource = new octopusdeploy.GitTrigger("gitTriggerResource", {
        channelId: "string",
        projectId: "string",
        sources: [{
            deploymentActionSlug: "string",
            excludeFilePaths: ["string"],
            gitDependencyName: "string",
            includeFilePaths: ["string"],
        }],
        description: "string",
        isDisabled: false,
        name: "string",
        spaceId: "string",
    });
    
    type: octopusdeploy:GitTrigger
    properties:
        channelId: string
        description: string
        isDisabled: false
        name: string
        projectId: string
        sources:
            - deploymentActionSlug: string
              excludeFilePaths:
                - string
              gitDependencyName: string
              includeFilePaths:
                - string
        spaceId: string
    

    GitTrigger 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 GitTrigger resource accepts the following input properties:

    ChannelId string
    The ID of the channel in which the release will be created if the action type is CreateRelease.
    ProjectId string
    The ID of the project to attach the trigger.
    Sources List<GitTriggerSource>
    Description string
    The description of this Git trigger..
    IsDisabled bool
    Disables the trigger from being run when set.
    Name string
    The name of this resource.
    SpaceId string
    The space ID associated with this Git trigger.
    ChannelId string
    The ID of the channel in which the release will be created if the action type is CreateRelease.
    ProjectId string
    The ID of the project to attach the trigger.
    Sources []GitTriggerSourceArgs
    Description string
    The description of this Git trigger..
    IsDisabled bool
    Disables the trigger from being run when set.
    Name string
    The name of this resource.
    SpaceId string
    The space ID associated with this Git trigger.
    channelId String
    The ID of the channel in which the release will be created if the action type is CreateRelease.
    projectId String
    The ID of the project to attach the trigger.
    sources List<GitTriggerSource>
    description String
    The description of this Git trigger..
    isDisabled Boolean
    Disables the trigger from being run when set.
    name String
    The name of this resource.
    spaceId String
    The space ID associated with this Git trigger.
    channelId string
    The ID of the channel in which the release will be created if the action type is CreateRelease.
    projectId string
    The ID of the project to attach the trigger.
    sources GitTriggerSource[]
    description string
    The description of this Git trigger..
    isDisabled boolean
    Disables the trigger from being run when set.
    name string
    The name of this resource.
    spaceId string
    The space ID associated with this Git trigger.
    channel_id str
    The ID of the channel in which the release will be created if the action type is CreateRelease.
    project_id str
    The ID of the project to attach the trigger.
    sources Sequence[GitTriggerSourceArgs]
    description str
    The description of this Git trigger..
    is_disabled bool
    Disables the trigger from being run when set.
    name str
    The name of this resource.
    space_id str
    The space ID associated with this Git trigger.
    channelId String
    The ID of the channel in which the release will be created if the action type is CreateRelease.
    projectId String
    The ID of the project to attach the trigger.
    sources List<Property Map>
    description String
    The description of this Git trigger..
    isDisabled Boolean
    Disables the trigger from being run when set.
    name String
    The name of this resource.
    spaceId String
    The space ID associated with this Git trigger.

    Outputs

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

    Id string
    The provider-assigned unique ID for this managed resource.
    Id string
    The provider-assigned unique ID for this managed resource.
    id String
    The provider-assigned unique ID for this managed resource.
    id string
    The provider-assigned unique ID for this managed resource.
    id str
    The provider-assigned unique ID for this managed resource.
    id String
    The provider-assigned unique ID for this managed resource.

    Look up Existing GitTrigger Resource

    Get an existing GitTrigger 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?: GitTriggerState, opts?: CustomResourceOptions): GitTrigger
    @staticmethod
    def get(resource_name: str,
            id: str,
            opts: Optional[ResourceOptions] = None,
            channel_id: Optional[str] = None,
            description: Optional[str] = None,
            is_disabled: Optional[bool] = None,
            name: Optional[str] = None,
            project_id: Optional[str] = None,
            sources: Optional[Sequence[GitTriggerSourceArgs]] = None,
            space_id: Optional[str] = None) -> GitTrigger
    func GetGitTrigger(ctx *Context, name string, id IDInput, state *GitTriggerState, opts ...ResourceOption) (*GitTrigger, error)
    public static GitTrigger Get(string name, Input<string> id, GitTriggerState? state, CustomResourceOptions? opts = null)
    public static GitTrigger get(String name, Output<String> id, GitTriggerState state, CustomResourceOptions options)
    resources:  _:    type: octopusdeploy:GitTrigger    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.
    The following state arguments are supported:
    ChannelId string
    The ID of the channel in which the release will be created if the action type is CreateRelease.
    Description string
    The description of this Git trigger..
    IsDisabled bool
    Disables the trigger from being run when set.
    Name string
    The name of this resource.
    ProjectId string
    The ID of the project to attach the trigger.
    Sources List<GitTriggerSource>
    SpaceId string
    The space ID associated with this Git trigger.
    ChannelId string
    The ID of the channel in which the release will be created if the action type is CreateRelease.
    Description string
    The description of this Git trigger..
    IsDisabled bool
    Disables the trigger from being run when set.
    Name string
    The name of this resource.
    ProjectId string
    The ID of the project to attach the trigger.
    Sources []GitTriggerSourceArgs
    SpaceId string
    The space ID associated with this Git trigger.
    channelId String
    The ID of the channel in which the release will be created if the action type is CreateRelease.
    description String
    The description of this Git trigger..
    isDisabled Boolean
    Disables the trigger from being run when set.
    name String
    The name of this resource.
    projectId String
    The ID of the project to attach the trigger.
    sources List<GitTriggerSource>
    spaceId String
    The space ID associated with this Git trigger.
    channelId string
    The ID of the channel in which the release will be created if the action type is CreateRelease.
    description string
    The description of this Git trigger..
    isDisabled boolean
    Disables the trigger from being run when set.
    name string
    The name of this resource.
    projectId string
    The ID of the project to attach the trigger.
    sources GitTriggerSource[]
    spaceId string
    The space ID associated with this Git trigger.
    channel_id str
    The ID of the channel in which the release will be created if the action type is CreateRelease.
    description str
    The description of this Git trigger..
    is_disabled bool
    Disables the trigger from being run when set.
    name str
    The name of this resource.
    project_id str
    The ID of the project to attach the trigger.
    sources Sequence[GitTriggerSourceArgs]
    space_id str
    The space ID associated with this Git trigger.
    channelId String
    The ID of the channel in which the release will be created if the action type is CreateRelease.
    description String
    The description of this Git trigger..
    isDisabled Boolean
    Disables the trigger from being run when set.
    name String
    The name of this resource.
    projectId String
    The ID of the project to attach the trigger.
    sources List<Property Map>
    spaceId String
    The space ID associated with this Git trigger.

    Supporting Types

    GitTriggerSource, GitTriggerSourceArgs

    DeploymentActionSlug string
    The deployment action slug.
    ExcludeFilePaths List<string>
    The file paths to exclude.
    GitDependencyName string
    The git dependency name.
    IncludeFilePaths List<string>
    The file paths to include.
    DeploymentActionSlug string
    The deployment action slug.
    ExcludeFilePaths []string
    The file paths to exclude.
    GitDependencyName string
    The git dependency name.
    IncludeFilePaths []string
    The file paths to include.
    deploymentActionSlug String
    The deployment action slug.
    excludeFilePaths List<String>
    The file paths to exclude.
    gitDependencyName String
    The git dependency name.
    includeFilePaths List<String>
    The file paths to include.
    deploymentActionSlug string
    The deployment action slug.
    excludeFilePaths string[]
    The file paths to exclude.
    gitDependencyName string
    The git dependency name.
    includeFilePaths string[]
    The file paths to include.
    deployment_action_slug str
    The deployment action slug.
    exclude_file_paths Sequence[str]
    The file paths to exclude.
    git_dependency_name str
    The git dependency name.
    include_file_paths Sequence[str]
    The file paths to include.
    deploymentActionSlug String
    The deployment action slug.
    excludeFilePaths List<String>
    The file paths to exclude.
    gitDependencyName String
    The git dependency name.
    includeFilePaths List<String>
    The file paths to include.

    Import

    $ pulumi import octopusdeploy:index/gitTrigger:GitTrigger [options] octopusdeploy_git_trigger.<name> <trigger-id>
    

    To learn more about importing existing cloud resources, see Importing resources.

    Package Details

    Repository
    octopusdeploy octopusdeploylabs/terraform-provider-octopusdeploy
    License
    Notes
    This Pulumi package is based on the octopusdeploy Terraform Provider.
    octopusdeploy logo
    octopusdeploy 0.43.1 published on Wednesday, Apr 30, 2025 by octopusdeploylabs