1. Packages
  2. Google Cloud (GCP) Classic
  3. API Docs
  4. cloudbuildv2
  5. Connection
Google Cloud Classic v7.19.0 published on Thursday, Apr 18, 2024 by Pulumi

gcp.cloudbuildv2.Connection

Explore with Pulumi AI

gcp logo
Google Cloud Classic v7.19.0 published on Thursday, Apr 18, 2024 by Pulumi

    A connection to a SCM like GitHub, GitHub Enterprise, Bitbucket Data Center or GitLab.

    To get more information about Connection, see:

    Example Usage

    Cloudbuildv2 Connection

    import * as pulumi from "@pulumi/pulumi";
    import * as gcp from "@pulumi/gcp";
    
    const my_connection = new gcp.cloudbuildv2.Connection("my-connection", {
        location: "us-central1",
        name: "tf-test-connection",
        githubConfig: {
            appInstallationId: 0,
            authorizerCredential: {
                oauthTokenSecretVersion: "projects/gcb-terraform-creds/secrets/github-pat/versions/1",
            },
        },
    });
    
    import pulumi
    import pulumi_gcp as gcp
    
    my_connection = gcp.cloudbuildv2.Connection("my-connection",
        location="us-central1",
        name="tf-test-connection",
        github_config=gcp.cloudbuildv2.ConnectionGithubConfigArgs(
            app_installation_id=0,
            authorizer_credential=gcp.cloudbuildv2.ConnectionGithubConfigAuthorizerCredentialArgs(
                oauth_token_secret_version="projects/gcb-terraform-creds/secrets/github-pat/versions/1",
            ),
        ))
    
    package main
    
    import (
    	"github.com/pulumi/pulumi-gcp/sdk/v7/go/gcp/cloudbuildv2"
    	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
    )
    
    func main() {
    	pulumi.Run(func(ctx *pulumi.Context) error {
    		_, err := cloudbuildv2.NewConnection(ctx, "my-connection", &cloudbuildv2.ConnectionArgs{
    			Location: pulumi.String("us-central1"),
    			Name:     pulumi.String("tf-test-connection"),
    			GithubConfig: &cloudbuildv2.ConnectionGithubConfigArgs{
    				AppInstallationId: pulumi.Int(0),
    				AuthorizerCredential: &cloudbuildv2.ConnectionGithubConfigAuthorizerCredentialArgs{
    					OauthTokenSecretVersion: pulumi.String("projects/gcb-terraform-creds/secrets/github-pat/versions/1"),
    				},
    			},
    		})
    		if err != nil {
    			return err
    		}
    		return nil
    	})
    }
    
    using System.Collections.Generic;
    using System.Linq;
    using Pulumi;
    using Gcp = Pulumi.Gcp;
    
    return await Deployment.RunAsync(() => 
    {
        var my_connection = new Gcp.CloudBuildV2.Connection("my-connection", new()
        {
            Location = "us-central1",
            Name = "tf-test-connection",
            GithubConfig = new Gcp.CloudBuildV2.Inputs.ConnectionGithubConfigArgs
            {
                AppInstallationId = 0,
                AuthorizerCredential = new Gcp.CloudBuildV2.Inputs.ConnectionGithubConfigAuthorizerCredentialArgs
                {
                    OauthTokenSecretVersion = "projects/gcb-terraform-creds/secrets/github-pat/versions/1",
                },
            },
        });
    
    });
    
    package generated_program;
    
    import com.pulumi.Context;
    import com.pulumi.Pulumi;
    import com.pulumi.core.Output;
    import com.pulumi.gcp.cloudbuildv2.Connection;
    import com.pulumi.gcp.cloudbuildv2.ConnectionArgs;
    import com.pulumi.gcp.cloudbuildv2.inputs.ConnectionGithubConfigArgs;
    import com.pulumi.gcp.cloudbuildv2.inputs.ConnectionGithubConfigAuthorizerCredentialArgs;
    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 my_connection = new Connection("my-connection", ConnectionArgs.builder()        
                .location("us-central1")
                .name("tf-test-connection")
                .githubConfig(ConnectionGithubConfigArgs.builder()
                    .appInstallationId(0)
                    .authorizerCredential(ConnectionGithubConfigAuthorizerCredentialArgs.builder()
                        .oauthTokenSecretVersion("projects/gcb-terraform-creds/secrets/github-pat/versions/1")
                        .build())
                    .build())
                .build());
    
        }
    }
    
    resources:
      my-connection:
        type: gcp:cloudbuildv2:Connection
        properties:
          location: us-central1
          name: tf-test-connection
          githubConfig:
            appInstallationId: 0
            authorizerCredential:
              oauthTokenSecretVersion: projects/gcb-terraform-creds/secrets/github-pat/versions/1
    

    Cloudbuildv2 Connection Ghe

    import * as pulumi from "@pulumi/pulumi";
    import * as gcp from "@pulumi/gcp";
    import * as std from "@pulumi/std";
    
    const private_key_secret = new gcp.secretmanager.Secret("private-key-secret", {
        secretId: "ghe-pk-secret",
        replication: {
            auto: {},
        },
    });
    const private_key_secret_version = new gcp.secretmanager.SecretVersion("private-key-secret-version", {
        secret: private_key_secret.id,
        secretData: std.file({
            input: "private-key.pem",
        }).then(invoke => invoke.result),
    });
    const webhook_secret_secret = new gcp.secretmanager.Secret("webhook-secret-secret", {
        secretId: "github-token-secret",
        replication: {
            auto: {},
        },
    });
    const webhook_secret_secret_version = new gcp.secretmanager.SecretVersion("webhook-secret-secret-version", {
        secret: webhook_secret_secret.id,
        secretData: "<webhook-secret-data>",
    });
    const p4sa-secretAccessor = gcp.organizations.getIAMPolicy({
        bindings: [{
            role: "roles/secretmanager.secretAccessor",
            members: ["serviceAccount:service-123456789@gcp-sa-cloudbuild.iam.gserviceaccount.com"],
        }],
    });
    const policy_pk = new gcp.secretmanager.SecretIamPolicy("policy-pk", {
        secretId: private_key_secret.secretId,
        policyData: p4sa_secretAccessor.then(p4sa_secretAccessor => p4sa_secretAccessor.policyData),
    });
    const policy_whs = new gcp.secretmanager.SecretIamPolicy("policy-whs", {
        secretId: webhook_secret_secret.secretId,
        policyData: p4sa_secretAccessor.then(p4sa_secretAccessor => p4sa_secretAccessor.policyData),
    });
    const my_connection = new gcp.cloudbuildv2.Connection("my-connection", {
        location: "us-central1",
        name: "my-terraform-ghe-connection",
        githubEnterpriseConfig: {
            hostUri: "https://ghe.com",
            privateKeySecretVersion: private_key_secret_version.id,
            webhookSecretSecretVersion: webhook_secret_secret_version.id,
            appId: 200,
            appSlug: "gcb-app",
            appInstallationId: 300,
        },
    });
    
    import pulumi
    import pulumi_gcp as gcp
    import pulumi_std as std
    
    private_key_secret = gcp.secretmanager.Secret("private-key-secret",
        secret_id="ghe-pk-secret",
        replication=gcp.secretmanager.SecretReplicationArgs(
            auto=gcp.secretmanager.SecretReplicationAutoArgs(),
        ))
    private_key_secret_version = gcp.secretmanager.SecretVersion("private-key-secret-version",
        secret=private_key_secret.id,
        secret_data=std.file(input="private-key.pem").result)
    webhook_secret_secret = gcp.secretmanager.Secret("webhook-secret-secret",
        secret_id="github-token-secret",
        replication=gcp.secretmanager.SecretReplicationArgs(
            auto=gcp.secretmanager.SecretReplicationAutoArgs(),
        ))
    webhook_secret_secret_version = gcp.secretmanager.SecretVersion("webhook-secret-secret-version",
        secret=webhook_secret_secret.id,
        secret_data="<webhook-secret-data>")
    p4sa_secret_accessor = gcp.organizations.get_iam_policy(bindings=[gcp.organizations.GetIAMPolicyBindingArgs(
        role="roles/secretmanager.secretAccessor",
        members=["serviceAccount:service-123456789@gcp-sa-cloudbuild.iam.gserviceaccount.com"],
    )])
    policy_pk = gcp.secretmanager.SecretIamPolicy("policy-pk",
        secret_id=private_key_secret.secret_id,
        policy_data=p4sa_secret_accessor.policy_data)
    policy_whs = gcp.secretmanager.SecretIamPolicy("policy-whs",
        secret_id=webhook_secret_secret.secret_id,
        policy_data=p4sa_secret_accessor.policy_data)
    my_connection = gcp.cloudbuildv2.Connection("my-connection",
        location="us-central1",
        name="my-terraform-ghe-connection",
        github_enterprise_config=gcp.cloudbuildv2.ConnectionGithubEnterpriseConfigArgs(
            host_uri="https://ghe.com",
            private_key_secret_version=private_key_secret_version.id,
            webhook_secret_secret_version=webhook_secret_secret_version.id,
            app_id=200,
            app_slug="gcb-app",
            app_installation_id=300,
        ))
    
    package main
    
    import (
    	"github.com/pulumi/pulumi-gcp/sdk/v7/go/gcp/cloudbuildv2"
    	"github.com/pulumi/pulumi-gcp/sdk/v7/go/gcp/organizations"
    	"github.com/pulumi/pulumi-gcp/sdk/v7/go/gcp/secretmanager"
    	"github.com/pulumi/pulumi-std/sdk/go/std"
    	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
    )
    
    func main() {
    	pulumi.Run(func(ctx *pulumi.Context) error {
    		_, err := secretmanager.NewSecret(ctx, "private-key-secret", &secretmanager.SecretArgs{
    			SecretId: pulumi.String("ghe-pk-secret"),
    			Replication: &secretmanager.SecretReplicationArgs{
    				Auto: nil,
    			},
    		})
    		if err != nil {
    			return err
    		}
    		invokeFile, err := std.File(ctx, &std.FileArgs{
    			Input: "private-key.pem",
    		}, nil)
    		if err != nil {
    			return err
    		}
    		_, err = secretmanager.NewSecretVersion(ctx, "private-key-secret-version", &secretmanager.SecretVersionArgs{
    			Secret:     private_key_secret.ID(),
    			SecretData: invokeFile.Result,
    		})
    		if err != nil {
    			return err
    		}
    		_, err = secretmanager.NewSecret(ctx, "webhook-secret-secret", &secretmanager.SecretArgs{
    			SecretId: pulumi.String("github-token-secret"),
    			Replication: &secretmanager.SecretReplicationArgs{
    				Auto: nil,
    			},
    		})
    		if err != nil {
    			return err
    		}
    		_, err = secretmanager.NewSecretVersion(ctx, "webhook-secret-secret-version", &secretmanager.SecretVersionArgs{
    			Secret:     webhook_secret_secret.ID(),
    			SecretData: pulumi.String("<webhook-secret-data>"),
    		})
    		if err != nil {
    			return err
    		}
    		p4sa_secretAccessor, err := organizations.LookupIAMPolicy(ctx, &organizations.LookupIAMPolicyArgs{
    			Bindings: []organizations.GetIAMPolicyBinding{
    				{
    					Role: "roles/secretmanager.secretAccessor",
    					Members: []string{
    						"serviceAccount:service-123456789@gcp-sa-cloudbuild.iam.gserviceaccount.com",
    					},
    				},
    			},
    		}, nil)
    		if err != nil {
    			return err
    		}
    		_, err = secretmanager.NewSecretIamPolicy(ctx, "policy-pk", &secretmanager.SecretIamPolicyArgs{
    			SecretId:   private_key_secret.SecretId,
    			PolicyData: pulumi.String(p4sa_secretAccessor.PolicyData),
    		})
    		if err != nil {
    			return err
    		}
    		_, err = secretmanager.NewSecretIamPolicy(ctx, "policy-whs", &secretmanager.SecretIamPolicyArgs{
    			SecretId:   webhook_secret_secret.SecretId,
    			PolicyData: pulumi.String(p4sa_secretAccessor.PolicyData),
    		})
    		if err != nil {
    			return err
    		}
    		_, err = cloudbuildv2.NewConnection(ctx, "my-connection", &cloudbuildv2.ConnectionArgs{
    			Location: pulumi.String("us-central1"),
    			Name:     pulumi.String("my-terraform-ghe-connection"),
    			GithubEnterpriseConfig: &cloudbuildv2.ConnectionGithubEnterpriseConfigArgs{
    				HostUri:                    pulumi.String("https://ghe.com"),
    				PrivateKeySecretVersion:    private_key_secret_version.ID(),
    				WebhookSecretSecretVersion: webhook_secret_secret_version.ID(),
    				AppId:                      pulumi.Int(200),
    				AppSlug:                    pulumi.String("gcb-app"),
    				AppInstallationId:          pulumi.Int(300),
    			},
    		})
    		if err != nil {
    			return err
    		}
    		return nil
    	})
    }
    
    using System.Collections.Generic;
    using System.Linq;
    using Pulumi;
    using Gcp = Pulumi.Gcp;
    using Std = Pulumi.Std;
    
    return await Deployment.RunAsync(() => 
    {
        var private_key_secret = new Gcp.SecretManager.Secret("private-key-secret", new()
        {
            SecretId = "ghe-pk-secret",
            Replication = new Gcp.SecretManager.Inputs.SecretReplicationArgs
            {
                Auto = null,
            },
        });
    
        var private_key_secret_version = new Gcp.SecretManager.SecretVersion("private-key-secret-version", new()
        {
            Secret = private_key_secret.Id,
            SecretData = Std.File.Invoke(new()
            {
                Input = "private-key.pem",
            }).Apply(invoke => invoke.Result),
        });
    
        var webhook_secret_secret = new Gcp.SecretManager.Secret("webhook-secret-secret", new()
        {
            SecretId = "github-token-secret",
            Replication = new Gcp.SecretManager.Inputs.SecretReplicationArgs
            {
                Auto = null,
            },
        });
    
        var webhook_secret_secret_version = new Gcp.SecretManager.SecretVersion("webhook-secret-secret-version", new()
        {
            Secret = webhook_secret_secret.Id,
            SecretData = "<webhook-secret-data>",
        });
    
        var p4sa_secretAccessor = Gcp.Organizations.GetIAMPolicy.Invoke(new()
        {
            Bindings = new[]
            {
                new Gcp.Organizations.Inputs.GetIAMPolicyBindingInputArgs
                {
                    Role = "roles/secretmanager.secretAccessor",
                    Members = new[]
                    {
                        "serviceAccount:service-123456789@gcp-sa-cloudbuild.iam.gserviceaccount.com",
                    },
                },
            },
        });
    
        var policy_pk = new Gcp.SecretManager.SecretIamPolicy("policy-pk", new()
        {
            SecretId = private_key_secret.SecretId,
            PolicyData = p4sa_secretAccessor.Apply(p4sa_secretAccessor => p4sa_secretAccessor.Apply(getIAMPolicyResult => getIAMPolicyResult.PolicyData)),
        });
    
        var policy_whs = new Gcp.SecretManager.SecretIamPolicy("policy-whs", new()
        {
            SecretId = webhook_secret_secret.SecretId,
            PolicyData = p4sa_secretAccessor.Apply(p4sa_secretAccessor => p4sa_secretAccessor.Apply(getIAMPolicyResult => getIAMPolicyResult.PolicyData)),
        });
    
        var my_connection = new Gcp.CloudBuildV2.Connection("my-connection", new()
        {
            Location = "us-central1",
            Name = "my-terraform-ghe-connection",
            GithubEnterpriseConfig = new Gcp.CloudBuildV2.Inputs.ConnectionGithubEnterpriseConfigArgs
            {
                HostUri = "https://ghe.com",
                PrivateKeySecretVersion = private_key_secret_version.Id,
                WebhookSecretSecretVersion = webhook_secret_secret_version.Id,
                AppId = 200,
                AppSlug = "gcb-app",
                AppInstallationId = 300,
            },
        });
    
    });
    
    package generated_program;
    
    import com.pulumi.Context;
    import com.pulumi.Pulumi;
    import com.pulumi.core.Output;
    import com.pulumi.gcp.secretmanager.Secret;
    import com.pulumi.gcp.secretmanager.SecretArgs;
    import com.pulumi.gcp.secretmanager.inputs.SecretReplicationArgs;
    import com.pulumi.gcp.secretmanager.inputs.SecretReplicationAutoArgs;
    import com.pulumi.gcp.secretmanager.SecretVersion;
    import com.pulumi.gcp.secretmanager.SecretVersionArgs;
    import com.pulumi.gcp.organizations.OrganizationsFunctions;
    import com.pulumi.gcp.organizations.inputs.GetIAMPolicyArgs;
    import com.pulumi.gcp.secretmanager.SecretIamPolicy;
    import com.pulumi.gcp.secretmanager.SecretIamPolicyArgs;
    import com.pulumi.gcp.cloudbuildv2.Connection;
    import com.pulumi.gcp.cloudbuildv2.ConnectionArgs;
    import com.pulumi.gcp.cloudbuildv2.inputs.ConnectionGithubEnterpriseConfigArgs;
    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 private_key_secret = new Secret("private-key-secret", SecretArgs.builder()        
                .secretId("ghe-pk-secret")
                .replication(SecretReplicationArgs.builder()
                    .auto()
                    .build())
                .build());
    
            var private_key_secret_version = new SecretVersion("private-key-secret-version", SecretVersionArgs.builder()        
                .secret(private_key_secret.id())
                .secretData(StdFunctions.file(FileArgs.builder()
                    .input("private-key.pem")
                    .build()).result())
                .build());
    
            var webhook_secret_secret = new Secret("webhook-secret-secret", SecretArgs.builder()        
                .secretId("github-token-secret")
                .replication(SecretReplicationArgs.builder()
                    .auto()
                    .build())
                .build());
    
            var webhook_secret_secret_version = new SecretVersion("webhook-secret-secret-version", SecretVersionArgs.builder()        
                .secret(webhook_secret_secret.id())
                .secretData("<webhook-secret-data>")
                .build());
    
            final var p4sa-secretAccessor = OrganizationsFunctions.getIAMPolicy(GetIAMPolicyArgs.builder()
                .bindings(GetIAMPolicyBindingArgs.builder()
                    .role("roles/secretmanager.secretAccessor")
                    .members("serviceAccount:service-123456789@gcp-sa-cloudbuild.iam.gserviceaccount.com")
                    .build())
                .build());
    
            var policy_pk = new SecretIamPolicy("policy-pk", SecretIamPolicyArgs.builder()        
                .secretId(private_key_secret.secretId())
                .policyData(p4sa_secretAccessor.policyData())
                .build());
    
            var policy_whs = new SecretIamPolicy("policy-whs", SecretIamPolicyArgs.builder()        
                .secretId(webhook_secret_secret.secretId())
                .policyData(p4sa_secretAccessor.policyData())
                .build());
    
            var my_connection = new Connection("my-connection", ConnectionArgs.builder()        
                .location("us-central1")
                .name("my-terraform-ghe-connection")
                .githubEnterpriseConfig(ConnectionGithubEnterpriseConfigArgs.builder()
                    .hostUri("https://ghe.com")
                    .privateKeySecretVersion(private_key_secret_version.id())
                    .webhookSecretSecretVersion(webhook_secret_secret_version.id())
                    .appId(200)
                    .appSlug("gcb-app")
                    .appInstallationId(300)
                    .build())
                .build());
    
        }
    }
    
    resources:
      private-key-secret:
        type: gcp:secretmanager:Secret
        properties:
          secretId: ghe-pk-secret
          replication:
            auto: {}
      private-key-secret-version:
        type: gcp:secretmanager:SecretVersion
        properties:
          secret: ${["private-key-secret"].id}
          secretData:
            fn::invoke:
              Function: std:file
              Arguments:
                input: private-key.pem
              Return: result
      webhook-secret-secret:
        type: gcp:secretmanager:Secret
        properties:
          secretId: github-token-secret
          replication:
            auto: {}
      webhook-secret-secret-version:
        type: gcp:secretmanager:SecretVersion
        properties:
          secret: ${["webhook-secret-secret"].id}
          secretData: <webhook-secret-data>
      policy-pk:
        type: gcp:secretmanager:SecretIamPolicy
        properties:
          secretId: ${["private-key-secret"].secretId}
          policyData: ${["p4sa-secretAccessor"].policyData}
      policy-whs:
        type: gcp:secretmanager:SecretIamPolicy
        properties:
          secretId: ${["webhook-secret-secret"].secretId}
          policyData: ${["p4sa-secretAccessor"].policyData}
      my-connection:
        type: gcp:cloudbuildv2:Connection
        properties:
          location: us-central1
          name: my-terraform-ghe-connection
          githubEnterpriseConfig:
            hostUri: https://ghe.com
            privateKeySecretVersion: ${["private-key-secret-version"].id}
            webhookSecretSecretVersion: ${["webhook-secret-secret-version"].id}
            appId: 200
            appSlug: gcb-app
            appInstallationId: 300
    variables:
      p4sa-secretAccessor:
        fn::invoke:
          Function: gcp:organizations:getIAMPolicy
          Arguments:
            bindings:
              - role: roles/secretmanager.secretAccessor
                members:
                  - serviceAccount:service-123456789@gcp-sa-cloudbuild.iam.gserviceaccount.com
    

    Cloudbuildv2 Connection Github

    import * as pulumi from "@pulumi/pulumi";
    import * as gcp from "@pulumi/gcp";
    import * as std from "@pulumi/std";
    
    const github_token_secret = new gcp.secretmanager.Secret("github-token-secret", {
        secretId: "github-token-secret",
        replication: {
            auto: {},
        },
    });
    const github_token_secret_version = new gcp.secretmanager.SecretVersion("github-token-secret-version", {
        secret: github_token_secret.id,
        secretData: std.file({
            input: "my-github-token.txt",
        }).then(invoke => invoke.result),
    });
    const p4sa-secretAccessor = gcp.organizations.getIAMPolicy({
        bindings: [{
            role: "roles/secretmanager.secretAccessor",
            members: ["serviceAccount:service-123456789@gcp-sa-cloudbuild.iam.gserviceaccount.com"],
        }],
    });
    const policy = new gcp.secretmanager.SecretIamPolicy("policy", {
        secretId: github_token_secret.secretId,
        policyData: p4sa_secretAccessor.then(p4sa_secretAccessor => p4sa_secretAccessor.policyData),
    });
    const my_connection = new gcp.cloudbuildv2.Connection("my-connection", {
        location: "us-central1",
        name: "my-connection",
        githubConfig: {
            appInstallationId: 123123,
            authorizerCredential: {
                oauthTokenSecretVersion: github_token_secret_version.id,
            },
        },
    });
    
    import pulumi
    import pulumi_gcp as gcp
    import pulumi_std as std
    
    github_token_secret = gcp.secretmanager.Secret("github-token-secret",
        secret_id="github-token-secret",
        replication=gcp.secretmanager.SecretReplicationArgs(
            auto=gcp.secretmanager.SecretReplicationAutoArgs(),
        ))
    github_token_secret_version = gcp.secretmanager.SecretVersion("github-token-secret-version",
        secret=github_token_secret.id,
        secret_data=std.file(input="my-github-token.txt").result)
    p4sa_secret_accessor = gcp.organizations.get_iam_policy(bindings=[gcp.organizations.GetIAMPolicyBindingArgs(
        role="roles/secretmanager.secretAccessor",
        members=["serviceAccount:service-123456789@gcp-sa-cloudbuild.iam.gserviceaccount.com"],
    )])
    policy = gcp.secretmanager.SecretIamPolicy("policy",
        secret_id=github_token_secret.secret_id,
        policy_data=p4sa_secret_accessor.policy_data)
    my_connection = gcp.cloudbuildv2.Connection("my-connection",
        location="us-central1",
        name="my-connection",
        github_config=gcp.cloudbuildv2.ConnectionGithubConfigArgs(
            app_installation_id=123123,
            authorizer_credential=gcp.cloudbuildv2.ConnectionGithubConfigAuthorizerCredentialArgs(
                oauth_token_secret_version=github_token_secret_version.id,
            ),
        ))
    
    package main
    
    import (
    	"github.com/pulumi/pulumi-gcp/sdk/v7/go/gcp/cloudbuildv2"
    	"github.com/pulumi/pulumi-gcp/sdk/v7/go/gcp/organizations"
    	"github.com/pulumi/pulumi-gcp/sdk/v7/go/gcp/secretmanager"
    	"github.com/pulumi/pulumi-std/sdk/go/std"
    	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
    )
    
    func main() {
    	pulumi.Run(func(ctx *pulumi.Context) error {
    		_, err := secretmanager.NewSecret(ctx, "github-token-secret", &secretmanager.SecretArgs{
    			SecretId: pulumi.String("github-token-secret"),
    			Replication: &secretmanager.SecretReplicationArgs{
    				Auto: nil,
    			},
    		})
    		if err != nil {
    			return err
    		}
    		invokeFile, err := std.File(ctx, &std.FileArgs{
    			Input: "my-github-token.txt",
    		}, nil)
    		if err != nil {
    			return err
    		}
    		_, err = secretmanager.NewSecretVersion(ctx, "github-token-secret-version", &secretmanager.SecretVersionArgs{
    			Secret:     github_token_secret.ID(),
    			SecretData: invokeFile.Result,
    		})
    		if err != nil {
    			return err
    		}
    		p4sa_secretAccessor, err := organizations.LookupIAMPolicy(ctx, &organizations.LookupIAMPolicyArgs{
    			Bindings: []organizations.GetIAMPolicyBinding{
    				{
    					Role: "roles/secretmanager.secretAccessor",
    					Members: []string{
    						"serviceAccount:service-123456789@gcp-sa-cloudbuild.iam.gserviceaccount.com",
    					},
    				},
    			},
    		}, nil)
    		if err != nil {
    			return err
    		}
    		_, err = secretmanager.NewSecretIamPolicy(ctx, "policy", &secretmanager.SecretIamPolicyArgs{
    			SecretId:   github_token_secret.SecretId,
    			PolicyData: pulumi.String(p4sa_secretAccessor.PolicyData),
    		})
    		if err != nil {
    			return err
    		}
    		_, err = cloudbuildv2.NewConnection(ctx, "my-connection", &cloudbuildv2.ConnectionArgs{
    			Location: pulumi.String("us-central1"),
    			Name:     pulumi.String("my-connection"),
    			GithubConfig: &cloudbuildv2.ConnectionGithubConfigArgs{
    				AppInstallationId: pulumi.Int(123123),
    				AuthorizerCredential: &cloudbuildv2.ConnectionGithubConfigAuthorizerCredentialArgs{
    					OauthTokenSecretVersion: github_token_secret_version.ID(),
    				},
    			},
    		})
    		if err != nil {
    			return err
    		}
    		return nil
    	})
    }
    
    using System.Collections.Generic;
    using System.Linq;
    using Pulumi;
    using Gcp = Pulumi.Gcp;
    using Std = Pulumi.Std;
    
    return await Deployment.RunAsync(() => 
    {
        var github_token_secret = new Gcp.SecretManager.Secret("github-token-secret", new()
        {
            SecretId = "github-token-secret",
            Replication = new Gcp.SecretManager.Inputs.SecretReplicationArgs
            {
                Auto = null,
            },
        });
    
        var github_token_secret_version = new Gcp.SecretManager.SecretVersion("github-token-secret-version", new()
        {
            Secret = github_token_secret.Id,
            SecretData = Std.File.Invoke(new()
            {
                Input = "my-github-token.txt",
            }).Apply(invoke => invoke.Result),
        });
    
        var p4sa_secretAccessor = Gcp.Organizations.GetIAMPolicy.Invoke(new()
        {
            Bindings = new[]
            {
                new Gcp.Organizations.Inputs.GetIAMPolicyBindingInputArgs
                {
                    Role = "roles/secretmanager.secretAccessor",
                    Members = new[]
                    {
                        "serviceAccount:service-123456789@gcp-sa-cloudbuild.iam.gserviceaccount.com",
                    },
                },
            },
        });
    
        var policy = new Gcp.SecretManager.SecretIamPolicy("policy", new()
        {
            SecretId = github_token_secret.SecretId,
            PolicyData = p4sa_secretAccessor.Apply(p4sa_secretAccessor => p4sa_secretAccessor.Apply(getIAMPolicyResult => getIAMPolicyResult.PolicyData)),
        });
    
        var my_connection = new Gcp.CloudBuildV2.Connection("my-connection", new()
        {
            Location = "us-central1",
            Name = "my-connection",
            GithubConfig = new Gcp.CloudBuildV2.Inputs.ConnectionGithubConfigArgs
            {
                AppInstallationId = 123123,
                AuthorizerCredential = new Gcp.CloudBuildV2.Inputs.ConnectionGithubConfigAuthorizerCredentialArgs
                {
                    OauthTokenSecretVersion = github_token_secret_version.Id,
                },
            },
        });
    
    });
    
    package generated_program;
    
    import com.pulumi.Context;
    import com.pulumi.Pulumi;
    import com.pulumi.core.Output;
    import com.pulumi.gcp.secretmanager.Secret;
    import com.pulumi.gcp.secretmanager.SecretArgs;
    import com.pulumi.gcp.secretmanager.inputs.SecretReplicationArgs;
    import com.pulumi.gcp.secretmanager.inputs.SecretReplicationAutoArgs;
    import com.pulumi.gcp.secretmanager.SecretVersion;
    import com.pulumi.gcp.secretmanager.SecretVersionArgs;
    import com.pulumi.gcp.organizations.OrganizationsFunctions;
    import com.pulumi.gcp.organizations.inputs.GetIAMPolicyArgs;
    import com.pulumi.gcp.secretmanager.SecretIamPolicy;
    import com.pulumi.gcp.secretmanager.SecretIamPolicyArgs;
    import com.pulumi.gcp.cloudbuildv2.Connection;
    import com.pulumi.gcp.cloudbuildv2.ConnectionArgs;
    import com.pulumi.gcp.cloudbuildv2.inputs.ConnectionGithubConfigArgs;
    import com.pulumi.gcp.cloudbuildv2.inputs.ConnectionGithubConfigAuthorizerCredentialArgs;
    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 github_token_secret = new Secret("github-token-secret", SecretArgs.builder()        
                .secretId("github-token-secret")
                .replication(SecretReplicationArgs.builder()
                    .auto()
                    .build())
                .build());
    
            var github_token_secret_version = new SecretVersion("github-token-secret-version", SecretVersionArgs.builder()        
                .secret(github_token_secret.id())
                .secretData(StdFunctions.file(FileArgs.builder()
                    .input("my-github-token.txt")
                    .build()).result())
                .build());
    
            final var p4sa-secretAccessor = OrganizationsFunctions.getIAMPolicy(GetIAMPolicyArgs.builder()
                .bindings(GetIAMPolicyBindingArgs.builder()
                    .role("roles/secretmanager.secretAccessor")
                    .members("serviceAccount:service-123456789@gcp-sa-cloudbuild.iam.gserviceaccount.com")
                    .build())
                .build());
    
            var policy = new SecretIamPolicy("policy", SecretIamPolicyArgs.builder()        
                .secretId(github_token_secret.secretId())
                .policyData(p4sa_secretAccessor.policyData())
                .build());
    
            var my_connection = new Connection("my-connection", ConnectionArgs.builder()        
                .location("us-central1")
                .name("my-connection")
                .githubConfig(ConnectionGithubConfigArgs.builder()
                    .appInstallationId(123123)
                    .authorizerCredential(ConnectionGithubConfigAuthorizerCredentialArgs.builder()
                        .oauthTokenSecretVersion(github_token_secret_version.id())
                        .build())
                    .build())
                .build());
    
        }
    }
    
    resources:
      github-token-secret:
        type: gcp:secretmanager:Secret
        properties:
          secretId: github-token-secret
          replication:
            auto: {}
      github-token-secret-version:
        type: gcp:secretmanager:SecretVersion
        properties:
          secret: ${["github-token-secret"].id}
          secretData:
            fn::invoke:
              Function: std:file
              Arguments:
                input: my-github-token.txt
              Return: result
      policy:
        type: gcp:secretmanager:SecretIamPolicy
        properties:
          secretId: ${["github-token-secret"].secretId}
          policyData: ${["p4sa-secretAccessor"].policyData}
      my-connection:
        type: gcp:cloudbuildv2:Connection
        properties:
          location: us-central1
          name: my-connection
          githubConfig:
            appInstallationId: 123123
            authorizerCredential:
              oauthTokenSecretVersion: ${["github-token-secret-version"].id}
    variables:
      p4sa-secretAccessor:
        fn::invoke:
          Function: gcp:organizations:getIAMPolicy
          Arguments:
            bindings:
              - role: roles/secretmanager.secretAccessor
                members:
                  - serviceAccount:service-123456789@gcp-sa-cloudbuild.iam.gserviceaccount.com
    

    Create Connection Resource

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

    Constructor syntax

    new Connection(name: string, args: ConnectionArgs, opts?: CustomResourceOptions);
    @overload
    def Connection(resource_name: str,
                   args: ConnectionArgs,
                   opts: Optional[ResourceOptions] = None)
    
    @overload
    def Connection(resource_name: str,
                   opts: Optional[ResourceOptions] = None,
                   location: Optional[str] = None,
                   annotations: Optional[Mapping[str, str]] = None,
                   disabled: Optional[bool] = None,
                   github_config: Optional[ConnectionGithubConfigArgs] = None,
                   github_enterprise_config: Optional[ConnectionGithubEnterpriseConfigArgs] = None,
                   gitlab_config: Optional[ConnectionGitlabConfigArgs] = None,
                   name: Optional[str] = None,
                   project: Optional[str] = None)
    func NewConnection(ctx *Context, name string, args ConnectionArgs, opts ...ResourceOption) (*Connection, error)
    public Connection(string name, ConnectionArgs args, CustomResourceOptions? opts = null)
    public Connection(String name, ConnectionArgs args)
    public Connection(String name, ConnectionArgs args, CustomResourceOptions options)
    
    type: gcp:cloudbuildv2:Connection
    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 ConnectionArgs
    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 ConnectionArgs
    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 ConnectionArgs
    The arguments to resource properties.
    opts ResourceOption
    Bag of options to control resource's behavior.
    name string
    The unique name of the resource.
    args ConnectionArgs
    The arguments to resource properties.
    opts CustomResourceOptions
    Bag of options to control resource's behavior.
    name String
    The unique name of the resource.
    args ConnectionArgs
    The arguments to resource properties.
    options CustomResourceOptions
    Bag of options to control resource's behavior.

    Example

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

    var gcpConnectionResource = new Gcp.CloudBuildV2.Connection("gcpConnectionResource", new()
    {
        Location = "string",
        Annotations = 
        {
            { "string", "string" },
        },
        Disabled = false,
        GithubConfig = new Gcp.CloudBuildV2.Inputs.ConnectionGithubConfigArgs
        {
            AppInstallationId = 0,
            AuthorizerCredential = new Gcp.CloudBuildV2.Inputs.ConnectionGithubConfigAuthorizerCredentialArgs
            {
                OauthTokenSecretVersion = "string",
                Username = "string",
            },
        },
        GithubEnterpriseConfig = new Gcp.CloudBuildV2.Inputs.ConnectionGithubEnterpriseConfigArgs
        {
            HostUri = "string",
            AppId = 0,
            AppInstallationId = 0,
            AppSlug = "string",
            PrivateKeySecretVersion = "string",
            ServiceDirectoryConfig = new Gcp.CloudBuildV2.Inputs.ConnectionGithubEnterpriseConfigServiceDirectoryConfigArgs
            {
                Service = "string",
            },
            SslCa = "string",
            WebhookSecretSecretVersion = "string",
        },
        GitlabConfig = new Gcp.CloudBuildV2.Inputs.ConnectionGitlabConfigArgs
        {
            AuthorizerCredential = new Gcp.CloudBuildV2.Inputs.ConnectionGitlabConfigAuthorizerCredentialArgs
            {
                UserTokenSecretVersion = "string",
                Username = "string",
            },
            ReadAuthorizerCredential = new Gcp.CloudBuildV2.Inputs.ConnectionGitlabConfigReadAuthorizerCredentialArgs
            {
                UserTokenSecretVersion = "string",
                Username = "string",
            },
            WebhookSecretSecretVersion = "string",
            HostUri = "string",
            ServerVersion = "string",
            ServiceDirectoryConfig = new Gcp.CloudBuildV2.Inputs.ConnectionGitlabConfigServiceDirectoryConfigArgs
            {
                Service = "string",
            },
            SslCa = "string",
        },
        Name = "string",
        Project = "string",
    });
    
    example, err := cloudbuildv2.NewConnection(ctx, "gcpConnectionResource", &cloudbuildv2.ConnectionArgs{
    	Location: pulumi.String("string"),
    	Annotations: pulumi.StringMap{
    		"string": pulumi.String("string"),
    	},
    	Disabled: pulumi.Bool(false),
    	GithubConfig: &cloudbuildv2.ConnectionGithubConfigArgs{
    		AppInstallationId: pulumi.Int(0),
    		AuthorizerCredential: &cloudbuildv2.ConnectionGithubConfigAuthorizerCredentialArgs{
    			OauthTokenSecretVersion: pulumi.String("string"),
    			Username:                pulumi.String("string"),
    		},
    	},
    	GithubEnterpriseConfig: &cloudbuildv2.ConnectionGithubEnterpriseConfigArgs{
    		HostUri:                 pulumi.String("string"),
    		AppId:                   pulumi.Int(0),
    		AppInstallationId:       pulumi.Int(0),
    		AppSlug:                 pulumi.String("string"),
    		PrivateKeySecretVersion: pulumi.String("string"),
    		ServiceDirectoryConfig: &cloudbuildv2.ConnectionGithubEnterpriseConfigServiceDirectoryConfigArgs{
    			Service: pulumi.String("string"),
    		},
    		SslCa:                      pulumi.String("string"),
    		WebhookSecretSecretVersion: pulumi.String("string"),
    	},
    	GitlabConfig: &cloudbuildv2.ConnectionGitlabConfigArgs{
    		AuthorizerCredential: &cloudbuildv2.ConnectionGitlabConfigAuthorizerCredentialArgs{
    			UserTokenSecretVersion: pulumi.String("string"),
    			Username:               pulumi.String("string"),
    		},
    		ReadAuthorizerCredential: &cloudbuildv2.ConnectionGitlabConfigReadAuthorizerCredentialArgs{
    			UserTokenSecretVersion: pulumi.String("string"),
    			Username:               pulumi.String("string"),
    		},
    		WebhookSecretSecretVersion: pulumi.String("string"),
    		HostUri:                    pulumi.String("string"),
    		ServerVersion:              pulumi.String("string"),
    		ServiceDirectoryConfig: &cloudbuildv2.ConnectionGitlabConfigServiceDirectoryConfigArgs{
    			Service: pulumi.String("string"),
    		},
    		SslCa: pulumi.String("string"),
    	},
    	Name:    pulumi.String("string"),
    	Project: pulumi.String("string"),
    })
    
    var gcpConnectionResource = new Connection("gcpConnectionResource", ConnectionArgs.builder()        
        .location("string")
        .annotations(Map.of("string", "string"))
        .disabled(false)
        .githubConfig(ConnectionGithubConfigArgs.builder()
            .appInstallationId(0)
            .authorizerCredential(ConnectionGithubConfigAuthorizerCredentialArgs.builder()
                .oauthTokenSecretVersion("string")
                .username("string")
                .build())
            .build())
        .githubEnterpriseConfig(ConnectionGithubEnterpriseConfigArgs.builder()
            .hostUri("string")
            .appId(0)
            .appInstallationId(0)
            .appSlug("string")
            .privateKeySecretVersion("string")
            .serviceDirectoryConfig(ConnectionGithubEnterpriseConfigServiceDirectoryConfigArgs.builder()
                .service("string")
                .build())
            .sslCa("string")
            .webhookSecretSecretVersion("string")
            .build())
        .gitlabConfig(ConnectionGitlabConfigArgs.builder()
            .authorizerCredential(ConnectionGitlabConfigAuthorizerCredentialArgs.builder()
                .userTokenSecretVersion("string")
                .username("string")
                .build())
            .readAuthorizerCredential(ConnectionGitlabConfigReadAuthorizerCredentialArgs.builder()
                .userTokenSecretVersion("string")
                .username("string")
                .build())
            .webhookSecretSecretVersion("string")
            .hostUri("string")
            .serverVersion("string")
            .serviceDirectoryConfig(ConnectionGitlabConfigServiceDirectoryConfigArgs.builder()
                .service("string")
                .build())
            .sslCa("string")
            .build())
        .name("string")
        .project("string")
        .build());
    
    gcp_connection_resource = gcp.cloudbuildv2.Connection("gcpConnectionResource",
        location="string",
        annotations={
            "string": "string",
        },
        disabled=False,
        github_config=gcp.cloudbuildv2.ConnectionGithubConfigArgs(
            app_installation_id=0,
            authorizer_credential=gcp.cloudbuildv2.ConnectionGithubConfigAuthorizerCredentialArgs(
                oauth_token_secret_version="string",
                username="string",
            ),
        ),
        github_enterprise_config=gcp.cloudbuildv2.ConnectionGithubEnterpriseConfigArgs(
            host_uri="string",
            app_id=0,
            app_installation_id=0,
            app_slug="string",
            private_key_secret_version="string",
            service_directory_config=gcp.cloudbuildv2.ConnectionGithubEnterpriseConfigServiceDirectoryConfigArgs(
                service="string",
            ),
            ssl_ca="string",
            webhook_secret_secret_version="string",
        ),
        gitlab_config=gcp.cloudbuildv2.ConnectionGitlabConfigArgs(
            authorizer_credential=gcp.cloudbuildv2.ConnectionGitlabConfigAuthorizerCredentialArgs(
                user_token_secret_version="string",
                username="string",
            ),
            read_authorizer_credential=gcp.cloudbuildv2.ConnectionGitlabConfigReadAuthorizerCredentialArgs(
                user_token_secret_version="string",
                username="string",
            ),
            webhook_secret_secret_version="string",
            host_uri="string",
            server_version="string",
            service_directory_config=gcp.cloudbuildv2.ConnectionGitlabConfigServiceDirectoryConfigArgs(
                service="string",
            ),
            ssl_ca="string",
        ),
        name="string",
        project="string")
    
    const gcpConnectionResource = new gcp.cloudbuildv2.Connection("gcpConnectionResource", {
        location: "string",
        annotations: {
            string: "string",
        },
        disabled: false,
        githubConfig: {
            appInstallationId: 0,
            authorizerCredential: {
                oauthTokenSecretVersion: "string",
                username: "string",
            },
        },
        githubEnterpriseConfig: {
            hostUri: "string",
            appId: 0,
            appInstallationId: 0,
            appSlug: "string",
            privateKeySecretVersion: "string",
            serviceDirectoryConfig: {
                service: "string",
            },
            sslCa: "string",
            webhookSecretSecretVersion: "string",
        },
        gitlabConfig: {
            authorizerCredential: {
                userTokenSecretVersion: "string",
                username: "string",
            },
            readAuthorizerCredential: {
                userTokenSecretVersion: "string",
                username: "string",
            },
            webhookSecretSecretVersion: "string",
            hostUri: "string",
            serverVersion: "string",
            serviceDirectoryConfig: {
                service: "string",
            },
            sslCa: "string",
        },
        name: "string",
        project: "string",
    });
    
    type: gcp:cloudbuildv2:Connection
    properties:
        annotations:
            string: string
        disabled: false
        githubConfig:
            appInstallationId: 0
            authorizerCredential:
                oauthTokenSecretVersion: string
                username: string
        githubEnterpriseConfig:
            appId: 0
            appInstallationId: 0
            appSlug: string
            hostUri: string
            privateKeySecretVersion: string
            serviceDirectoryConfig:
                service: string
            sslCa: string
            webhookSecretSecretVersion: string
        gitlabConfig:
            authorizerCredential:
                userTokenSecretVersion: string
                username: string
            hostUri: string
            readAuthorizerCredential:
                userTokenSecretVersion: string
                username: string
            serverVersion: string
            serviceDirectoryConfig:
                service: string
            sslCa: string
            webhookSecretSecretVersion: string
        location: string
        name: string
        project: string
    

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

    Location string
    The location for the resource


    Annotations Dictionary<string, string>
    Allows clients to store small amounts of arbitrary data. Note: This field is non-authoritative, and will only manage the annotations present in your configuration. Please refer to the field effective_annotations for all of the annotations present on the resource.
    Disabled bool
    If disabled is set to true, functionality is disabled for this connection. Repository based API methods and webhooks processing for repositories in this connection will be disabled.
    GithubConfig ConnectionGithubConfig
    Configuration for connections to github.com. Structure is documented below.
    GithubEnterpriseConfig ConnectionGithubEnterpriseConfig
    Configuration for connections to an instance of GitHub Enterprise. Structure is documented below.
    GitlabConfig ConnectionGitlabConfig
    Configuration for connections to gitlab.com or an instance of GitLab Enterprise. Structure is documented below.
    Name string
    Immutable. The resource name of the connection.
    Project string
    The ID of the project in which the resource belongs. If it is not provided, the provider project is used.
    Location string
    The location for the resource


    Annotations map[string]string
    Allows clients to store small amounts of arbitrary data. Note: This field is non-authoritative, and will only manage the annotations present in your configuration. Please refer to the field effective_annotations for all of the annotations present on the resource.
    Disabled bool
    If disabled is set to true, functionality is disabled for this connection. Repository based API methods and webhooks processing for repositories in this connection will be disabled.
    GithubConfig ConnectionGithubConfigArgs
    Configuration for connections to github.com. Structure is documented below.
    GithubEnterpriseConfig ConnectionGithubEnterpriseConfigArgs
    Configuration for connections to an instance of GitHub Enterprise. Structure is documented below.
    GitlabConfig ConnectionGitlabConfigArgs
    Configuration for connections to gitlab.com or an instance of GitLab Enterprise. Structure is documented below.
    Name string
    Immutable. The resource name of the connection.
    Project string
    The ID of the project in which the resource belongs. If it is not provided, the provider project is used.
    location String
    The location for the resource


    annotations Map<String,String>
    Allows clients to store small amounts of arbitrary data. Note: This field is non-authoritative, and will only manage the annotations present in your configuration. Please refer to the field effective_annotations for all of the annotations present on the resource.
    disabled Boolean
    If disabled is set to true, functionality is disabled for this connection. Repository based API methods and webhooks processing for repositories in this connection will be disabled.
    githubConfig ConnectionGithubConfig
    Configuration for connections to github.com. Structure is documented below.
    githubEnterpriseConfig ConnectionGithubEnterpriseConfig
    Configuration for connections to an instance of GitHub Enterprise. Structure is documented below.
    gitlabConfig ConnectionGitlabConfig
    Configuration for connections to gitlab.com or an instance of GitLab Enterprise. Structure is documented below.
    name String
    Immutable. The resource name of the connection.
    project String
    The ID of the project in which the resource belongs. If it is not provided, the provider project is used.
    location string
    The location for the resource


    annotations {[key: string]: string}
    Allows clients to store small amounts of arbitrary data. Note: This field is non-authoritative, and will only manage the annotations present in your configuration. Please refer to the field effective_annotations for all of the annotations present on the resource.
    disabled boolean
    If disabled is set to true, functionality is disabled for this connection. Repository based API methods and webhooks processing for repositories in this connection will be disabled.
    githubConfig ConnectionGithubConfig
    Configuration for connections to github.com. Structure is documented below.
    githubEnterpriseConfig ConnectionGithubEnterpriseConfig
    Configuration for connections to an instance of GitHub Enterprise. Structure is documented below.
    gitlabConfig ConnectionGitlabConfig
    Configuration for connections to gitlab.com or an instance of GitLab Enterprise. Structure is documented below.
    name string
    Immutable. The resource name of the connection.
    project string
    The ID of the project in which the resource belongs. If it is not provided, the provider project is used.
    location str
    The location for the resource


    annotations Mapping[str, str]
    Allows clients to store small amounts of arbitrary data. Note: This field is non-authoritative, and will only manage the annotations present in your configuration. Please refer to the field effective_annotations for all of the annotations present on the resource.
    disabled bool
    If disabled is set to true, functionality is disabled for this connection. Repository based API methods and webhooks processing for repositories in this connection will be disabled.
    github_config ConnectionGithubConfigArgs
    Configuration for connections to github.com. Structure is documented below.
    github_enterprise_config ConnectionGithubEnterpriseConfigArgs
    Configuration for connections to an instance of GitHub Enterprise. Structure is documented below.
    gitlab_config ConnectionGitlabConfigArgs
    Configuration for connections to gitlab.com or an instance of GitLab Enterprise. Structure is documented below.
    name str
    Immutable. The resource name of the connection.
    project str
    The ID of the project in which the resource belongs. If it is not provided, the provider project is used.
    location String
    The location for the resource


    annotations Map<String>
    Allows clients to store small amounts of arbitrary data. Note: This field is non-authoritative, and will only manage the annotations present in your configuration. Please refer to the field effective_annotations for all of the annotations present on the resource.
    disabled Boolean
    If disabled is set to true, functionality is disabled for this connection. Repository based API methods and webhooks processing for repositories in this connection will be disabled.
    githubConfig Property Map
    Configuration for connections to github.com. Structure is documented below.
    githubEnterpriseConfig Property Map
    Configuration for connections to an instance of GitHub Enterprise. Structure is documented below.
    gitlabConfig Property Map
    Configuration for connections to gitlab.com or an instance of GitLab Enterprise. Structure is documented below.
    name String
    Immutable. The resource name of the connection.
    project String
    The ID of the project in which the resource belongs. If it is not provided, the provider project is used.

    Outputs

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

    CreateTime string
    Output only. Server assigned timestamp for when the connection was created.
    EffectiveAnnotations Dictionary<string, string>
    All of annotations (key/value pairs) present on the resource in GCP, including the annotations configured through Terraform, other clients and services.
    Etag string
    This checksum is computed by the server based on the value of other fields, and may be sent on update and delete requests to ensure the client has an up-to-date value before proceeding.
    Id string
    The provider-assigned unique ID for this managed resource.
    InstallationStates List<ConnectionInstallationState>
    Output only. Installation state of the Connection. Structure is documented below.
    Reconciling bool
    Output only. Set to true when the connection is being set up or updated in the background.
    UpdateTime string
    Output only. Server assigned timestamp for when the connection was updated.
    CreateTime string
    Output only. Server assigned timestamp for when the connection was created.
    EffectiveAnnotations map[string]string
    All of annotations (key/value pairs) present on the resource in GCP, including the annotations configured through Terraform, other clients and services.
    Etag string
    This checksum is computed by the server based on the value of other fields, and may be sent on update and delete requests to ensure the client has an up-to-date value before proceeding.
    Id string
    The provider-assigned unique ID for this managed resource.
    InstallationStates []ConnectionInstallationState
    Output only. Installation state of the Connection. Structure is documented below.
    Reconciling bool
    Output only. Set to true when the connection is being set up or updated in the background.
    UpdateTime string
    Output only. Server assigned timestamp for when the connection was updated.
    createTime String
    Output only. Server assigned timestamp for when the connection was created.
    effectiveAnnotations Map<String,String>
    All of annotations (key/value pairs) present on the resource in GCP, including the annotations configured through Terraform, other clients and services.
    etag String
    This checksum is computed by the server based on the value of other fields, and may be sent on update and delete requests to ensure the client has an up-to-date value before proceeding.
    id String
    The provider-assigned unique ID for this managed resource.
    installationStates List<ConnectionInstallationState>
    Output only. Installation state of the Connection. Structure is documented below.
    reconciling Boolean
    Output only. Set to true when the connection is being set up or updated in the background.
    updateTime String
    Output only. Server assigned timestamp for when the connection was updated.
    createTime string
    Output only. Server assigned timestamp for when the connection was created.
    effectiveAnnotations {[key: string]: string}
    All of annotations (key/value pairs) present on the resource in GCP, including the annotations configured through Terraform, other clients and services.
    etag string
    This checksum is computed by the server based on the value of other fields, and may be sent on update and delete requests to ensure the client has an up-to-date value before proceeding.
    id string
    The provider-assigned unique ID for this managed resource.
    installationStates ConnectionInstallationState[]
    Output only. Installation state of the Connection. Structure is documented below.
    reconciling boolean
    Output only. Set to true when the connection is being set up or updated in the background.
    updateTime string
    Output only. Server assigned timestamp for when the connection was updated.
    create_time str
    Output only. Server assigned timestamp for when the connection was created.
    effective_annotations Mapping[str, str]
    All of annotations (key/value pairs) present on the resource in GCP, including the annotations configured through Terraform, other clients and services.
    etag str
    This checksum is computed by the server based on the value of other fields, and may be sent on update and delete requests to ensure the client has an up-to-date value before proceeding.
    id str
    The provider-assigned unique ID for this managed resource.
    installation_states Sequence[ConnectionInstallationState]
    Output only. Installation state of the Connection. Structure is documented below.
    reconciling bool
    Output only. Set to true when the connection is being set up or updated in the background.
    update_time str
    Output only. Server assigned timestamp for when the connection was updated.
    createTime String
    Output only. Server assigned timestamp for when the connection was created.
    effectiveAnnotations Map<String>
    All of annotations (key/value pairs) present on the resource in GCP, including the annotations configured through Terraform, other clients and services.
    etag String
    This checksum is computed by the server based on the value of other fields, and may be sent on update and delete requests to ensure the client has an up-to-date value before proceeding.
    id String
    The provider-assigned unique ID for this managed resource.
    installationStates List<Property Map>
    Output only. Installation state of the Connection. Structure is documented below.
    reconciling Boolean
    Output only. Set to true when the connection is being set up or updated in the background.
    updateTime String
    Output only. Server assigned timestamp for when the connection was updated.

    Look up Existing Connection Resource

    Get an existing Connection 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?: ConnectionState, opts?: CustomResourceOptions): Connection
    @staticmethod
    def get(resource_name: str,
            id: str,
            opts: Optional[ResourceOptions] = None,
            annotations: Optional[Mapping[str, str]] = None,
            create_time: Optional[str] = None,
            disabled: Optional[bool] = None,
            effective_annotations: Optional[Mapping[str, str]] = None,
            etag: Optional[str] = None,
            github_config: Optional[ConnectionGithubConfigArgs] = None,
            github_enterprise_config: Optional[ConnectionGithubEnterpriseConfigArgs] = None,
            gitlab_config: Optional[ConnectionGitlabConfigArgs] = None,
            installation_states: Optional[Sequence[ConnectionInstallationStateArgs]] = None,
            location: Optional[str] = None,
            name: Optional[str] = None,
            project: Optional[str] = None,
            reconciling: Optional[bool] = None,
            update_time: Optional[str] = None) -> Connection
    func GetConnection(ctx *Context, name string, id IDInput, state *ConnectionState, opts ...ResourceOption) (*Connection, error)
    public static Connection Get(string name, Input<string> id, ConnectionState? state, CustomResourceOptions? opts = null)
    public static Connection get(String name, Output<String> id, ConnectionState 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:
    Annotations Dictionary<string, string>
    Allows clients to store small amounts of arbitrary data. Note: This field is non-authoritative, and will only manage the annotations present in your configuration. Please refer to the field effective_annotations for all of the annotations present on the resource.
    CreateTime string
    Output only. Server assigned timestamp for when the connection was created.
    Disabled bool
    If disabled is set to true, functionality is disabled for this connection. Repository based API methods and webhooks processing for repositories in this connection will be disabled.
    EffectiveAnnotations Dictionary<string, string>
    All of annotations (key/value pairs) present on the resource in GCP, including the annotations configured through Terraform, other clients and services.
    Etag string
    This checksum is computed by the server based on the value of other fields, and may be sent on update and delete requests to ensure the client has an up-to-date value before proceeding.
    GithubConfig ConnectionGithubConfig
    Configuration for connections to github.com. Structure is documented below.
    GithubEnterpriseConfig ConnectionGithubEnterpriseConfig
    Configuration for connections to an instance of GitHub Enterprise. Structure is documented below.
    GitlabConfig ConnectionGitlabConfig
    Configuration for connections to gitlab.com or an instance of GitLab Enterprise. Structure is documented below.
    InstallationStates List<ConnectionInstallationState>
    Output only. Installation state of the Connection. Structure is documented below.
    Location string
    The location for the resource


    Name string
    Immutable. The resource name of the connection.
    Project string
    The ID of the project in which the resource belongs. If it is not provided, the provider project is used.
    Reconciling bool
    Output only. Set to true when the connection is being set up or updated in the background.
    UpdateTime string
    Output only. Server assigned timestamp for when the connection was updated.
    Annotations map[string]string
    Allows clients to store small amounts of arbitrary data. Note: This field is non-authoritative, and will only manage the annotations present in your configuration. Please refer to the field effective_annotations for all of the annotations present on the resource.
    CreateTime string
    Output only. Server assigned timestamp for when the connection was created.
    Disabled bool
    If disabled is set to true, functionality is disabled for this connection. Repository based API methods and webhooks processing for repositories in this connection will be disabled.
    EffectiveAnnotations map[string]string
    All of annotations (key/value pairs) present on the resource in GCP, including the annotations configured through Terraform, other clients and services.
    Etag string
    This checksum is computed by the server based on the value of other fields, and may be sent on update and delete requests to ensure the client has an up-to-date value before proceeding.
    GithubConfig ConnectionGithubConfigArgs
    Configuration for connections to github.com. Structure is documented below.
    GithubEnterpriseConfig ConnectionGithubEnterpriseConfigArgs
    Configuration for connections to an instance of GitHub Enterprise. Structure is documented below.
    GitlabConfig ConnectionGitlabConfigArgs
    Configuration for connections to gitlab.com or an instance of GitLab Enterprise. Structure is documented below.
    InstallationStates []ConnectionInstallationStateArgs
    Output only. Installation state of the Connection. Structure is documented below.
    Location string
    The location for the resource


    Name string
    Immutable. The resource name of the connection.
    Project string
    The ID of the project in which the resource belongs. If it is not provided, the provider project is used.
    Reconciling bool
    Output only. Set to true when the connection is being set up or updated in the background.
    UpdateTime string
    Output only. Server assigned timestamp for when the connection was updated.
    annotations Map<String,String>
    Allows clients to store small amounts of arbitrary data. Note: This field is non-authoritative, and will only manage the annotations present in your configuration. Please refer to the field effective_annotations for all of the annotations present on the resource.
    createTime String
    Output only. Server assigned timestamp for when the connection was created.
    disabled Boolean
    If disabled is set to true, functionality is disabled for this connection. Repository based API methods and webhooks processing for repositories in this connection will be disabled.
    effectiveAnnotations Map<String,String>
    All of annotations (key/value pairs) present on the resource in GCP, including the annotations configured through Terraform, other clients and services.
    etag String
    This checksum is computed by the server based on the value of other fields, and may be sent on update and delete requests to ensure the client has an up-to-date value before proceeding.
    githubConfig ConnectionGithubConfig
    Configuration for connections to github.com. Structure is documented below.
    githubEnterpriseConfig ConnectionGithubEnterpriseConfig
    Configuration for connections to an instance of GitHub Enterprise. Structure is documented below.
    gitlabConfig ConnectionGitlabConfig
    Configuration for connections to gitlab.com or an instance of GitLab Enterprise. Structure is documented below.
    installationStates List<ConnectionInstallationState>
    Output only. Installation state of the Connection. Structure is documented below.
    location String
    The location for the resource


    name String
    Immutable. The resource name of the connection.
    project String
    The ID of the project in which the resource belongs. If it is not provided, the provider project is used.
    reconciling Boolean
    Output only. Set to true when the connection is being set up or updated in the background.
    updateTime String
    Output only. Server assigned timestamp for when the connection was updated.
    annotations {[key: string]: string}
    Allows clients to store small amounts of arbitrary data. Note: This field is non-authoritative, and will only manage the annotations present in your configuration. Please refer to the field effective_annotations for all of the annotations present on the resource.
    createTime string
    Output only. Server assigned timestamp for when the connection was created.
    disabled boolean
    If disabled is set to true, functionality is disabled for this connection. Repository based API methods and webhooks processing for repositories in this connection will be disabled.
    effectiveAnnotations {[key: string]: string}
    All of annotations (key/value pairs) present on the resource in GCP, including the annotations configured through Terraform, other clients and services.
    etag string
    This checksum is computed by the server based on the value of other fields, and may be sent on update and delete requests to ensure the client has an up-to-date value before proceeding.
    githubConfig ConnectionGithubConfig
    Configuration for connections to github.com. Structure is documented below.
    githubEnterpriseConfig ConnectionGithubEnterpriseConfig
    Configuration for connections to an instance of GitHub Enterprise. Structure is documented below.
    gitlabConfig ConnectionGitlabConfig
    Configuration for connections to gitlab.com or an instance of GitLab Enterprise. Structure is documented below.
    installationStates ConnectionInstallationState[]
    Output only. Installation state of the Connection. Structure is documented below.
    location string
    The location for the resource


    name string
    Immutable. The resource name of the connection.
    project string
    The ID of the project in which the resource belongs. If it is not provided, the provider project is used.
    reconciling boolean
    Output only. Set to true when the connection is being set up or updated in the background.
    updateTime string
    Output only. Server assigned timestamp for when the connection was updated.
    annotations Mapping[str, str]
    Allows clients to store small amounts of arbitrary data. Note: This field is non-authoritative, and will only manage the annotations present in your configuration. Please refer to the field effective_annotations for all of the annotations present on the resource.
    create_time str
    Output only. Server assigned timestamp for when the connection was created.
    disabled bool
    If disabled is set to true, functionality is disabled for this connection. Repository based API methods and webhooks processing for repositories in this connection will be disabled.
    effective_annotations Mapping[str, str]
    All of annotations (key/value pairs) present on the resource in GCP, including the annotations configured through Terraform, other clients and services.
    etag str
    This checksum is computed by the server based on the value of other fields, and may be sent on update and delete requests to ensure the client has an up-to-date value before proceeding.
    github_config ConnectionGithubConfigArgs
    Configuration for connections to github.com. Structure is documented below.
    github_enterprise_config ConnectionGithubEnterpriseConfigArgs
    Configuration for connections to an instance of GitHub Enterprise. Structure is documented below.
    gitlab_config ConnectionGitlabConfigArgs
    Configuration for connections to gitlab.com or an instance of GitLab Enterprise. Structure is documented below.
    installation_states Sequence[ConnectionInstallationStateArgs]
    Output only. Installation state of the Connection. Structure is documented below.
    location str
    The location for the resource


    name str
    Immutable. The resource name of the connection.
    project str
    The ID of the project in which the resource belongs. If it is not provided, the provider project is used.
    reconciling bool
    Output only. Set to true when the connection is being set up or updated in the background.
    update_time str
    Output only. Server assigned timestamp for when the connection was updated.
    annotations Map<String>
    Allows clients to store small amounts of arbitrary data. Note: This field is non-authoritative, and will only manage the annotations present in your configuration. Please refer to the field effective_annotations for all of the annotations present on the resource.
    createTime String
    Output only. Server assigned timestamp for when the connection was created.
    disabled Boolean
    If disabled is set to true, functionality is disabled for this connection. Repository based API methods and webhooks processing for repositories in this connection will be disabled.
    effectiveAnnotations Map<String>
    All of annotations (key/value pairs) present on the resource in GCP, including the annotations configured through Terraform, other clients and services.
    etag String
    This checksum is computed by the server based on the value of other fields, and may be sent on update and delete requests to ensure the client has an up-to-date value before proceeding.
    githubConfig Property Map
    Configuration for connections to github.com. Structure is documented below.
    githubEnterpriseConfig Property Map
    Configuration for connections to an instance of GitHub Enterprise. Structure is documented below.
    gitlabConfig Property Map
    Configuration for connections to gitlab.com or an instance of GitLab Enterprise. Structure is documented below.
    installationStates List<Property Map>
    Output only. Installation state of the Connection. Structure is documented below.
    location String
    The location for the resource


    name String
    Immutable. The resource name of the connection.
    project String
    The ID of the project in which the resource belongs. If it is not provided, the provider project is used.
    reconciling Boolean
    Output only. Set to true when the connection is being set up or updated in the background.
    updateTime String
    Output only. Server assigned timestamp for when the connection was updated.

    Supporting Types

    ConnectionGithubConfig, ConnectionGithubConfigArgs

    AppInstallationId int
    GitHub App installation id.
    AuthorizerCredential ConnectionGithubConfigAuthorizerCredential
    OAuth credential of the account that authorized the Cloud Build GitHub App. It is recommended to use a robot account instead of a human user account. The OAuth token must be tied to the Cloud Build GitHub App. Structure is documented below.
    AppInstallationId int
    GitHub App installation id.
    AuthorizerCredential ConnectionGithubConfigAuthorizerCredential
    OAuth credential of the account that authorized the Cloud Build GitHub App. It is recommended to use a robot account instead of a human user account. The OAuth token must be tied to the Cloud Build GitHub App. Structure is documented below.
    appInstallationId Integer
    GitHub App installation id.
    authorizerCredential ConnectionGithubConfigAuthorizerCredential
    OAuth credential of the account that authorized the Cloud Build GitHub App. It is recommended to use a robot account instead of a human user account. The OAuth token must be tied to the Cloud Build GitHub App. Structure is documented below.
    appInstallationId number
    GitHub App installation id.
    authorizerCredential ConnectionGithubConfigAuthorizerCredential
    OAuth credential of the account that authorized the Cloud Build GitHub App. It is recommended to use a robot account instead of a human user account. The OAuth token must be tied to the Cloud Build GitHub App. Structure is documented below.
    app_installation_id int
    GitHub App installation id.
    authorizer_credential ConnectionGithubConfigAuthorizerCredential
    OAuth credential of the account that authorized the Cloud Build GitHub App. It is recommended to use a robot account instead of a human user account. The OAuth token must be tied to the Cloud Build GitHub App. Structure is documented below.
    appInstallationId Number
    GitHub App installation id.
    authorizerCredential Property Map
    OAuth credential of the account that authorized the Cloud Build GitHub App. It is recommended to use a robot account instead of a human user account. The OAuth token must be tied to the Cloud Build GitHub App. Structure is documented below.

    ConnectionGithubConfigAuthorizerCredential, ConnectionGithubConfigAuthorizerCredentialArgs

    OauthTokenSecretVersion string
    A SecretManager resource containing the OAuth token that authorizes the Cloud Build connection. Format: projects/*/secrets/*/versions/*.
    Username string
    (Output) Output only. The username associated to this token.
    OauthTokenSecretVersion string
    A SecretManager resource containing the OAuth token that authorizes the Cloud Build connection. Format: projects/*/secrets/*/versions/*.
    Username string
    (Output) Output only. The username associated to this token.
    oauthTokenSecretVersion String
    A SecretManager resource containing the OAuth token that authorizes the Cloud Build connection. Format: projects/*/secrets/*/versions/*.
    username String
    (Output) Output only. The username associated to this token.
    oauthTokenSecretVersion string
    A SecretManager resource containing the OAuth token that authorizes the Cloud Build connection. Format: projects/*/secrets/*/versions/*.
    username string
    (Output) Output only. The username associated to this token.
    oauth_token_secret_version str
    A SecretManager resource containing the OAuth token that authorizes the Cloud Build connection. Format: projects/*/secrets/*/versions/*.
    username str
    (Output) Output only. The username associated to this token.
    oauthTokenSecretVersion String
    A SecretManager resource containing the OAuth token that authorizes the Cloud Build connection. Format: projects/*/secrets/*/versions/*.
    username String
    (Output) Output only. The username associated to this token.

    ConnectionGithubEnterpriseConfig, ConnectionGithubEnterpriseConfigArgs

    HostUri string
    Required. The URI of the GitHub Enterprise host this connection is for.
    AppId int
    Id of the GitHub App created from the manifest.
    AppInstallationId int
    ID of the installation of the GitHub App.
    AppSlug string
    The URL-friendly name of the GitHub App.
    PrivateKeySecretVersion string
    SecretManager resource containing the private key of the GitHub App, formatted as projects/*/secrets/*/versions/*.
    ServiceDirectoryConfig ConnectionGithubEnterpriseConfigServiceDirectoryConfig
    Configuration for using Service Directory to privately connect to a GitHub Enterprise server. This should only be set if the GitHub Enterprise server is hosted on-premises and not reachable by public internet. If this field is left empty, calls to the GitHub Enterprise server will be made over the public internet. Structure is documented below.
    SslCa string
    SSL certificate to use for requests to GitHub Enterprise.
    WebhookSecretSecretVersion string
    SecretManager resource containing the webhook secret of the GitHub App, formatted as projects/*/secrets/*/versions/*.
    HostUri string
    Required. The URI of the GitHub Enterprise host this connection is for.
    AppId int
    Id of the GitHub App created from the manifest.
    AppInstallationId int
    ID of the installation of the GitHub App.
    AppSlug string
    The URL-friendly name of the GitHub App.
    PrivateKeySecretVersion string
    SecretManager resource containing the private key of the GitHub App, formatted as projects/*/secrets/*/versions/*.
    ServiceDirectoryConfig ConnectionGithubEnterpriseConfigServiceDirectoryConfig
    Configuration for using Service Directory to privately connect to a GitHub Enterprise server. This should only be set if the GitHub Enterprise server is hosted on-premises and not reachable by public internet. If this field is left empty, calls to the GitHub Enterprise server will be made over the public internet. Structure is documented below.
    SslCa string
    SSL certificate to use for requests to GitHub Enterprise.
    WebhookSecretSecretVersion string
    SecretManager resource containing the webhook secret of the GitHub App, formatted as projects/*/secrets/*/versions/*.
    hostUri String
    Required. The URI of the GitHub Enterprise host this connection is for.
    appId Integer
    Id of the GitHub App created from the manifest.
    appInstallationId Integer
    ID of the installation of the GitHub App.
    appSlug String
    The URL-friendly name of the GitHub App.
    privateKeySecretVersion String
    SecretManager resource containing the private key of the GitHub App, formatted as projects/*/secrets/*/versions/*.
    serviceDirectoryConfig ConnectionGithubEnterpriseConfigServiceDirectoryConfig
    Configuration for using Service Directory to privately connect to a GitHub Enterprise server. This should only be set if the GitHub Enterprise server is hosted on-premises and not reachable by public internet. If this field is left empty, calls to the GitHub Enterprise server will be made over the public internet. Structure is documented below.
    sslCa String
    SSL certificate to use for requests to GitHub Enterprise.
    webhookSecretSecretVersion String
    SecretManager resource containing the webhook secret of the GitHub App, formatted as projects/*/secrets/*/versions/*.
    hostUri string
    Required. The URI of the GitHub Enterprise host this connection is for.
    appId number
    Id of the GitHub App created from the manifest.
    appInstallationId number
    ID of the installation of the GitHub App.
    appSlug string
    The URL-friendly name of the GitHub App.
    privateKeySecretVersion string
    SecretManager resource containing the private key of the GitHub App, formatted as projects/*/secrets/*/versions/*.
    serviceDirectoryConfig ConnectionGithubEnterpriseConfigServiceDirectoryConfig
    Configuration for using Service Directory to privately connect to a GitHub Enterprise server. This should only be set if the GitHub Enterprise server is hosted on-premises and not reachable by public internet. If this field is left empty, calls to the GitHub Enterprise server will be made over the public internet. Structure is documented below.
    sslCa string
    SSL certificate to use for requests to GitHub Enterprise.
    webhookSecretSecretVersion string
    SecretManager resource containing the webhook secret of the GitHub App, formatted as projects/*/secrets/*/versions/*.
    host_uri str
    Required. The URI of the GitHub Enterprise host this connection is for.
    app_id int
    Id of the GitHub App created from the manifest.
    app_installation_id int
    ID of the installation of the GitHub App.
    app_slug str
    The URL-friendly name of the GitHub App.
    private_key_secret_version str
    SecretManager resource containing the private key of the GitHub App, formatted as projects/*/secrets/*/versions/*.
    service_directory_config ConnectionGithubEnterpriseConfigServiceDirectoryConfig
    Configuration for using Service Directory to privately connect to a GitHub Enterprise server. This should only be set if the GitHub Enterprise server is hosted on-premises and not reachable by public internet. If this field is left empty, calls to the GitHub Enterprise server will be made over the public internet. Structure is documented below.
    ssl_ca str
    SSL certificate to use for requests to GitHub Enterprise.
    webhook_secret_secret_version str
    SecretManager resource containing the webhook secret of the GitHub App, formatted as projects/*/secrets/*/versions/*.
    hostUri String
    Required. The URI of the GitHub Enterprise host this connection is for.
    appId Number
    Id of the GitHub App created from the manifest.
    appInstallationId Number
    ID of the installation of the GitHub App.
    appSlug String
    The URL-friendly name of the GitHub App.
    privateKeySecretVersion String
    SecretManager resource containing the private key of the GitHub App, formatted as projects/*/secrets/*/versions/*.
    serviceDirectoryConfig Property Map
    Configuration for using Service Directory to privately connect to a GitHub Enterprise server. This should only be set if the GitHub Enterprise server is hosted on-premises and not reachable by public internet. If this field is left empty, calls to the GitHub Enterprise server will be made over the public internet. Structure is documented below.
    sslCa String
    SSL certificate to use for requests to GitHub Enterprise.
    webhookSecretSecretVersion String
    SecretManager resource containing the webhook secret of the GitHub App, formatted as projects/*/secrets/*/versions/*.

    ConnectionGithubEnterpriseConfigServiceDirectoryConfig, ConnectionGithubEnterpriseConfigServiceDirectoryConfigArgs

    Service string
    Required. The Service Directory service name. Format: projects/{project}/locations/{location}/namespaces/{namespace}/services/{service}.
    Service string
    Required. The Service Directory service name. Format: projects/{project}/locations/{location}/namespaces/{namespace}/services/{service}.
    service String
    Required. The Service Directory service name. Format: projects/{project}/locations/{location}/namespaces/{namespace}/services/{service}.
    service string
    Required. The Service Directory service name. Format: projects/{project}/locations/{location}/namespaces/{namespace}/services/{service}.
    service str
    Required. The Service Directory service name. Format: projects/{project}/locations/{location}/namespaces/{namespace}/services/{service}.
    service String
    Required. The Service Directory service name. Format: projects/{project}/locations/{location}/namespaces/{namespace}/services/{service}.

    ConnectionGitlabConfig, ConnectionGitlabConfigArgs

    AuthorizerCredential ConnectionGitlabConfigAuthorizerCredential
    Required. A GitLab personal access token with the api scope access. Structure is documented below.
    ReadAuthorizerCredential ConnectionGitlabConfigReadAuthorizerCredential
    Required. A GitLab personal access token with the minimum read_api scope access. Structure is documented below.
    WebhookSecretSecretVersion string
    Required. Immutable. SecretManager resource containing the webhook secret of a GitLab Enterprise project, formatted as projects/*/secrets/*/versions/*.
    HostUri string
    The URI of the GitLab Enterprise host this connection is for. If not specified, the default value is https://gitlab.com.
    ServerVersion string
    (Output) Output only. Version of the GitLab Enterprise server running on the host_uri.
    ServiceDirectoryConfig ConnectionGitlabConfigServiceDirectoryConfig
    Configuration for using Service Directory to privately connect to a GitLab Enterprise server. This should only be set if the GitLab Enterprise server is hosted on-premises and not reachable by public internet. If this field is left empty, calls to the GitLab Enterprise server will be made over the public internet. Structure is documented below.
    SslCa string
    SSL certificate to use for requests to GitLab Enterprise.
    AuthorizerCredential ConnectionGitlabConfigAuthorizerCredential
    Required. A GitLab personal access token with the api scope access. Structure is documented below.
    ReadAuthorizerCredential ConnectionGitlabConfigReadAuthorizerCredential
    Required. A GitLab personal access token with the minimum read_api scope access. Structure is documented below.
    WebhookSecretSecretVersion string
    Required. Immutable. SecretManager resource containing the webhook secret of a GitLab Enterprise project, formatted as projects/*/secrets/*/versions/*.
    HostUri string
    The URI of the GitLab Enterprise host this connection is for. If not specified, the default value is https://gitlab.com.
    ServerVersion string
    (Output) Output only. Version of the GitLab Enterprise server running on the host_uri.
    ServiceDirectoryConfig ConnectionGitlabConfigServiceDirectoryConfig
    Configuration for using Service Directory to privately connect to a GitLab Enterprise server. This should only be set if the GitLab Enterprise server is hosted on-premises and not reachable by public internet. If this field is left empty, calls to the GitLab Enterprise server will be made over the public internet. Structure is documented below.
    SslCa string
    SSL certificate to use for requests to GitLab Enterprise.
    authorizerCredential ConnectionGitlabConfigAuthorizerCredential
    Required. A GitLab personal access token with the api scope access. Structure is documented below.
    readAuthorizerCredential ConnectionGitlabConfigReadAuthorizerCredential
    Required. A GitLab personal access token with the minimum read_api scope access. Structure is documented below.
    webhookSecretSecretVersion String
    Required. Immutable. SecretManager resource containing the webhook secret of a GitLab Enterprise project, formatted as projects/*/secrets/*/versions/*.
    hostUri String
    The URI of the GitLab Enterprise host this connection is for. If not specified, the default value is https://gitlab.com.
    serverVersion String
    (Output) Output only. Version of the GitLab Enterprise server running on the host_uri.
    serviceDirectoryConfig ConnectionGitlabConfigServiceDirectoryConfig
    Configuration for using Service Directory to privately connect to a GitLab Enterprise server. This should only be set if the GitLab Enterprise server is hosted on-premises and not reachable by public internet. If this field is left empty, calls to the GitLab Enterprise server will be made over the public internet. Structure is documented below.
    sslCa String
    SSL certificate to use for requests to GitLab Enterprise.
    authorizerCredential ConnectionGitlabConfigAuthorizerCredential
    Required. A GitLab personal access token with the api scope access. Structure is documented below.
    readAuthorizerCredential ConnectionGitlabConfigReadAuthorizerCredential
    Required. A GitLab personal access token with the minimum read_api scope access. Structure is documented below.
    webhookSecretSecretVersion string
    Required. Immutable. SecretManager resource containing the webhook secret of a GitLab Enterprise project, formatted as projects/*/secrets/*/versions/*.
    hostUri string
    The URI of the GitLab Enterprise host this connection is for. If not specified, the default value is https://gitlab.com.
    serverVersion string
    (Output) Output only. Version of the GitLab Enterprise server running on the host_uri.
    serviceDirectoryConfig ConnectionGitlabConfigServiceDirectoryConfig
    Configuration for using Service Directory to privately connect to a GitLab Enterprise server. This should only be set if the GitLab Enterprise server is hosted on-premises and not reachable by public internet. If this field is left empty, calls to the GitLab Enterprise server will be made over the public internet. Structure is documented below.
    sslCa string
    SSL certificate to use for requests to GitLab Enterprise.
    authorizer_credential ConnectionGitlabConfigAuthorizerCredential
    Required. A GitLab personal access token with the api scope access. Structure is documented below.
    read_authorizer_credential ConnectionGitlabConfigReadAuthorizerCredential
    Required. A GitLab personal access token with the minimum read_api scope access. Structure is documented below.
    webhook_secret_secret_version str
    Required. Immutable. SecretManager resource containing the webhook secret of a GitLab Enterprise project, formatted as projects/*/secrets/*/versions/*.
    host_uri str
    The URI of the GitLab Enterprise host this connection is for. If not specified, the default value is https://gitlab.com.
    server_version str
    (Output) Output only. Version of the GitLab Enterprise server running on the host_uri.
    service_directory_config ConnectionGitlabConfigServiceDirectoryConfig
    Configuration for using Service Directory to privately connect to a GitLab Enterprise server. This should only be set if the GitLab Enterprise server is hosted on-premises and not reachable by public internet. If this field is left empty, calls to the GitLab Enterprise server will be made over the public internet. Structure is documented below.
    ssl_ca str
    SSL certificate to use for requests to GitLab Enterprise.
    authorizerCredential Property Map
    Required. A GitLab personal access token with the api scope access. Structure is documented below.
    readAuthorizerCredential Property Map
    Required. A GitLab personal access token with the minimum read_api scope access. Structure is documented below.
    webhookSecretSecretVersion String
    Required. Immutable. SecretManager resource containing the webhook secret of a GitLab Enterprise project, formatted as projects/*/secrets/*/versions/*.
    hostUri String
    The URI of the GitLab Enterprise host this connection is for. If not specified, the default value is https://gitlab.com.
    serverVersion String
    (Output) Output only. Version of the GitLab Enterprise server running on the host_uri.
    serviceDirectoryConfig Property Map
    Configuration for using Service Directory to privately connect to a GitLab Enterprise server. This should only be set if the GitLab Enterprise server is hosted on-premises and not reachable by public internet. If this field is left empty, calls to the GitLab Enterprise server will be made over the public internet. Structure is documented below.
    sslCa String
    SSL certificate to use for requests to GitLab Enterprise.

    ConnectionGitlabConfigAuthorizerCredential, ConnectionGitlabConfigAuthorizerCredentialArgs

    UserTokenSecretVersion string
    Required. A SecretManager resource containing the user token that authorizes the Cloud Build connection. Format: projects/*/secrets/*/versions/*.
    Username string
    (Output) Output only. The username associated to this token.
    UserTokenSecretVersion string
    Required. A SecretManager resource containing the user token that authorizes the Cloud Build connection. Format: projects/*/secrets/*/versions/*.
    Username string
    (Output) Output only. The username associated to this token.
    userTokenSecretVersion String
    Required. A SecretManager resource containing the user token that authorizes the Cloud Build connection. Format: projects/*/secrets/*/versions/*.
    username String
    (Output) Output only. The username associated to this token.
    userTokenSecretVersion string
    Required. A SecretManager resource containing the user token that authorizes the Cloud Build connection. Format: projects/*/secrets/*/versions/*.
    username string
    (Output) Output only. The username associated to this token.
    user_token_secret_version str
    Required. A SecretManager resource containing the user token that authorizes the Cloud Build connection. Format: projects/*/secrets/*/versions/*.
    username str
    (Output) Output only. The username associated to this token.
    userTokenSecretVersion String
    Required. A SecretManager resource containing the user token that authorizes the Cloud Build connection. Format: projects/*/secrets/*/versions/*.
    username String
    (Output) Output only. The username associated to this token.

    ConnectionGitlabConfigReadAuthorizerCredential, ConnectionGitlabConfigReadAuthorizerCredentialArgs

    UserTokenSecretVersion string
    Required. A SecretManager resource containing the user token that authorizes the Cloud Build connection. Format: projects/*/secrets/*/versions/*.
    Username string
    (Output) Output only. The username associated to this token.
    UserTokenSecretVersion string
    Required. A SecretManager resource containing the user token that authorizes the Cloud Build connection. Format: projects/*/secrets/*/versions/*.
    Username string
    (Output) Output only. The username associated to this token.
    userTokenSecretVersion String
    Required. A SecretManager resource containing the user token that authorizes the Cloud Build connection. Format: projects/*/secrets/*/versions/*.
    username String
    (Output) Output only. The username associated to this token.
    userTokenSecretVersion string
    Required. A SecretManager resource containing the user token that authorizes the Cloud Build connection. Format: projects/*/secrets/*/versions/*.
    username string
    (Output) Output only. The username associated to this token.
    user_token_secret_version str
    Required. A SecretManager resource containing the user token that authorizes the Cloud Build connection. Format: projects/*/secrets/*/versions/*.
    username str
    (Output) Output only. The username associated to this token.
    userTokenSecretVersion String
    Required. A SecretManager resource containing the user token that authorizes the Cloud Build connection. Format: projects/*/secrets/*/versions/*.
    username String
    (Output) Output only. The username associated to this token.

    ConnectionGitlabConfigServiceDirectoryConfig, ConnectionGitlabConfigServiceDirectoryConfigArgs

    Service string
    Required. The Service Directory service name. Format: projects/{project}/locations/{location}/namespaces/{namespace}/services/{service}.
    Service string
    Required. The Service Directory service name. Format: projects/{project}/locations/{location}/namespaces/{namespace}/services/{service}.
    service String
    Required. The Service Directory service name. Format: projects/{project}/locations/{location}/namespaces/{namespace}/services/{service}.
    service string
    Required. The Service Directory service name. Format: projects/{project}/locations/{location}/namespaces/{namespace}/services/{service}.
    service str
    Required. The Service Directory service name. Format: projects/{project}/locations/{location}/namespaces/{namespace}/services/{service}.
    service String
    Required. The Service Directory service name. Format: projects/{project}/locations/{location}/namespaces/{namespace}/services/{service}.

    ConnectionInstallationState, ConnectionInstallationStateArgs

    ActionUri string
    (Output) Output only. Link to follow for next action. Empty string if the installation is already complete.
    Message string
    (Output) Output only. Message of what the user should do next to continue the installation. Empty string if the installation is already complete.
    Stage string
    (Output) Output only. Current step of the installation process.
    ActionUri string
    (Output) Output only. Link to follow for next action. Empty string if the installation is already complete.
    Message string
    (Output) Output only. Message of what the user should do next to continue the installation. Empty string if the installation is already complete.
    Stage string
    (Output) Output only. Current step of the installation process.
    actionUri String
    (Output) Output only. Link to follow for next action. Empty string if the installation is already complete.
    message String
    (Output) Output only. Message of what the user should do next to continue the installation. Empty string if the installation is already complete.
    stage String
    (Output) Output only. Current step of the installation process.
    actionUri string
    (Output) Output only. Link to follow for next action. Empty string if the installation is already complete.
    message string
    (Output) Output only. Message of what the user should do next to continue the installation. Empty string if the installation is already complete.
    stage string
    (Output) Output only. Current step of the installation process.
    action_uri str
    (Output) Output only. Link to follow for next action. Empty string if the installation is already complete.
    message str
    (Output) Output only. Message of what the user should do next to continue the installation. Empty string if the installation is already complete.
    stage str
    (Output) Output only. Current step of the installation process.
    actionUri String
    (Output) Output only. Link to follow for next action. Empty string if the installation is already complete.
    message String
    (Output) Output only. Message of what the user should do next to continue the installation. Empty string if the installation is already complete.
    stage String
    (Output) Output only. Current step of the installation process.

    Import

    Connection can be imported using any of these accepted formats:

    • projects/{{project}}/locations/{{location}}/connections/{{name}}

    • {{project}}/{{location}}/{{name}}

    • {{location}}/{{name}}

    • {{name}}

    When using the pulumi import command, Connection can be imported using one of the formats above. For example:

    $ pulumi import gcp:cloudbuildv2/connection:Connection default projects/{{project}}/locations/{{location}}/connections/{{name}}
    
    $ pulumi import gcp:cloudbuildv2/connection:Connection default {{project}}/{{location}}/{{name}}
    
    $ pulumi import gcp:cloudbuildv2/connection:Connection default {{location}}/{{name}}
    
    $ pulumi import gcp:cloudbuildv2/connection:Connection default {{name}}
    

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

    Package Details

    Repository
    Google Cloud (GCP) Classic pulumi/pulumi-gcp
    License
    Apache-2.0
    Notes
    This Pulumi package is based on the google-beta Terraform Provider.
    gcp logo
    Google Cloud Classic v7.19.0 published on Thursday, Apr 18, 2024 by Pulumi