diff --git a/baiducloud/data_source_baiducloud_dns_customlines.go b/baiducloud/data_source_baiducloud_dns_customlines.go new file mode 100644 index 00000000..1e1d30e8 --- /dev/null +++ b/baiducloud/data_source_baiducloud_dns_customlines.go @@ -0,0 +1,167 @@ +/* +Use this data source to query Dns customline list. + +Example Usage + +```hcl +data "baiducloud_dns_customlines" "default" { + name = "xxxx" +} + +output "customlines" { + value = "${data.baiducloud_dns_customlines.default.customlines}" +} +``` +*/ +package baiducloud + +import ( + "github.com/baidubce/bce-sdk-go/services/dns" + "github.com/hashicorp/terraform-plugin-sdk/helper/resource" + "github.com/hashicorp/terraform-plugin-sdk/helper/schema" + "github.com/terraform-providers/terraform-provider-baiducloud/baiducloud/connectivity" +) + +func dataSourceBaiduCloudDnscustomlines() *schema.Resource { + return &schema.Resource{ + Read: dataSourceBaiduCloudDnscustomlinesRead, + + Schema: map[string]*schema.Schema{ + "output_file": { + Type: schema.TypeString, + Description: "DNS customlines search result output file", + Optional: true, + ForceNew: true, + }, + "filter": dataSourceFiltersSchema(), + + "customlines": { + Type: schema.TypeList, + Description: "customline list", + Computed: true, + Elem: &schema.Resource{ + Schema: map[string]*schema.Schema{ + "name": { + Type: schema.TypeString, + Description: "Dns customline name", + Computed: true, + }, + "lines": { + Type: schema.TypeSet, + Description: "lines of dns ", + Computed: true, + Elem: &schema.Schema{ + Type: schema.TypeString, + }, + }, + "line_id": { + Type: schema.TypeString, + Description: "Dns customline id", + Computed: true, + }, + "related_zone_count": { + Type: schema.TypeInt, + Description: "Dns customline related zone count", + Computed: true, + }, + "related_record_count": { + Type: schema.TypeInt, + Description: "Dns customline related record count", + Computed: true, + }, + }, + }, + }, + }, + } +} + +func dataSourceBaiduCloudDnscustomlinesRead(d *schema.ResourceData, meta interface{}) error { + + action := "List all dns customline name " + + dnscustomlineArgs := buildBaiduCloudCreatednscustomlineListArgs(d) + + customlines, err := listAllcustomlineList(dnscustomlineArgs, meta) + + addDebug(action, customlines) + + if err != nil { + if NotFoundError(err) { + d.SetId("") + return nil + } + return WrapErrorf(err, DefaultErrorMsg, "baiducloud_dns_customlines", action, BCESDKGoERROR) + } + + customlinesResult := make([]map[string]interface{}, 0) + + for _, customline := range customlines { + + innerMap := make(map[string]interface{}) + innerMap["line_id"] = customline.Id + innerMap["name"] = customline.Name + innerMap["lines"] = customline.Lines + innerMap["related_zone_count"] = customline.RelatedZoneCount + innerMap["related_record_count"] = customline.RelatedRecordCount + + if err != nil { + return WrapErrorf(err, DefaultErrorMsg, "baiducloud_dns_customlines", action, BCESDKGoERROR) + } + + customlinesResult = append(customlinesResult, innerMap) + } + + addDebug(action, customlinesResult) + + FilterDataSourceResult(d, &customlinesResult) + + if err := d.Set("customlines", customlinesResult); err != nil { + return WrapErrorf(err, DefaultErrorMsg, "baiducloud_dns_customlines", action, BCESDKGoERROR) + } + + d.SetId(resource.UniqueId()) + + if v, ok := d.GetOk("output_file"); ok && v.(string) != "" { + if err := writeToFile(v.(string), customlinesResult); err != nil { + return WrapErrorf(err, DefaultErrorMsg, "baiducloud_dns_customlines", action, BCESDKGoERROR) + } + } + return nil +} + +func listAllcustomlineList(args *dns.ListLineGroupRequest, meta interface{}) ([]dns.Line, error) { + client := meta.(*connectivity.BaiduClient) + + action := "List all dns customlines " + + customlines := make([]dns.Line, 0) + + for { + raw, err := client.WithDNSClient(func(dnsClient *dns.Client) (interface{}, error) { + return dnsClient.ListLineGroup(args) + }) + + if err != nil { + return nil, WrapErrorf(err, DefaultErrorMsg, "baiducloud_dns_customline", action, BCESDKGoERROR) + } + + result, _ := raw.(*dns.ListLineGroupResponse) + customlines = append(customlines, result.LineList...) + + if !*result.IsTruncated { + break + } + + args.Marker = *result.NextMarker + args.MaxKeys = int(*result.MaxKeys) + } + + return customlines, nil +} +func buildBaiduCloudCreatednscustomlineListArgs(d *schema.ResourceData) *dns.ListLineGroupRequest { + + request := &dns.ListLineGroupRequest{} + + return request +} diff --git a/baiducloud/data_source_baiducloud_dns_customlines_test.go b/baiducloud/data_source_baiducloud_dns_customlines_test.go new file mode 100644 index 00000000..7d5cc2d9 --- /dev/null +++ b/baiducloud/data_source_baiducloud_dns_customlines_test.go @@ -0,0 +1,69 @@ +package baiducloud + +import ( + "fmt" + "testing" + + "github.com/hashicorp/terraform-plugin-sdk/helper/resource" +) + +const ( + testAccDnscustomlinesDataSourceName = "data.baiducloud_dns_customlines.default" + testAccDnscustomlinesDataSourceAttrKeyPrefix = "customlines.0." +) + +//lintignore:AT003 +func TestAccBaiduCloudDnscustomlinesDataSourceSimple(t *testing.T) { + resource.Test(t, resource.TestCase{ + PreCheck: func() { + testAccPreCheck(t) + }, + Providers: testAccProviders, + Steps: []resource.TestStep{ + { + Config: testAccDnscustomlineByNameDataSourceSimpleConfig(), + Check: resource.ComposeTestCheckFunc( + testAccCheckBaiduCloudDataSourceId(testAccDnscustomlinesDataSourceName), + resource.TestCheckResourceAttrSet(testAccDnscustomlinesDataSourceAttrKeyPrefix, testAccDnscustomlinesDataSourceAttrKeyPrefix+"name"), + ), + }, + }, + }) +} + +func TestAccBaiduCloudDnscustomlinesDataSourceFull(t *testing.T) { + resource.Test(t, resource.TestCase{ + PreCheck: func() { + testAccPreCheck(t) + }, + Providers: testAccProviders, + Steps: []resource.TestStep{ + { + Config: testAccDnscustomlineDataSourceFullConfig(), + Check: resource.ComposeTestCheckFunc( + testAccCheckBaiduCloudDataSourceId(testAccDnscustomlinesDataSourceName), + resource.TestCheckResourceAttrSet(testAccDnscustomlinesDataSourceName, testAccDnscustomlinesDataSourceAttrKeyPrefix+"name"), + ), + }, + }, + }) +} + +func testAccDnscustomlineByNameDataSourceSimpleConfig() string { + return fmt.Sprintf(` +data "baiducloud_dns_customlines" "default" { +} +`) +} + +func testAccDnscustomlineDataSourceFullConfig() string { + return fmt.Sprintf(` +resource "baiducloud_dns_customline" "default" { + name = "testname" + lines = ["zhejiang.ct"] +} + +data "baiducloud_dns_customlines" "default" { +} +`) +} diff --git a/baiducloud/provider.go b/baiducloud/provider.go index 54ec0d89..33974c49 100644 --- a/baiducloud/provider.go +++ b/baiducloud/provider.go @@ -219,6 +219,7 @@ func Provider() terraform.ResourceProvider { "baiducloud_rds_security_ips": dataSourceBaiduCloudRdsSecurityIps(), "baiducloud_dtss": dataSourceBaiduCloudDtss(), "baiducloud_dns_zones": dataSourceBaiduCloudDnsZones(), + "baiducloud_dns_customlines": dataSourceBaiduCloudDnscustomlines(), "baiducloud_cdn_domains": cdn.DataSourceDomains(), "baiducloud_cdn_domain_certificate": cdn.DataSourceDomainCertificate(), "baiducloud_localdns_privatezones": dataSourceBaiduCloudLocalDnsPrivateZones(), @@ -291,6 +292,7 @@ func Provider() terraform.ResourceProvider { "baiducloud_rds_security_ip": resourceBaiduCloudRdsSecurityIp(), "baiducloud_dts": resourceBaiduCloudDts(), "baiducloud_dns_zone": resourceBaiduCloudDnsZone(), + "baiducloud_dns_customline": resourceBaiduCloudDnsCustomline(), "baiducloud_iam_user": resourceBaiduCloudIamUser(), "baiducloud_iam_group": resourceBaiduCloudIamGroup(), "baiducloud_iam_group_membership": resourceBaiduCloudIamGroupMembership(), diff --git a/baiducloud/resource_baiducloud_dns_customline.go b/baiducloud/resource_baiducloud_dns_customline.go new file mode 100644 index 00000000..10349bbd --- /dev/null +++ b/baiducloud/resource_baiducloud_dns_customline.go @@ -0,0 +1,314 @@ +/* +Provide a resource to create an Dns customline. + +Example Usage + +```hcl +resource "baiducloud_dns_customline" "default" { + name = "testDnscustomline" +} +``` +*/ +package baiducloud + +import ( + "github.com/baidubce/bce-sdk-go/services/dns" + "time" + + "github.com/baidubce/bce-sdk-go/bce" + "github.com/hashicorp/terraform-plugin-sdk/helper/resource" + "github.com/hashicorp/terraform-plugin-sdk/helper/schema" + "github.com/terraform-providers/terraform-provider-baiducloud/baiducloud/connectivity" +) + +func resourceBaiduCloudDnsCustomline() *schema.Resource { + return &schema.Resource{ + Create: resourceBaiduCloudDnscustomlineCreate, + Read: resourceBaiduCloudDnscustomlineRead, + Update: resourceBaiduCloudDnscustomlineUpdate, + Delete: resourceBaiduCloudDnscustomlineDelete, + + Importer: &schema.ResourceImporter{ + State: schema.ImportStatePassthrough, + }, + + Timeouts: &schema.ResourceTimeout{ + Create: schema.DefaultTimeout(10 * time.Minute), + Update: schema.DefaultTimeout(10 * time.Minute), + Delete: schema.DefaultTimeout(20 * time.Minute), + }, + + Schema: map[string]*schema.Schema{ + "name": { + Type: schema.TypeString, + Description: "Dns customline name", + Required: true, + ForceNew: true, + }, + "lines": { + Type: schema.TypeSet, + Description: "lines of dns ", + Required: true, + Elem: &schema.Schema{ + Type: schema.TypeString, + }, + }, + "line_id": { + Type: schema.TypeString, + Description: "Dns customline id", + Computed: true, + }, + "related_zone_count": { + Type: schema.TypeString, + Description: "Dns customline related zone count", + Computed: true, + }, + "related_record_count": { + Type: schema.TypeString, + Description: "Dns customline related record count", + Computed: true, + }, + }, + } +} + +func resourceBaiduCloudDnscustomlineCreate(d *schema.ResourceData, meta interface{}) error { + + client := meta.(*connectivity.BaiduClient) + + createArgs := buildBaiduCloudCreatednscustomlineArgs(d) + + action := "Create Dns customline " + createArgs.Name + + err := resource.Retry(d.Timeout(schema.TimeoutCreate), func() *resource.RetryError { + + raw, err := client.WithDNSClient(func(dnsClient *dns.Client) (interface{}, error) { + return nil, dnsClient.AddLineGroup(createArgs, buildClientToken()) + }) + + if err != nil { + if IsExceptedErrors(err, []string{bce.EINTERNAL_ERROR}) { + return resource.RetryableError(err) + } + return resource.NonRetryableError(err) + } + + addDebug(action, raw) + + d.SetId(resource.UniqueId()) + return nil + }) + + if err != nil { + return WrapErrorf(err, DefaultErrorMsg, "baiducloud_dns_customline", action, BCESDKGoERROR) + } + + return resourceBaiduCloudDnscustomlineRead(d, meta) +} + +func resourceBaiduCloudDnscustomlineRead(d *schema.ResourceData, meta interface{}) error { + + action := "Query DNS customline " + + queryArgs := buildBaiduCloudCreatednscustomlineQueryArgs(d) + + customlines, err := listAllcustomlines(queryArgs, meta) + + addDebug(action, customlines) + + if err != nil { + if NotFoundError(err) { + d.SetId("") + return nil + } + return WrapErrorf(err, DefaultErrorMsg, "baiducloud_dns_customline", action, BCESDKGoERROR) + } + + var customline dns.Line + for _, z := range customlines { + if z.Name == d.Get("name") { + customline = z + break + } + } + + d.Set("line_id", customline.Id) + + d.Set("related_zone_count", customline.RelatedZoneCount) + + d.Set("related_record_count", customline.RelatedRecordCount) + + return nil +} + +func resourceBaiduCloudDnscustomlineUpdate(d *schema.ResourceData, meta interface{}) error { + + client := meta.(*connectivity.BaiduClient) + + if d.HasChange("lines") { + + lineId := d.Get("line_id").(string) + + action := "Update Dns customline lineId is " + lineId + + updateArgs := buildBaiduCloudDnsLineUpdateLinesArgs(d) + + _, updateErr := client.WithDNSClient(func(dnsClient *dns.Client) (interface{}, error) { + return nil, dnsClient.UpdateLineGroup(lineId, updateArgs, buildClientToken()) + }) + + if updateErr != nil { + if IsExceptedErrors(updateErr, ObjectNotFound) { + return nil + } + return WrapErrorf(updateErr, DefaultErrorMsg, "baiducloud_dns_customline", action, BCESDKGoERROR) + + } + + addDebug(action, updateErr) + } + + if d.HasChange("name") { + + lineId := d.Get("line_id").(string) + + action := "Update Dns customline lineId is " + lineId + + updateArgs := buildBaiduCloudDnsLineUpdateNameArgs(d) + + _, updateErr := client.WithDNSClient(func(dnsClient *dns.Client) (interface{}, error) { + return nil, dnsClient.UpdateLineGroup(lineId, updateArgs, buildClientToken()) + }) + + if updateErr != nil { + if IsExceptedErrors(updateErr, ObjectNotFound) { + return nil + } + return WrapErrorf(updateErr, DefaultErrorMsg, "baiducloud_dns_customline", action, BCESDKGoERROR) + + } + + addDebug(action, updateErr) + } + + return resourceBaiduCloudDnscustomlineRead(d, meta) +} + +func resourceBaiduCloudDnscustomlineDelete(d *schema.ResourceData, meta interface{}) error { + + client := meta.(*connectivity.BaiduClient) + + lineId := d.Get("line_id").(string) + + action := "Delete dns customline lineId IS " + lineId + + _, err := client.WithDNSClient(func(dnsClient *dns.Client) (interface{}, error) { + return nil, dnsClient.DeleteLineGroup(lineId, buildClientToken()) + }) + + if err != nil { + if IsExceptedErrors(err, ObjectNotFound) { + return nil + } + return WrapErrorf(err, DefaultErrorMsg, "baiducloud_dns_customline", action, BCESDKGoERROR) + } + + return nil +} + +func buildBaiduCloudCreatednscustomlineQueryArgs(d *schema.ResourceData) *dns.ListLineGroupRequest { + + request := &dns.ListLineGroupRequest{} + + return request +} + +func buildBaiduCloudCreatednscustomlineArgs(d *schema.ResourceData) *dns.AddLineGroupRequest { + + request := &dns.AddLineGroupRequest{} + + if v, ok := d.GetOk("name"); ok && len(v.(string)) > 0 { + request.Name = v.(string) + } + + if lines, ok := d.GetOk("lines"); ok { + + group_lines := make([]string, 0) + for _, ip := range lines.(*schema.Set).List() { + group_lines = append(group_lines, ip.(string)) + } + request.Lines = group_lines + } + + return request +} + +func buildBaiduCloudDnsLineUpdateLinesArgs(d *schema.ResourceData) *dns.UpdateLineGroupRequest { + + request := &dns.UpdateLineGroupRequest{} + + if v, ok := d.GetOk("name"); ok && len(v.(string)) > 0 { + request.Name = v.(string) + } + + if lines, ok := d.GetOk("lines"); ok { + + group_lines := make([]string, 0) + for _, ip := range lines.(*schema.Set).List() { + group_lines = append(group_lines, ip.(string)) + } + request.Lines = group_lines + } + + return request +} + +func buildBaiduCloudDnsLineUpdateNameArgs(d *schema.ResourceData) *dns.UpdateLineGroupRequest { + + request := &dns.UpdateLineGroupRequest{} + + if v, ok := d.GetOk("name"); ok && len(v.(string)) > 0 { + request.Name = v.(string) + } + + if lines, ok := d.GetOk("lines"); ok { + + group_lines := make([]string, 0) + for _, ip := range lines.(*schema.Set).List() { + group_lines = append(group_lines, ip.(string)) + } + request.Lines = group_lines + } + + return request +} + +func listAllcustomlines(args *dns.ListLineGroupRequest, meta interface{}) ([]dns.Line, error) { + client := meta.(*connectivity.BaiduClient) + + action := "List all dns customlines " + + customlines := make([]dns.Line, 0) + + for { + raw, err := client.WithDNSClient(func(dnsClient *dns.Client) (interface{}, error) { + return dnsClient.ListLineGroup(args) + }) + + if err != nil { + return nil, WrapErrorf(err, DefaultErrorMsg, "baiducloud_dns_customline", action, BCESDKGoERROR) + } + + result, _ := raw.(*dns.ListLineGroupResponse) + customlines = append(customlines, result.LineList...) + + if !*result.IsTruncated { + break + } + + args.Marker = *result.NextMarker + args.MaxKeys = int(*result.MaxKeys) + } + + return customlines, nil +} diff --git a/baiducloud/resource_baiducloud_dns_customline_test.go b/baiducloud/resource_baiducloud_dns_customline_test.go new file mode 100644 index 00000000..a5817691 --- /dev/null +++ b/baiducloud/resource_baiducloud_dns_customline_test.go @@ -0,0 +1,157 @@ +package baiducloud + +import ( + "fmt" + "github.com/hashicorp/terraform-plugin-sdk/helper/resource" + "testing" +) + +const ( + testAccDnscustomlineResourceType = "baiducloud_dns_customline" + testAccDnscustomlineResourceName = testAccDnscustomlineResourceType + "." + BaiduCloudTestResourceName +) + +func TestAccBaiduCloudDnscustomlineSimple(t *testing.T) { + resource.Test(t, resource.TestCase{ + PreCheck: func() { + testAccPreCheck(t) + }, + Providers: testAccProviders, + + Steps: []resource.TestStep{ + { + Config: testAccDnscustomlineConfig("tf-test-acc-dns_customline"), + Check: resource.ComposeTestCheckFunc( + testAccCheckBaiduCloudDataSourceId(testAccDnscustomlineResourceName), + resource.TestCheckResourceAttrSet(testAccDnscustomlineResourceName, "name"), + ), + }, + }, + }) +} + +func TestAccBaiduCloudDnscustomlineUpdate(t *testing.T) { + resource.Test(t, resource.TestCase{ + PreCheck: func() { + testAccPreCheck(t) + }, + Providers: testAccProviders, + CheckDestroy: testAccBLBListenerDestory, + + Steps: []resource.TestStep{ + { + Config: testAccDnscustomlineConfig("tf-test-acc-dns_customline"), + Check: resource.ComposeTestCheckFunc( + testAccCheckBaiduCloudDataSourceId(testAccDnscustomlineResourceName), + resource.TestCheckResourceAttrSet(testAccDnscustomlineResourceName, "name"), + resource.TestCheckResourceAttrSet(testAccDnscustomlineResourceName, "lines"), + ), + }, + { + Config: testAccDnscustomlineConfig("tf-test-acc-dns_customline"), + Check: resource.ComposeTestCheckFunc( + testAccCheckBaiduCloudDataSourceId(testAccDnscustomlineResourceName), + resource.TestCheckResourceAttrSet(testAccDnscustomlineResourceName, "name"), + resource.TestCheckResourceAttrSet(testAccDnscustomlineResourceName, "lines"), + ), + }, + }, + }) +} + +func TestAccBaiduCloudDnscustomlineUpdateName(t *testing.T) { + resource.Test(t, resource.TestCase{ + PreCheck: func() { + testAccPreCheck(t) + }, + Providers: testAccProviders, + CheckDestroy: testAccBLBListenerDestory, + + Steps: []resource.TestStep{ + { + Config: testAccDnscustomlineConfig("tf-test-acc-dns_customline"), + Check: resource.ComposeTestCheckFunc( + testAccCheckBaiduCloudDataSourceId(testAccDnscustomlineResourceName), + resource.TestCheckResourceAttrSet(testAccDnscustomlineResourceName, "name"), + resource.TestCheckResourceAttrSet(testAccDnscustomlineResourceName, "lines"), + ), + }, + { + Config: testAccDnscustomlineConfigUpdateName("tf-test-acc-dns_customline"), + Check: resource.ComposeTestCheckFunc( + testAccCheckBaiduCloudDataSourceId(testAccDnscustomlineResourceName), + resource.TestCheckResourceAttrSet(testAccDnscustomlineResourceName, "name"), + resource.TestCheckResourceAttrSet(testAccDnscustomlineResourceName, "lines"), + ), + }, + }, + }) +} + +func TestAccBaiduCloudDnscustomlineUpdateLine(t *testing.T) { + resource.Test(t, resource.TestCase{ + PreCheck: func() { + testAccPreCheck(t) + }, + Providers: testAccProviders, + CheckDestroy: testAccBLBListenerDestory, + + Steps: []resource.TestStep{ + { + Config: testAccDnscustomlineConfig("tf-test-acc-dns_customline"), + Check: resource.ComposeTestCheckFunc( + testAccCheckBaiduCloudDataSourceId(testAccDnscustomlineResourceName), + resource.TestCheckResourceAttrSet(testAccDnscustomlineResourceName, "name"), + resource.TestCheckResourceAttrSet(testAccDnscustomlineResourceName, "lines"), + ), + }, + { + Config: testAccDnscustomlineConfigUpdateLines("tf-test-acc-dns_customline"), + Check: resource.ComposeTestCheckFunc( + testAccCheckBaiduCloudDataSourceId(testAccDnscustomlineResourceName), + resource.TestCheckResourceAttrSet(testAccDnscustomlineResourceName, "name"), + resource.TestCheckResourceAttrSet(testAccDnscustomlineResourceName, "lines"), + ), + }, + }, + }) +} + +func testAccDnscustomlineConfig(name string) string { + return fmt.Sprintf(` +variable "name" { + default = "%s" +} + +resource "baiducloud_dns_customline" "default" { + name = "testname" + lines = ["zhejiang.ct", "shanxi.ct"] +} +`, name) +} + +func testAccDnscustomlineConfigUpdateName(name string) string { + return fmt.Sprintf(` +variable "name" { + default = "%s" +} + +resource "baiducloud_dns_customline" "default" { + name = "testname1" + lines = ["zhejiang.ct", "shanxi.ct"] +} +`, name) +} + +func testAccDnscustomlineConfigUpdateLines(name string) string { + return fmt.Sprintf(` +variable "name" { + default = "%s" +} + +resource "baiducloud_dns_customline" "default" { + name = "testname" + lines = ["zhejiang.ct"] +} +`, name) +} diff --git a/website/docs/d/dns_customlines.html.markdown b/website/docs/d/dns_customlines.html.markdown new file mode 100644 index 00000000..01fe7690 --- /dev/null +++ b/website/docs/d/dns_customlines.html.markdown @@ -0,0 +1,48 @@ +--- +layout: "baiducloud" +page_title: "BaiduCloud: baiducloud_dns_customlines" +sidebar_current: "docs-baiducloud-datasource-dns_customlines" +description: |- + Use this data source to query Dns customline list. +--- + +# baiducloud_dns_customlines + +Use this data source to query Dns customline list. + +## Example Usage + +```hcl +data "baiducloud_dns_customlines" "default" { + name = "xxxx" +} + +output "customlines" { + value = "${data.baiducloud_dns_customlines.default.customlines}" +} +``` + +## Argument Reference + +The following arguments are supported: + +* `filter` - (Optional, ForceNew) only support filter string/int/bool value +* `output_file` - (Optional, ForceNew) DNS customlines search result output file + +The `filter` object supports the following: + +* `name` - (Required) filter variable name +* `values` - (Required) filter variable value list + +## Attributes Reference + +In addition to all arguments above, the following attributes are exported: + +* `customlines` - customline list + * `line_id` - Dns customline id + * `lines` - lines of dns + * `name` - Dns customline name + * `related_record_count` - Dns customline related record count + * `related_zone_count` - Dns customline related zone count + + diff --git a/website/docs/r/dns_customline.html.markdown b/website/docs/r/dns_customline.html.markdown new file mode 100644 index 00000000..f9e5d3de --- /dev/null +++ b/website/docs/r/dns_customline.html.markdown @@ -0,0 +1,36 @@ +--- +layout: "baiducloud" +page_title: "BaiduCloud: baiducloud_dns_customline" +sidebar_current: "docs-baiducloud-resource-dns_customline" +description: |- + Provide a resource to create an Dns customline. +--- + +# baiducloud_dns_customline + +Provide a resource to create an Dns customline. + +## Example Usage + +```hcl +resource "baiducloud_dns_customline" "default" { + name = "testDnscustomline" +} +``` + +## Argument Reference + +The following arguments are supported: + +* `lines` - (Required) lines of dns +* `name` - (Required, ForceNew) Dns customline name + +## Attributes Reference + +In addition to all arguments above, the following attributes are exported: + +* `line_id` - Dns customline id +* `related_record_count` - Dns customline related record count +* `related_zone_count` - Dns customline related zone count + +