diff --git a/ibm/data_source_ibm_is_vpc.go b/ibm/data_source_ibm_is_vpc.go index c4a8910e8c..282baa0e98 100644 --- a/ibm/data_source_ibm_is_vpc.go +++ b/ibm/data_source_ibm_is_vpc.go @@ -25,6 +25,12 @@ func dataSourceIBMISVPC() *schema.Resource { Computed: true, }, + isVPCDefaultRoutingTable: { + Type: schema.TypeString, + Computed: true, + Description: "Default routing table associated with VPC", + }, + isVPCName: { Type: schema.TypeString, Required: true, @@ -517,6 +523,9 @@ func vpcGetByName(d *schema.ResourceData, meta interface{}, name string) error { } else { d.Set(isVPCDefaultNetworkACL, nil) } + if vpc.DefaultRoutingTable != nil { + d.Set(isVPCDefaultRoutingTable, *vpc.DefaultRoutingTable.ID) + } if vpc.DefaultSecurityGroup != nil { d.Set(isVPCIDefaultSecurityGroup, *vpc.DefaultSecurityGroup.ID) } else { diff --git a/ibm/resource_ibm_is_vpc.go b/ibm/resource_ibm_is_vpc.go index 5656965394..6b091e3063 100644 --- a/ibm/resource_ibm_is_vpc.go +++ b/ibm/resource_ibm_is_vpc.go @@ -19,6 +19,7 @@ import ( const ( isVPCDefaultNetworkACL = "default_network_acl" isVPCIDefaultSecurityGroup = "default_security_group" + isVPCDefaultRoutingTable = "default_routing_table" isVPCName = "name" isVPCResourceGroup = "resource_group" isVPCStatus = "status" @@ -89,6 +90,12 @@ func resourceIBMISVPC() *schema.Resource { Description: "Default network ACL", }, + isVPCDefaultRoutingTable: { + Type: schema.TypeString, + Computed: true, + Description: "Default routing table associated with VPC", + }, + isVPCClassicAccess: { Type: schema.TypeBool, ForceNew: true, @@ -796,6 +803,9 @@ func vpcGet(d *schema.ResourceData, meta interface{}, id string) error { } else { d.Set(isVPCIDefaultSecurityGroup, nil) } + if vpc.DefaultRoutingTable != nil { + d.Set(isVPCDefaultRoutingTable, *vpc.DefaultRoutingTable.ID) + } tags, err := GetTagsUsingCRN(meta, *vpc.CRN) if err != nil { log.Printf( diff --git a/website/docs/d/is_vpc.html.markdown b/website/docs/d/is_vpc.html.markdown index eea6ca5373..7e0d79070c 100644 --- a/website/docs/d/is_vpc.html.markdown +++ b/website/docs/d/is_vpc.html.markdown @@ -38,6 +38,7 @@ The following attributes are exported: * `status` - The status of VPC. * `default_network_acl` - ID of the default network ACL. * `default_security_group` - The unique identifier of the VPC default security group. +* `default_routing_table` - The unique identifier of the VPC default routing table. * `classic_access` - Indicates whether this VPC is connected to Classic Infrastructure. * `resource_group` - The resource group ID where the VPC created. * `tags` - Tags associated with the instance. diff --git a/website/docs/r/is_vpc.html.markdown b/website/docs/r/is_vpc.html.markdown index ce95bfa675..40515948ce 100644 --- a/website/docs/r/is_vpc.html.markdown +++ b/website/docs/r/is_vpc.html.markdown @@ -48,6 +48,7 @@ The following attributes are exported: * `id` - The unique identifier of the VPC. * `crn` - The CRN of VPC. * `default_security_group` - The unique identifier of the VPC default security group. +* `default_routing_table` - The unique identifier of the VPC default routing table. * `default_network_acl` - The unique identifier of the VPC default Network ACL. * `status` - The status of VPC. * `cse_source_addresses` - A list describing the cloud service endpoint source ip adresses and zones. The nested cse_source_addresses block have the following structure: