All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.pulumi.gcp.activedirectory.kotlin.PeeringArgs.kt Maven / Gradle / Ivy

Go to download

Build cloud applications and infrastructure by combining the safety and reliability of infrastructure as code with the power of the Kotlin programming language.

There is a newer version: 8.10.0.0
Show newest version
@file:Suppress("NAME_SHADOWING", "DEPRECATION")

package com.pulumi.gcp.activedirectory.kotlin

import com.pulumi.core.Output
import com.pulumi.core.Output.of
import com.pulumi.gcp.activedirectory.PeeringArgs.builder
import com.pulumi.kotlin.ConvertibleToJava
import com.pulumi.kotlin.PulumiTagMarker
import kotlin.Pair
import kotlin.String
import kotlin.Suppress
import kotlin.collections.Map
import kotlin.jvm.JvmName

/**
 * ## Example Usage
 * ### Active Directory Peering Basic
 * 
 * ```typescript
 * import * as pulumi from "@pulumi/pulumi";
 * import * as gcp from "@pulumi/gcp";
 * const source_network = new gcp.compute.Network("source-network", {name: "ad-network"});
 * const ad_domain = new gcp.activedirectory.Domain("ad-domain", {
 *     domainName: "ad.test.hashicorptest.com",
 *     locations: ["us-central1"],
 *     reservedIpRange: "192.168.255.0/24",
 *     authorizedNetworks: [source_network.id],
 * });
 * const peered_project = new gcp.organizations.Project("peered-project", {
 *     name: "my-peered-project",
 *     projectId: "my-peered-project",
 *     orgId: "123456789",
 *     billingAccount: "000000-0000000-0000000-000000",
 * });
 * const compute = new gcp.projects.Service("compute", {
 *     project: peered_project.projectId,
 *     service: "compute.googleapis.com",
 * });
 * const peered_network = new gcp.compute.Network("peered-network", {
 *     project: compute.project,
 *     name: "ad-peered-network",
 * });
 * const ad_domain_peering = new gcp.activedirectory.Peering("ad-domain-peering", {
 *     domainResource: ad_domain.name,
 *     peeringId: "ad-domain-peering",
 *     authorizedNetwork: peered_network.id,
 *     labels: {
 *         foo: "bar",
 *     },
 * });
 * ```
 * ```python
 * import pulumi
 * import pulumi_gcp as gcp
 * source_network = gcp.compute.Network("source-network", name="ad-network")
 * ad_domain = gcp.activedirectory.Domain("ad-domain",
 *     domain_name="ad.test.hashicorptest.com",
 *     locations=["us-central1"],
 *     reserved_ip_range="192.168.255.0/24",
 *     authorized_networks=[source_network.id])
 * peered_project = gcp.organizations.Project("peered-project",
 *     name="my-peered-project",
 *     project_id="my-peered-project",
 *     org_id="123456789",
 *     billing_account="000000-0000000-0000000-000000")
 * compute = gcp.projects.Service("compute",
 *     project=peered_project.project_id,
 *     service="compute.googleapis.com")
 * peered_network = gcp.compute.Network("peered-network",
 *     project=compute.project,
 *     name="ad-peered-network")
 * ad_domain_peering = gcp.activedirectory.Peering("ad-domain-peering",
 *     domain_resource=ad_domain.name,
 *     peering_id="ad-domain-peering",
 *     authorized_network=peered_network.id,
 *     labels={
 *         "foo": "bar",
 *     })
 * ```
 * ```csharp
 * using System.Collections.Generic;
 * using System.Linq;
 * using Pulumi;
 * using Gcp = Pulumi.Gcp;
 * return await Deployment.RunAsync(() =>
 * {
 *     var source_network = new Gcp.Compute.Network("source-network", new()
 *     {
 *         Name = "ad-network",
 *     });
 *     var ad_domain = new Gcp.ActiveDirectory.Domain("ad-domain", new()
 *     {
 *         DomainName = "ad.test.hashicorptest.com",
 *         Locations = new[]
 *         {
 *             "us-central1",
 *         },
 *         ReservedIpRange = "192.168.255.0/24",
 *         AuthorizedNetworks = new[]
 *         {
 *             source_network.Id,
 *         },
 *     });
 *     var peered_project = new Gcp.Organizations.Project("peered-project", new()
 *     {
 *         Name = "my-peered-project",
 *         ProjectId = "my-peered-project",
 *         OrgId = "123456789",
 *         BillingAccount = "000000-0000000-0000000-000000",
 *     });
 *     var compute = new Gcp.Projects.Service("compute", new()
 *     {
 *         Project = peered_project.ProjectId,
 *         ServiceName = "compute.googleapis.com",
 *     });
 *     var peered_network = new Gcp.Compute.Network("peered-network", new()
 *     {
 *         Project = compute.Project,
 *         Name = "ad-peered-network",
 *     });
 *     var ad_domain_peering = new Gcp.ActiveDirectory.Peering("ad-domain-peering", new()
 *     {
 *         DomainResource = ad_domain.Name,
 *         PeeringId = "ad-domain-peering",
 *         AuthorizedNetwork = peered_network.Id,
 *         Labels =
 *         {
 *             { "foo", "bar" },
 *         },
 *     });
 * });
 * ```
 * ```go
 * package main
 * import (
 * 	"github.com/pulumi/pulumi-gcp/sdk/v7/go/gcp/activedirectory"
 * 	"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/sdk/v3/go/pulumi"
 * )
 * func main() {
 * 	pulumi.Run(func(ctx *pulumi.Context) error {
 * 		_, err := compute.NewNetwork(ctx, "source-network", &compute.NetworkArgs{
 * 			Name: pulumi.String("ad-network"),
 * 		})
 * 		if err != nil {
 * 			return err
 * 		}
 * 		_, err = activedirectory.NewDomain(ctx, "ad-domain", &activedirectory.DomainArgs{
 * 			DomainName: pulumi.String("ad.test.hashicorptest.com"),
 * 			Locations: pulumi.StringArray{
 * 				pulumi.String("us-central1"),
 * 			},
 * 			ReservedIpRange: pulumi.String("192.168.255.0/24"),
 * 			AuthorizedNetworks: pulumi.StringArray{
 * 				source_network.ID(),
 * 			},
 * 		})
 * 		if err != nil {
 * 			return err
 * 		}
 * 		_, err = organizations.NewProject(ctx, "peered-project", &organizations.ProjectArgs{
 * 			Name:           pulumi.String("my-peered-project"),
 * 			ProjectId:      pulumi.String("my-peered-project"),
 * 			OrgId:          pulumi.String("123456789"),
 * 			BillingAccount: pulumi.String("000000-0000000-0000000-000000"),
 * 		})
 * 		if err != nil {
 * 			return err
 * 		}
 * 		compute, err := projects.NewService(ctx, "compute", &projects.ServiceArgs{
 * 			Project: peered_project.ProjectId,
 * 			Service: pulumi.String("compute.googleapis.com"),
 * 		})
 * 		if err != nil {
 * 			return err
 * 		}
 * 		_, err = compute.NewNetwork(ctx, "peered-network", &compute.NetworkArgs{
 * 			Project: compute.Project,
 * 			Name:    pulumi.String("ad-peered-network"),
 * 		})
 * 		if err != nil {
 * 			return err
 * 		}
 * 		_, err = activedirectory.NewPeering(ctx, "ad-domain-peering", &activedirectory.PeeringArgs{
 * 			DomainResource:    ad_domain.Name,
 * 			PeeringId:         pulumi.String("ad-domain-peering"),
 * 			AuthorizedNetwork: peered_network.ID(),
 * 			Labels: pulumi.StringMap{
 * 				"foo": pulumi.String("bar"),
 * 			},
 * 		})
 * 		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.compute.Network;
 * import com.pulumi.gcp.compute.NetworkArgs;
 * import com.pulumi.gcp.activedirectory.Domain;
 * import com.pulumi.gcp.activedirectory.DomainArgs;
 * import com.pulumi.gcp.organizations.Project;
 * import com.pulumi.gcp.organizations.ProjectArgs;
 * import com.pulumi.gcp.projects.Service;
 * import com.pulumi.gcp.projects.ServiceArgs;
 * import com.pulumi.gcp.activedirectory.Peering;
 * import com.pulumi.gcp.activedirectory.PeeringArgs;
 * 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 source_network = new Network("source-network", NetworkArgs.builder()
 *             .name("ad-network")
 *             .build());
 *         var ad_domain = new Domain("ad-domain", DomainArgs.builder()
 *             .domainName("ad.test.hashicorptest.com")
 *             .locations("us-central1")
 *             .reservedIpRange("192.168.255.0/24")
 *             .authorizedNetworks(source_network.id())
 *             .build());
 *         var peered_project = new Project("peered-project", ProjectArgs.builder()
 *             .name("my-peered-project")
 *             .projectId("my-peered-project")
 *             .orgId("123456789")
 *             .billingAccount("000000-0000000-0000000-000000")
 *             .build());
 *         var compute = new Service("compute", ServiceArgs.builder()
 *             .project(peered_project.projectId())
 *             .service("compute.googleapis.com")
 *             .build());
 *         var peered_network = new Network("peered-network", NetworkArgs.builder()
 *             .project(compute.project())
 *             .name("ad-peered-network")
 *             .build());
 *         var ad_domain_peering = new Peering("ad-domain-peering", PeeringArgs.builder()
 *             .domainResource(ad_domain.name())
 *             .peeringId("ad-domain-peering")
 *             .authorizedNetwork(peered_network.id())
 *             .labels(Map.of("foo", "bar"))
 *             .build());
 *     }
 * }
 * ```
 * ```yaml
 * resources:
 *   ad-domain-peering:
 *     type: gcp:activedirectory:Peering
 *     properties:
 *       domainResource: ${["ad-domain"].name}
 *       peeringId: ad-domain-peering
 *       authorizedNetwork: ${["peered-network"].id}
 *       labels:
 *         foo: bar
 *   ad-domain:
 *     type: gcp:activedirectory:Domain
 *     properties:
 *       domainName: ad.test.hashicorptest.com
 *       locations:
 *         - us-central1
 *       reservedIpRange: 192.168.255.0/24
 *       authorizedNetworks:
 *         - ${["source-network"].id}
 *   peered-network:
 *     type: gcp:compute:Network
 *     properties:
 *       project: ${compute.project}
 *       name: ad-peered-network
 *   source-network:
 *     type: gcp:compute:Network
 *     properties:
 *       name: ad-network
 *   compute:
 *     type: gcp:projects:Service
 *     properties:
 *       project: ${["peered-project"].projectId}
 *       service: compute.googleapis.com
 *   peered-project:
 *     type: gcp:organizations:Project
 *     properties:
 *       name: my-peered-project
 *       projectId: my-peered-project
 *       orgId: '123456789'
 *       billingAccount: 000000-0000000-0000000-000000
 * ```
 * 
 * ## Import
 * This resource does not support import.
 * @property authorizedNetwork The full names of the Google Compute Engine networks to which the instance is connected. Caller needs to make sure that CIDR subnets do not overlap between networks, else peering creation will fail.
 * @property domainResource Full domain resource path for the Managed AD Domain involved in peering. The resource path should be in the form projects/{projectId}/locations/global/domains/{domainName}
 * @property labels Resource labels that can contain user-provided metadata
 * **Note**: This field is non-authoritative, and will only manage the labels present in your configuration.
 * Please refer to the field `effective_labels` for all of the labels present on the resource.
 * @property peeringId - - -
 * @property project The ID of the project in which the resource belongs.
 * If it is not provided, the provider project is used.
 * @property status The current state of this Peering.
 * @property statusMessage Additional information about the current status of this peering, if available.
 */
public data class PeeringArgs(
    public val authorizedNetwork: Output? = null,
    public val domainResource: Output? = null,
    public val labels: Output>? = null,
    public val peeringId: Output? = null,
    public val project: Output? = null,
    public val status: Output? = null,
    public val statusMessage: Output? = null,
) : ConvertibleToJava {
    override fun toJava(): com.pulumi.gcp.activedirectory.PeeringArgs =
        com.pulumi.gcp.activedirectory.PeeringArgs.builder()
            .authorizedNetwork(authorizedNetwork?.applyValue({ args0 -> args0 }))
            .domainResource(domainResource?.applyValue({ args0 -> args0 }))
            .labels(labels?.applyValue({ args0 -> args0.map({ args0 -> args0.key.to(args0.value) }).toMap() }))
            .peeringId(peeringId?.applyValue({ args0 -> args0 }))
            .project(project?.applyValue({ args0 -> args0 }))
            .status(status?.applyValue({ args0 -> args0 }))
            .statusMessage(statusMessage?.applyValue({ args0 -> args0 })).build()
}

/**
 * Builder for [PeeringArgs].
 */
@PulumiTagMarker
public class PeeringArgsBuilder internal constructor() {
    private var authorizedNetwork: Output? = null

    private var domainResource: Output? = null

    private var labels: Output>? = null

    private var peeringId: Output? = null

    private var project: Output? = null

    private var status: Output? = null

    private var statusMessage: Output? = null

    /**
     * @param value The full names of the Google Compute Engine networks to which the instance is connected. Caller needs to make sure that CIDR subnets do not overlap between networks, else peering creation will fail.
     */
    @JvmName("rwqqvdlybekbsogs")
    public suspend fun authorizedNetwork(`value`: Output) {
        this.authorizedNetwork = value
    }

    /**
     * @param value Full domain resource path for the Managed AD Domain involved in peering. The resource path should be in the form projects/{projectId}/locations/global/domains/{domainName}
     */
    @JvmName("utejgvopuetireyc")
    public suspend fun domainResource(`value`: Output) {
        this.domainResource = value
    }

    /**
     * @param value Resource labels that can contain user-provided metadata
     * **Note**: This field is non-authoritative, and will only manage the labels present in your configuration.
     * Please refer to the field `effective_labels` for all of the labels present on the resource.
     */
    @JvmName("cjjdgsyuetjfnqto")
    public suspend fun labels(`value`: Output>) {
        this.labels = value
    }

    /**
     * @param value - - -
     */
    @JvmName("oluwblbnwaloaech")
    public suspend fun peeringId(`value`: Output) {
        this.peeringId = value
    }

    /**
     * @param value The ID of the project in which the resource belongs.
     * If it is not provided, the provider project is used.
     */
    @JvmName("pxwkvwnomvnorwwk")
    public suspend fun project(`value`: Output) {
        this.project = value
    }

    /**
     * @param value The current state of this Peering.
     */
    @JvmName("yyaostikuncrfmig")
    public suspend fun status(`value`: Output) {
        this.status = value
    }

    /**
     * @param value Additional information about the current status of this peering, if available.
     */
    @JvmName("fanwstkthcnurrid")
    public suspend fun statusMessage(`value`: Output) {
        this.statusMessage = value
    }

    /**
     * @param value The full names of the Google Compute Engine networks to which the instance is connected. Caller needs to make sure that CIDR subnets do not overlap between networks, else peering creation will fail.
     */
    @JvmName("qymguegyarwjxwpw")
    public suspend fun authorizedNetwork(`value`: String?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.authorizedNetwork = mapped
    }

    /**
     * @param value Full domain resource path for the Managed AD Domain involved in peering. The resource path should be in the form projects/{projectId}/locations/global/domains/{domainName}
     */
    @JvmName("riyucgeglkivvfll")
    public suspend fun domainResource(`value`: String?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.domainResource = mapped
    }

    /**
     * @param value Resource labels that can contain user-provided metadata
     * **Note**: This field is non-authoritative, and will only manage the labels present in your configuration.
     * Please refer to the field `effective_labels` for all of the labels present on the resource.
     */
    @JvmName("hhynijftskgycnuv")
    public suspend fun labels(`value`: Map?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.labels = mapped
    }

    /**
     * @param values Resource labels that can contain user-provided metadata
     * **Note**: This field is non-authoritative, and will only manage the labels present in your configuration.
     * Please refer to the field `effective_labels` for all of the labels present on the resource.
     */
    @JvmName("etyqxixixhqexrod")
    public fun labels(vararg values: Pair) {
        val toBeMapped = values.toMap()
        val mapped = toBeMapped.let({ args0 -> of(args0) })
        this.labels = mapped
    }

    /**
     * @param value - - -
     */
    @JvmName("rpigusjdyqaktxpf")
    public suspend fun peeringId(`value`: String?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.peeringId = mapped
    }

    /**
     * @param value The ID of the project in which the resource belongs.
     * If it is not provided, the provider project is used.
     */
    @JvmName("fnvvaxugdxjgguad")
    public suspend fun project(`value`: String?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.project = mapped
    }

    /**
     * @param value The current state of this Peering.
     */
    @JvmName("bdwsuacphftogixo")
    public suspend fun status(`value`: String?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.status = mapped
    }

    /**
     * @param value Additional information about the current status of this peering, if available.
     */
    @JvmName("nasoapoprdtwijxw")
    public suspend fun statusMessage(`value`: String?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.statusMessage = mapped
    }

    internal fun build(): PeeringArgs = PeeringArgs(
        authorizedNetwork = authorizedNetwork,
        domainResource = domainResource,
        labels = labels,
        peeringId = peeringId,
        project = project,
        status = status,
        statusMessage = statusMessage,
    )
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy