1. Packages
  2. Alibaba Cloud
  3. API Docs
  4. dns
  5. AlidnsDomainAttachment
Alibaba Cloud v3.54.0 published on Wednesday, Apr 24, 2024 by Pulumi

alicloud.dns.AlidnsDomainAttachment

Explore with Pulumi AI

alicloud logo
Alibaba Cloud v3.54.0 published on Wednesday, Apr 24, 2024 by Pulumi

    Provides bind the domain name to the Alidns instance resource.

    NOTE: Available since v1.99.0.

    Example Usage

    import * as pulumi from "@pulumi/pulumi";
    import * as alicloud from "@pulumi/alicloud";
    
    const _default = new alicloud.dns.DomainGroup("default", {domainGroupName: "tf-example"});
    const defaultAlidnsDomain = new alicloud.dns.AlidnsDomain("default", {
        domainName: "starmove.com",
        groupId: _default.id,
        tags: {
            Created: "TF",
            For: "example",
        },
    });
    const defaultAlidnsInstance = new alicloud.dns.AlidnsInstance("default", {
        dnsSecurity: "basic",
        domainNumbers: "3",
        versionCode: "version_personal",
        period: 1,
        renewalStatus: "ManualRenewal",
    });
    const defaultAlidnsDomainAttachment = new alicloud.dns.AlidnsDomainAttachment("default", {
        instanceId: defaultAlidnsInstance.id,
        domainNames: [defaultAlidnsDomain.domainName],
    });
    
    import pulumi
    import pulumi_alicloud as alicloud
    
    default = alicloud.dns.DomainGroup("default", domain_group_name="tf-example")
    default_alidns_domain = alicloud.dns.AlidnsDomain("default",
        domain_name="starmove.com",
        group_id=default.id,
        tags={
            "Created": "TF",
            "For": "example",
        })
    default_alidns_instance = alicloud.dns.AlidnsInstance("default",
        dns_security="basic",
        domain_numbers="3",
        version_code="version_personal",
        period=1,
        renewal_status="ManualRenewal")
    default_alidns_domain_attachment = alicloud.dns.AlidnsDomainAttachment("default",
        instance_id=default_alidns_instance.id,
        domain_names=[default_alidns_domain.domain_name])
    
    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 {
    		_, err := dns.NewDomainGroup(ctx, "default", &dns.DomainGroupArgs{
    			DomainGroupName: pulumi.String("tf-example"),
    		})
    		if err != nil {
    			return err
    		}
    		defaultAlidnsDomain, err := dns.NewAlidnsDomain(ctx, "default", &dns.AlidnsDomainArgs{
    			DomainName: pulumi.String("starmove.com"),
    			GroupId:    _default.ID(),
    			Tags: pulumi.Map{
    				"Created": pulumi.Any("TF"),
    				"For":     pulumi.Any("example"),
    			},
    		})
    		if err != nil {
    			return err
    		}
    		defaultAlidnsInstance, err := dns.NewAlidnsInstance(ctx, "default", &dns.AlidnsInstanceArgs{
    			DnsSecurity:   pulumi.String("basic"),
    			DomainNumbers: pulumi.String("3"),
    			VersionCode:   pulumi.String("version_personal"),
    			Period:        pulumi.Int(1),
    			RenewalStatus: pulumi.String("ManualRenewal"),
    		})
    		if err != nil {
    			return err
    		}
    		_, err = dns.NewAlidnsDomainAttachment(ctx, "default", &dns.AlidnsDomainAttachmentArgs{
    			InstanceId: defaultAlidnsInstance.ID(),
    			DomainNames: pulumi.StringArray{
    				defaultAlidnsDomain.DomainName,
    			},
    		})
    		if err != nil {
    			return err
    		}
    		return nil
    	})
    }
    
    using System.Collections.Generic;
    using System.Linq;
    using Pulumi;
    using AliCloud = Pulumi.AliCloud;
    
    return await Deployment.RunAsync(() => 
    {
        var @default = new AliCloud.Dns.DomainGroup("default", new()
        {
            DomainGroupName = "tf-example",
        });
    
        var defaultAlidnsDomain = new AliCloud.Dns.AlidnsDomain("default", new()
        {
            DomainName = "starmove.com",
            GroupId = @default.Id,
            Tags = 
            {
                { "Created", "TF" },
                { "For", "example" },
            },
        });
    
        var defaultAlidnsInstance = new AliCloud.Dns.AlidnsInstance("default", new()
        {
            DnsSecurity = "basic",
            DomainNumbers = "3",
            VersionCode = "version_personal",
            Period = 1,
            RenewalStatus = "ManualRenewal",
        });
    
        var defaultAlidnsDomainAttachment = new AliCloud.Dns.AlidnsDomainAttachment("default", new()
        {
            InstanceId = defaultAlidnsInstance.Id,
            DomainNames = new[]
            {
                defaultAlidnsDomain.DomainName,
            },
        });
    
    });
    
    package generated_program;
    
    import com.pulumi.Context;
    import com.pulumi.Pulumi;
    import com.pulumi.core.Output;
    import com.pulumi.alicloud.dns.DomainGroup;
    import com.pulumi.alicloud.dns.DomainGroupArgs;
    import com.pulumi.alicloud.dns.AlidnsDomain;
    import com.pulumi.alicloud.dns.AlidnsDomainArgs;
    import com.pulumi.alicloud.dns.AlidnsInstance;
    import com.pulumi.alicloud.dns.AlidnsInstanceArgs;
    import com.pulumi.alicloud.dns.AlidnsDomainAttachment;
    import com.pulumi.alicloud.dns.AlidnsDomainAttachmentArgs;
    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 default_ = new DomainGroup("default", DomainGroupArgs.builder()        
                .domainGroupName("tf-example")
                .build());
    
            var defaultAlidnsDomain = new AlidnsDomain("defaultAlidnsDomain", AlidnsDomainArgs.builder()        
                .domainName("starmove.com")
                .groupId(default_.id())
                .tags(Map.ofEntries(
                    Map.entry("Created", "TF"),
                    Map.entry("For", "example")
                ))
                .build());
    
            var defaultAlidnsInstance = new AlidnsInstance("defaultAlidnsInstance", AlidnsInstanceArgs.builder()        
                .dnsSecurity("basic")
                .domainNumbers(3)
                .versionCode("version_personal")
                .period(1)
                .renewalStatus("ManualRenewal")
                .build());
    
            var defaultAlidnsDomainAttachment = new AlidnsDomainAttachment("defaultAlidnsDomainAttachment", AlidnsDomainAttachmentArgs.builder()        
                .instanceId(defaultAlidnsInstance.id())
                .domainNames(defaultAlidnsDomain.domainName())
                .build());
    
        }
    }
    
    resources:
      default:
        type: alicloud:dns:DomainGroup
        properties:
          domainGroupName: tf-example
      defaultAlidnsDomain:
        type: alicloud:dns:AlidnsDomain
        name: default
        properties:
          domainName: starmove.com
          groupId: ${default.id}
          tags:
            Created: TF
            For: example
      defaultAlidnsInstance:
        type: alicloud:dns:AlidnsInstance
        name: default
        properties:
          dnsSecurity: basic
          domainNumbers: 3
          versionCode: version_personal
          period: 1
          renewalStatus: ManualRenewal
      defaultAlidnsDomainAttachment:
        type: alicloud:dns:AlidnsDomainAttachment
        name: default
        properties:
          instanceId: ${defaultAlidnsInstance.id}
          domainNames:
            - ${defaultAlidnsDomain.domainName}
    

    Create AlidnsDomainAttachment Resource

    Resources are created with functions called constructors. To learn more about declaring and configuring resources, see Resources.

    Constructor syntax

    new AlidnsDomainAttachment(name: string, args: AlidnsDomainAttachmentArgs, opts?: CustomResourceOptions);
    @overload
    def AlidnsDomainAttachment(resource_name: str,
                               args: AlidnsDomainAttachmentArgs,
                               opts: Optional[ResourceOptions] = None)
    
    @overload
    def AlidnsDomainAttachment(resource_name: str,
                               opts: Optional[ResourceOptions] = None,
                               domain_names: Optional[Sequence[str]] = None,
                               instance_id: Optional[str] = None)
    func NewAlidnsDomainAttachment(ctx *Context, name string, args AlidnsDomainAttachmentArgs, opts ...ResourceOption) (*AlidnsDomainAttachment, error)
    public AlidnsDomainAttachment(string name, AlidnsDomainAttachmentArgs args, CustomResourceOptions? opts = null)
    public AlidnsDomainAttachment(String name, AlidnsDomainAttachmentArgs args)
    public AlidnsDomainAttachment(String name, AlidnsDomainAttachmentArgs args, CustomResourceOptions options)
    
    type: alicloud:dns:AlidnsDomainAttachment
    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 AlidnsDomainAttachmentArgs
    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 AlidnsDomainAttachmentArgs
    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 AlidnsDomainAttachmentArgs
    The arguments to resource properties.
    opts ResourceOption
    Bag of options to control resource's behavior.
    name string
    The unique name of the resource.
    args AlidnsDomainAttachmentArgs
    The arguments to resource properties.
    opts CustomResourceOptions
    Bag of options to control resource's behavior.
    name String
    The unique name of the resource.
    args AlidnsDomainAttachmentArgs
    The arguments to resource properties.
    options CustomResourceOptions
    Bag of options to control resource's behavior.

    Example

    The following reference example uses placeholder values for all input properties.

    var alidnsDomainAttachmentResource = new AliCloud.Dns.AlidnsDomainAttachment("alidnsDomainAttachmentResource", new()
    {
        DomainNames = new[]
        {
            "string",
        },
        InstanceId = "string",
    });
    
    example, err := dns.NewAlidnsDomainAttachment(ctx, "alidnsDomainAttachmentResource", &dns.AlidnsDomainAttachmentArgs{
    	DomainNames: pulumi.StringArray{
    		pulumi.String("string"),
    	},
    	InstanceId: pulumi.String("string"),
    })
    
    var alidnsDomainAttachmentResource = new AlidnsDomainAttachment("alidnsDomainAttachmentResource", AlidnsDomainAttachmentArgs.builder()        
        .domainNames("string")
        .instanceId("string")
        .build());
    
    alidns_domain_attachment_resource = alicloud.dns.AlidnsDomainAttachment("alidnsDomainAttachmentResource",
        domain_names=["string"],
        instance_id="string")
    
    const alidnsDomainAttachmentResource = new alicloud.dns.AlidnsDomainAttachment("alidnsDomainAttachmentResource", {
        domainNames: ["string"],
        instanceId: "string",
    });
    
    type: alicloud:dns:AlidnsDomainAttachment
    properties:
        domainNames:
            - string
        instanceId: string
    

    AlidnsDomainAttachment Resource Properties

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

    Inputs

    The AlidnsDomainAttachment resource accepts the following input properties:

    DomainNames List<string>
    The domain names bound to the DNS instance.
    InstanceId string
    The id of the DNS instance.
    DomainNames []string
    The domain names bound to the DNS instance.
    InstanceId string
    The id of the DNS instance.
    domainNames List<String>
    The domain names bound to the DNS instance.
    instanceId String
    The id of the DNS instance.
    domainNames string[]
    The domain names bound to the DNS instance.
    instanceId string
    The id of the DNS instance.
    domain_names Sequence[str]
    The domain names bound to the DNS instance.
    instance_id str
    The id of the DNS instance.
    domainNames List<String>
    The domain names bound to the DNS instance.
    instanceId String
    The id of the DNS instance.

    Outputs

    All input properties are implicitly available as output properties. Additionally, the AlidnsDomainAttachment 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 AlidnsDomainAttachment Resource

    Get an existing AlidnsDomainAttachment 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?: AlidnsDomainAttachmentState, opts?: CustomResourceOptions): AlidnsDomainAttachment
    @staticmethod
    def get(resource_name: str,
            id: str,
            opts: Optional[ResourceOptions] = None,
            domain_names: Optional[Sequence[str]] = None,
            instance_id: Optional[str] = None) -> AlidnsDomainAttachment
    func GetAlidnsDomainAttachment(ctx *Context, name string, id IDInput, state *AlidnsDomainAttachmentState, opts ...ResourceOption) (*AlidnsDomainAttachment, error)
    public static AlidnsDomainAttachment Get(string name, Input<string> id, AlidnsDomainAttachmentState? state, CustomResourceOptions? opts = null)
    public static AlidnsDomainAttachment get(String name, Output<String> id, AlidnsDomainAttachmentState 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.
    The following state arguments are supported:
    DomainNames List<string>
    The domain names bound to the DNS instance.
    InstanceId string
    The id of the DNS instance.
    DomainNames []string
    The domain names bound to the DNS instance.
    InstanceId string
    The id of the DNS instance.
    domainNames List<String>
    The domain names bound to the DNS instance.
    instanceId String
    The id of the DNS instance.
    domainNames string[]
    The domain names bound to the DNS instance.
    instanceId string
    The id of the DNS instance.
    domain_names Sequence[str]
    The domain names bound to the DNS instance.
    instance_id str
    The id of the DNS instance.
    domainNames List<String>
    The domain names bound to the DNS instance.
    instanceId String
    The id of the DNS instance.

    Import

    DNS domain attachment can be imported using the id, e.g.

    $ pulumi import alicloud:dns/alidnsDomainAttachment:AlidnsDomainAttachment example dns-cn-v0h1ldjhxxx
    

    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.
    alicloud logo
    Alibaba Cloud v3.54.0 published on Wednesday, Apr 24, 2024 by Pulumi