1. Packages
  2. Gcore Provider
  3. API Docs
  4. DnsNetworkMapping
gcore 0.28.0 published on Monday, Aug 4, 2025 by g-core

gcore.DnsNetworkMapping

Explore with Pulumi AI

gcore logo
gcore 0.28.0 published on Monday, Aug 4, 2025 by g-core

    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 DnsNetworkMappingMapping[]
    dnsNetworkMappingId string
    The ID of this resource.
    name string
    mappings List<Property Map>
    dnsNetworkMappingId String
    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.
    The following state arguments are supported:
    dnsNetworkMappingId string
    The ID of this resource.
    mappings DnsNetworkMappingMapping[]
    name string
    dnsNetworkMappingId String
    The ID of this resource.
    mappings List<Property Map>
    name String

    Supporting Types

    DnsNetworkMappingMapping, DnsNetworkMappingMappingArgs

    Tags List<string>
    Cidr4s List<string>
    Cidr6s List<string>
    Tags []string
    Cidr4s []string
    Cidr6s []string
    tags List<String>
    cidr4s List<String>
    cidr6s List<String>
    tags string[]
    cidr4s string[]
    cidr6s string[]
    tags Sequence[str]
    cidr4s Sequence[str]
    cidr6s Sequence[str]
    tags List<String>
    cidr4s List<String>
    cidr6s List<String>

    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.
    gcore logo
    gcore 0.28.0 published on Monday, Aug 4, 2025 by g-core