gcp.activedirectory.Peering
Explore with Pulumi AI
Import
This resource does not support import.
Example Usage
Active Directory Peering Basic
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()
{
}, new CustomResourceOptions
{
Provider = google_beta,
});
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,
},
}, new CustomResourceOptions
{
Provider = google_beta,
});
var peered_project = new Gcp.Organizations.Project("peered-project", new()
{
ProjectId = "my-peered-project",
OrgId = "123456789",
BillingAccount = "000000-0000000-0000000-000000",
}, new CustomResourceOptions
{
Provider = google_beta,
});
var compute = new Gcp.Projects.Service("compute", new()
{
Project = peered_project.ProjectId,
ServiceName = "compute.googleapis.com",
}, new CustomResourceOptions
{
Provider = google_beta,
});
var peered_network = new Gcp.Compute.Network("peered-network", new()
{
Project = compute.Project,
}, new CustomResourceOptions
{
Provider = google_beta,
});
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" },
},
}, new CustomResourceOptions
{
Provider = google_beta,
});
});
package main
import (
"github.com/pulumi/pulumi-gcp/sdk/v6/go/gcp/activedirectory"
"github.com/pulumi/pulumi-gcp/sdk/v6/go/gcp/compute"
"github.com/pulumi/pulumi-gcp/sdk/v6/go/gcp/organizations"
"github.com/pulumi/pulumi-gcp/sdk/v6/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", nil, pulumi.Provider(google_beta))
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(),
},
}, pulumi.Provider(google_beta))
if err != nil {
return err
}
_, err = organizations.NewProject(ctx, "peered-project", &organizations.ProjectArgs{
ProjectId: pulumi.String("my-peered-project"),
OrgId: pulumi.String("123456789"),
BillingAccount: pulumi.String("000000-0000000-0000000-000000"),
}, pulumi.Provider(google_beta))
if err != nil {
return err
}
compute, err := projects.NewService(ctx, "compute", &projects.ServiceArgs{
Project: peered_project.ProjectId,
Service: pulumi.String("compute.googleapis.com"),
}, pulumi.Provider(google_beta))
if err != nil {
return err
}
_, err = compute.NewNetwork(ctx, "peered-network", &compute.NetworkArgs{
Project: compute.Project,
}, pulumi.Provider(google_beta))
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"),
},
}, pulumi.Provider(google_beta))
if err != nil {
return err
}
return nil
})
}
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 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) {
var source_network = new Network("source-network", NetworkArgs.Empty, CustomResourceOptions.builder()
.provider(google_beta)
.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(), CustomResourceOptions.builder()
.provider(google_beta)
.build());
var peered_project = new Project("peered-project", ProjectArgs.builder()
.projectId("my-peered-project")
.orgId("123456789")
.billingAccount("000000-0000000-0000000-000000")
.build(), CustomResourceOptions.builder()
.provider(google_beta)
.build());
var compute = new Service("compute", ServiceArgs.builder()
.project(peered_project.projectId())
.service("compute.googleapis.com")
.build(), CustomResourceOptions.builder()
.provider(google_beta)
.build());
var peered_network = new Network("peered-network", NetworkArgs.builder()
.project(compute.project())
.build(), CustomResourceOptions.builder()
.provider(google_beta)
.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(), CustomResourceOptions.builder()
.provider(google_beta)
.build());
}
}
import pulumi
import pulumi_gcp as gcp
source_network = gcp.compute.Network("source-network", opts=pulumi.ResourceOptions(provider=google_beta))
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],
opts=pulumi.ResourceOptions(provider=google_beta))
peered_project = gcp.organizations.Project("peered-project",
project_id="my-peered-project",
org_id="123456789",
billing_account="000000-0000000-0000000-000000",
opts=pulumi.ResourceOptions(provider=google_beta))
compute = gcp.projects.Service("compute",
project=peered_project.project_id,
service="compute.googleapis.com",
opts=pulumi.ResourceOptions(provider=google_beta))
peered_network = gcp.compute.Network("peered-network", project=compute.project,
opts=pulumi.ResourceOptions(provider=google_beta))
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",
},
opts=pulumi.ResourceOptions(provider=google_beta))
import * as pulumi from "@pulumi/pulumi";
import * as gcp from "@pulumi/gcp";
const source_network = new gcp.compute.Network("source-network", {}, {
provider: google_beta,
});
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],
}, {
provider: google_beta,
});
const peered_project = new gcp.organizations.Project("peered-project", {
projectId: "my-peered-project",
orgId: "123456789",
billingAccount: "000000-0000000-0000000-000000",
}, {
provider: google_beta,
});
const compute = new gcp.projects.Service("compute", {
project: peered_project.projectId,
service: "compute.googleapis.com",
}, {
provider: google_beta,
});
const peered_network = new gcp.compute.Network("peered-network", {project: compute.project}, {
provider: google_beta,
});
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",
},
}, {
provider: google_beta,
});
resources:
ad-domain-peering:
type: gcp:activedirectory:Peering
properties:
domainResource: ${["ad-domain"].name}
peeringId: ad-domain-peering
authorizedNetwork: ${["peered-network"].id}
labels:
foo: bar
options:
provider: ${["google-beta"]}
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}
options:
provider: ${["google-beta"]}
peered-network:
type: gcp:compute:Network
properties:
project: ${compute.project}
options:
provider: ${["google-beta"]}
source-network:
type: gcp:compute:Network
options:
provider: ${["google-beta"]}
compute:
type: gcp:projects:Service
properties:
project: ${["peered-project"].projectId}
service: compute.googleapis.com
options:
provider: ${["google-beta"]}
peered-project:
type: gcp:organizations:Project
properties:
projectId: my-peered-project
orgId: '123456789'
billingAccount: 000000-0000000-0000000-000000
options:
provider: ${["google-beta"]}
Create Peering Resource
new Peering(name: string, args: PeeringArgs, opts?: CustomResourceOptions);
@overload
def Peering(resource_name: str,
opts: Optional[ResourceOptions] = None,
authorized_network: Optional[str] = None,
domain_resource: Optional[str] = None,
labels: Optional[Mapping[str, str]] = None,
peering_id: Optional[str] = None,
project: Optional[str] = None,
status: Optional[str] = None,
status_message: Optional[str] = None)
@overload
def Peering(resource_name: str,
args: PeeringArgs,
opts: Optional[ResourceOptions] = None)
func NewPeering(ctx *Context, name string, args PeeringArgs, opts ...ResourceOption) (*Peering, error)
public Peering(string name, PeeringArgs args, CustomResourceOptions? opts = null)
public Peering(String name, PeeringArgs args)
public Peering(String name, PeeringArgs args, CustomResourceOptions options)
type: gcp:activedirectory:Peering
properties: # The arguments to resource properties.
options: # Bag of options to control resource's behavior.
- name string
- The unique name of the resource.
- args PeeringArgs
- 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 PeeringArgs
- 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 PeeringArgs
- The arguments to resource properties.
- opts ResourceOption
- Bag of options to control resource's behavior.
- name string
- The unique name of the resource.
- args PeeringArgs
- The arguments to resource properties.
- opts CustomResourceOptions
- Bag of options to control resource's behavior.
- name String
- The unique name of the resource.
- args PeeringArgs
- The arguments to resource properties.
- options CustomResourceOptions
- Bag of options to control resource's behavior.
Peering 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 Peering resource accepts the following input properties:
- string
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.
- Domain
Resource string 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}
- Peering
Id string - Labels Dictionary<string, string>
Resource labels that can contain user-provided metadata
- Project string
The ID of the project in which the resource belongs. If it is not provided, the provider project is used.
- Status string
The current state of this Peering.
- Status
Message string Additional information about the current status of this peering, if available.
- string
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.
- Domain
Resource string 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}
- Peering
Id string - Labels map[string]string
Resource labels that can contain user-provided metadata
- Project string
The ID of the project in which the resource belongs. If it is not provided, the provider project is used.
- Status string
The current state of this Peering.
- Status
Message string Additional information about the current status of this peering, if available.
- String
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.
- domain
Resource String 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}
- peering
Id String - labels Map<String,String>
Resource labels that can contain user-provided metadata
- project String
The ID of the project in which the resource belongs. If it is not provided, the provider project is used.
- status String
The current state of this Peering.
- status
Message String Additional information about the current status of this peering, if available.
- string
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.
- domain
Resource string 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}
- peering
Id string - labels {[key: string]: string}
Resource labels that can contain user-provided metadata
- project string
The ID of the project in which the resource belongs. If it is not provided, the provider project is used.
- status string
The current state of this Peering.
- status
Message string Additional information about the current status of this peering, if available.
- str
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.
- domain_
resource str 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}
- peering_
id str - labels Mapping[str, str]
Resource labels that can contain user-provided metadata
- project str
The ID of the project in which the resource belongs. If it is not provided, the provider project is used.
- status str
The current state of this Peering.
- status_
message str Additional information about the current status of this peering, if available.
- String
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.
- domain
Resource String 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}
- peering
Id String - labels Map<String>
Resource labels that can contain user-provided metadata
- project String
The ID of the project in which the resource belongs. If it is not provided, the provider project is used.
- status String
The current state of this Peering.
- status
Message String Additional information about the current status of this peering, if available.
Outputs
All input properties are implicitly available as output properties. Additionally, the Peering resource produces the following output properties:
Look up Existing Peering Resource
Get an existing Peering 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?: PeeringState, opts?: CustomResourceOptions): Peering
@staticmethod
def get(resource_name: str,
id: str,
opts: Optional[ResourceOptions] = None,
authorized_network: Optional[str] = None,
domain_resource: Optional[str] = None,
labels: Optional[Mapping[str, str]] = None,
name: Optional[str] = None,
peering_id: Optional[str] = None,
project: Optional[str] = None,
status: Optional[str] = None,
status_message: Optional[str] = None) -> Peering
func GetPeering(ctx *Context, name string, id IDInput, state *PeeringState, opts ...ResourceOption) (*Peering, error)
public static Peering Get(string name, Input<string> id, PeeringState? state, CustomResourceOptions? opts = null)
public static Peering get(String name, Output<String> id, PeeringState 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.
- string
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.
- Domain
Resource string 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}
- Labels Dictionary<string, string>
Resource labels that can contain user-provided metadata
- Name string
Unique name of the peering in this scope including projects and location using the form: projects/{projectId}/locations/global/peerings/{peeringId}.
- Peering
Id string - Project string
The ID of the project in which the resource belongs. If it is not provided, the provider project is used.
- Status string
The current state of this Peering.
- Status
Message string Additional information about the current status of this peering, if available.
- string
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.
- Domain
Resource string 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}
- Labels map[string]string
Resource labels that can contain user-provided metadata
- Name string
Unique name of the peering in this scope including projects and location using the form: projects/{projectId}/locations/global/peerings/{peeringId}.
- Peering
Id string - Project string
The ID of the project in which the resource belongs. If it is not provided, the provider project is used.
- Status string
The current state of this Peering.
- Status
Message string Additional information about the current status of this peering, if available.
- String
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.
- domain
Resource String 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}
- labels Map<String,String>
Resource labels that can contain user-provided metadata
- name String
Unique name of the peering in this scope including projects and location using the form: projects/{projectId}/locations/global/peerings/{peeringId}.
- peering
Id String - project String
The ID of the project in which the resource belongs. If it is not provided, the provider project is used.
- status String
The current state of this Peering.
- status
Message String Additional information about the current status of this peering, if available.
- string
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.
- domain
Resource string 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}
- labels {[key: string]: string}
Resource labels that can contain user-provided metadata
- name string
Unique name of the peering in this scope including projects and location using the form: projects/{projectId}/locations/global/peerings/{peeringId}.
- peering
Id string - project string
The ID of the project in which the resource belongs. If it is not provided, the provider project is used.
- status string
The current state of this Peering.
- status
Message string Additional information about the current status of this peering, if available.
- str
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.
- domain_
resource str 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}
- labels Mapping[str, str]
Resource labels that can contain user-provided metadata
- name str
Unique name of the peering in this scope including projects and location using the form: projects/{projectId}/locations/global/peerings/{peeringId}.
- peering_
id str - project str
The ID of the project in which the resource belongs. If it is not provided, the provider project is used.
- status str
The current state of this Peering.
- status_
message str Additional information about the current status of this peering, if available.
- String
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.
- domain
Resource String 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}
- labels Map<String>
Resource labels that can contain user-provided metadata
- name String
Unique name of the peering in this scope including projects and location using the form: projects/{projectId}/locations/global/peerings/{peeringId}.
- peering
Id String - project String
The ID of the project in which the resource belongs. If it is not provided, the provider project is used.
- status String
The current state of this Peering.
- status
Message String Additional information about the current status of this peering, if available.
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.