gcore.DnsNetworkMapping
Explore with Pulumi AI
Example Usage
import * as pulumi from "@pulumi/pulumi";
import * as gcore from "@pulumi/gcore";
const example = new gcore.DnsNetworkMapping("example", {mappings: [{
cidr4s: [
"10.0.0.0/16",
"10.1.0.0/16",
],
cidr6s: ["fd00::/8"],
tags: [
"development",
"test",
],
}]});
import pulumi
import pulumi_gcore as gcore
example = gcore.DnsNetworkMapping("example", mappings=[{
"cidr4s": [
"10.0.0.0/16",
"10.1.0.0/16",
],
"cidr6s": ["fd00::/8"],
"tags": [
"development",
"test",
],
}])
package main
import (
"github.com/pulumi/pulumi-terraform-provider/sdks/go/gcore/gcore"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)
func main() {
pulumi.Run(func(ctx *pulumi.Context) error {
_, err := gcore.NewDnsNetworkMapping(ctx, "example", &gcore.DnsNetworkMappingArgs{
Mappings: gcore.DnsNetworkMappingMappingArray{
&gcore.DnsNetworkMappingMappingArgs{
Cidr4s: pulumi.StringArray{
pulumi.String("10.0.0.0/16"),
pulumi.String("10.1.0.0/16"),
},
Cidr6s: pulumi.StringArray{
pulumi.String("fd00::/8"),
},
Tags: pulumi.StringArray{
pulumi.String("development"),
pulumi.String("test"),
},
},
},
})
if err != nil {
return err
}
return nil
})
}
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using Gcore = Pulumi.Gcore;
return await Deployment.RunAsync(() =>
{
var example = new Gcore.DnsNetworkMapping("example", new()
{
Mappings = new[]
{
new Gcore.Inputs.DnsNetworkMappingMappingArgs
{
Cidr4s = new[]
{
"10.0.0.0/16",
"10.1.0.0/16",
},
Cidr6s = new[]
{
"fd00::/8",
},
Tags = new[]
{
"development",
"test",
},
},
},
});
});
package generated_program;
import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.gcore.DnsNetworkMapping;
import com.pulumi.gcore.DnsNetworkMappingArgs;
import com.pulumi.gcore.inputs.DnsNetworkMappingMappingArgs;
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 example = new DnsNetworkMapping("example", DnsNetworkMappingArgs.builder()
.mappings(DnsNetworkMappingMappingArgs.builder()
.cidr4s(
"10.0.0.0/16",
"10.1.0.0/16")
.cidr6s("fd00::/8")
.tags(
"development",
"test")
.build())
.build());
}
}
resources:
example:
type: gcore:DnsNetworkMapping
properties:
mappings:
- cidr4s:
- 10.0.0.0/16
- 10.1.0.0/16
cidr6s:
- fd00::/8
tags:
- development
- test
Create DnsNetworkMapping Resource
Resources are created with functions called constructors. To learn more about declaring and configuring resources, see Resources.
Constructor syntax
new DnsNetworkMapping(name: string, args: DnsNetworkMappingArgs, opts?: CustomResourceOptions);
@overload
def DnsNetworkMapping(resource_name: str,
args: DnsNetworkMappingArgs,
opts: Optional[ResourceOptions] = None)
@overload
def DnsNetworkMapping(resource_name: str,
opts: Optional[ResourceOptions] = None,
mappings: Optional[Sequence[DnsNetworkMappingMappingArgs]] = None,
dns_network_mapping_id: Optional[str] = None,
name: Optional[str] = None)
func NewDnsNetworkMapping(ctx *Context, name string, args DnsNetworkMappingArgs, opts ...ResourceOption) (*DnsNetworkMapping, error)
public DnsNetworkMapping(string name, DnsNetworkMappingArgs args, CustomResourceOptions? opts = null)
public DnsNetworkMapping(String name, DnsNetworkMappingArgs args)
public DnsNetworkMapping(String name, DnsNetworkMappingArgs args, CustomResourceOptions options)
type: gcore:DnsNetworkMapping
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 DnsNetworkMappingArgs
- 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 DnsNetworkMappingArgs
- 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 DnsNetworkMappingArgs
- The arguments to resource properties.
- opts ResourceOption
- Bag of options to control resource's behavior.
- name string
- The unique name of the resource.
- args DnsNetworkMappingArgs
- The arguments to resource properties.
- opts CustomResourceOptions
- Bag of options to control resource's behavior.
- name String
- The unique name of the resource.
- args DnsNetworkMappingArgs
- 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 dnsNetworkMappingResource = new Gcore.DnsNetworkMapping("dnsNetworkMappingResource", new()
{
Mappings = new[]
{
new Gcore.Inputs.DnsNetworkMappingMappingArgs
{
Tags = new[]
{
"string",
},
Cidr4s = new[]
{
"string",
},
Cidr6s = new[]
{
"string",
},
},
},
DnsNetworkMappingId = "string",
Name = "string",
});
example, err := gcore.NewDnsNetworkMapping(ctx, "dnsNetworkMappingResource", &gcore.DnsNetworkMappingArgs{
Mappings: gcore.DnsNetworkMappingMappingArray{
&gcore.DnsNetworkMappingMappingArgs{
Tags: pulumi.StringArray{
pulumi.String("string"),
},
Cidr4s: pulumi.StringArray{
pulumi.String("string"),
},
Cidr6s: pulumi.StringArray{
pulumi.String("string"),
},
},
},
DnsNetworkMappingId: pulumi.String("string"),
Name: pulumi.String("string"),
})
var dnsNetworkMappingResource = new DnsNetworkMapping("dnsNetworkMappingResource", DnsNetworkMappingArgs.builder()
.mappings(DnsNetworkMappingMappingArgs.builder()
.tags("string")
.cidr4s("string")
.cidr6s("string")
.build())
.dnsNetworkMappingId("string")
.name("string")
.build());
dns_network_mapping_resource = gcore.DnsNetworkMapping("dnsNetworkMappingResource",
mappings=[{
"tags": ["string"],
"cidr4s": ["string"],
"cidr6s": ["string"],
}],
dns_network_mapping_id="string",
name="string")
const dnsNetworkMappingResource = new gcore.DnsNetworkMapping("dnsNetworkMappingResource", {
mappings: [{
tags: ["string"],
cidr4s: ["string"],
cidr6s: ["string"],
}],
dnsNetworkMappingId: "string",
name: "string",
});
type: gcore:DnsNetworkMapping
properties:
dnsNetworkMappingId: string
mappings:
- cidr4s:
- string
cidr6s:
- string
tags:
- string
name: string
DnsNetworkMapping 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 DnsNetworkMapping resource accepts the following input properties:
- Mappings
List<Dns
Network Mapping Mapping> - Dns
Network stringMapping Id - The ID of this resource.
- Name string
- Mappings
[]Dns
Network Mapping Mapping Args - Dns
Network stringMapping Id - The ID of this resource.
- Name string
- mappings
List<Dns
Network Mapping Mapping> - dns
Network StringMapping Id - The ID of this resource.
- name String
- mappings
Dns
Network Mapping Mapping[] - dns
Network stringMapping Id - The ID of this resource.
- name string
- mappings
Sequence[Dns
Network Mapping Mapping Args] - dns_
network_ strmapping_ id - The ID of this resource.
- name str
- mappings List<Property Map>
- dns
Network StringMapping Id - The ID of this resource.
- name String
Outputs
All input properties are implicitly available as output properties. Additionally, the DnsNetworkMapping resource produces the following output properties:
- Id string
- The provider-assigned unique ID for this managed resource.
- Id string
- The provider-assigned unique ID for this managed resource.
- id String
- The provider-assigned unique ID for this managed resource.
- id string
- The provider-assigned unique ID for this managed resource.
- id str
- The provider-assigned unique ID for this managed resource.
- id String
- The provider-assigned unique ID for this managed resource.
Look up Existing DnsNetworkMapping Resource
Get an existing DnsNetworkMapping 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?: DnsNetworkMappingState, opts?: CustomResourceOptions): DnsNetworkMapping
@staticmethod
def get(resource_name: str,
id: str,
opts: Optional[ResourceOptions] = None,
dns_network_mapping_id: Optional[str] = None,
mappings: Optional[Sequence[DnsNetworkMappingMappingArgs]] = None,
name: Optional[str] = None) -> DnsNetworkMapping
func GetDnsNetworkMapping(ctx *Context, name string, id IDInput, state *DnsNetworkMappingState, opts ...ResourceOption) (*DnsNetworkMapping, error)
public static DnsNetworkMapping Get(string name, Input<string> id, DnsNetworkMappingState? state, CustomResourceOptions? opts = null)
public static DnsNetworkMapping get(String name, Output<String> id, DnsNetworkMappingState state, CustomResourceOptions options)
resources: _: type: gcore:DnsNetworkMapping 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.
- Dns
Network stringMapping Id - The ID of this resource.
- Mappings
List<Dns
Network Mapping Mapping> - Name string
- Dns
Network stringMapping Id - The ID of this resource.
- Mappings
[]Dns
Network Mapping Mapping Args - Name string
- dns
Network StringMapping Id - The ID of this resource.
- mappings
List<Dns
Network Mapping Mapping> - name String
- dns
Network stringMapping Id - The ID of this resource.
- mappings
Dns
Network Mapping Mapping[] - name string
- dns_
network_ strmapping_ id - The ID of this resource.
- mappings
Sequence[Dns
Network Mapping Mapping Args] - name str
- dns
Network StringMapping Id - The ID of this resource.
- mappings List<Property Map>
- name String
Supporting Types
DnsNetworkMappingMapping, DnsNetworkMappingMappingArgs
Import
The pulumi import
command can be used, for example:
import using zone name format
$ pulumi import gcore:index/dnsNetworkMapping:DnsNetworkMapping example DevNetwork
To learn more about importing existing cloud resources, see Importing resources.
Package Details
- Repository
- gcore g-core/terraform-provider-gcore
- License
- Notes
- This Pulumi package is based on the
gcore
Terraform Provider.