1. Packages
  2. Harness
  3. API Docs
  4. GitConnector
Harness v0.0.6 published on Saturday, Jul 1, 2023 by lbrlabs

harness.GitConnector

Explore with Pulumi AI

harness logo
Harness v0.0.6 published on Saturday, Jul 1, 2023 by lbrlabs

    Resource for creating a git connector

    Example Usage

    using System.Collections.Generic;
    using System.Linq;
    using Pulumi;
    using Harness = Lbrlabs.PulumiPackage.Harness;
    using Harness = Pulumi.Harness;
    
    return await Deployment.RunAsync(() => 
    {
        var @default = Harness.GetSecretManager.Invoke(new()
        {
            Default = true,
        });
    
        var exampleEncryptedText = new Harness.EncryptedText("exampleEncryptedText", new()
        {
            Value = "foo",
            SecretManagerId = @default.Apply(@default => @default.Apply(getSecretManagerResult => getSecretManagerResult.Id)),
        });
    
        var exampleGitConnector = new Harness.GitConnector("exampleGitConnector", new()
        {
            Url = "https://github.com/harness/terraform-provider-harness",
            Branch = "master",
            GenerateWebhookUrl = true,
            PasswordSecretId = exampleEncryptedText.Id,
            UrlType = "REPO",
            Username = "someuser",
        });
    
    });
    
    package main
    
    import (
    	"github.com/lbrlabs/pulumi-harness/sdk/go/harness"
    	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
    )
    
    func main() {
    	pulumi.Run(func(ctx *pulumi.Context) error {
    		_default, err := harness.GetSecretManager(ctx, &harness.GetSecretManagerArgs{
    			Default: pulumi.BoolRef(true),
    		}, nil)
    		if err != nil {
    			return err
    		}
    		exampleEncryptedText, err := harness.NewEncryptedText(ctx, "exampleEncryptedText", &harness.EncryptedTextArgs{
    			Value:           pulumi.String("foo"),
    			SecretManagerId: *pulumi.String(_default.Id),
    		})
    		if err != nil {
    			return err
    		}
    		_, err = harness.NewGitConnector(ctx, "exampleGitConnector", &harness.GitConnectorArgs{
    			Url:                pulumi.String("https://github.com/harness/terraform-provider-harness"),
    			Branch:             pulumi.String("master"),
    			GenerateWebhookUrl: pulumi.Bool(true),
    			PasswordSecretId:   exampleEncryptedText.ID(),
    			UrlType:            pulumi.String("REPO"),
    			Username:           pulumi.String("someuser"),
    		})
    		if err != nil {
    			return err
    		}
    		return nil
    	})
    }
    
    package generated_program;
    
    import com.pulumi.Context;
    import com.pulumi.Pulumi;
    import com.pulumi.core.Output;
    import com.pulumi.harness.HarnessFunctions;
    import com.pulumi.harness.inputs.GetSecretManagerArgs;
    import com.pulumi.harness.EncryptedText;
    import com.pulumi.harness.EncryptedTextArgs;
    import com.pulumi.harness.GitConnector;
    import com.pulumi.harness.GitConnectorArgs;
    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) {
            final var default = HarnessFunctions.getSecretManager(GetSecretManagerArgs.builder()
                .default_(true)
                .build());
    
            var exampleEncryptedText = new EncryptedText("exampleEncryptedText", EncryptedTextArgs.builder()        
                .value("foo")
                .secretManagerId(default_.id())
                .build());
    
            var exampleGitConnector = new GitConnector("exampleGitConnector", GitConnectorArgs.builder()        
                .url("https://github.com/harness/terraform-provider-harness")
                .branch("master")
                .generateWebhookUrl(true)
                .passwordSecretId(exampleEncryptedText.id())
                .urlType("REPO")
                .username("someuser")
                .build());
    
        }
    }
    
    import pulumi
    import lbrlabs_pulumi_harness as harness
    import pulumi_harness as harness
    
    default = harness.get_secret_manager(default=True)
    example_encrypted_text = harness.EncryptedText("exampleEncryptedText",
        value="foo",
        secret_manager_id=default.id)
    example_git_connector = harness.GitConnector("exampleGitConnector",
        url="https://github.com/harness/terraform-provider-harness",
        branch="master",
        generate_webhook_url=True,
        password_secret_id=example_encrypted_text.id,
        url_type="REPO",
        username="someuser")
    
    import * as pulumi from "@pulumi/pulumi";
    import * as harness from "@lbrlabs/pulumi-harness";
    import * as harness from "@pulumi/harness";
    
    const default = harness.getSecretManager({
        "default": true,
    });
    const exampleEncryptedText = new harness.EncryptedText("exampleEncryptedText", {
        value: "foo",
        secretManagerId: _default.then(_default => _default.id),
    });
    const exampleGitConnector = new harness.GitConnector("exampleGitConnector", {
        url: "https://github.com/harness/terraform-provider-harness",
        branch: "master",
        generateWebhookUrl: true,
        passwordSecretId: exampleEncryptedText.id,
        urlType: "REPO",
        username: "someuser",
    });
    
    resources:
      exampleEncryptedText:
        type: harness:EncryptedText
        properties:
          value: foo
          secretManagerId: ${default.id}
      exampleGitConnector:
        type: harness:GitConnector
        properties:
          url: https://github.com/harness/terraform-provider-harness
          branch: master
          generateWebhookUrl: true
          passwordSecretId: ${exampleEncryptedText.id}
          urlType: REPO
          username: someuser
    variables:
      default:
        fn::invoke:
          Function: harness:getSecretManager
          Arguments:
            default: true
    

    Create GitConnector Resource

    new GitConnector(name: string, args: GitConnectorArgs, opts?: CustomResourceOptions);
    @overload
    def GitConnector(resource_name: str,
                     opts: Optional[ResourceOptions] = None,
                     branch: Optional[str] = None,
                     commit_details: Optional[GitConnectorCommitDetailsArgs] = None,
                     delegate_selectors: Optional[Sequence[str]] = None,
                     generate_webhook_url: Optional[bool] = None,
                     name: Optional[str] = None,
                     password_secret_id: Optional[str] = None,
                     ssh_setting_id: Optional[str] = None,
                     url: Optional[str] = None,
                     url_type: Optional[str] = None,
                     usage_scopes: Optional[Sequence[GitConnectorUsageScopeArgs]] = None,
                     username: Optional[str] = None)
    @overload
    def GitConnector(resource_name: str,
                     args: GitConnectorArgs,
                     opts: Optional[ResourceOptions] = None)
    func NewGitConnector(ctx *Context, name string, args GitConnectorArgs, opts ...ResourceOption) (*GitConnector, error)
    public GitConnector(string name, GitConnectorArgs args, CustomResourceOptions? opts = null)
    public GitConnector(String name, GitConnectorArgs args)
    public GitConnector(String name, GitConnectorArgs args, CustomResourceOptions options)
    
    type: harness:GitConnector
    properties: # The arguments to resource properties.
    options: # Bag of options to control resource's behavior.
    
    
    name string
    The unique name of the resource.
    args GitConnectorArgs
    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 GitConnectorArgs
    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 GitConnectorArgs
    The arguments to resource properties.
    opts ResourceOption
    Bag of options to control resource's behavior.
    name string
    The unique name of the resource.
    args GitConnectorArgs
    The arguments to resource properties.
    opts CustomResourceOptions
    Bag of options to control resource's behavior.
    name String
    The unique name of the resource.
    args GitConnectorArgs
    The arguments to resource properties.
    options CustomResourceOptions
    Bag of options to control resource's behavior.

    GitConnector Resource Properties

    To learn more about resource properties and how to use them, see Inputs and Outputs in the Architecture and Concepts docs.

    Inputs

    The GitConnector resource accepts the following input properties:

    Url string
    The URL of the git repository or account/organization
    UrlType string
    The type of git url being used. Options are ACCOUNT, and REPO.
    Branch string
    The branch of the git connector to use
    CommitDetails Lbrlabs.PulumiPackage.Harness.Inputs.GitConnectorCommitDetails
    Custom details to use when making commits using this git connector
    DelegateSelectors List<string>
    Delegate selectors to apply to this git connector.
    GenerateWebhookUrl bool
    Boolean indicating whether or not to generate a webhook url.
    Name string
    Name of the git connector.
    PasswordSecretId string
    The id of the secret for connecting to the git repository.
    SshSettingId string
    The id of the SSH secret to use
    UsageScopes List<Lbrlabs.PulumiPackage.Harness.Inputs.GitConnectorUsageScope>
    This block is used for scoping the resource to a specific set of applications or environments.
    Username string
    The name of the user used to connect to the git repository
    Url string
    The URL of the git repository or account/organization
    UrlType string
    The type of git url being used. Options are ACCOUNT, and REPO.
    Branch string
    The branch of the git connector to use
    CommitDetails GitConnectorCommitDetailsArgs
    Custom details to use when making commits using this git connector
    DelegateSelectors []string
    Delegate selectors to apply to this git connector.
    GenerateWebhookUrl bool
    Boolean indicating whether or not to generate a webhook url.
    Name string
    Name of the git connector.
    PasswordSecretId string
    The id of the secret for connecting to the git repository.
    SshSettingId string
    The id of the SSH secret to use
    UsageScopes []GitConnectorUsageScopeArgs
    This block is used for scoping the resource to a specific set of applications or environments.
    Username string
    The name of the user used to connect to the git repository
    url String
    The URL of the git repository or account/organization
    urlType String
    The type of git url being used. Options are ACCOUNT, and REPO.
    branch String
    The branch of the git connector to use
    commitDetails GitConnectorCommitDetails
    Custom details to use when making commits using this git connector
    delegateSelectors List<String>
    Delegate selectors to apply to this git connector.
    generateWebhookUrl Boolean
    Boolean indicating whether or not to generate a webhook url.
    name String
    Name of the git connector.
    passwordSecretId String
    The id of the secret for connecting to the git repository.
    sshSettingId String
    The id of the SSH secret to use
    usageScopes List<GitConnectorUsageScope>
    This block is used for scoping the resource to a specific set of applications or environments.
    username String
    The name of the user used to connect to the git repository
    url string
    The URL of the git repository or account/organization
    urlType string
    The type of git url being used. Options are ACCOUNT, and REPO.
    branch string
    The branch of the git connector to use
    commitDetails GitConnectorCommitDetails
    Custom details to use when making commits using this git connector
    delegateSelectors string[]
    Delegate selectors to apply to this git connector.
    generateWebhookUrl boolean
    Boolean indicating whether or not to generate a webhook url.
    name string
    Name of the git connector.
    passwordSecretId string
    The id of the secret for connecting to the git repository.
    sshSettingId string
    The id of the SSH secret to use
    usageScopes GitConnectorUsageScope[]
    This block is used for scoping the resource to a specific set of applications or environments.
    username string
    The name of the user used to connect to the git repository
    url str
    The URL of the git repository or account/organization
    url_type str
    The type of git url being used. Options are ACCOUNT, and REPO.
    branch str
    The branch of the git connector to use
    commit_details GitConnectorCommitDetailsArgs
    Custom details to use when making commits using this git connector
    delegate_selectors Sequence[str]
    Delegate selectors to apply to this git connector.
    generate_webhook_url bool
    Boolean indicating whether or not to generate a webhook url.
    name str
    Name of the git connector.
    password_secret_id str
    The id of the secret for connecting to the git repository.
    ssh_setting_id str
    The id of the SSH secret to use
    usage_scopes Sequence[GitConnectorUsageScopeArgs]
    This block is used for scoping the resource to a specific set of applications or environments.
    username str
    The name of the user used to connect to the git repository
    url String
    The URL of the git repository or account/organization
    urlType String
    The type of git url being used. Options are ACCOUNT, and REPO.
    branch String
    The branch of the git connector to use
    commitDetails Property Map
    Custom details to use when making commits using this git connector
    delegateSelectors List<String>
    Delegate selectors to apply to this git connector.
    generateWebhookUrl Boolean
    Boolean indicating whether or not to generate a webhook url.
    name String
    Name of the git connector.
    passwordSecretId String
    The id of the secret for connecting to the git repository.
    sshSettingId String
    The id of the SSH secret to use
    usageScopes List<Property Map>
    This block is used for scoping the resource to a specific set of applications or environments.
    username String
    The name of the user used to connect to the git repository

    Outputs

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

    CreatedAt string
    The time the git connector was created
    Id string
    The provider-assigned unique ID for this managed resource.
    WebhookUrl string
    The generated webhook url
    CreatedAt string
    The time the git connector was created
    Id string
    The provider-assigned unique ID for this managed resource.
    WebhookUrl string
    The generated webhook url
    createdAt String
    The time the git connector was created
    id String
    The provider-assigned unique ID for this managed resource.
    webhookUrl String
    The generated webhook url
    createdAt string
    The time the git connector was created
    id string
    The provider-assigned unique ID for this managed resource.
    webhookUrl string
    The generated webhook url
    created_at str
    The time the git connector was created
    id str
    The provider-assigned unique ID for this managed resource.
    webhook_url str
    The generated webhook url
    createdAt String
    The time the git connector was created
    id String
    The provider-assigned unique ID for this managed resource.
    webhookUrl String
    The generated webhook url

    Look up Existing GitConnector Resource

    Get an existing GitConnector 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?: GitConnectorState, opts?: CustomResourceOptions): GitConnector
    @staticmethod
    def get(resource_name: str,
            id: str,
            opts: Optional[ResourceOptions] = None,
            branch: Optional[str] = None,
            commit_details: Optional[GitConnectorCommitDetailsArgs] = None,
            created_at: Optional[str] = None,
            delegate_selectors: Optional[Sequence[str]] = None,
            generate_webhook_url: Optional[bool] = None,
            name: Optional[str] = None,
            password_secret_id: Optional[str] = None,
            ssh_setting_id: Optional[str] = None,
            url: Optional[str] = None,
            url_type: Optional[str] = None,
            usage_scopes: Optional[Sequence[GitConnectorUsageScopeArgs]] = None,
            username: Optional[str] = None,
            webhook_url: Optional[str] = None) -> GitConnector
    func GetGitConnector(ctx *Context, name string, id IDInput, state *GitConnectorState, opts ...ResourceOption) (*GitConnector, error)
    public static GitConnector Get(string name, Input<string> id, GitConnectorState? state, CustomResourceOptions? opts = null)
    public static GitConnector get(String name, Output<String> id, GitConnectorState state, CustomResourceOptions options)
    Resource lookup is not supported in YAML
    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:
    Branch string
    The branch of the git connector to use
    CommitDetails Lbrlabs.PulumiPackage.Harness.Inputs.GitConnectorCommitDetails
    Custom details to use when making commits using this git connector
    CreatedAt string
    The time the git connector was created
    DelegateSelectors List<string>
    Delegate selectors to apply to this git connector.
    GenerateWebhookUrl bool
    Boolean indicating whether or not to generate a webhook url.
    Name string
    Name of the git connector.
    PasswordSecretId string
    The id of the secret for connecting to the git repository.
    SshSettingId string
    The id of the SSH secret to use
    Url string
    The URL of the git repository or account/organization
    UrlType string
    The type of git url being used. Options are ACCOUNT, and REPO.
    UsageScopes List<Lbrlabs.PulumiPackage.Harness.Inputs.GitConnectorUsageScope>
    This block is used for scoping the resource to a specific set of applications or environments.
    Username string
    The name of the user used to connect to the git repository
    WebhookUrl string
    The generated webhook url
    Branch string
    The branch of the git connector to use
    CommitDetails GitConnectorCommitDetailsArgs
    Custom details to use when making commits using this git connector
    CreatedAt string
    The time the git connector was created
    DelegateSelectors []string
    Delegate selectors to apply to this git connector.
    GenerateWebhookUrl bool
    Boolean indicating whether or not to generate a webhook url.
    Name string
    Name of the git connector.
    PasswordSecretId string
    The id of the secret for connecting to the git repository.
    SshSettingId string
    The id of the SSH secret to use
    Url string
    The URL of the git repository or account/organization
    UrlType string
    The type of git url being used. Options are ACCOUNT, and REPO.
    UsageScopes []GitConnectorUsageScopeArgs
    This block is used for scoping the resource to a specific set of applications or environments.
    Username string
    The name of the user used to connect to the git repository
    WebhookUrl string
    The generated webhook url
    branch String
    The branch of the git connector to use
    commitDetails GitConnectorCommitDetails
    Custom details to use when making commits using this git connector
    createdAt String
    The time the git connector was created
    delegateSelectors List<String>
    Delegate selectors to apply to this git connector.
    generateWebhookUrl Boolean
    Boolean indicating whether or not to generate a webhook url.
    name String
    Name of the git connector.
    passwordSecretId String
    The id of the secret for connecting to the git repository.
    sshSettingId String
    The id of the SSH secret to use
    url String
    The URL of the git repository or account/organization
    urlType String
    The type of git url being used. Options are ACCOUNT, and REPO.
    usageScopes List<GitConnectorUsageScope>
    This block is used for scoping the resource to a specific set of applications or environments.
    username String
    The name of the user used to connect to the git repository
    webhookUrl String
    The generated webhook url
    branch string
    The branch of the git connector to use
    commitDetails GitConnectorCommitDetails
    Custom details to use when making commits using this git connector
    createdAt string
    The time the git connector was created
    delegateSelectors string[]
    Delegate selectors to apply to this git connector.
    generateWebhookUrl boolean
    Boolean indicating whether or not to generate a webhook url.
    name string
    Name of the git connector.
    passwordSecretId string
    The id of the secret for connecting to the git repository.
    sshSettingId string
    The id of the SSH secret to use
    url string
    The URL of the git repository or account/organization
    urlType string
    The type of git url being used. Options are ACCOUNT, and REPO.
    usageScopes GitConnectorUsageScope[]
    This block is used for scoping the resource to a specific set of applications or environments.
    username string
    The name of the user used to connect to the git repository
    webhookUrl string
    The generated webhook url
    branch str
    The branch of the git connector to use
    commit_details GitConnectorCommitDetailsArgs
    Custom details to use when making commits using this git connector
    created_at str
    The time the git connector was created
    delegate_selectors Sequence[str]
    Delegate selectors to apply to this git connector.
    generate_webhook_url bool
    Boolean indicating whether or not to generate a webhook url.
    name str
    Name of the git connector.
    password_secret_id str
    The id of the secret for connecting to the git repository.
    ssh_setting_id str
    The id of the SSH secret to use
    url str
    The URL of the git repository or account/organization
    url_type str
    The type of git url being used. Options are ACCOUNT, and REPO.
    usage_scopes Sequence[GitConnectorUsageScopeArgs]
    This block is used for scoping the resource to a specific set of applications or environments.
    username str
    The name of the user used to connect to the git repository
    webhook_url str
    The generated webhook url
    branch String
    The branch of the git connector to use
    commitDetails Property Map
    Custom details to use when making commits using this git connector
    createdAt String
    The time the git connector was created
    delegateSelectors List<String>
    Delegate selectors to apply to this git connector.
    generateWebhookUrl Boolean
    Boolean indicating whether or not to generate a webhook url.
    name String
    Name of the git connector.
    passwordSecretId String
    The id of the secret for connecting to the git repository.
    sshSettingId String
    The id of the SSH secret to use
    url String
    The URL of the git repository or account/organization
    urlType String
    The type of git url being used. Options are ACCOUNT, and REPO.
    usageScopes List<Property Map>
    This block is used for scoping the resource to a specific set of applications or environments.
    username String
    The name of the user used to connect to the git repository
    webhookUrl String
    The generated webhook url

    Supporting Types

    GitConnectorCommitDetails, GitConnectorCommitDetailsArgs

    AuthorEmailId string
    The email id of the author
    AuthorName string
    The name of the author
    Message string
    Commit message
    AuthorEmailId string
    The email id of the author
    AuthorName string
    The name of the author
    Message string
    Commit message
    authorEmailId String
    The email id of the author
    authorName String
    The name of the author
    message String
    Commit message
    authorEmailId string
    The email id of the author
    authorName string
    The name of the author
    message string
    Commit message
    author_email_id str
    The email id of the author
    author_name str
    The name of the author
    message str
    Commit message
    authorEmailId String
    The email id of the author
    authorName String
    The name of the author
    message String
    Commit message

    GitConnectorUsageScope, GitConnectorUsageScopeArgs

    ApplicationId string
    Id of the application to scope to. If empty then this scope applies to all applications.
    EnvironmentFilterType string
    Type of environment filter applied. Cannot be used with environment_id. Valid options are NONPRODUCTIONENVIRONMENTS, PRODUCTION_ENVIRONMENTS.
    EnvironmentId string
    Id of the id of the specific environment to scope to. Cannot be used with environment_filter_type.
    ApplicationId string
    Id of the application to scope to. If empty then this scope applies to all applications.
    EnvironmentFilterType string
    Type of environment filter applied. Cannot be used with environment_id. Valid options are NONPRODUCTIONENVIRONMENTS, PRODUCTION_ENVIRONMENTS.
    EnvironmentId string
    Id of the id of the specific environment to scope to. Cannot be used with environment_filter_type.
    applicationId String
    Id of the application to scope to. If empty then this scope applies to all applications.
    environmentFilterType String
    Type of environment filter applied. Cannot be used with environment_id. Valid options are NONPRODUCTIONENVIRONMENTS, PRODUCTION_ENVIRONMENTS.
    environmentId String
    Id of the id of the specific environment to scope to. Cannot be used with environment_filter_type.
    applicationId string
    Id of the application to scope to. If empty then this scope applies to all applications.
    environmentFilterType string
    Type of environment filter applied. Cannot be used with environment_id. Valid options are NONPRODUCTIONENVIRONMENTS, PRODUCTION_ENVIRONMENTS.
    environmentId string
    Id of the id of the specific environment to scope to. Cannot be used with environment_filter_type.
    application_id str
    Id of the application to scope to. If empty then this scope applies to all applications.
    environment_filter_type str
    Type of environment filter applied. Cannot be used with environment_id. Valid options are NONPRODUCTIONENVIRONMENTS, PRODUCTION_ENVIRONMENTS.
    environment_id str
    Id of the id of the specific environment to scope to. Cannot be used with environment_filter_type.
    applicationId String
    Id of the application to scope to. If empty then this scope applies to all applications.
    environmentFilterType String
    Type of environment filter applied. Cannot be used with environment_id. Valid options are NONPRODUCTIONENVIRONMENTS, PRODUCTION_ENVIRONMENTS.
    environmentId String
    Id of the id of the specific environment to scope to. Cannot be used with environment_filter_type.

    Import

    Import using the Harness git connector id

     $ pulumi import harness:index/gitConnector:GitConnector example <connector_id>
    

    Package Details

    Repository
    harness lbrlabs/pulumi-harness
    License
    Apache-2.0
    Notes
    This Pulumi package is based on the harness Terraform Provider.
    harness logo
    Harness v0.0.6 published on Saturday, Jul 1, 2023 by lbrlabs