octopusdeploy.GitTrigger
Explore with Pulumi AI
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:
- Channel
Id string - The ID of the channel in which the release will be created if the action type is CreateRelease.
- Project
Id string - The ID of the project to attach the trigger.
- Sources
List<Git
Trigger Source> - Description string
- The description of this Git trigger..
- Is
Disabled bool - Disables the trigger from being run when set.
- Name string
- The name of this resource.
- Space
Id string - The space ID associated with this Git trigger.
- Channel
Id string - The ID of the channel in which the release will be created if the action type is CreateRelease.
- Project
Id string - The ID of the project to attach the trigger.
- Sources
[]Git
Trigger Source Args - Description string
- The description of this Git trigger..
- Is
Disabled bool - Disables the trigger from being run when set.
- Name string
- The name of this resource.
- Space
Id string - The space ID associated with this Git trigger.
- channel
Id String - The ID of the channel in which the release will be created if the action type is CreateRelease.
- project
Id String - The ID of the project to attach the trigger.
- sources
List<Git
Trigger Source> - description String
- The description of this Git trigger..
- is
Disabled Boolean - Disables the trigger from being run when set.
- name String
- The name of this resource.
- space
Id String - The space ID associated with this Git trigger.
- channel
Id string - The ID of the channel in which the release will be created if the action type is CreateRelease.
- project
Id string - The ID of the project to attach the trigger.
- sources
Git
Trigger Source[] - description string
- The description of this Git trigger..
- is
Disabled boolean - Disables the trigger from being run when set.
- name string
- The name of this resource.
- space
Id 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[Git
Trigger Source Args] - 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.
- channel
Id String - The ID of the channel in which the release will be created if the action type is CreateRelease.
- project
Id String - The ID of the project to attach the trigger.
- sources List<Property Map>
- description String
- The description of this Git trigger..
- is
Disabled Boolean - Disables the trigger from being run when set.
- name String
- The name of this resource.
- space
Id 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.
- Channel
Id 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..
- Is
Disabled bool - Disables the trigger from being run when set.
- Name string
- The name of this resource.
- Project
Id string - The ID of the project to attach the trigger.
- Sources
List<Git
Trigger Source> - Space
Id string - The space ID associated with this Git trigger.
- Channel
Id 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..
- Is
Disabled bool - Disables the trigger from being run when set.
- Name string
- The name of this resource.
- Project
Id string - The ID of the project to attach the trigger.
- Sources
[]Git
Trigger Source Args - Space
Id string - The space ID associated with this Git trigger.
- channel
Id 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..
- is
Disabled Boolean - Disables the trigger from being run when set.
- name String
- The name of this resource.
- project
Id String - The ID of the project to attach the trigger.
- sources
List<Git
Trigger Source> - space
Id String - The space ID associated with this Git trigger.
- channel
Id 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..
- is
Disabled boolean - Disables the trigger from being run when set.
- name string
- The name of this resource.
- project
Id string - The ID of the project to attach the trigger.
- sources
Git
Trigger Source[] - space
Id 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[Git
Trigger Source Args] - space_
id str - The space ID associated with this Git trigger.
- channel
Id 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..
- is
Disabled Boolean - Disables the trigger from being run when set.
- name String
- The name of this resource.
- project
Id String - The ID of the project to attach the trigger.
- sources List<Property Map>
- space
Id String - The space ID associated with this Git trigger.
Supporting Types
GitTriggerSource, GitTriggerSourceArgs
- Deployment
Action stringSlug - The deployment action slug.
- Exclude
File List<string>Paths - The file paths to exclude.
- Git
Dependency stringName - The git dependency name.
- Include
File List<string>Paths - The file paths to include.
- Deployment
Action stringSlug - The deployment action slug.
- Exclude
File []stringPaths - The file paths to exclude.
- Git
Dependency stringName - The git dependency name.
- Include
File []stringPaths - The file paths to include.
- deployment
Action StringSlug - The deployment action slug.
- exclude
File List<String>Paths - The file paths to exclude.
- git
Dependency StringName - The git dependency name.
- include
File List<String>Paths - The file paths to include.
- deployment
Action stringSlug - The deployment action slug.
- exclude
File string[]Paths - The file paths to exclude.
- git
Dependency stringName - The git dependency name.
- include
File string[]Paths - The file paths to include.
- deployment_
action_ strslug - The deployment action slug.
- exclude_
file_ Sequence[str]paths - The file paths to exclude.
- git_
dependency_ strname - The git dependency name.
- include_
file_ Sequence[str]paths - The file paths to include.
- deployment
Action StringSlug - The deployment action slug.
- exclude
File List<String>Paths - The file paths to exclude.
- git
Dependency StringName - The git dependency name.
- include
File List<String>Paths - 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.