How do I connect on-premises Active Directory with Google Cloud?
In this guide, we will connect an on-premises Active Directory with Google Cloud. This involves creating a Managed Microsoft AD domain in Google Cloud and setting up a peering connection between the on-premises network and Google Cloud.
The following Pulumi program accomplishes this:
- Creates a Managed Microsoft AD domain in Google Cloud.
- Sets up a peering connection between the on-premises network and Google Cloud.
import * as pulumi from "@pulumi/pulumi";
import * as gcp from "@pulumi/gcp";
// Create a Managed Microsoft AD domain
const adDomain = new gcp.activedirectory.Domain("adDomain", {
domainName: "example.com",
reservedIpRange: "10.0.0.0/24",
locations: ["us-central1"],
project: "my-gcp-project",
});
// Set up a peering connection
const peering = new gcp.activedirectory.Peering("adPeering", {
domainResource: adDomain.id,
authorizedNetwork: "projects/my-gcp-project/global/networks/my-vpc-network",
peeringId: "my-peering",
project: "my-gcp-project",
});
// Export the domain name and peering connection details
export const domainName = adDomain.domainName;
export const peeringId = peering.peeringId;
Key Points
- Managed Microsoft AD Domain: The
gcp.activedirectory.Domain
resource creates a Managed Microsoft AD domain in Google Cloud. - Peering Connection: The
gcp.activedirectory.Peering
resource sets up a peering connection between the on-premises network and Google Cloud. - Exports: The domain name and peering connection ID are exported for reference.
Summary
This program sets up a Managed Microsoft AD domain in Google Cloud and establishes a peering connection to an on-premises network. This allows for seamless integration between on-premises Active Directory and Google Cloud services.
Deploy this code
Want to deploy this code? Sign up for a free Pulumi account to deploy in a few clicks.
Sign upNew to Pulumi?
Want to deploy this code? Sign up with Pulumi to deploy in a few clicks.
Sign upThank you for your feedback!
If you have a question about how to use Pulumi, reach out in Community Slack.
Open an issue on GitHub to report a problem or suggest an improvement.