Please wait. This can take some minutes ...
Many resources are needed to download a project. Please understand that we have to compensate our server costs. Thank you in advance.
Project price only 1 $
You can buy this project and download/modify it how often you want.
com.pulumi.gcp.cloudbuild.kotlin.BitbucketServerConfigArgs.kt Maven / Gradle / Ivy
@file:Suppress("NAME_SHADOWING", "DEPRECATION")
package com.pulumi.gcp.cloudbuild.kotlin
import com.pulumi.core.Output
import com.pulumi.core.Output.of
import com.pulumi.gcp.cloudbuild.BitbucketServerConfigArgs.builder
import com.pulumi.gcp.cloudbuild.kotlin.inputs.BitbucketServerConfigConnectedRepositoryArgs
import com.pulumi.gcp.cloudbuild.kotlin.inputs.BitbucketServerConfigConnectedRepositoryArgsBuilder
import com.pulumi.gcp.cloudbuild.kotlin.inputs.BitbucketServerConfigSecretsArgs
import com.pulumi.gcp.cloudbuild.kotlin.inputs.BitbucketServerConfigSecretsArgsBuilder
import com.pulumi.kotlin.ConvertibleToJava
import com.pulumi.kotlin.PulumiTagMarker
import com.pulumi.kotlin.applySuspend
import kotlin.String
import kotlin.Suppress
import kotlin.Unit
import kotlin.collections.List
import kotlin.jvm.JvmName
/**
* 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: "",
* });
* ```
* ```python
* import pulumi
* import pulumi_gcp as gcp
* bbs_config = gcp.cloudbuild.BitbucketServerConfig("bbs-config",
* config_id="bbs-config",
* location="us-central1",
* host_uri="https://bbs.com",
* secrets={
* "admin_access_token_version_name": "projects/myProject/secrets/mybbspat/versions/1",
* "read_access_token_version_name": "projects/myProject/secrets/mybbspat/versions/1",
* "webhook_secret_version_name": "projects/myProject/secrets/mybbspat/versions/1",
* },
* username="test",
* api_key="")
* ```
* ```csharp
* using System.Collections.Generic;
* using System.Linq;
* using Pulumi;
* using Gcp = Pulumi.Gcp;
* return await Deployment.RunAsync(() =>
* {
* var bbs_config = new Gcp.CloudBuild.BitbucketServerConfig("bbs-config", new()
* {
* ConfigId = "bbs-config",
* Location = "us-central1",
* HostUri = "https://bbs.com",
* Secrets = new Gcp.CloudBuild.Inputs.BitbucketServerConfigSecretsArgs
* {
* AdminAccessTokenVersionName = "projects/myProject/secrets/mybbspat/versions/1",
* ReadAccessTokenVersionName = "projects/myProject/secrets/mybbspat/versions/1",
* WebhookSecretVersionName = "projects/myProject/secrets/mybbspat/versions/1",
* },
* Username = "test",
* ApiKey = "",
* });
* });
* ```
* ```go
* package main
* import (
* "github.com/pulumi/pulumi-gcp/sdk/v7/go/gcp/cloudbuild"
* "github.com/pulumi/pulumi/sdk/v3/go/pulumi"
* )
* func main() {
* pulumi.Run(func(ctx *pulumi.Context) error {
* _, err := cloudbuild.NewBitbucketServerConfig(ctx, "bbs-config", &cloudbuild.BitbucketServerConfigArgs{
* ConfigId: pulumi.String("bbs-config"),
* Location: pulumi.String("us-central1"),
* HostUri: pulumi.String("https://bbs.com"),
* Secrets: &cloudbuild.BitbucketServerConfigSecretsArgs{
* AdminAccessTokenVersionName: pulumi.String("projects/myProject/secrets/mybbspat/versions/1"),
* ReadAccessTokenVersionName: pulumi.String("projects/myProject/secrets/mybbspat/versions/1"),
* WebhookSecretVersionName: pulumi.String("projects/myProject/secrets/mybbspat/versions/1"),
* },
* Username: pulumi.String("test"),
* ApiKey: pulumi.String(""),
* })
* if err != nil {
* return err
* }
* return nil
* })
* }
* ```
* ```java
* package generated_program;
* import com.pulumi.Context;
* import com.pulumi.Pulumi;
* import com.pulumi.core.Output;
* import com.pulumi.gcp.cloudbuild.BitbucketServerConfig;
* import com.pulumi.gcp.cloudbuild.BitbucketServerConfigArgs;
* import com.pulumi.gcp.cloudbuild.inputs.BitbucketServerConfigSecretsArgs;
* 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 bbs_config = new BitbucketServerConfig("bbs-config", BitbucketServerConfigArgs.builder()
* .configId("bbs-config")
* .location("us-central1")
* .hostUri("https://bbs.com")
* .secrets(BitbucketServerConfigSecretsArgs.builder()
* .adminAccessTokenVersionName("projects/myProject/secrets/mybbspat/versions/1")
* .readAccessTokenVersionName("projects/myProject/secrets/mybbspat/versions/1")
* .webhookSecretVersionName("projects/myProject/secrets/mybbspat/versions/1")
* .build())
* .username("test")
* .apiKey("")
* .build());
* }
* }
* ```
* ```yaml
* resources:
* bbs-config:
* type: gcp:cloudbuild:BitbucketServerConfig
* properties:
* 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:
* ```
*
* ### 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: "",
* connectedRepositories: [
* {
* projectKey: "DEV",
* repoSlug: "repo1",
* },
* {
* projectKey: "PROD",
* repoSlug: "repo1",
* },
* ],
* });
* ```
* ```python
* import pulumi
* import pulumi_gcp as gcp
* bbs_config_with_repos = gcp.cloudbuild.BitbucketServerConfig("bbs-config-with-repos",
* config_id="bbs-config",
* location="us-central1",
* host_uri="https://bbs.com",
* secrets={
* "admin_access_token_version_name": "projects/myProject/secrets/mybbspat/versions/1",
* "read_access_token_version_name": "projects/myProject/secrets/mybbspat/versions/1",
* "webhook_secret_version_name": "projects/myProject/secrets/mybbspat/versions/1",
* },
* username="test",
* api_key="",
* connected_repositories=[
* {
* "project_key": "DEV",
* "repo_slug": "repo1",
* },
* {
* "project_key": "PROD",
* "repo_slug": "repo1",
* },
* ])
* ```
* ```csharp
* using System.Collections.Generic;
* using System.Linq;
* using Pulumi;
* using Gcp = Pulumi.Gcp;
* return await Deployment.RunAsync(() =>
* {
* var bbs_config_with_repos = new Gcp.CloudBuild.BitbucketServerConfig("bbs-config-with-repos", new()
* {
* ConfigId = "bbs-config",
* Location = "us-central1",
* HostUri = "https://bbs.com",
* Secrets = new Gcp.CloudBuild.Inputs.BitbucketServerConfigSecretsArgs
* {
* AdminAccessTokenVersionName = "projects/myProject/secrets/mybbspat/versions/1",
* ReadAccessTokenVersionName = "projects/myProject/secrets/mybbspat/versions/1",
* WebhookSecretVersionName = "projects/myProject/secrets/mybbspat/versions/1",
* },
* Username = "test",
* ApiKey = "",
* ConnectedRepositories = new[]
* {
* new Gcp.CloudBuild.Inputs.BitbucketServerConfigConnectedRepositoryArgs
* {
* ProjectKey = "DEV",
* RepoSlug = "repo1",
* },
* new Gcp.CloudBuild.Inputs.BitbucketServerConfigConnectedRepositoryArgs
* {
* ProjectKey = "PROD",
* RepoSlug = "repo1",
* },
* },
* });
* });
* ```
* ```go
* package main
* import (
* "github.com/pulumi/pulumi-gcp/sdk/v7/go/gcp/cloudbuild"
* "github.com/pulumi/pulumi/sdk/v3/go/pulumi"
* )
* func main() {
* pulumi.Run(func(ctx *pulumi.Context) error {
* _, err := cloudbuild.NewBitbucketServerConfig(ctx, "bbs-config-with-repos", &cloudbuild.BitbucketServerConfigArgs{
* ConfigId: pulumi.String("bbs-config"),
* Location: pulumi.String("us-central1"),
* HostUri: pulumi.String("https://bbs.com"),
* Secrets: &cloudbuild.BitbucketServerConfigSecretsArgs{
* AdminAccessTokenVersionName: pulumi.String("projects/myProject/secrets/mybbspat/versions/1"),
* ReadAccessTokenVersionName: pulumi.String("projects/myProject/secrets/mybbspat/versions/1"),
* WebhookSecretVersionName: pulumi.String("projects/myProject/secrets/mybbspat/versions/1"),
* },
* Username: pulumi.String("test"),
* ApiKey: pulumi.String(""),
* ConnectedRepositories: cloudbuild.BitbucketServerConfigConnectedRepositoryArray{
* &cloudbuild.BitbucketServerConfigConnectedRepositoryArgs{
* ProjectKey: pulumi.String("DEV"),
* RepoSlug: pulumi.String("repo1"),
* },
* &cloudbuild.BitbucketServerConfigConnectedRepositoryArgs{
* ProjectKey: pulumi.String("PROD"),
* RepoSlug: pulumi.String("repo1"),
* },
* },
* })
* if err != nil {
* return err
* }
* return nil
* })
* }
* ```
* ```java
* package generated_program;
* import com.pulumi.Context;
* import com.pulumi.Pulumi;
* import com.pulumi.core.Output;
* import com.pulumi.gcp.cloudbuild.BitbucketServerConfig;
* import com.pulumi.gcp.cloudbuild.BitbucketServerConfigArgs;
* import com.pulumi.gcp.cloudbuild.inputs.BitbucketServerConfigSecretsArgs;
* import com.pulumi.gcp.cloudbuild.inputs.BitbucketServerConfigConnectedRepositoryArgs;
* 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 bbs_config_with_repos = new BitbucketServerConfig("bbs-config-with-repos", BitbucketServerConfigArgs.builder()
* .configId("bbs-config")
* .location("us-central1")
* .hostUri("https://bbs.com")
* .secrets(BitbucketServerConfigSecretsArgs.builder()
* .adminAccessTokenVersionName("projects/myProject/secrets/mybbspat/versions/1")
* .readAccessTokenVersionName("projects/myProject/secrets/mybbspat/versions/1")
* .webhookSecretVersionName("projects/myProject/secrets/mybbspat/versions/1")
* .build())
* .username("test")
* .apiKey("")
* .connectedRepositories(
* BitbucketServerConfigConnectedRepositoryArgs.builder()
* .projectKey("DEV")
* .repoSlug("repo1")
* .build(),
* BitbucketServerConfigConnectedRepositoryArgs.builder()
* .projectKey("PROD")
* .repoSlug("repo1")
* .build())
* .build());
* }
* }
* ```
* ```yaml
* resources:
* bbs-config-with-repos:
* type: gcp:cloudbuild:BitbucketServerConfig
* properties:
* 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:
* 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",
* disableOnDestroy: false,
* });
* 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: "",
* 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],
* });
* ```
* ```python
* import pulumi
* import pulumi_gcp as gcp
* import pulumi_std as std
* project = gcp.organizations.get_project()
* servicenetworking = gcp.projects.Service("servicenetworking",
* service="servicenetworking.googleapis.com",
* disable_on_destroy=False)
* vpc_network = gcp.compute.Network("vpc_network", name="vpc-network",
* opts = pulumi.ResourceOptions(depends_on=[servicenetworking]))
* private_ip_alloc = gcp.compute.GlobalAddress("private_ip_alloc",
* name="private-ip-alloc",
* purpose="VPC_PEERING",
* address_type="INTERNAL",
* prefix_length=16,
* network=vpc_network.id)
* default = gcp.servicenetworking.Connection("default",
* network=vpc_network.id,
* service="servicenetworking.googleapis.com",
* reserved_peering_ranges=[private_ip_alloc.name],
* opts = pulumi.ResourceOptions(depends_on=[servicenetworking]))
* bbs_config_with_peered_network = gcp.cloudbuild.BitbucketServerConfig("bbs-config-with-peered-network",
* config_id="bbs-config",
* location="us-central1",
* host_uri="https://bbs.com",
* secrets={
* "admin_access_token_version_name": "projects/myProject/secrets/mybbspat/versions/1",
* "read_access_token_version_name": "projects/myProject/secrets/mybbspat/versions/1",
* "webhook_secret_version_name": "projects/myProject/secrets/mybbspat/versions/1",
* },
* username="test",
* api_key="",
* peered_network=vpc_network.id.apply(lambda id: std.replace_output(text=id,
* search=project.name,
* replace=project.number)).apply(lambda invoke: invoke.result),
* ssl_ca="""-----BEGIN CERTIFICATE-----
* -----END CERTIFICATE-----
* -----BEGIN CERTIFICATE-----
* -----END CERTIFICATE-----
* """,
* opts = pulumi.ResourceOptions(depends_on=[default]))
* ```
* ```csharp
* using System.Collections.Generic;
* using System.Linq;
* using Pulumi;
* using Gcp = Pulumi.Gcp;
* using Std = Pulumi.Std;
* return await Deployment.RunAsync(() =>
* {
* var project = Gcp.Organizations.GetProject.Invoke();
* var servicenetworking = new Gcp.Projects.Service("servicenetworking", new()
* {
* ServiceName = "servicenetworking.googleapis.com",
* DisableOnDestroy = false,
* });
* var vpcNetwork = new Gcp.Compute.Network("vpc_network", new()
* {
* Name = "vpc-network",
* }, new CustomResourceOptions
* {
* DependsOn =
* {
* servicenetworking,
* },
* });
* var privateIpAlloc = new Gcp.Compute.GlobalAddress("private_ip_alloc", new()
* {
* Name = "private-ip-alloc",
* Purpose = "VPC_PEERING",
* AddressType = "INTERNAL",
* PrefixLength = 16,
* Network = vpcNetwork.Id,
* });
* var @default = new Gcp.ServiceNetworking.Connection("default", new()
* {
* Network = vpcNetwork.Id,
* Service = "servicenetworking.googleapis.com",
* ReservedPeeringRanges = new[]
* {
* privateIpAlloc.Name,
* },
* }, new CustomResourceOptions
* {
* DependsOn =
* {
* servicenetworking,
* },
* });
* var bbs_config_with_peered_network = new Gcp.CloudBuild.BitbucketServerConfig("bbs-config-with-peered-network", new()
* {
* ConfigId = "bbs-config",
* Location = "us-central1",
* HostUri = "https://bbs.com",
* Secrets = new Gcp.CloudBuild.Inputs.BitbucketServerConfigSecretsArgs
* {
* AdminAccessTokenVersionName = "projects/myProject/secrets/mybbspat/versions/1",
* ReadAccessTokenVersionName = "projects/myProject/secrets/mybbspat/versions/1",
* WebhookSecretVersionName = "projects/myProject/secrets/mybbspat/versions/1",
* },
* Username = "test",
* ApiKey = "",
* PeeredNetwork = Output.Tuple(vpcNetwork.Id, project, project).Apply(values =>
* {
* var id = values.Item1;
* var project = values.Item2;
* var project1 = values.Item3;
* return Std.Replace.Invoke(new()
* {
* Text = id,
* Search = project.Apply(getProjectResult => getProjectResult.Name),
* Replace = project1.Number,
* });
* }).Apply(invoke => invoke.Result),
* SslCa = @"-----BEGIN CERTIFICATE-----
* -----END CERTIFICATE-----
* -----BEGIN CERTIFICATE-----
* -----END CERTIFICATE-----
* ",
* }, new CustomResourceOptions
* {
* DependsOn =
* {
* @default,
* },
* });
* });
* ```
* ```go
* package main
* import (
* "github.com/pulumi/pulumi-gcp/sdk/v7/go/gcp/cloudbuild"
* "github.com/pulumi/pulumi-gcp/sdk/v7/go/gcp/compute"
* "github.com/pulumi/pulumi-gcp/sdk/v7/go/gcp/organizations"
* "github.com/pulumi/pulumi-gcp/sdk/v7/go/gcp/projects"
* "github.com/pulumi/pulumi-gcp/sdk/v7/go/gcp/servicenetworking"
* "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 {
* project, err := organizations.LookupProject(ctx, nil, nil)
* if err != nil {
* return err
* }
* servicenetworking, err := projects.NewService(ctx, "servicenetworking", &projects.ServiceArgs{
* Service: pulumi.String("servicenetworking.googleapis.com"),
* DisableOnDestroy: pulumi.Bool(false),
* })
* if err != nil {
* return err
* }
* vpcNetwork, err := compute.NewNetwork(ctx, "vpc_network", &compute.NetworkArgs{
* Name: pulumi.String("vpc-network"),
* }, pulumi.DependsOn([]pulumi.Resource{
* servicenetworking,
* }))
* if err != nil {
* return err
* }
* privateIpAlloc, err := compute.NewGlobalAddress(ctx, "private_ip_alloc", &compute.GlobalAddressArgs{
* Name: pulumi.String("private-ip-alloc"),
* Purpose: pulumi.String("VPC_PEERING"),
* AddressType: pulumi.String("INTERNAL"),
* PrefixLength: pulumi.Int(16),
* Network: vpcNetwork.ID(),
* })
* if err != nil {
* return err
* }
* _, err = servicenetworking.NewConnection(ctx, "default", &servicenetworking.ConnectionArgs{
* Network: vpcNetwork.ID(),
* Service: pulumi.String("servicenetworking.googleapis.com"),
* ReservedPeeringRanges: pulumi.StringArray{
* privateIpAlloc.Name,
* },
* }, pulumi.DependsOn([]pulumi.Resource{
* servicenetworking,
* }))
* if err != nil {
* return err
* }
* _, err = cloudbuild.NewBitbucketServerConfig(ctx, "bbs-config-with-peered-network", &cloudbuild.BitbucketServerConfigArgs{
* ConfigId: pulumi.String("bbs-config"),
* Location: pulumi.String("us-central1"),
* HostUri: pulumi.String("https://bbs.com"),
* Secrets: &cloudbuild.BitbucketServerConfigSecretsArgs{
* AdminAccessTokenVersionName: pulumi.String("projects/myProject/secrets/mybbspat/versions/1"),
* ReadAccessTokenVersionName: pulumi.String("projects/myProject/secrets/mybbspat/versions/1"),
* WebhookSecretVersionName: pulumi.String("projects/myProject/secrets/mybbspat/versions/1"),
* },
* Username: pulumi.String("test"),
* ApiKey: pulumi.String(""),
* PeeredNetwork: pulumi.String(vpcNetwork.ID().ApplyT(func(id string) (std.ReplaceResult, error) {
* return std.ReplaceResult(interface{}(std.ReplaceOutput(ctx, std.ReplaceOutputArgs{
* Text: id,
* Search: project.Name,
* Replace: project.Number,
* }, nil))), nil
* }).(std.ReplaceResultOutput).ApplyT(func(invoke std.ReplaceResult) (*string, error) {
* return invoke.Result, nil
* }).(pulumi.StringPtrOutput)),
* SslCa: pulumi.String("-----BEGIN CERTIFICATE-----\n-----END CERTIFICATE-----\n-----BEGIN CERTIFICATE-----\n-----END CERTIFICATE-----\n"),
* }, pulumi.DependsOn([]pulumi.Resource{
* _default,
* }))
* if err != nil {
* return err
* }
* return nil
* })
* }
* ```
* ```java
* package generated_program;
* import com.pulumi.Context;
* import com.pulumi.Pulumi;
* import com.pulumi.core.Output;
* import com.pulumi.gcp.organizations.OrganizationsFunctions;
* import com.pulumi.gcp.organizations.inputs.GetProjectArgs;
* import com.pulumi.gcp.projects.Service;
* import com.pulumi.gcp.projects.ServiceArgs;
* import com.pulumi.gcp.compute.Network;
* import com.pulumi.gcp.compute.NetworkArgs;
* import com.pulumi.gcp.compute.GlobalAddress;
* import com.pulumi.gcp.compute.GlobalAddressArgs;
* import com.pulumi.gcp.servicenetworking.Connection;
* import com.pulumi.gcp.servicenetworking.ConnectionArgs;
* import com.pulumi.gcp.cloudbuild.BitbucketServerConfig;
* import com.pulumi.gcp.cloudbuild.BitbucketServerConfigArgs;
* import com.pulumi.gcp.cloudbuild.inputs.BitbucketServerConfigSecretsArgs;
* import com.pulumi.resources.CustomResourceOptions;
* import java.util.List;
* import java.util.ArrayList;
* import java.util.Map;
* import java.io.File;
* import java.nio.file.Files;
* import java.nio.file.Paths;
* public class App {
* public static void main(String[] args) {
* Pulumi.run(App::stack);
* }
* public static void stack(Context ctx) {
* final var project = OrganizationsFunctions.getProject();
* var servicenetworking = new Service("servicenetworking", ServiceArgs.builder()
* .service("servicenetworking.googleapis.com")
* .disableOnDestroy(false)
* .build());
* var vpcNetwork = new Network("vpcNetwork", NetworkArgs.builder()
* .name("vpc-network")
* .build(), CustomResourceOptions.builder()
* .dependsOn(servicenetworking)
* .build());
* var privateIpAlloc = new GlobalAddress("privateIpAlloc", GlobalAddressArgs.builder()
* .name("private-ip-alloc")
* .purpose("VPC_PEERING")
* .addressType("INTERNAL")
* .prefixLength(16)
* .network(vpcNetwork.id())
* .build());
* var default_ = new Connection("default", ConnectionArgs.builder()
* .network(vpcNetwork.id())
* .service("servicenetworking.googleapis.com")
* .reservedPeeringRanges(privateIpAlloc.name())
* .build(), CustomResourceOptions.builder()
* .dependsOn(servicenetworking)
* .build());
* var bbs_config_with_peered_network = new BitbucketServerConfig("bbs-config-with-peered-network", BitbucketServerConfigArgs.builder()
* .configId("bbs-config")
* .location("us-central1")
* .hostUri("https://bbs.com")
* .secrets(BitbucketServerConfigSecretsArgs.builder()
* .adminAccessTokenVersionName("projects/myProject/secrets/mybbspat/versions/1")
* .readAccessTokenVersionName("projects/myProject/secrets/mybbspat/versions/1")
* .webhookSecretVersionName("projects/myProject/secrets/mybbspat/versions/1")
* .build())
* .username("test")
* .apiKey("")
* .peeredNetwork(vpcNetwork.id().applyValue(id -> StdFunctions.replace()).applyValue(invoke -> invoke.result()))
* .sslCa("""
* -----BEGIN CERTIFICATE-----
* -----END CERTIFICATE-----
* -----BEGIN CERTIFICATE-----
* -----END CERTIFICATE-----
* """)
* .build(), CustomResourceOptions.builder()
* .dependsOn(default_)
* .build());
* }
* }
* ```
* ```yaml
* resources:
* servicenetworking:
* type: gcp:projects:Service
* properties:
* service: servicenetworking.googleapis.com
* disableOnDestroy: false
* vpcNetwork:
* type: gcp:compute:Network
* name: vpc_network
* properties:
* name: vpc-network
* options:
* dependson:
* - ${servicenetworking}
* privateIpAlloc:
* type: gcp:compute:GlobalAddress
* name: private_ip_alloc
* properties:
* name: private-ip-alloc
* purpose: VPC_PEERING
* addressType: INTERNAL
* prefixLength: 16
* network: ${vpcNetwork.id}
* default:
* type: gcp:servicenetworking:Connection
* properties:
* network: ${vpcNetwork.id}
* service: servicenetworking.googleapis.com
* reservedPeeringRanges:
* - ${privateIpAlloc.name}
* options:
* dependson:
* - ${servicenetworking}
* bbs-config-with-peered-network:
* type: gcp:cloudbuild:BitbucketServerConfig
* properties:
* 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:
* peeredNetwork:
* fn::invoke:
* Function: std:replace
* Arguments:
* text: ${vpcNetwork.id}
* search: ${project.name}
* replace: ${project.number}
* Return: result
* sslCa: |
* -----BEGIN CERTIFICATE-----
* -----END CERTIFICATE-----
* -----BEGIN CERTIFICATE-----
* -----END CERTIFICATE-----
* options:
* dependson:
* - ${default}
* variables:
* project:
* fn::invoke:
* Function: gcp:organizations:getProject
* Arguments: {}
* ```
*
* ## 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}}
* ```
* @property apiKey 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.
* @property configId The ID to use for the BitbucketServerConfig, which will become the final component of the BitbucketServerConfig's resource name.
* @property connectedRepositories Connected Bitbucket Server repositories for this config.
* @property hostUri 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.
* @property location The location of this bitbucket server config.
* @property peeredNetwork 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.
* @property project
* @property secrets Secret Manager secrets needed by the config.
* Structure is documented below.
* @property sslCa 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.
* @property username Username of the account Cloud Build will use on Bitbucket Server.
*/
public data class BitbucketServerConfigArgs(
public val apiKey: Output? = null,
public val configId: Output? = null,
public val connectedRepositories: Output>? =
null,
public val hostUri: Output? = null,
public val location: Output? = null,
public val peeredNetwork: Output? = null,
public val project: Output? = null,
public val secrets: Output? = null,
public val sslCa: Output? = null,
public val username: Output? = null,
) : ConvertibleToJava {
override fun toJava(): com.pulumi.gcp.cloudbuild.BitbucketServerConfigArgs =
com.pulumi.gcp.cloudbuild.BitbucketServerConfigArgs.builder()
.apiKey(apiKey?.applyValue({ args0 -> args0 }))
.configId(configId?.applyValue({ args0 -> args0 }))
.connectedRepositories(
connectedRepositories?.applyValue({ args0 ->
args0.map({ args0 ->
args0.let({ args0 -> args0.toJava() })
})
}),
)
.hostUri(hostUri?.applyValue({ args0 -> args0 }))
.location(location?.applyValue({ args0 -> args0 }))
.peeredNetwork(peeredNetwork?.applyValue({ args0 -> args0 }))
.project(project?.applyValue({ args0 -> args0 }))
.secrets(secrets?.applyValue({ args0 -> args0.let({ args0 -> args0.toJava() }) }))
.sslCa(sslCa?.applyValue({ args0 -> args0 }))
.username(username?.applyValue({ args0 -> args0 })).build()
}
/**
* Builder for [BitbucketServerConfigArgs].
*/
@PulumiTagMarker
public class BitbucketServerConfigArgsBuilder internal constructor() {
private var apiKey: Output? = null
private var configId: Output? = null
private var connectedRepositories: Output>? =
null
private var hostUri: Output? = null
private var location: Output? = null
private var peeredNetwork: Output? = null
private var project: Output? = null
private var secrets: Output? = null
private var sslCa: Output? = null
private var username: Output? = null
/**
* @param value 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.
*/
@JvmName("ginuixycqrybcwgp")
public suspend fun apiKey(`value`: Output) {
this.apiKey = value
}
/**
* @param value The ID to use for the BitbucketServerConfig, which will become the final component of the BitbucketServerConfig's resource name.
*/
@JvmName("mtytybsyoxuywfxx")
public suspend fun configId(`value`: Output) {
this.configId = value
}
/**
* @param value Connected Bitbucket Server repositories for this config.
*/
@JvmName("iimntcfidbopijvr")
public suspend fun connectedRepositories(`value`: Output>) {
this.connectedRepositories = value
}
@JvmName("mxokpaldfekvxmhf")
public suspend fun connectedRepositories(vararg values: Output) {
this.connectedRepositories = Output.all(values.asList())
}
/**
* @param values Connected Bitbucket Server repositories for this config.
*/
@JvmName("ntvomcajugbjjlag")
public suspend fun connectedRepositories(values: List>) {
this.connectedRepositories = Output.all(values)
}
/**
* @param value 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.
*/
@JvmName("jcfavhagridnfpkh")
public suspend fun hostUri(`value`: Output) {
this.hostUri = value
}
/**
* @param value The location of this bitbucket server config.
*/
@JvmName("gdcadwdfualxulje")
public suspend fun location(`value`: Output) {
this.location = value
}
/**
* @param value 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.
*/
@JvmName("qgfghdjquqisjhby")
public suspend fun peeredNetwork(`value`: Output) {
this.peeredNetwork = value
}
/**
* @param value
*/
@JvmName("snaykfhmevtdmyny")
public suspend fun project(`value`: Output) {
this.project = value
}
/**
* @param value Secret Manager secrets needed by the config.
* Structure is documented below.
*/
@JvmName("ccufyaygxgcmielj")
public suspend fun secrets(`value`: Output) {
this.secrets = value
}
/**
* @param value 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.
*/
@JvmName("fiwjapulafuhacon")
public suspend fun sslCa(`value`: Output) {
this.sslCa = value
}
/**
* @param value Username of the account Cloud Build will use on Bitbucket Server.
*/
@JvmName("begdqbgkvcxrnjof")
public suspend fun username(`value`: Output) {
this.username = value
}
/**
* @param value 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.
*/
@JvmName("dairpidvsttwgmdd")
public suspend fun apiKey(`value`: String?) {
val toBeMapped = value
val mapped = toBeMapped?.let({ args0 -> of(args0) })
this.apiKey = mapped
}
/**
* @param value The ID to use for the BitbucketServerConfig, which will become the final component of the BitbucketServerConfig's resource name.
*/
@JvmName("kbbrfqnpokqdqlgk")
public suspend fun configId(`value`: String?) {
val toBeMapped = value
val mapped = toBeMapped?.let({ args0 -> of(args0) })
this.configId = mapped
}
/**
* @param value Connected Bitbucket Server repositories for this config.
*/
@JvmName("fjkiltaswtejjmwo")
public suspend fun connectedRepositories(`value`: List?) {
val toBeMapped = value
val mapped = toBeMapped?.let({ args0 -> of(args0) })
this.connectedRepositories = mapped
}
/**
* @param argument Connected Bitbucket Server repositories for this config.
*/
@JvmName("rtfinkmkjpfxhqpy")
public suspend fun connectedRepositories(argument: List Unit>) {
val toBeMapped = argument.toList().map {
BitbucketServerConfigConnectedRepositoryArgsBuilder().applySuspend { it() }.build()
}
val mapped = of(toBeMapped)
this.connectedRepositories = mapped
}
/**
* @param argument Connected Bitbucket Server repositories for this config.
*/
@JvmName("gylyissugxqisulc")
public suspend fun connectedRepositories(vararg argument: suspend BitbucketServerConfigConnectedRepositoryArgsBuilder.() -> Unit) {
val toBeMapped = argument.toList().map {
BitbucketServerConfigConnectedRepositoryArgsBuilder().applySuspend { it() }.build()
}
val mapped = of(toBeMapped)
this.connectedRepositories = mapped
}
/**
* @param argument Connected Bitbucket Server repositories for this config.
*/
@JvmName("dyvmwroduayegrdo")
public suspend fun connectedRepositories(argument: suspend BitbucketServerConfigConnectedRepositoryArgsBuilder.() -> Unit) {
val toBeMapped = listOf(
BitbucketServerConfigConnectedRepositoryArgsBuilder().applySuspend {
argument()
}.build(),
)
val mapped = of(toBeMapped)
this.connectedRepositories = mapped
}
/**
* @param values Connected Bitbucket Server repositories for this config.
*/
@JvmName("pimakjmwqgtsxtex")
public suspend fun connectedRepositories(vararg values: BitbucketServerConfigConnectedRepositoryArgs) {
val toBeMapped = values.toList()
val mapped = toBeMapped.let({ args0 -> of(args0) })
this.connectedRepositories = mapped
}
/**
* @param value 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.
*/
@JvmName("ykouqscqputxhiwv")
public suspend fun hostUri(`value`: String?) {
val toBeMapped = value
val mapped = toBeMapped?.let({ args0 -> of(args0) })
this.hostUri = mapped
}
/**
* @param value The location of this bitbucket server config.
*/
@JvmName("nrfqvyvbsahnijmx")
public suspend fun location(`value`: String?) {
val toBeMapped = value
val mapped = toBeMapped?.let({ args0 -> of(args0) })
this.location = mapped
}
/**
* @param value 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.
*/
@JvmName("qsukpwhsqxpmhwju")
public suspend fun peeredNetwork(`value`: String?) {
val toBeMapped = value
val mapped = toBeMapped?.let({ args0 -> of(args0) })
this.peeredNetwork = mapped
}
/**
* @param value
*/
@JvmName("yyjidamvggtbymwf")
public suspend fun project(`value`: String?) {
val toBeMapped = value
val mapped = toBeMapped?.let({ args0 -> of(args0) })
this.project = mapped
}
/**
* @param value Secret Manager secrets needed by the config.
* Structure is documented below.
*/
@JvmName("gjtsumirpddjnidr")
public suspend fun secrets(`value`: BitbucketServerConfigSecretsArgs?) {
val toBeMapped = value
val mapped = toBeMapped?.let({ args0 -> of(args0) })
this.secrets = mapped
}
/**
* @param argument Secret Manager secrets needed by the config.
* Structure is documented below.
*/
@JvmName("eavwehhvqbnducad")
public suspend fun secrets(argument: suspend BitbucketServerConfigSecretsArgsBuilder.() -> Unit) {
val toBeMapped = BitbucketServerConfigSecretsArgsBuilder().applySuspend { argument() }.build()
val mapped = of(toBeMapped)
this.secrets = mapped
}
/**
* @param value 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.
*/
@JvmName("gwmhskxngpctpuvq")
public suspend fun sslCa(`value`: String?) {
val toBeMapped = value
val mapped = toBeMapped?.let({ args0 -> of(args0) })
this.sslCa = mapped
}
/**
* @param value Username of the account Cloud Build will use on Bitbucket Server.
*/
@JvmName("qvvjmxgvniebyloo")
public suspend fun username(`value`: String?) {
val toBeMapped = value
val mapped = toBeMapped?.let({ args0 -> of(args0) })
this.username = mapped
}
internal fun build(): BitbucketServerConfigArgs = BitbucketServerConfigArgs(
apiKey = apiKey,
configId = configId,
connectedRepositories = connectedRepositories,
hostUri = hostUri,
location = location,
peeredNetwork = peeredNetwork,
project = project,
secrets = secrets,
sslCa = sslCa,
username = username,
)
}