Ready to level-up your engineering skills? Join a Pulumi Workshop. Register Now

GlobalDns

Provides a Rancher V2 Global DNS resource. This can be used to create Global DNS records for Rancher V2.

Example Usage

using Pulumi;
using Rancher2 = Pulumi.Rancher2;

class MyStack : Stack
{
    public MyStack()
    {
        // Create a new rancher2 Global DNS Provider
        var fooGlobalDnsProvider = new Rancher2.GlobalDnsProvider("fooGlobalDnsProvider", new Rancher2.GlobalDnsProviderArgs
        {
            RootDomain = "example.com",
            Route53Config = new Rancher2.Inputs.GlobalDnsProviderRoute53ConfigArgs
            {
                AccessKey = "YYYYYYYYYYYYYYYYYYYY",
                SecretKey = "XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX",
                ZoneType = "private",
                Region = "us-east-1",
            },
        });
        // Create a new rancher2 Global DNS using project IDs
        var fooGlobalDns = new Rancher2.GlobalDns("fooGlobalDns", new Rancher2.GlobalDnsArgs
        {
            Fqdn = "foo.example.com",
            ProviderId = fooGlobalDnsProvider.Id,
            ProjectIds = 
            {
                "project1",
                "project2",
            },
        });
    }

}
package main

import (
    "github.com/pulumi/pulumi-rancher2/sdk/v2/go/rancher2"
    "github.com/pulumi/pulumi/sdk/v2/go/pulumi"
)

func main() {
    pulumi.Run(func(ctx *pulumi.Context) error {
        fooGlobalDnsProvider, err := rancher2.NewGlobalDnsProvider(ctx, "fooGlobalDnsProvider", &rancher2.GlobalDnsProviderArgs{
            RootDomain: pulumi.String("example.com"),
            Route53Config: &rancher2.GlobalDnsProviderRoute53ConfigArgs{
                AccessKey: pulumi.String("YYYYYYYYYYYYYYYYYYYY"),
                SecretKey: pulumi.String("XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX"),
                ZoneType:  pulumi.String("private"),
                Region:    pulumi.String("us-east-1"),
            },
        })
        if err != nil {
            return err
        }
        _, err = rancher2.NewGlobalDns(ctx, "fooGlobalDns", &rancher2.GlobalDnsArgs{
            Fqdn:       pulumi.String("foo.example.com"),
            ProviderId: fooGlobalDnsProvider.ID(),
            ProjectIds: pulumi.StringArray{
                pulumi.String("project1"),
                pulumi.String("project2"),
            },
        })
        if err != nil {
            return err
        }
        return nil
    })
}
import pulumi
import pulumi_rancher2 as rancher2

# Create a new rancher2 Global DNS Provider
foo_global_dns_provider = rancher2.GlobalDnsProvider("fooGlobalDnsProvider",
    root_domain="example.com",
    route53_config=rancher2.GlobalDnsProviderRoute53ConfigArgs(
        access_key="YYYYYYYYYYYYYYYYYYYY",
        secret_key="XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX",
        zone_type="private",
        region="us-east-1",
    ))
# Create a new rancher2 Global DNS using project IDs
foo_global_dns = rancher2.GlobalDns("fooGlobalDns",
    fqdn="foo.example.com",
    provider_id=foo_global_dns_provider.id,
    project_ids=[
        "project1",
        "project2",
    ])
import * as pulumi from "@pulumi/pulumi";
import * as rancher2 from "@pulumi/rancher2";

// Create a new rancher2 Global DNS Provider
const fooGlobalDnsProvider = new rancher2.GlobalDnsProvider("fooGlobalDnsProvider", {
    rootDomain: "example.com",
    route53Config: {
        accessKey: "YYYYYYYYYYYYYYYYYYYY",
        secretKey: "XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX",
        zoneType: "private",
        region: "us-east-1",
    },
});
// Create a new rancher2 Global DNS using project IDs
const fooGlobalDns = new rancher2.GlobalDns("fooGlobalDns", {
    fqdn: "foo.example.com",
    providerId: fooGlobalDnsProvider.id,
    projectIds: [
        "project1",
        "project2",
    ],
});

Create a GlobalDns Resource

new GlobalDns(name: string, args: GlobalDnsArgs, opts?: CustomResourceOptions);
def GlobalDns(resource_name: str, opts: Optional[ResourceOptions] = None, annotations: Optional[Mapping[str, Any]] = None, fqdn: Optional[str] = None, labels: Optional[Mapping[str, Any]] = None, multi_cluster_app_id: Optional[str] = None, name: Optional[str] = None, project_ids: Optional[Sequence[str]] = None, provider_id: Optional[str] = None, ttl: Optional[int] = None)
func NewGlobalDns(ctx *Context, name string, args GlobalDnsArgs, opts ...ResourceOption) (*GlobalDns, error)
public GlobalDns(string name, GlobalDnsArgs args, CustomResourceOptions? opts = null)
name string
The unique name of the resource.
args GlobalDnsArgs
The arguments to resource properties.
opts CustomResourceOptions
Bag of options to control resource's behavior.
resource_name str
The unique name of the resource.
opts ResourceOptions
A bag of options that control this resource's behavior.
ctx Context
Context object for the current deployment.
name string
The unique name of the resource.
args GlobalDnsArgs
The arguments to resource properties.
opts ResourceOption
Bag of options to control resource's behavior.
name string
The unique name of the resource.
args GlobalDnsArgs
The arguments to resource properties.
opts CustomResourceOptions
Bag of options to control resource's behavior.

GlobalDns Resource Properties

To learn more about resource properties and how to use them, see Inputs and Outputs in the Programming Model docs.

Inputs

The GlobalDns resource accepts the following input properties:

Fqdn string

The Global DNS record (string)

ProviderId string

The Global DNS provider ID to use (string)

Annotations Dictionary<string, object>

Annotations for Global DNS (map)

Labels Dictionary<string, object>

Labels for Global DNS (map)

MultiClusterAppId string

The MultiCluster App ID to assign to the Global DNS. Conflicts with project_ids (string)

Name string

The name of the Global DNS (string)

ProjectIds List<string>

A list of project_ids to assign to the Global DNS. Conflicts with multi_cluster_app_id (list(string))

Ttl int

TTL in seconds for DNS record. Default: 300 (int)

Fqdn string

The Global DNS record (string)

ProviderId string

The Global DNS provider ID to use (string)

Annotations map[string]interface{}

Annotations for Global DNS (map)

Labels map[string]interface{}

Labels for Global DNS (map)

MultiClusterAppId string

The MultiCluster App ID to assign to the Global DNS. Conflicts with project_ids (string)

Name string

The name of the Global DNS (string)

ProjectIds []string

A list of project_ids to assign to the Global DNS. Conflicts with multi_cluster_app_id (list(string))

Ttl int

TTL in seconds for DNS record. Default: 300 (int)

fqdn string

The Global DNS record (string)

providerId string

The Global DNS provider ID to use (string)

annotations {[key: string]: any}

Annotations for Global DNS (map)

labels {[key: string]: any}

Labels for Global DNS (map)

multiClusterAppId string

The MultiCluster App ID to assign to the Global DNS. Conflicts with project_ids (string)

name string

The name of the Global DNS (string)

projectIds string[]

A list of project_ids to assign to the Global DNS. Conflicts with multi_cluster_app_id (list(string))

ttl number

TTL in seconds for DNS record. Default: 300 (int)

fqdn str

The Global DNS record (string)

provider_id str

The Global DNS provider ID to use (string)

annotations Mapping[str, Any]

Annotations for Global DNS (map)

labels Mapping[str, Any]

Labels for Global DNS (map)

multi_cluster_app_id str

The MultiCluster App ID to assign to the Global DNS. Conflicts with project_ids (string)

name str

The name of the Global DNS (string)

project_ids Sequence[str]

A list of project_ids to assign to the Global DNS. Conflicts with multi_cluster_app_id (list(string))

ttl int

TTL in seconds for DNS record. Default: 300 (int)

Outputs

All input properties are implicitly available as output properties. Additionally, the GlobalDns 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 str
The provider-assigned unique ID for this managed resource.

Look up an Existing GlobalDns Resource

Get an existing GlobalDns 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?: GlobalDnsState, opts?: CustomResourceOptions): GlobalDns
@staticmethod
def get(resource_name: str, id: str, opts: Optional[ResourceOptions] = None, annotations: Optional[Mapping[str, Any]] = None, fqdn: Optional[str] = None, labels: Optional[Mapping[str, Any]] = None, multi_cluster_app_id: Optional[str] = None, name: Optional[str] = None, project_ids: Optional[Sequence[str]] = None, provider_id: Optional[str] = None, ttl: Optional[int] = None) -> GlobalDns
func GetGlobalDns(ctx *Context, name string, id IDInput, state *GlobalDnsState, opts ...ResourceOption) (*GlobalDns, error)
public static GlobalDns Get(string name, Input<string> id, GlobalDnsState? state, CustomResourceOptions? opts = null)
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.

The following state arguments are supported:

Annotations Dictionary<string, object>

Annotations for Global DNS (map)

Fqdn string

The Global DNS record (string)

Labels Dictionary<string, object>

Labels for Global DNS (map)

MultiClusterAppId string

The MultiCluster App ID to assign to the Global DNS. Conflicts with project_ids (string)

Name string

The name of the Global DNS (string)

ProjectIds List<string>

A list of project_ids to assign to the Global DNS. Conflicts with multi_cluster_app_id (list(string))

ProviderId string

The Global DNS provider ID to use (string)

Ttl int

TTL in seconds for DNS record. Default: 300 (int)

Annotations map[string]interface{}

Annotations for Global DNS (map)

Fqdn string

The Global DNS record (string)

Labels map[string]interface{}

Labels for Global DNS (map)

MultiClusterAppId string

The MultiCluster App ID to assign to the Global DNS. Conflicts with project_ids (string)

Name string

The name of the Global DNS (string)

ProjectIds []string

A list of project_ids to assign to the Global DNS. Conflicts with multi_cluster_app_id (list(string))

ProviderId string

The Global DNS provider ID to use (string)

Ttl int

TTL in seconds for DNS record. Default: 300 (int)

annotations {[key: string]: any}

Annotations for Global DNS (map)

fqdn string

The Global DNS record (string)

labels {[key: string]: any}

Labels for Global DNS (map)

multiClusterAppId string

The MultiCluster App ID to assign to the Global DNS. Conflicts with project_ids (string)

name string

The name of the Global DNS (string)

projectIds string[]

A list of project_ids to assign to the Global DNS. Conflicts with multi_cluster_app_id (list(string))

providerId string

The Global DNS provider ID to use (string)

ttl number

TTL in seconds for DNS record. Default: 300 (int)

annotations Mapping[str, Any]

Annotations for Global DNS (map)

fqdn str

The Global DNS record (string)

labels Mapping[str, Any]

Labels for Global DNS (map)

multi_cluster_app_id str

The MultiCluster App ID to assign to the Global DNS. Conflicts with project_ids (string)

name str

The name of the Global DNS (string)

project_ids Sequence[str]

A list of project_ids to assign to the Global DNS. Conflicts with multi_cluster_app_id (list(string))

provider_id str

The Global DNS provider ID to use (string)

ttl int

TTL in seconds for DNS record. Default: 300 (int)

Import

Global DNS Entry can be imported using the Rancher Global DNS ID

 $ pulumi import rancher2:index/globalDns:GlobalDns foo <global_dns_id>

Package Details

Repository
https://github.com/pulumi/pulumi-rancher2
License
Apache-2.0
Notes
This Pulumi package is based on the rancher2 Terraform Provider.