@pulumi/gcp
Version:
A Pulumi package for creating and managing Google Cloud Platform resources.
418 lines • 17.7 kB
TypeScript
import * as pulumi from "@pulumi/pulumi";
import * as inputs from "../types/input";
import * as outputs from "../types/output";
/**
* A connection to a SCM like GitHub, GitHub Enterprise, Bitbucket Data Center/Cloud or GitLab.
*
* To get more information about Connection, see:
*
* * [API documentation](https://cloud.google.com/build/docs/api/reference/rest)
* * How-to Guides
* * [Official Documentation](https://cloud.google.com/build/docs)
*
* ## Example Usage
*
* ### Cloudbuildv2 Connection
*
* ```typescript
* 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",
* },
* },
* });
* ```
* ### Cloudbuildv2 Connection Ghe
*
* ```typescript
* 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,
* },
* }, {
* dependsOn: [
* policy_pk,
* policy_whs,
* ],
* });
* ```
* ### Cloudbuildv2 Connection Github
*
* ```typescript
* 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
*
* 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:
*
* ```sh
* $ 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}}
* ```
*/
export declare class Connection extends pulumi.CustomResource {
/**
* Get an existing Connection resource's state with the given name, ID, and optional extra
* properties used to qualify the lookup.
*
* @param name The _unique_ name of the resulting resource.
* @param id The _unique_ provider ID of the resource to lookup.
* @param state Any extra arguments used during the lookup.
* @param opts Optional settings to control the behavior of the CustomResource.
*/
static get(name: string, id: pulumi.Input<pulumi.ID>, state?: ConnectionState, opts?: pulumi.CustomResourceOptions): Connection;
/**
* Returns true if the given object is an instance of Connection. This is designed to work even
* when multiple copies of the Pulumi SDK have been loaded into the same process.
*/
static isInstance(obj: any): obj is Connection;
/**
* 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 `effectiveAnnotations` for all of the annotations present on the resource.
*/
readonly annotations: pulumi.Output<{
[key: string]: string;
} | undefined>;
/**
* Configuration for connections to Bitbucket Cloud.
* Structure is documented below.
*/
readonly bitbucketCloudConfig: pulumi.Output<outputs.cloudbuildv2.ConnectionBitbucketCloudConfig | undefined>;
/**
* Configuration for connections to Bitbucket Data Center.
* Structure is documented below.
*/
readonly bitbucketDataCenterConfig: pulumi.Output<outputs.cloudbuildv2.ConnectionBitbucketDataCenterConfig | undefined>;
/**
* Output only. Server assigned timestamp for when the connection was created.
*/
readonly createTime: pulumi.Output<string>;
/**
* Whether Terraform will be prevented from destroying the resource. Defaults to DELETE.
* When a 'terraform destroy' or 'pulumi up' would delete the resource,
* the command will fail if this field is set to "PREVENT" in Terraform state.
* When set to "ABANDON", the command will remove the resource from Terraform
* management without updating or deleting the resource in the API.
* When set to "DELETE", deleting the resource is allowed.
*/
readonly deletionPolicy: pulumi.Output<string>;
/**
* 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.
*/
readonly disabled: pulumi.Output<boolean | undefined>;
/**
* All of annotations (key/value pairs) present on the resource in GCP, including the annotations configured through Terraform, other clients and services.
*/
readonly effectiveAnnotations: pulumi.Output<{
[key: string]: 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.
*/
readonly etag: pulumi.Output<string>;
/**
* Configuration for connections to github.com.
* Structure is documented below.
*/
readonly githubConfig: pulumi.Output<outputs.cloudbuildv2.ConnectionGithubConfig | undefined>;
/**
* Configuration for connections to an instance of GitHub Enterprise.
* Structure is documented below.
*/
readonly githubEnterpriseConfig: pulumi.Output<outputs.cloudbuildv2.ConnectionGithubEnterpriseConfig | undefined>;
/**
* Configuration for connections to gitlab.com or an instance of GitLab Enterprise.
* Structure is documented below.
*/
readonly gitlabConfig: pulumi.Output<outputs.cloudbuildv2.ConnectionGitlabConfig | undefined>;
/**
* Output only. Installation state of the Connection.
* Structure is documented below.
*/
readonly installationStates: pulumi.Output<outputs.cloudbuildv2.ConnectionInstallationState[]>;
/**
* The location for the resource
*/
readonly location: pulumi.Output<string>;
/**
* Immutable. The resource name of the connection.
*/
readonly name: pulumi.Output<string>;
/**
* The ID of the project in which the resource belongs.
* If it is not provided, the provider project is used.
*/
readonly project: pulumi.Output<string>;
/**
* Output only. Set to true when the connection is being set up or updated in the background.
*/
readonly reconciling: pulumi.Output<boolean>;
/**
* Output only. Server assigned timestamp for when the connection was updated.
*/
readonly updateTime: pulumi.Output<string>;
/**
* Create a Connection resource with the given unique name, arguments, and options.
*
* @param name The _unique_ name of the resource.
* @param args The arguments to use to populate this resource's properties.
* @param opts A bag of options that control this resource's behavior.
*/
constructor(name: string, args: ConnectionArgs, opts?: pulumi.CustomResourceOptions);
}
/**
* Input properties used for looking up and filtering Connection resources.
*/
export interface ConnectionState {
/**
* 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 `effectiveAnnotations` for all of the annotations present on the resource.
*/
annotations?: pulumi.Input<{
[key: string]: pulumi.Input<string>;
} | undefined>;
/**
* Configuration for connections to Bitbucket Cloud.
* Structure is documented below.
*/
bitbucketCloudConfig?: pulumi.Input<inputs.cloudbuildv2.ConnectionBitbucketCloudConfig | undefined>;
/**
* Configuration for connections to Bitbucket Data Center.
* Structure is documented below.
*/
bitbucketDataCenterConfig?: pulumi.Input<inputs.cloudbuildv2.ConnectionBitbucketDataCenterConfig | undefined>;
/**
* Output only. Server assigned timestamp for when the connection was created.
*/
createTime?: pulumi.Input<string | undefined>;
/**
* Whether Terraform will be prevented from destroying the resource. Defaults to DELETE.
* When a 'terraform destroy' or 'pulumi up' would delete the resource,
* the command will fail if this field is set to "PREVENT" in Terraform state.
* When set to "ABANDON", the command will remove the resource from Terraform
* management without updating or deleting the resource in the API.
* When set to "DELETE", deleting the resource is allowed.
*/
deletionPolicy?: pulumi.Input<string | undefined>;
/**
* 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.
*/
disabled?: pulumi.Input<boolean | undefined>;
/**
* All of annotations (key/value pairs) present on the resource in GCP, including the annotations configured through Terraform, other clients and services.
*/
effectiveAnnotations?: pulumi.Input<{
[key: string]: pulumi.Input<string>;
} | undefined>;
/**
* 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.
*/
etag?: pulumi.Input<string | undefined>;
/**
* Configuration for connections to github.com.
* Structure is documented below.
*/
githubConfig?: pulumi.Input<inputs.cloudbuildv2.ConnectionGithubConfig | undefined>;
/**
* Configuration for connections to an instance of GitHub Enterprise.
* Structure is documented below.
*/
githubEnterpriseConfig?: pulumi.Input<inputs.cloudbuildv2.ConnectionGithubEnterpriseConfig | undefined>;
/**
* Configuration for connections to gitlab.com or an instance of GitLab Enterprise.
* Structure is documented below.
*/
gitlabConfig?: pulumi.Input<inputs.cloudbuildv2.ConnectionGitlabConfig | undefined>;
/**
* Output only. Installation state of the Connection.
* Structure is documented below.
*/
installationStates?: pulumi.Input<pulumi.Input<inputs.cloudbuildv2.ConnectionInstallationState>[] | undefined>;
/**
* The location for the resource
*/
location?: pulumi.Input<string | undefined>;
/**
* Immutable. The resource name of the connection.
*/
name?: pulumi.Input<string | undefined>;
/**
* The ID of the project in which the resource belongs.
* If it is not provided, the provider project is used.
*/
project?: pulumi.Input<string | undefined>;
/**
* Output only. Set to true when the connection is being set up or updated in the background.
*/
reconciling?: pulumi.Input<boolean | undefined>;
/**
* Output only. Server assigned timestamp for when the connection was updated.
*/
updateTime?: pulumi.Input<string | undefined>;
}
/**
* The set of arguments for constructing a Connection resource.
*/
export interface ConnectionArgs {
/**
* 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 `effectiveAnnotations` for all of the annotations present on the resource.
*/
annotations?: pulumi.Input<{
[key: string]: pulumi.Input<string>;
} | undefined>;
/**
* Configuration for connections to Bitbucket Cloud.
* Structure is documented below.
*/
bitbucketCloudConfig?: pulumi.Input<inputs.cloudbuildv2.ConnectionBitbucketCloudConfig | undefined>;
/**
* Configuration for connections to Bitbucket Data Center.
* Structure is documented below.
*/
bitbucketDataCenterConfig?: pulumi.Input<inputs.cloudbuildv2.ConnectionBitbucketDataCenterConfig | undefined>;
/**
* Whether Terraform will be prevented from destroying the resource. Defaults to DELETE.
* When a 'terraform destroy' or 'pulumi up' would delete the resource,
* the command will fail if this field is set to "PREVENT" in Terraform state.
* When set to "ABANDON", the command will remove the resource from Terraform
* management without updating or deleting the resource in the API.
* When set to "DELETE", deleting the resource is allowed.
*/
deletionPolicy?: pulumi.Input<string | undefined>;
/**
* 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.
*/
disabled?: pulumi.Input<boolean | undefined>;
/**
* Configuration for connections to github.com.
* Structure is documented below.
*/
githubConfig?: pulumi.Input<inputs.cloudbuildv2.ConnectionGithubConfig | undefined>;
/**
* Configuration for connections to an instance of GitHub Enterprise.
* Structure is documented below.
*/
githubEnterpriseConfig?: pulumi.Input<inputs.cloudbuildv2.ConnectionGithubEnterpriseConfig | undefined>;
/**
* Configuration for connections to gitlab.com or an instance of GitLab Enterprise.
* Structure is documented below.
*/
gitlabConfig?: pulumi.Input<inputs.cloudbuildv2.ConnectionGitlabConfig | undefined>;
/**
* The location for the resource
*/
location: pulumi.Input<string>;
/**
* Immutable. The resource name of the connection.
*/
name?: pulumi.Input<string | undefined>;
/**
* The ID of the project in which the resource belongs.
* If it is not provided, the provider project is used.
*/
project?: pulumi.Input<string | undefined>;
}
//# sourceMappingURL=connection.d.ts.map