1. Packages
  2. Alibaba Cloud
  3. API Docs
  4. dns
  5. AlidnsDomainAttachment
Alibaba Cloud v3.51.0 published on Saturday, Mar 23, 2024 by Pulumi

alicloud.dns.AlidnsDomainAttachment

Explore with Pulumi AI

alicloud logo
Alibaba Cloud v3.51.0 published on Saturday, Mar 23, 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 defaultDomainGroup = new alicloud.dns.DomainGroup("defaultDomainGroup", {domainGroupName: "tf-example"});
    const defaultAlidnsDomain = new alicloud.dns.AlidnsDomain("defaultAlidnsDomain", {
        domainName: "starmove.com",
        groupId: defaultDomainGroup.id,
        tags: {
            Created: "TF",
            For: "example",
        },
    });
    const defaultAlidnsInstance = new alicloud.dns.AlidnsInstance("defaultAlidnsInstance", {
        dnsSecurity: "basic",
        domainNumbers: "3",
        versionCode: "version_personal",
        period: 1,
        renewalStatus: "ManualRenewal",
    });
    const defaultAlidnsDomainAttachment = new alicloud.dns.AlidnsDomainAttachment("defaultAlidnsDomainAttachment", {
        instanceId: defaultAlidnsInstance.id,
        domainNames: [defaultAlidnsDomain.domainName],
    });
    
    import pulumi
    import pulumi_alicloud as alicloud
    
    default_domain_group = alicloud.dns.DomainGroup("defaultDomainGroup", domain_group_name="tf-example")
    default_alidns_domain = alicloud.dns.AlidnsDomain("defaultAlidnsDomain",
        domain_name="starmove.com",
        group_id=default_domain_group.id,
        tags={
            "Created": "TF",
            "For": "example",
        })
    default_alidns_instance = alicloud.dns.AlidnsInstance("defaultAlidnsInstance",
        dns_security="basic",
        domain_numbers="3",
        version_code="version_personal",
        period=1,
        renewal_status="ManualRenewal")
    default_alidns_domain_attachment = alicloud.dns.AlidnsDomainAttachment("defaultAlidnsDomainAttachment",
        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 {
    		defaultDomainGroup, err := dns.NewDomainGroup(ctx, "defaultDomainGroup", &dns.DomainGroupArgs{
    			DomainGroupName: pulumi.String("tf-example"),
    		})
    		if err != nil {
    			return err
    		}
    		defaultAlidnsDomain, err := dns.NewAlidnsDomain(ctx, "defaultAlidnsDomain", &dns.AlidnsDomainArgs{
    			DomainName: pulumi.String("starmove.com"),
    			GroupId:    defaultDomainGroup.ID(),
    			Tags: pulumi.Map{
    				"Created": pulumi.Any("TF"),
    				"For":     pulumi.Any("example"),
    			},
    		})
    		if err != nil {
    			return err
    		}
    		defaultAlidnsInstance, err := dns.NewAlidnsInstance(ctx, "defaultAlidnsInstance", &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, "defaultAlidnsDomainAttachment", &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 defaultDomainGroup = new AliCloud.Dns.DomainGroup("defaultDomainGroup", new()
        {
            DomainGroupName = "tf-example",
        });
    
        var defaultAlidnsDomain = new AliCloud.Dns.AlidnsDomain("defaultAlidnsDomain", new()
        {
            DomainName = "starmove.com",
            GroupId = defaultDomainGroup.Id,
            Tags = 
            {
                { "Created", "TF" },
                { "For", "example" },
            },
        });
    
        var defaultAlidnsInstance = new AliCloud.Dns.AlidnsInstance("defaultAlidnsInstance", new()
        {
            DnsSecurity = "basic",
            DomainNumbers = "3",
            VersionCode = "version_personal",
            Period = 1,
            RenewalStatus = "ManualRenewal",
        });
    
        var defaultAlidnsDomainAttachment = new AliCloud.Dns.AlidnsDomainAttachment("defaultAlidnsDomainAttachment", 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 defaultDomainGroup = new DomainGroup("defaultDomainGroup", DomainGroupArgs.builder()        
                .domainGroupName("tf-example")
                .build());
    
            var defaultAlidnsDomain = new AlidnsDomain("defaultAlidnsDomain", AlidnsDomainArgs.builder()        
                .domainName("starmove.com")
                .groupId(defaultDomainGroup.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:
      defaultDomainGroup:
        type: alicloud:dns:DomainGroup
        properties:
          domainGroupName: tf-example
      defaultAlidnsDomain:
        type: alicloud:dns:AlidnsDomain
        properties:
          domainName: starmove.com
          groupId: ${defaultDomainGroup.id}
          tags:
            Created: TF
            For: example
      defaultAlidnsInstance:
        type: alicloud:dns:AlidnsInstance
        properties:
          dnsSecurity: basic
          domainNumbers: 3
          versionCode: version_personal
          period: 1
          renewalStatus: ManualRenewal
      defaultAlidnsDomainAttachment:
        type: alicloud:dns:AlidnsDomainAttachment
        properties:
          instanceId: ${defaultAlidnsInstance.id}
          domainNames:
            - ${defaultAlidnsDomain.domainName}
    

    Create AlidnsDomainAttachment Resource

    new AlidnsDomainAttachment(name: string, args: AlidnsDomainAttachmentArgs, opts?: CustomResourceOptions);
    @overload
    def AlidnsDomainAttachment(resource_name: str,
                               opts: Optional[ResourceOptions] = None,
                               domain_names: Optional[Sequence[str]] = None,
                               instance_id: Optional[str] = None)
    @overload
    def AlidnsDomainAttachment(resource_name: str,
                               args: AlidnsDomainAttachmentArgs,
                               opts: Optional[ResourceOptions] = 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.
    
    
    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.

    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
    

    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.51.0 published on Saturday, Mar 23, 2024 by Pulumi