gcp.apigee.DnsZone
Explore with Pulumi AI
Apigee Dns Zone.
To get more information about DnsZone, see:
- API documentation
- How-to Guides
Example Usage
Apigee Dns Zone Basic
import * as pulumi from "@pulumi/pulumi";
import * as gcp from "@pulumi/gcp";
const current = gcp.organizations.getClientConfig({});
const apigeeNetwork = new gcp.compute.Network("apigee_network", {name: "apigee-network"});
const org = new gcp.apigee.Organization("org", {
description: "Terraform-provisioned basic Apigee Org without VPC Peering.",
analyticsRegion: "us-central1",
projectId: current.then(current => current.project),
disableVpcPeering: true,
});
const apigeeDnsZone = new gcp.apigee.DnsZone("apigee_dns_zone", {
orgId: apigeeOrg.id,
dnsZoneId: "test1",
domain: "foo.com",
description: "test",
peeringConfig: {
targetProjectId: current.then(current => current.project),
targetNetworkId: apigeeNetwork.id,
},
});
import pulumi
import pulumi_gcp as gcp
current = gcp.organizations.get_client_config()
apigee_network = gcp.compute.Network("apigee_network", name="apigee-network")
org = gcp.apigee.Organization("org",
description="Terraform-provisioned basic Apigee Org without VPC Peering.",
analytics_region="us-central1",
project_id=current.project,
disable_vpc_peering=True)
apigee_dns_zone = gcp.apigee.DnsZone("apigee_dns_zone",
org_id=apigee_org["id"],
dns_zone_id="test1",
domain="foo.com",
description="test",
peering_config={
"target_project_id": current.project,
"target_network_id": apigee_network.id,
})
package main
import (
"github.com/pulumi/pulumi-gcp/sdk/v8/go/gcp/apigee"
"github.com/pulumi/pulumi-gcp/sdk/v8/go/gcp/compute"
"github.com/pulumi/pulumi-gcp/sdk/v8/go/gcp/organizations"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)
func main() {
pulumi.Run(func(ctx *pulumi.Context) error {
current, err := organizations.GetClientConfig(ctx, map[string]interface{}{}, nil)
if err != nil {
return err
}
apigeeNetwork, err := compute.NewNetwork(ctx, "apigee_network", &compute.NetworkArgs{
Name: pulumi.String("apigee-network"),
})
if err != nil {
return err
}
_, err = apigee.NewOrganization(ctx, "org", &apigee.OrganizationArgs{
Description: pulumi.String("Terraform-provisioned basic Apigee Org without VPC Peering."),
AnalyticsRegion: pulumi.String("us-central1"),
ProjectId: pulumi.String(current.Project),
DisableVpcPeering: pulumi.Bool(true),
})
if err != nil {
return err
}
_, err = apigee.NewDnsZone(ctx, "apigee_dns_zone", &apigee.DnsZoneArgs{
OrgId: pulumi.Any(apigeeOrg.Id),
DnsZoneId: pulumi.String("test1"),
Domain: pulumi.String("foo.com"),
Description: pulumi.String("test"),
PeeringConfig: &apigee.DnsZonePeeringConfigArgs{
TargetProjectId: pulumi.String(current.Project),
TargetNetworkId: apigeeNetwork.ID(),
},
})
if err != nil {
return err
}
return nil
})
}
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using Gcp = Pulumi.Gcp;
return await Deployment.RunAsync(() =>
{
var current = Gcp.Organizations.GetClientConfig.Invoke();
var apigeeNetwork = new Gcp.Compute.Network("apigee_network", new()
{
Name = "apigee-network",
});
var org = new Gcp.Apigee.Organization("org", new()
{
Description = "Terraform-provisioned basic Apigee Org without VPC Peering.",
AnalyticsRegion = "us-central1",
ProjectId = current.Apply(getClientConfigResult => getClientConfigResult.Project),
DisableVpcPeering = true,
});
var apigeeDnsZone = new Gcp.Apigee.DnsZone("apigee_dns_zone", new()
{
OrgId = apigeeOrg.Id,
DnsZoneId = "test1",
Domain = "foo.com",
Description = "test",
PeeringConfig = new Gcp.Apigee.Inputs.DnsZonePeeringConfigArgs
{
TargetProjectId = current.Apply(getClientConfigResult => getClientConfigResult.Project),
TargetNetworkId = apigeeNetwork.Id,
},
});
});
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.compute.Network;
import com.pulumi.gcp.compute.NetworkArgs;
import com.pulumi.gcp.apigee.Organization;
import com.pulumi.gcp.apigee.OrganizationArgs;
import com.pulumi.gcp.apigee.DnsZone;
import com.pulumi.gcp.apigee.DnsZoneArgs;
import com.pulumi.gcp.apigee.inputs.DnsZonePeeringConfigArgs;
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 current = OrganizationsFunctions.getClientConfig(%!v(PANIC=Format method: runtime error: invalid memory address or nil pointer dereference);
var apigeeNetwork = new Network("apigeeNetwork", NetworkArgs.builder()
.name("apigee-network")
.build());
var org = new Organization("org", OrganizationArgs.builder()
.description("Terraform-provisioned basic Apigee Org without VPC Peering.")
.analyticsRegion("us-central1")
.projectId(current.project())
.disableVpcPeering(true)
.build());
var apigeeDnsZone = new DnsZone("apigeeDnsZone", DnsZoneArgs.builder()
.orgId(apigeeOrg.id())
.dnsZoneId("test1")
.domain("foo.com")
.description("test")
.peeringConfig(DnsZonePeeringConfigArgs.builder()
.targetProjectId(current.project())
.targetNetworkId(apigeeNetwork.id())
.build())
.build());
}
}
resources:
apigeeNetwork:
type: gcp:compute:Network
name: apigee_network
properties:
name: apigee-network
org:
type: gcp:apigee:Organization
properties:
description: Terraform-provisioned basic Apigee Org without VPC Peering.
analyticsRegion: us-central1
projectId: ${current.project}
disableVpcPeering: true
apigeeDnsZone:
type: gcp:apigee:DnsZone
name: apigee_dns_zone
properties:
orgId: ${apigeeOrg.id}
dnsZoneId: test1
domain: foo.com
description: test
peeringConfig:
targetProjectId: ${current.project}
targetNetworkId: ${apigeeNetwork.id}
variables:
current:
fn::invoke:
function: gcp:organizations:getClientConfig
arguments: {}
Create DnsZone Resource
Resources are created with functions called constructors. To learn more about declaring and configuring resources, see Resources.
Constructor syntax
new DnsZone(name: string, args: DnsZoneArgs, opts?: CustomResourceOptions);
@overload
def DnsZone(resource_name: str,
args: DnsZoneArgs,
opts: Optional[ResourceOptions] = None)
@overload
def DnsZone(resource_name: str,
opts: Optional[ResourceOptions] = None,
description: Optional[str] = None,
dns_zone_id: Optional[str] = None,
domain: Optional[str] = None,
org_id: Optional[str] = None,
peering_config: Optional[DnsZonePeeringConfigArgs] = None)
func NewDnsZone(ctx *Context, name string, args DnsZoneArgs, opts ...ResourceOption) (*DnsZone, error)
public DnsZone(string name, DnsZoneArgs args, CustomResourceOptions? opts = null)
public DnsZone(String name, DnsZoneArgs args)
public DnsZone(String name, DnsZoneArgs args, CustomResourceOptions options)
type: gcp:apigee:DnsZone
properties: # The arguments to resource properties.
options: # Bag of options to control resource's behavior.
Parameters
- name string
- The unique name of the resource.
- args DnsZoneArgs
- 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 DnsZoneArgs
- 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 DnsZoneArgs
- The arguments to resource properties.
- opts ResourceOption
- Bag of options to control resource's behavior.
- name string
- The unique name of the resource.
- args DnsZoneArgs
- The arguments to resource properties.
- opts CustomResourceOptions
- Bag of options to control resource's behavior.
- name String
- The unique name of the resource.
- args DnsZoneArgs
- The arguments to resource properties.
- options CustomResourceOptions
- Bag of options to control resource's behavior.
Constructor example
The following reference example uses placeholder values for all input properties.
var dnsZoneResource = new Gcp.Apigee.DnsZone("dnsZoneResource", new()
{
Description = "string",
DnsZoneId = "string",
Domain = "string",
OrgId = "string",
PeeringConfig = new Gcp.Apigee.Inputs.DnsZonePeeringConfigArgs
{
TargetNetworkId = "string",
TargetProjectId = "string",
},
});
example, err := apigee.NewDnsZone(ctx, "dnsZoneResource", &apigee.DnsZoneArgs{
Description: pulumi.String("string"),
DnsZoneId: pulumi.String("string"),
Domain: pulumi.String("string"),
OrgId: pulumi.String("string"),
PeeringConfig: &apigee.DnsZonePeeringConfigArgs{
TargetNetworkId: pulumi.String("string"),
TargetProjectId: pulumi.String("string"),
},
})
var dnsZoneResource = new DnsZone("dnsZoneResource", DnsZoneArgs.builder()
.description("string")
.dnsZoneId("string")
.domain("string")
.orgId("string")
.peeringConfig(DnsZonePeeringConfigArgs.builder()
.targetNetworkId("string")
.targetProjectId("string")
.build())
.build());
dns_zone_resource = gcp.apigee.DnsZone("dnsZoneResource",
description="string",
dns_zone_id="string",
domain="string",
org_id="string",
peering_config={
"target_network_id": "string",
"target_project_id": "string",
})
const dnsZoneResource = new gcp.apigee.DnsZone("dnsZoneResource", {
description: "string",
dnsZoneId: "string",
domain: "string",
orgId: "string",
peeringConfig: {
targetNetworkId: "string",
targetProjectId: "string",
},
});
type: gcp:apigee:DnsZone
properties:
description: string
dnsZoneId: string
domain: string
orgId: string
peeringConfig:
targetNetworkId: string
targetProjectId: string
DnsZone Resource Properties
To learn more about resource properties and how to use them, see Inputs and Outputs in the Architecture and Concepts docs.
Inputs
In Python, inputs that are objects can be passed either as argument classes or as dictionary literals.
The DnsZone resource accepts the following input properties:
- Description string
- Description for the zone.
- Dns
Zone stringId - ID of the dns zone.
- Domain string
- Doamin for the zone.
- Org
Id string - The Apigee Organization associated with the Apigee instance,
in the format
organizations/{{org_name}}
. - Peering
Config DnsZone Peering Config - Peering zone config Structure is documented below.
- Description string
- Description for the zone.
- Dns
Zone stringId - ID of the dns zone.
- Domain string
- Doamin for the zone.
- Org
Id string - The Apigee Organization associated with the Apigee instance,
in the format
organizations/{{org_name}}
. - Peering
Config DnsZone Peering Config Args - Peering zone config Structure is documented below.
- description String
- Description for the zone.
- dns
Zone StringId - ID of the dns zone.
- domain String
- Doamin for the zone.
- org
Id String - The Apigee Organization associated with the Apigee instance,
in the format
organizations/{{org_name}}
. - peering
Config DnsZone Peering Config - Peering zone config Structure is documented below.
- description string
- Description for the zone.
- dns
Zone stringId - ID of the dns zone.
- domain string
- Doamin for the zone.
- org
Id string - The Apigee Organization associated with the Apigee instance,
in the format
organizations/{{org_name}}
. - peering
Config DnsZone Peering Config - Peering zone config Structure is documented below.
- description str
- Description for the zone.
- dns_
zone_ strid - ID of the dns zone.
- domain str
- Doamin for the zone.
- org_
id str - The Apigee Organization associated with the Apigee instance,
in the format
organizations/{{org_name}}
. - peering_
config DnsZone Peering Config Args - Peering zone config Structure is documented below.
- description String
- Description for the zone.
- dns
Zone StringId - ID of the dns zone.
- domain String
- Doamin for the zone.
- org
Id String - The Apigee Organization associated with the Apigee instance,
in the format
organizations/{{org_name}}
. - peering
Config Property Map - Peering zone config Structure is documented below.
Outputs
All input properties are implicitly available as output properties. Additionally, the DnsZone resource produces the following output properties:
Look up Existing DnsZone Resource
Get an existing DnsZone 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?: DnsZoneState, opts?: CustomResourceOptions): DnsZone
@staticmethod
def get(resource_name: str,
id: str,
opts: Optional[ResourceOptions] = None,
description: Optional[str] = None,
dns_zone_id: Optional[str] = None,
domain: Optional[str] = None,
name: Optional[str] = None,
org_id: Optional[str] = None,
peering_config: Optional[DnsZonePeeringConfigArgs] = None) -> DnsZone
func GetDnsZone(ctx *Context, name string, id IDInput, state *DnsZoneState, opts ...ResourceOption) (*DnsZone, error)
public static DnsZone Get(string name, Input<string> id, DnsZoneState? state, CustomResourceOptions? opts = null)
public static DnsZone get(String name, Output<String> id, DnsZoneState state, CustomResourceOptions options)
resources: _: type: gcp:apigee:DnsZone get: id: ${id}
- 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.
- Description string
- Description for the zone.
- Dns
Zone stringId - ID of the dns zone.
- Domain string
- Doamin for the zone.
- Name string
- Name of the Dns Zone in the following format: organizations/{organization}/dnsZones/{dnsZone}.
- Org
Id string - The Apigee Organization associated with the Apigee instance,
in the format
organizations/{{org_name}}
. - Peering
Config DnsZone Peering Config - Peering zone config Structure is documented below.
- Description string
- Description for the zone.
- Dns
Zone stringId - ID of the dns zone.
- Domain string
- Doamin for the zone.
- Name string
- Name of the Dns Zone in the following format: organizations/{organization}/dnsZones/{dnsZone}.
- Org
Id string - The Apigee Organization associated with the Apigee instance,
in the format
organizations/{{org_name}}
. - Peering
Config DnsZone Peering Config Args - Peering zone config Structure is documented below.
- description String
- Description for the zone.
- dns
Zone StringId - ID of the dns zone.
- domain String
- Doamin for the zone.
- name String
- Name of the Dns Zone in the following format: organizations/{organization}/dnsZones/{dnsZone}.
- org
Id String - The Apigee Organization associated with the Apigee instance,
in the format
organizations/{{org_name}}
. - peering
Config DnsZone Peering Config - Peering zone config Structure is documented below.
- description string
- Description for the zone.
- dns
Zone stringId - ID of the dns zone.
- domain string
- Doamin for the zone.
- name string
- Name of the Dns Zone in the following format: organizations/{organization}/dnsZones/{dnsZone}.
- org
Id string - The Apigee Organization associated with the Apigee instance,
in the format
organizations/{{org_name}}
. - peering
Config DnsZone Peering Config - Peering zone config Structure is documented below.
- description str
- Description for the zone.
- dns_
zone_ strid - ID of the dns zone.
- domain str
- Doamin for the zone.
- name str
- Name of the Dns Zone in the following format: organizations/{organization}/dnsZones/{dnsZone}.
- org_
id str - The Apigee Organization associated with the Apigee instance,
in the format
organizations/{{org_name}}
. - peering_
config DnsZone Peering Config Args - Peering zone config Structure is documented below.
- description String
- Description for the zone.
- dns
Zone StringId - ID of the dns zone.
- domain String
- Doamin for the zone.
- name String
- Name of the Dns Zone in the following format: organizations/{organization}/dnsZones/{dnsZone}.
- org
Id String - The Apigee Organization associated with the Apigee instance,
in the format
organizations/{{org_name}}
. - peering
Config Property Map - Peering zone config Structure is documented below.
Supporting Types
DnsZonePeeringConfig, DnsZonePeeringConfigArgs
- Target
Network stringId - The name of the producer VPC network.
- Target
Project stringId - The ID of the project that contains the producer VPC network.
- Target
Network stringId - The name of the producer VPC network.
- Target
Project stringId - The ID of the project that contains the producer VPC network.
- target
Network StringId - The name of the producer VPC network.
- target
Project StringId - The ID of the project that contains the producer VPC network.
- target
Network stringId - The name of the producer VPC network.
- target
Project stringId - The ID of the project that contains the producer VPC network.
- target_
network_ strid - The name of the producer VPC network.
- target_
project_ strid - The ID of the project that contains the producer VPC network.
- target
Network StringId - The name of the producer VPC network.
- target
Project StringId - The ID of the project that contains the producer VPC network.
Import
DnsZone can be imported using any of these accepted formats:
{{org_id}}/dnsZones/{{dns_zone_id}}
{{org_id}}/{{dns_zone_id}}
When using the pulumi import
command, DnsZone can be imported using one of the formats above. For example:
$ pulumi import gcp:apigee/dnsZone:DnsZone default {{org_id}}/dnsZones/{{dns_zone_id}}
$ pulumi import gcp:apigee/dnsZone:DnsZone default {{org_id}}/{{dns_zone_id}}
To learn more about importing existing cloud resources, see Importing resources.
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.