alicloud.dns.DnsDomain
Explore with Pulumi AI
Provides a DNS domain resource.
DEPRECATED: This resource has been renamed to alicloud.dns.AlidnsDomain from version 1.95.0.
NOTE: The domain name which you want to add must be already registered and had not added by another account. Every domain name can only exist in a unique group.
NOTE: Available in v1.81.0+.
Example Usage
import * as pulumi from "@pulumi/pulumi";
import * as alicloud from "@pulumi/alicloud";
// Add a new Domain.
const dns = new alicloud.dns.DnsDomain("dns", {
domainName: "starmove.com",
groupId: "85ab8713-4a30-4de4-9d20-155ff830****",
tags: {
Created: "Terraform",
Environment: "test",
},
});
import pulumi
import pulumi_alicloud as alicloud
# Add a new Domain.
dns = alicloud.dns.DnsDomain("dns",
domain_name="starmove.com",
group_id="85ab8713-4a30-4de4-9d20-155ff830****",
tags={
"Created": "Terraform",
"Environment": "test",
})
package main
import (
"github.com/pulumi/pulumi-alicloud/sdk/v3/go/alicloud/dns"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)
func main() {
pulumi.Run(func(ctx *pulumi.Context) error {
// Add a new Domain.
_, err := dns.NewDnsDomain(ctx, "dns", &dns.DnsDomainArgs{
DomainName: pulumi.String("starmove.com"),
GroupId: pulumi.String("85ab8713-4a30-4de4-9d20-155ff830****"),
Tags: pulumi.StringMap{
"Created": pulumi.String("Terraform"),
"Environment": pulumi.String("test"),
},
})
if err != nil {
return err
}
return nil
})
}
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using AliCloud = Pulumi.AliCloud;
return await Deployment.RunAsync(() =>
{
// Add a new Domain.
var dns = new AliCloud.Dns.DnsDomain("dns", new()
{
DomainName = "starmove.com",
GroupId = "85ab8713-4a30-4de4-9d20-155ff830****",
Tags =
{
{ "Created", "Terraform" },
{ "Environment", "test" },
},
});
});
package generated_program;
import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.alicloud.dns.DnsDomain;
import com.pulumi.alicloud.dns.DnsDomainArgs;
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) {
// Add a new Domain.
var dns = new DnsDomain("dns", DnsDomainArgs.builder()
.domainName("starmove.com")
.groupId("85ab8713-4a30-4de4-9d20-155ff830****")
.tags(Map.ofEntries(
Map.entry("Created", "Terraform"),
Map.entry("Environment", "test")
))
.build());
}
}
resources:
# Add a new Domain.
dns:
type: alicloud:dns:DnsDomain
properties:
domainName: starmove.com
groupId: 85ab8713-4a30-4de4-9d20-155ff830****
tags:
Created: Terraform
Environment: test
Create DnsDomain Resource
Resources are created with functions called constructors. To learn more about declaring and configuring resources, see Resources.
Constructor syntax
new DnsDomain(name: string, args: DnsDomainArgs, opts?: CustomResourceOptions);
@overload
def DnsDomain(resource_name: str,
args: DnsDomainArgs,
opts: Optional[ResourceOptions] = None)
@overload
def DnsDomain(resource_name: str,
opts: Optional[ResourceOptions] = None,
domain_name: Optional[str] = None,
group_id: Optional[str] = None,
lang: Optional[str] = None,
remark: Optional[str] = None,
resource_group_id: Optional[str] = None,
tags: Optional[Mapping[str, str]] = None)
func NewDnsDomain(ctx *Context, name string, args DnsDomainArgs, opts ...ResourceOption) (*DnsDomain, error)
public DnsDomain(string name, DnsDomainArgs args, CustomResourceOptions? opts = null)
public DnsDomain(String name, DnsDomainArgs args)
public DnsDomain(String name, DnsDomainArgs args, CustomResourceOptions options)
type: alicloud:dns:DnsDomain
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 DnsDomainArgs
- 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 DnsDomainArgs
- 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 DnsDomainArgs
- The arguments to resource properties.
- opts ResourceOption
- Bag of options to control resource's behavior.
- name string
- The unique name of the resource.
- args DnsDomainArgs
- The arguments to resource properties.
- opts CustomResourceOptions
- Bag of options to control resource's behavior.
- name String
- The unique name of the resource.
- args DnsDomainArgs
- 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 dnsDomainResource = new AliCloud.Dns.DnsDomain("dnsDomainResource", new()
{
DomainName = "string",
GroupId = "string",
Lang = "string",
Remark = "string",
ResourceGroupId = "string",
Tags =
{
{ "string", "string" },
},
});
example, err := dns.NewDnsDomain(ctx, "dnsDomainResource", &dns.DnsDomainArgs{
DomainName: pulumi.String("string"),
GroupId: pulumi.String("string"),
Lang: pulumi.String("string"),
Remark: pulumi.String("string"),
ResourceGroupId: pulumi.String("string"),
Tags: pulumi.StringMap{
"string": pulumi.String("string"),
},
})
var dnsDomainResource = new DnsDomain("dnsDomainResource", DnsDomainArgs.builder()
.domainName("string")
.groupId("string")
.lang("string")
.remark("string")
.resourceGroupId("string")
.tags(Map.of("string", "string"))
.build());
dns_domain_resource = alicloud.dns.DnsDomain("dnsDomainResource",
domain_name="string",
group_id="string",
lang="string",
remark="string",
resource_group_id="string",
tags={
"string": "string",
})
const dnsDomainResource = new alicloud.dns.DnsDomain("dnsDomainResource", {
domainName: "string",
groupId: "string",
lang: "string",
remark: "string",
resourceGroupId: "string",
tags: {
string: "string",
},
});
type: alicloud:dns:DnsDomain
properties:
domainName: string
groupId: string
lang: string
remark: string
resourceGroupId: string
tags:
string: string
DnsDomain 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 DnsDomain resource accepts the following input properties:
- Domain
Name string - Name of the domain. This name without suffix can have a string of 1 to 63 characters(domain name subject, excluding suffix), must contain only alphanumeric characters or "-", and must not begin or end with "-", and "-" must not in the 3th and 4th character positions at the same time. Suffix
.sh
and.tel
are not supported. - Group
Id string - Id of the group in which the domain will add. If not supplied, then use default group.
- Lang string
- User language.
- Remark string
- Remarks information for your domain name.
- Resource
Group stringId - The Id of resource group which the dns domain belongs.
- Dictionary<string, string>
- A mapping of tags to assign to the resource.
- Key: It can be up to 64 characters in length. It cannot begin with "aliyun", "acs:", "http://", or "https://". It cannot be a null string.
- Value: It can be up to 128 characters in length. It cannot begin with "aliyun", "acs:", "http://", or "https://". It can be a null string.
- Domain
Name string - Name of the domain. This name without suffix can have a string of 1 to 63 characters(domain name subject, excluding suffix), must contain only alphanumeric characters or "-", and must not begin or end with "-", and "-" must not in the 3th and 4th character positions at the same time. Suffix
.sh
and.tel
are not supported. - Group
Id string - Id of the group in which the domain will add. If not supplied, then use default group.
- Lang string
- User language.
- Remark string
- Remarks information for your domain name.
- Resource
Group stringId - The Id of resource group which the dns domain belongs.
- map[string]string
- A mapping of tags to assign to the resource.
- Key: It can be up to 64 characters in length. It cannot begin with "aliyun", "acs:", "http://", or "https://". It cannot be a null string.
- Value: It can be up to 128 characters in length. It cannot begin with "aliyun", "acs:", "http://", or "https://". It can be a null string.
- domain
Name String - Name of the domain. This name without suffix can have a string of 1 to 63 characters(domain name subject, excluding suffix), must contain only alphanumeric characters or "-", and must not begin or end with "-", and "-" must not in the 3th and 4th character positions at the same time. Suffix
.sh
and.tel
are not supported. - group
Id String - Id of the group in which the domain will add. If not supplied, then use default group.
- lang String
- User language.
- remark String
- Remarks information for your domain name.
- resource
Group StringId - The Id of resource group which the dns domain belongs.
- Map<String,String>
- A mapping of tags to assign to the resource.
- Key: It can be up to 64 characters in length. It cannot begin with "aliyun", "acs:", "http://", or "https://". It cannot be a null string.
- Value: It can be up to 128 characters in length. It cannot begin with "aliyun", "acs:", "http://", or "https://". It can be a null string.
- domain
Name string - Name of the domain. This name without suffix can have a string of 1 to 63 characters(domain name subject, excluding suffix), must contain only alphanumeric characters or "-", and must not begin or end with "-", and "-" must not in the 3th and 4th character positions at the same time. Suffix
.sh
and.tel
are not supported. - group
Id string - Id of the group in which the domain will add. If not supplied, then use default group.
- lang string
- User language.
- remark string
- Remarks information for your domain name.
- resource
Group stringId - The Id of resource group which the dns domain belongs.
- {[key: string]: string}
- A mapping of tags to assign to the resource.
- Key: It can be up to 64 characters in length. It cannot begin with "aliyun", "acs:", "http://", or "https://". It cannot be a null string.
- Value: It can be up to 128 characters in length. It cannot begin with "aliyun", "acs:", "http://", or "https://". It can be a null string.
- domain_
name str - Name of the domain. This name without suffix can have a string of 1 to 63 characters(domain name subject, excluding suffix), must contain only alphanumeric characters or "-", and must not begin or end with "-", and "-" must not in the 3th and 4th character positions at the same time. Suffix
.sh
and.tel
are not supported. - group_
id str - Id of the group in which the domain will add. If not supplied, then use default group.
- lang str
- User language.
- remark str
- Remarks information for your domain name.
- resource_
group_ strid - The Id of resource group which the dns domain belongs.
- Mapping[str, str]
- A mapping of tags to assign to the resource.
- Key: It can be up to 64 characters in length. It cannot begin with "aliyun", "acs:", "http://", or "https://". It cannot be a null string.
- Value: It can be up to 128 characters in length. It cannot begin with "aliyun", "acs:", "http://", or "https://". It can be a null string.
- domain
Name String - Name of the domain. This name without suffix can have a string of 1 to 63 characters(domain name subject, excluding suffix), must contain only alphanumeric characters or "-", and must not begin or end with "-", and "-" must not in the 3th and 4th character positions at the same time. Suffix
.sh
and.tel
are not supported. - group
Id String - Id of the group in which the domain will add. If not supplied, then use default group.
- lang String
- User language.
- remark String
- Remarks information for your domain name.
- resource
Group StringId - The Id of resource group which the dns domain belongs.
- Map<String>
- A mapping of tags to assign to the resource.
- Key: It can be up to 64 characters in length. It cannot begin with "aliyun", "acs:", "http://", or "https://". It cannot be a null string.
- Value: It can be up to 128 characters in length. It cannot begin with "aliyun", "acs:", "http://", or "https://". It can be a null string.
Outputs
All input properties are implicitly available as output properties. Additionally, the DnsDomain resource produces the following output properties:
- Dns
Servers List<string> - Domain
Id string - The domain ID.
- Group
Name string - Id string
- The provider-assigned unique ID for this managed resource.
- Puny
Code string
- Dns
Servers []string - Domain
Id string - The domain ID.
- Group
Name string - Id string
- The provider-assigned unique ID for this managed resource.
- Puny
Code string
- dns
Servers List<String> - domain
Id String - The domain ID.
- group
Name String - id String
- The provider-assigned unique ID for this managed resource.
- puny
Code String
- dns
Servers string[] - domain
Id string - The domain ID.
- group
Name string - id string
- The provider-assigned unique ID for this managed resource.
- puny
Code string
- dns_
servers Sequence[str] - domain_
id str - The domain ID.
- group_
name str - id str
- The provider-assigned unique ID for this managed resource.
- puny_
code str
- dns
Servers List<String> - domain
Id String - The domain ID.
- group
Name String - id String
- The provider-assigned unique ID for this managed resource.
- puny
Code String
Look up Existing DnsDomain Resource
Get an existing DnsDomain 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?: DnsDomainState, opts?: CustomResourceOptions): DnsDomain
@staticmethod
def get(resource_name: str,
id: str,
opts: Optional[ResourceOptions] = None,
dns_servers: Optional[Sequence[str]] = None,
domain_id: Optional[str] = None,
domain_name: Optional[str] = None,
group_id: Optional[str] = None,
group_name: Optional[str] = None,
lang: Optional[str] = None,
puny_code: Optional[str] = None,
remark: Optional[str] = None,
resource_group_id: Optional[str] = None,
tags: Optional[Mapping[str, str]] = None) -> DnsDomain
func GetDnsDomain(ctx *Context, name string, id IDInput, state *DnsDomainState, opts ...ResourceOption) (*DnsDomain, error)
public static DnsDomain Get(string name, Input<string> id, DnsDomainState? state, CustomResourceOptions? opts = null)
public static DnsDomain get(String name, Output<String> id, DnsDomainState state, CustomResourceOptions options)
Resource lookup is not supported in YAML
- 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
Servers List<string> - Domain
Id string - The domain ID.
- Domain
Name string - Name of the domain. This name without suffix can have a string of 1 to 63 characters(domain name subject, excluding suffix), must contain only alphanumeric characters or "-", and must not begin or end with "-", and "-" must not in the 3th and 4th character positions at the same time. Suffix
.sh
and.tel
are not supported. - Group
Id string - Id of the group in which the domain will add. If not supplied, then use default group.
- Group
Name string - Lang string
- User language.
- Puny
Code string - Remark string
- Remarks information for your domain name.
- Resource
Group stringId - The Id of resource group which the dns domain belongs.
- Dictionary<string, string>
- A mapping of tags to assign to the resource.
- Key: It can be up to 64 characters in length. It cannot begin with "aliyun", "acs:", "http://", or "https://". It cannot be a null string.
- Value: It can be up to 128 characters in length. It cannot begin with "aliyun", "acs:", "http://", or "https://". It can be a null string.
- Dns
Servers []string - Domain
Id string - The domain ID.
- Domain
Name string - Name of the domain. This name without suffix can have a string of 1 to 63 characters(domain name subject, excluding suffix), must contain only alphanumeric characters or "-", and must not begin or end with "-", and "-" must not in the 3th and 4th character positions at the same time. Suffix
.sh
and.tel
are not supported. - Group
Id string - Id of the group in which the domain will add. If not supplied, then use default group.
- Group
Name string - Lang string
- User language.
- Puny
Code string - Remark string
- Remarks information for your domain name.
- Resource
Group stringId - The Id of resource group which the dns domain belongs.
- map[string]string
- A mapping of tags to assign to the resource.
- Key: It can be up to 64 characters in length. It cannot begin with "aliyun", "acs:", "http://", or "https://". It cannot be a null string.
- Value: It can be up to 128 characters in length. It cannot begin with "aliyun", "acs:", "http://", or "https://". It can be a null string.
- dns
Servers List<String> - domain
Id String - The domain ID.
- domain
Name String - Name of the domain. This name without suffix can have a string of 1 to 63 characters(domain name subject, excluding suffix), must contain only alphanumeric characters or "-", and must not begin or end with "-", and "-" must not in the 3th and 4th character positions at the same time. Suffix
.sh
and.tel
are not supported. - group
Id String - Id of the group in which the domain will add. If not supplied, then use default group.
- group
Name String - lang String
- User language.
- puny
Code String - remark String
- Remarks information for your domain name.
- resource
Group StringId - The Id of resource group which the dns domain belongs.
- Map<String,String>
- A mapping of tags to assign to the resource.
- Key: It can be up to 64 characters in length. It cannot begin with "aliyun", "acs:", "http://", or "https://". It cannot be a null string.
- Value: It can be up to 128 characters in length. It cannot begin with "aliyun", "acs:", "http://", or "https://". It can be a null string.
- dns
Servers string[] - domain
Id string - The domain ID.
- domain
Name string - Name of the domain. This name without suffix can have a string of 1 to 63 characters(domain name subject, excluding suffix), must contain only alphanumeric characters or "-", and must not begin or end with "-", and "-" must not in the 3th and 4th character positions at the same time. Suffix
.sh
and.tel
are not supported. - group
Id string - Id of the group in which the domain will add. If not supplied, then use default group.
- group
Name string - lang string
- User language.
- puny
Code string - remark string
- Remarks information for your domain name.
- resource
Group stringId - The Id of resource group which the dns domain belongs.
- {[key: string]: string}
- A mapping of tags to assign to the resource.
- Key: It can be up to 64 characters in length. It cannot begin with "aliyun", "acs:", "http://", or "https://". It cannot be a null string.
- Value: It can be up to 128 characters in length. It cannot begin with "aliyun", "acs:", "http://", or "https://". It can be a null string.
- dns_
servers Sequence[str] - domain_
id str - The domain ID.
- domain_
name str - Name of the domain. This name without suffix can have a string of 1 to 63 characters(domain name subject, excluding suffix), must contain only alphanumeric characters or "-", and must not begin or end with "-", and "-" must not in the 3th and 4th character positions at the same time. Suffix
.sh
and.tel
are not supported. - group_
id str - Id of the group in which the domain will add. If not supplied, then use default group.
- group_
name str - lang str
- User language.
- puny_
code str - remark str
- Remarks information for your domain name.
- resource_
group_ strid - The Id of resource group which the dns domain belongs.
- Mapping[str, str]
- A mapping of tags to assign to the resource.
- Key: It can be up to 64 characters in length. It cannot begin with "aliyun", "acs:", "http://", or "https://". It cannot be a null string.
- Value: It can be up to 128 characters in length. It cannot begin with "aliyun", "acs:", "http://", or "https://". It can be a null string.
- dns
Servers List<String> - domain
Id String - The domain ID.
- domain
Name String - Name of the domain. This name without suffix can have a string of 1 to 63 characters(domain name subject, excluding suffix), must contain only alphanumeric characters or "-", and must not begin or end with "-", and "-" must not in the 3th and 4th character positions at the same time. Suffix
.sh
and.tel
are not supported. - group
Id String - Id of the group in which the domain will add. If not supplied, then use default group.
- group
Name String - lang String
- User language.
- puny
Code String - remark String
- Remarks information for your domain name.
- resource
Group StringId - The Id of resource group which the dns domain belongs.
- Map<String>
- A mapping of tags to assign to the resource.
- Key: It can be up to 64 characters in length. It cannot begin with "aliyun", "acs:", "http://", or "https://". It cannot be a null string.
- Value: It can be up to 128 characters in length. It cannot begin with "aliyun", "acs:", "http://", or "https://". It can be a null string.
Import
DNS domain can be imported using the id or domain name, e.g.
$ pulumi import alicloud:dns/dnsDomain:DnsDomain example aliyun.com
To learn more about importing existing cloud resources, see Importing resources.
Package Details
- Repository
- Alibaba Cloud pulumi/pulumi-alicloud
- License
- Apache-2.0
- Notes
- This Pulumi package is based on the
alicloud
Terraform Provider.