UNPKG

@pulumi/gcp

Version:

A Pulumi package for creating and managing Google Cloud Platform resources.

334 lines (333 loc) • 14.4 kB
import * as pulumi from "@pulumi/pulumi"; import * as inputs from "../types/input"; import * as outputs from "../types/output"; /** * BitbucketServerConfig represents the configuration for a Bitbucket Server. * * To get more information about BitbucketServerConfig, see: * * * [API documentation](https://cloud.google.com/build/docs/api/reference/rest/v1/projects.locations.bitbucketServerConfigs) * * How-to Guides * * [Connect to a Bitbucket Server host](https://cloud.google.com/build/docs/automating-builds/bitbucket/connect-host-bitbucket-server) * * ## Example Usage * * ### Cloudbuild Bitbucket Server Config * * ```typescript * import * as pulumi from "@pulumi/pulumi"; * import * as gcp from "@pulumi/gcp"; * * const bbs_config = new gcp.cloudbuild.BitbucketServerConfig("bbs-config", { * configId: "bbs-config", * location: "us-central1", * hostUri: "https://bbs.com", * secrets: { * adminAccessTokenVersionName: "projects/myProject/secrets/mybbspat/versions/1", * readAccessTokenVersionName: "projects/myProject/secrets/mybbspat/versions/1", * webhookSecretVersionName: "projects/myProject/secrets/mybbspat/versions/1", * }, * username: "test", * apiKey: "<api-key>", * }); * ``` * ### Cloudbuild Bitbucket Server Config Repositories * * ```typescript * import * as pulumi from "@pulumi/pulumi"; * import * as gcp from "@pulumi/gcp"; * * const bbs_config_with_repos = new gcp.cloudbuild.BitbucketServerConfig("bbs-config-with-repos", { * configId: "bbs-config", * location: "us-central1", * hostUri: "https://bbs.com", * secrets: { * adminAccessTokenVersionName: "projects/myProject/secrets/mybbspat/versions/1", * readAccessTokenVersionName: "projects/myProject/secrets/mybbspat/versions/1", * webhookSecretVersionName: "projects/myProject/secrets/mybbspat/versions/1", * }, * username: "test", * apiKey: "<api-key>", * connectedRepositories: [ * { * projectKey: "DEV", * repoSlug: "repo1", * }, * { * projectKey: "PROD", * repoSlug: "repo1", * }, * ], * }); * ``` * ### Cloudbuild Bitbucket Server Config Peered Network * * ```typescript * import * as pulumi from "@pulumi/pulumi"; * import * as gcp from "@pulumi/gcp"; * import * as std from "@pulumi/std"; * * const project = gcp.organizations.getProject({}); * const servicenetworking = new gcp.projects.Service("servicenetworking", {service: "servicenetworking.googleapis.com"}); * const vpcNetwork = new gcp.compute.Network("vpc_network", {name: "vpc-network"}, { * dependsOn: [servicenetworking], * }); * const privateIpAlloc = new gcp.compute.GlobalAddress("private_ip_alloc", { * name: "private-ip-alloc", * purpose: "VPC_PEERING", * addressType: "INTERNAL", * prefixLength: 16, * network: vpcNetwork.id, * }); * const _default = new gcp.servicenetworking.Connection("default", { * network: vpcNetwork.id, * service: "servicenetworking.googleapis.com", * reservedPeeringRanges: [privateIpAlloc.name], * }, { * dependsOn: [servicenetworking], * }); * const bbs_config_with_peered_network = new gcp.cloudbuild.BitbucketServerConfig("bbs-config-with-peered-network", { * configId: "bbs-config", * location: "us-central1", * hostUri: "https://bbs.com", * secrets: { * adminAccessTokenVersionName: "projects/myProject/secrets/mybbspat/versions/1", * readAccessTokenVersionName: "projects/myProject/secrets/mybbspat/versions/1", * webhookSecretVersionName: "projects/myProject/secrets/mybbspat/versions/1", * }, * username: "test", * apiKey: "<api-key>", * peeredNetwork: pulumi.all([vpcNetwork.id, project, project]).apply(([id, project, project1]) => std.replaceOutput({ * text: id, * search: project.name, * replace: project1.number, * })).apply(invoke => invoke.result), * sslCa: `-----BEGIN CERTIFICATE----- * -----END CERTIFICATE----- * -----BEGIN CERTIFICATE----- * -----END CERTIFICATE----- * `, * }, { * dependsOn: [_default], * }); * ``` * * ## Import * * BitbucketServerConfig can be imported using any of these accepted formats: * * * `projects/{{project}}/locations/{{location}}/bitbucketServerConfigs/{{config_id}}` * * * `{{project}}/{{location}}/{{config_id}}` * * * `{{location}}/{{config_id}}` * * When using the `pulumi import` command, BitbucketServerConfig can be imported using one of the formats above. For example: * * ```sh * $ pulumi import gcp:cloudbuild/bitbucketServerConfig:BitbucketServerConfig default projects/{{project}}/locations/{{location}}/bitbucketServerConfigs/{{config_id}} * ``` * * ```sh * $ pulumi import gcp:cloudbuild/bitbucketServerConfig:BitbucketServerConfig default {{project}}/{{location}}/{{config_id}} * ``` * * ```sh * $ pulumi import gcp:cloudbuild/bitbucketServerConfig:BitbucketServerConfig default {{location}}/{{config_id}} * ``` */ export declare class BitbucketServerConfig extends pulumi.CustomResource { /** * Get an existing BitbucketServerConfig 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?: BitbucketServerConfigState, opts?: pulumi.CustomResourceOptions): BitbucketServerConfig; /** * Returns true if the given object is an instance of BitbucketServerConfig. 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 BitbucketServerConfig; /** * Immutable. API Key that will be attached to webhook. Once this field has been set, it cannot be changed. * Changing this field will result in deleting/ recreating the resource. */ readonly apiKey: pulumi.Output<string>; /** * The ID to use for the BitbucketServerConfig, which will become the final component of the BitbucketServerConfig's resource name. */ readonly configId: pulumi.Output<string>; /** * Connected Bitbucket Server repositories for this config. * Structure is documented below. */ readonly connectedRepositories: pulumi.Output<outputs.cloudbuild.BitbucketServerConfigConnectedRepository[] | undefined>; /** * Immutable. The URI of the Bitbucket Server host. Once this field has been set, it cannot be changed. * If you need to change it, please create another BitbucketServerConfig. */ readonly hostUri: pulumi.Output<string>; /** * The location of this bitbucket server config. */ readonly location: pulumi.Output<string>; /** * The resource name for the config. */ readonly name: pulumi.Output<string>; /** * The network to be used when reaching out to the Bitbucket Server instance. The VPC network must be enabled for private service connection. * This should be set if the Bitbucket Server instance is hosted on-premises and not reachable by public internet. If this field is left empty, * no network peering will occur and calls to the Bitbucket Server instance will be made over the public internet. Must be in the format * projects/{project}/global/networks/{network}, where {project} is a project number or id and {network} is the name of a VPC network in the project. */ readonly peeredNetwork: pulumi.Output<string | undefined>; /** * 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>; /** * Secret Manager secrets needed by the config. * Structure is documented below. */ readonly secrets: pulumi.Output<outputs.cloudbuild.BitbucketServerConfigSecrets>; /** * SSL certificate to use for requests to Bitbucket Server. The format should be PEM format but the extension can be one of .pem, .cer, or .crt. */ readonly sslCa: pulumi.Output<string | undefined>; /** * Username of the account Cloud Build will use on Bitbucket Server. */ readonly username: pulumi.Output<string>; /** * Output only. UUID included in webhook requests. The UUID is used to look up the corresponding config. */ readonly webhookKey: pulumi.Output<string>; /** * Create a BitbucketServerConfig 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: BitbucketServerConfigArgs, opts?: pulumi.CustomResourceOptions); } /** * Input properties used for looking up and filtering BitbucketServerConfig resources. */ export interface BitbucketServerConfigState { /** * Immutable. API Key that will be attached to webhook. Once this field has been set, it cannot be changed. * Changing this field will result in deleting/ recreating the resource. */ apiKey?: pulumi.Input<string>; /** * The ID to use for the BitbucketServerConfig, which will become the final component of the BitbucketServerConfig's resource name. */ configId?: pulumi.Input<string>; /** * Connected Bitbucket Server repositories for this config. * Structure is documented below. */ connectedRepositories?: pulumi.Input<pulumi.Input<inputs.cloudbuild.BitbucketServerConfigConnectedRepository>[]>; /** * Immutable. The URI of the Bitbucket Server host. Once this field has been set, it cannot be changed. * If you need to change it, please create another BitbucketServerConfig. */ hostUri?: pulumi.Input<string>; /** * The location of this bitbucket server config. */ location?: pulumi.Input<string>; /** * The resource name for the config. */ name?: pulumi.Input<string>; /** * The network to be used when reaching out to the Bitbucket Server instance. The VPC network must be enabled for private service connection. * This should be set if the Bitbucket Server instance is hosted on-premises and not reachable by public internet. If this field is left empty, * no network peering will occur and calls to the Bitbucket Server instance will be made over the public internet. Must be in the format * projects/{project}/global/networks/{network}, where {project} is a project number or id and {network} is the name of a VPC network in the project. */ peeredNetwork?: pulumi.Input<string>; /** * The ID of the project in which the resource belongs. * If it is not provided, the provider project is used. */ project?: pulumi.Input<string>; /** * Secret Manager secrets needed by the config. * Structure is documented below. */ secrets?: pulumi.Input<inputs.cloudbuild.BitbucketServerConfigSecrets>; /** * SSL certificate to use for requests to Bitbucket Server. The format should be PEM format but the extension can be one of .pem, .cer, or .crt. */ sslCa?: pulumi.Input<string>; /** * Username of the account Cloud Build will use on Bitbucket Server. */ username?: pulumi.Input<string>; /** * Output only. UUID included in webhook requests. The UUID is used to look up the corresponding config. */ webhookKey?: pulumi.Input<string>; } /** * The set of arguments for constructing a BitbucketServerConfig resource. */ export interface BitbucketServerConfigArgs { /** * Immutable. API Key that will be attached to webhook. Once this field has been set, it cannot be changed. * Changing this field will result in deleting/ recreating the resource. */ apiKey: pulumi.Input<string>; /** * The ID to use for the BitbucketServerConfig, which will become the final component of the BitbucketServerConfig's resource name. */ configId: pulumi.Input<string>; /** * Connected Bitbucket Server repositories for this config. * Structure is documented below. */ connectedRepositories?: pulumi.Input<pulumi.Input<inputs.cloudbuild.BitbucketServerConfigConnectedRepository>[]>; /** * Immutable. The URI of the Bitbucket Server host. Once this field has been set, it cannot be changed. * If you need to change it, please create another BitbucketServerConfig. */ hostUri: pulumi.Input<string>; /** * The location of this bitbucket server config. */ location: pulumi.Input<string>; /** * The network to be used when reaching out to the Bitbucket Server instance. The VPC network must be enabled for private service connection. * This should be set if the Bitbucket Server instance is hosted on-premises and not reachable by public internet. If this field is left empty, * no network peering will occur and calls to the Bitbucket Server instance will be made over the public internet. Must be in the format * projects/{project}/global/networks/{network}, where {project} is a project number or id and {network} is the name of a VPC network in the project. */ peeredNetwork?: pulumi.Input<string>; /** * The ID of the project in which the resource belongs. * If it is not provided, the provider project is used. */ project?: pulumi.Input<string>; /** * Secret Manager secrets needed by the config. * Structure is documented below. */ secrets: pulumi.Input<inputs.cloudbuild.BitbucketServerConfigSecrets>; /** * SSL certificate to use for requests to Bitbucket Server. The format should be PEM format but the extension can be one of .pem, .cer, or .crt. */ sslCa?: pulumi.Input<string>; /** * Username of the account Cloud Build will use on Bitbucket Server. */ username: pulumi.Input<string>; }