Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 10 additions & 1 deletion tencentcloud/resource_tc_vpc.go
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,15 @@ func resourceTencentCloudVpcInstance() *schema.Resource {
"assistant_cidrs": {
Type: schema.TypeList,
Optional: true,
Description: "List of Assistant CIDR.",
Description: "List of Assistant CIDR, NOTE: Only `NORMAL` typed CIDRs included, check the Docker CIDR by readonly `assistant_docker_cidrs`.",
Computed: true,
Elem: &schema.Schema{
Type: schema.TypeString,
},
},
"docker_assistant_cidrs": {
Type: schema.TypeList,
Description: "List of Docker Assistant CIDR.",
Computed: true,
Elem: &schema.Schema{
Type: schema.TypeString,
Expand Down Expand Up @@ -256,6 +264,7 @@ func resourceTencentCloudVpcInstanceRead(d *schema.ResourceData, meta interface{
_ = d.Set("create_time", info.createTime)
_ = d.Set("is_default", info.isDefault)
_ = d.Set("assistant_cidrs", info.assistantCidrs)
_ = d.Set("docker_assistant_cidrs", info.dockerAssistantCidrs)
_ = d.Set("tags", tags)

return nil
Expand Down
26 changes: 16 additions & 10 deletions tencentcloud/service_tencentcloud_vpc.go
Original file line number Diff line number Diff line change
Expand Up @@ -27,15 +27,16 @@ var eipUnattachLocker = &sync.Mutex{}

// VPC basic information
type VpcBasicInfo struct {
vpcId string
name string
cidr string
isMulticast bool
isDefault bool
dnsServers []string
createTime string
tags []*vpc.Tag
assistantCidrs []string
vpcId string
name string
cidr string
isMulticast bool
isDefault bool
dnsServers []string
createTime string
tags []*vpc.Tag
assistantCidrs []string
dockerAssistantCidrs []string
}

// subnet basic information
Expand Down Expand Up @@ -353,8 +354,13 @@ getMoreData:

if len(item.AssistantCidrSet) > 0 {
for i := range item.AssistantCidrSet {
kind := item.AssistantCidrSet[i].AssistantType
cidr := item.AssistantCidrSet[i].CidrBlock
basicInfo.assistantCidrs = append(basicInfo.assistantCidrs, *cidr)
if kind != nil && *kind == 0 {
basicInfo.assistantCidrs = append(basicInfo.assistantCidrs, *cidr)
} else {
basicInfo.dockerAssistantCidrs = append(basicInfo.dockerAssistantCidrs, *cidr)
}
}
}

Expand Down
3 changes: 2 additions & 1 deletion website/docs/r/vpc.html.markdown
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ The following arguments are supported:

* `cidr_block` - (Required, String, ForceNew) A network address block which should be a subnet of the three internal network segments (10.0.0.0/16, 172.16.0.0/12 and 192.168.0.0/16).
* `name` - (Required, String) The name of the VPC.
* `assistant_cidrs` - (Optional, List: [`String`]) List of Assistant CIDR.
* `assistant_cidrs` - (Optional, List: [`String`]) List of Assistant CIDR, NOTE: Only `NORMAL` typed CIDRs included, check the Docker CIDR by readonly `assistant_docker_cidrs`.
* `dns_servers` - (Optional, Set: [`String`]) The DNS server list of the VPC. And you can specify 0 to 5 servers to this list.
* `is_multicast` - (Optional, Bool) Indicates whether VPC multicast is enabled. The default value is 'true'.
* `tags` - (Optional, Map) Tags of the VPC.
Expand All @@ -59,6 +59,7 @@ In addition to all arguments above, the following attributes are exported:
* `id` - ID of the resource.
* `create_time` - Creation time of VPC.
* `default_route_table_id` - Default route table id, which created automatically after VPC create.
* `docker_assistant_cidrs` - List of Docker Assistant CIDR.
* `is_default` - Indicates whether it is the default VPC for this region.


Expand Down