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

harness.platform.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;
    
    return await Deployment.RunAsync(() => 
    {
        // Credentials ssh
        var test = new Harness.Platform.GitConnector("test", new()
        {
            ConnectionType = "Account",
            Credentials = new Harness.Platform.Inputs.GitConnectorCredentialsArgs
            {
                Ssh = new Harness.Platform.Inputs.GitConnectorCredentialsSshArgs
                {
                    SshKeyRef = "account.secret_id",
                },
            },
            DelegateSelectors = new[]
            {
                "harness-delegate",
            },
            Description = "test",
            Identifier = "identifier",
            Tags = new[]
            {
                "foo:bar",
            },
            Url = "https://git.example.com/account",
            ValidationRepo = "some_repo",
        });
    
    });
    
    package main
    
    import (
    	"github.com/lbrlabs/pulumi-harness/sdk/go/harness/platform"
    	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
    )
    
    func main() {
    	pulumi.Run(func(ctx *pulumi.Context) error {
    		_, err := platform.NewGitConnector(ctx, "test", &platform.GitConnectorArgs{
    			ConnectionType: pulumi.String("Account"),
    			Credentials: &platform.GitConnectorCredentialsArgs{
    				Ssh: &platform.GitConnectorCredentialsSshArgs{
    					SshKeyRef: pulumi.String("account.secret_id"),
    				},
    			},
    			DelegateSelectors: pulumi.StringArray{
    				pulumi.String("harness-delegate"),
    			},
    			Description: pulumi.String("test"),
    			Identifier:  pulumi.String("identifier"),
    			Tags: pulumi.StringArray{
    				pulumi.String("foo:bar"),
    			},
    			Url:            pulumi.String("https://git.example.com/account"),
    			ValidationRepo: pulumi.String("some_repo"),
    		})
    		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.platform.GitConnector;
    import com.pulumi.harness.platform.GitConnectorArgs;
    import com.pulumi.harness.platform.inputs.GitConnectorCredentialsArgs;
    import com.pulumi.harness.platform.inputs.GitConnectorCredentialsSshArgs;
    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 GitConnector("test", GitConnectorArgs.builder()        
                .connectionType("Account")
                .credentials(GitConnectorCredentialsArgs.builder()
                    .ssh(GitConnectorCredentialsSshArgs.builder()
                        .sshKeyRef("account.secret_id")
                        .build())
                    .build())
                .delegateSelectors("harness-delegate")
                .description("test")
                .identifier("identifier")
                .tags("foo:bar")
                .url("https://git.example.com/account")
                .validationRepo("some_repo")
                .build());
    
        }
    }
    
    import pulumi
    import lbrlabs_pulumi_harness as harness
    
    # Credentials ssh
    test = harness.platform.GitConnector("test",
        connection_type="Account",
        credentials=harness.platform.GitConnectorCredentialsArgs(
            ssh=harness.platform.GitConnectorCredentialsSshArgs(
                ssh_key_ref="account.secret_id",
            ),
        ),
        delegate_selectors=["harness-delegate"],
        description="test",
        identifier="identifier",
        tags=["foo:bar"],
        url="https://git.example.com/account",
        validation_repo="some_repo")
    
    import * as pulumi from "@pulumi/pulumi";
    import * as harness from "@lbrlabs/pulumi-harness";
    
    // Credentials ssh
    const test = new harness.platform.GitConnector("test", {
        connectionType: "Account",
        credentials: {
            ssh: {
                sshKeyRef: "account.secret_id",
            },
        },
        delegateSelectors: ["harness-delegate"],
        description: "test",
        identifier: "identifier",
        tags: ["foo:bar"],
        url: "https://git.example.com/account",
        validationRepo: "some_repo",
    });
    
    resources:
      # Credentials ssh
      test:
        type: harness:platform:GitConnector
        properties:
          connectionType: Account
          credentials:
            ssh:
              sshKeyRef: account.secret_id
          delegateSelectors:
            - harness-delegate
          description: test
          identifier: identifier
          tags:
            - foo:bar
          url: https://git.example.com/account
          validationRepo: some_repo
    

    Create GitConnector Resource

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

    Constructor syntax

    new GitConnector(name: string, args: GitConnectorArgs, opts?: CustomResourceOptions);
    @overload
    def GitConnector(resource_name: str,
                     args: GitConnectorArgs,
                     opts: Optional[ResourceOptions] = None)
    
    @overload
    def GitConnector(resource_name: str,
                     opts: Optional[ResourceOptions] = None,
                     connection_type: Optional[str] = None,
                     credentials: Optional[GitConnectorCredentialsArgs] = None,
                     identifier: Optional[str] = None,
                     url: Optional[str] = None,
                     delegate_selectors: Optional[Sequence[str]] = None,
                     description: Optional[str] = None,
                     name: Optional[str] = None,
                     org_id: Optional[str] = None,
                     project_id: Optional[str] = None,
                     tags: Optional[Sequence[str]] = None,
                     validation_repo: Optional[str] = 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:platform:GitConnector
    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 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.

    Constructor example

    The following reference example uses placeholder values for all input properties.

    var harnessGitConnectorResource = new Harness.Platform.GitConnector("harnessGitConnectorResource", new()
    {
        ConnectionType = "string",
        Credentials = new Harness.Platform.Inputs.GitConnectorCredentialsArgs
        {
            Http = new Harness.Platform.Inputs.GitConnectorCredentialsHttpArgs
            {
                PasswordRef = "string",
                Username = "string",
                UsernameRef = "string",
            },
            Ssh = new Harness.Platform.Inputs.GitConnectorCredentialsSshArgs
            {
                SshKeyRef = "string",
            },
        },
        Identifier = "string",
        Url = "string",
        DelegateSelectors = new[]
        {
            "string",
        },
        Description = "string",
        Name = "string",
        OrgId = "string",
        ProjectId = "string",
        Tags = new[]
        {
            "string",
        },
        ValidationRepo = "string",
    });
    
    example, err := platform.NewGitConnector(ctx, "harnessGitConnectorResource", &platform.GitConnectorArgs{
    	ConnectionType: pulumi.String("string"),
    	Credentials: &platform.GitConnectorCredentialsArgs{
    		Http: &platform.GitConnectorCredentialsHttpArgs{
    			PasswordRef: pulumi.String("string"),
    			Username:    pulumi.String("string"),
    			UsernameRef: pulumi.String("string"),
    		},
    		Ssh: &platform.GitConnectorCredentialsSshArgs{
    			SshKeyRef: pulumi.String("string"),
    		},
    	},
    	Identifier: pulumi.String("string"),
    	Url:        pulumi.String("string"),
    	DelegateSelectors: pulumi.StringArray{
    		pulumi.String("string"),
    	},
    	Description: pulumi.String("string"),
    	Name:        pulumi.String("string"),
    	OrgId:       pulumi.String("string"),
    	ProjectId:   pulumi.String("string"),
    	Tags: pulumi.StringArray{
    		pulumi.String("string"),
    	},
    	ValidationRepo: pulumi.String("string"),
    })
    
    var harnessGitConnectorResource = new GitConnector("harnessGitConnectorResource", GitConnectorArgs.builder()
        .connectionType("string")
        .credentials(GitConnectorCredentialsArgs.builder()
            .http(GitConnectorCredentialsHttpArgs.builder()
                .passwordRef("string")
                .username("string")
                .usernameRef("string")
                .build())
            .ssh(GitConnectorCredentialsSshArgs.builder()
                .sshKeyRef("string")
                .build())
            .build())
        .identifier("string")
        .url("string")
        .delegateSelectors("string")
        .description("string")
        .name("string")
        .orgId("string")
        .projectId("string")
        .tags("string")
        .validationRepo("string")
        .build());
    
    harness_git_connector_resource = harness.platform.GitConnector("harnessGitConnectorResource",
        connection_type="string",
        credentials=harness.platform.GitConnectorCredentialsArgs(
            http=harness.platform.GitConnectorCredentialsHttpArgs(
                password_ref="string",
                username="string",
                username_ref="string",
            ),
            ssh=harness.platform.GitConnectorCredentialsSshArgs(
                ssh_key_ref="string",
            ),
        ),
        identifier="string",
        url="string",
        delegate_selectors=["string"],
        description="string",
        name="string",
        org_id="string",
        project_id="string",
        tags=["string"],
        validation_repo="string")
    
    const harnessGitConnectorResource = new harness.platform.GitConnector("harnessGitConnectorResource", {
        connectionType: "string",
        credentials: {
            http: {
                passwordRef: "string",
                username: "string",
                usernameRef: "string",
            },
            ssh: {
                sshKeyRef: "string",
            },
        },
        identifier: "string",
        url: "string",
        delegateSelectors: ["string"],
        description: "string",
        name: "string",
        orgId: "string",
        projectId: "string",
        tags: ["string"],
        validationRepo: "string",
    });
    
    type: harness:platform:GitConnector
    properties:
        connectionType: string
        credentials:
            http:
                passwordRef: string
                username: string
                usernameRef: string
            ssh:
                sshKeyRef: string
        delegateSelectors:
            - string
        description: string
        identifier: string
        name: string
        orgId: string
        projectId: string
        tags:
            - string
        url: string
        validationRepo: string
    

    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:

    ConnectionType string
    Whether the connection we're making is to a git repository or a git account. Valid values are Account, Repo.
    Credentials Lbrlabs.PulumiPackage.Harness.Platform.Inputs.GitConnectorCredentials
    Credentials to use for the connection.
    Identifier string
    Unique identifier of the resource.
    Url string
    URL of the git repository or account.
    DelegateSelectors List<string>
    Tags to filter delegates for connection.
    Description string
    Description of the resource.
    Name string
    Name of the resource.
    OrgId string
    Unique identifier of the organization.
    ProjectId string
    Unique identifier of the project.
    Tags List<string>
    Tags to associate with the resource.
    ValidationRepo string
    Repository to test the connection with. This is only used when connection_type is Account.
    ConnectionType string
    Whether the connection we're making is to a git repository or a git account. Valid values are Account, Repo.
    Credentials GitConnectorCredentialsArgs
    Credentials to use for the connection.
    Identifier string
    Unique identifier of the resource.
    Url string
    URL of the git repository or account.
    DelegateSelectors []string
    Tags to filter delegates for connection.
    Description string
    Description of the resource.
    Name string
    Name of the resource.
    OrgId string
    Unique identifier of the organization.
    ProjectId string
    Unique identifier of the project.
    Tags []string
    Tags to associate with the resource.
    ValidationRepo string
    Repository to test the connection with. This is only used when connection_type is Account.
    connectionType String
    Whether the connection we're making is to a git repository or a git account. Valid values are Account, Repo.
    credentials GitConnectorCredentials
    Credentials to use for the connection.
    identifier String
    Unique identifier of the resource.
    url String
    URL of the git repository or account.
    delegateSelectors List<String>
    Tags to filter delegates for connection.
    description String
    Description of the resource.
    name String
    Name of the resource.
    orgId String
    Unique identifier of the organization.
    projectId String
    Unique identifier of the project.
    tags List<String>
    Tags to associate with the resource.
    validationRepo String
    Repository to test the connection with. This is only used when connection_type is Account.
    connectionType string
    Whether the connection we're making is to a git repository or a git account. Valid values are Account, Repo.
    credentials GitConnectorCredentials
    Credentials to use for the connection.
    identifier string
    Unique identifier of the resource.
    url string
    URL of the git repository or account.
    delegateSelectors string[]
    Tags to filter delegates for connection.
    description string
    Description of the resource.
    name string
    Name of the resource.
    orgId string
    Unique identifier of the organization.
    projectId string
    Unique identifier of the project.
    tags string[]
    Tags to associate with the resource.
    validationRepo string
    Repository to test the connection with. This is only used when connection_type is Account.
    connection_type str
    Whether the connection we're making is to a git repository or a git account. Valid values are Account, Repo.
    credentials GitConnectorCredentialsArgs
    Credentials to use for the connection.
    identifier str
    Unique identifier of the resource.
    url str
    URL of the git repository or account.
    delegate_selectors Sequence[str]
    Tags to filter delegates for connection.
    description str
    Description of the resource.
    name str
    Name of the resource.
    org_id str
    Unique identifier of the organization.
    project_id str
    Unique identifier of the project.
    tags Sequence[str]
    Tags to associate with the resource.
    validation_repo str
    Repository to test the connection with. This is only used when connection_type is Account.
    connectionType String
    Whether the connection we're making is to a git repository or a git account. Valid values are Account, Repo.
    credentials Property Map
    Credentials to use for the connection.
    identifier String
    Unique identifier of the resource.
    url String
    URL of the git repository or account.
    delegateSelectors List<String>
    Tags to filter delegates for connection.
    description String
    Description of the resource.
    name String
    Name of the resource.
    orgId String
    Unique identifier of the organization.
    projectId String
    Unique identifier of the project.
    tags List<String>
    Tags to associate with the resource.
    validationRepo String
    Repository to test the connection with. This is only used when connection_type is Account.

    Outputs

    All input properties are implicitly available as output properties. Additionally, the GitConnector 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 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,
            connection_type: Optional[str] = None,
            credentials: Optional[GitConnectorCredentialsArgs] = None,
            delegate_selectors: Optional[Sequence[str]] = None,
            description: Optional[str] = None,
            identifier: Optional[str] = None,
            name: Optional[str] = None,
            org_id: Optional[str] = None,
            project_id: Optional[str] = None,
            tags: Optional[Sequence[str]] = None,
            url: Optional[str] = None,
            validation_repo: 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:
    ConnectionType string
    Whether the connection we're making is to a git repository or a git account. Valid values are Account, Repo.
    Credentials Lbrlabs.PulumiPackage.Harness.Platform.Inputs.GitConnectorCredentials
    Credentials to use for the connection.
    DelegateSelectors List<string>
    Tags to filter delegates for connection.
    Description string
    Description of the resource.
    Identifier string
    Unique identifier of the resource.
    Name string
    Name of the resource.
    OrgId string
    Unique identifier of the organization.
    ProjectId string
    Unique identifier of the project.
    Tags List<string>
    Tags to associate with the resource.
    Url string
    URL of the git repository or account.
    ValidationRepo string
    Repository to test the connection with. This is only used when connection_type is Account.
    ConnectionType string
    Whether the connection we're making is to a git repository or a git account. Valid values are Account, Repo.
    Credentials GitConnectorCredentialsArgs
    Credentials to use for the connection.
    DelegateSelectors []string
    Tags to filter delegates for connection.
    Description string
    Description of the resource.
    Identifier string
    Unique identifier of the resource.
    Name string
    Name of the resource.
    OrgId string
    Unique identifier of the organization.
    ProjectId string
    Unique identifier of the project.
    Tags []string
    Tags to associate with the resource.
    Url string
    URL of the git repository or account.
    ValidationRepo string
    Repository to test the connection with. This is only used when connection_type is Account.
    connectionType String
    Whether the connection we're making is to a git repository or a git account. Valid values are Account, Repo.
    credentials GitConnectorCredentials
    Credentials to use for the connection.
    delegateSelectors List<String>
    Tags to filter delegates for connection.
    description String
    Description of the resource.
    identifier String
    Unique identifier of the resource.
    name String
    Name of the resource.
    orgId String
    Unique identifier of the organization.
    projectId String
    Unique identifier of the project.
    tags List<String>
    Tags to associate with the resource.
    url String
    URL of the git repository or account.
    validationRepo String
    Repository to test the connection with. This is only used when connection_type is Account.
    connectionType string
    Whether the connection we're making is to a git repository or a git account. Valid values are Account, Repo.
    credentials GitConnectorCredentials
    Credentials to use for the connection.
    delegateSelectors string[]
    Tags to filter delegates for connection.
    description string
    Description of the resource.
    identifier string
    Unique identifier of the resource.
    name string
    Name of the resource.
    orgId string
    Unique identifier of the organization.
    projectId string
    Unique identifier of the project.
    tags string[]
    Tags to associate with the resource.
    url string
    URL of the git repository or account.
    validationRepo string
    Repository to test the connection with. This is only used when connection_type is Account.
    connection_type str
    Whether the connection we're making is to a git repository or a git account. Valid values are Account, Repo.
    credentials GitConnectorCredentialsArgs
    Credentials to use for the connection.
    delegate_selectors Sequence[str]
    Tags to filter delegates for connection.
    description str
    Description of the resource.
    identifier str
    Unique identifier of the resource.
    name str
    Name of the resource.
    org_id str
    Unique identifier of the organization.
    project_id str
    Unique identifier of the project.
    tags Sequence[str]
    Tags to associate with the resource.
    url str
    URL of the git repository or account.
    validation_repo str
    Repository to test the connection with. This is only used when connection_type is Account.
    connectionType String
    Whether the connection we're making is to a git repository or a git account. Valid values are Account, Repo.
    credentials Property Map
    Credentials to use for the connection.
    delegateSelectors List<String>
    Tags to filter delegates for connection.
    description String
    Description of the resource.
    identifier String
    Unique identifier of the resource.
    name String
    Name of the resource.
    orgId String
    Unique identifier of the organization.
    projectId String
    Unique identifier of the project.
    tags List<String>
    Tags to associate with the resource.
    url String
    URL of the git repository or account.
    validationRepo String
    Repository to test the connection with. This is only used when connection_type is Account.

    Supporting Types

    GitConnectorCredentials, GitConnectorCredentialsArgs

    Http Lbrlabs.PulumiPackage.Harness.Platform.Inputs.GitConnectorCredentialsHttp
    Authenticate using Username and password over http(s) for the connection.
    Ssh Lbrlabs.PulumiPackage.Harness.Platform.Inputs.GitConnectorCredentialsSsh
    Authenticate using SSH for the connection.
    Http GitConnectorCredentialsHttp
    Authenticate using Username and password over http(s) for the connection.
    Ssh GitConnectorCredentialsSsh
    Authenticate using SSH for the connection.
    http GitConnectorCredentialsHttp
    Authenticate using Username and password over http(s) for the connection.
    ssh GitConnectorCredentialsSsh
    Authenticate using SSH for the connection.
    http GitConnectorCredentialsHttp
    Authenticate using Username and password over http(s) for the connection.
    ssh GitConnectorCredentialsSsh
    Authenticate using SSH for the connection.
    http GitConnectorCredentialsHttp
    Authenticate using Username and password over http(s) for the connection.
    ssh GitConnectorCredentialsSsh
    Authenticate using SSH for the connection.
    http Property Map
    Authenticate using Username and password over http(s) for the connection.
    ssh Property Map
    Authenticate using SSH for the connection.

    GitConnectorCredentialsHttp, GitConnectorCredentialsHttpArgs

    PasswordRef string
    Username string
    UsernameRef string
    PasswordRef string
    Username string
    UsernameRef string
    passwordRef String
    username String
    usernameRef String
    passwordRef string
    username string
    usernameRef string
    passwordRef String
    username String
    usernameRef String

    GitConnectorCredentialsSsh, GitConnectorCredentialsSshArgs

    SshKeyRef string
    SshKeyRef string
    sshKeyRef String
    sshKeyRef string
    sshKeyRef String

    Import

    Import account level git connector

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

    Import org level git connector

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

    Import project level git connector

     $ pulumi import harness:platform/gitConnector:GitConnector example <org_id>/<project_id>/<connector_id>
    

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

    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