Skip to content

Commit

Permalink
move "outbound_ip" to the top level
Browse files Browse the repository at this point in the history
  • Loading branch information
njuCZ committed Nov 19, 2020
1 parent ca97834 commit d9edb8e
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 18 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -111,22 +111,6 @@ func resourceArmSpringCloudService() *schema.Resource {
Computed: true,
ForceNew: true,
},

"outbound_ip": {
Type: schema.TypeList,
Computed: true,
Elem: &schema.Resource{
Schema: map[string]*schema.Schema{
"public_ips": {
Type: schema.TypeList,
Computed: true,
Elem: &schema.Schema{
Type: schema.TypeString,
},
},
},
},
},
},
},
},
Expand Down Expand Up @@ -225,6 +209,22 @@ func resourceArmSpringCloudService() *schema.Resource {
},
},

"outbound_ip": {
Type: schema.TypeList,
Computed: true,
Elem: &schema.Resource{
Schema: map[string]*schema.Schema{
"public_ips": {
Type: schema.TypeList,
Computed: true,
Elem: &schema.Schema{
Type: schema.TypeString,
},
},
},
},
},

"tags": tags.Schema(),
},
}
Expand Down Expand Up @@ -396,6 +396,11 @@ func resourceArmSpringCloudServiceRead(d *schema.ResourceData, meta interface{})
if err := d.Set("network", flattenArmSpringCloudNetwork(resp.Properties.NetworkProfile)); err != nil {
return fmt.Errorf("setting `network`: %+v", err)
}
if resp.Properties.NetworkProfile != nil {
if err := d.Set("outbound_ip", flattenArmSpringCloudNetworkOutboundIPs(resp.Properties.NetworkProfile.OutboundIPs)); err != nil {
return fmt.Errorf("setting `outbound_ip`: %+v", err)
}
}
if resp.Properties.ConfigServerProperties != nil && resp.Properties.ConfigServerProperties.ConfigServer != nil {
if props := resp.Properties.ConfigServerProperties.ConfigServer.GitProperty; props != nil {
if err := d.Set("config_server_git_setting", flattenArmSpringCloudConfigServerGitProperty(props, d)); err != nil {
Expand Down Expand Up @@ -821,7 +826,6 @@ func flattenArmSpringCloudNetwork(input *appplatform.NetworkProfile) []interface
"cidr_ranges": cidrRanges,
"app_network_resource_group": appNetworkResourceGroup,
"service_runtime_network_resource_group": serviceRuntimeNetworkResourceGroup,
"outbound_ip": flattenArmSpringCloudNetworkOutboundIPs(input.OutboundIPs),
},
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,7 @@ func TestAccAzureRMSpringCloudService_virtualNetwork(t *testing.T) {
testCheckAzureRMSpringCloudServiceExists(data.ResourceName),
resource.TestCheckResourceAttrSet(data.ResourceName, "network.0.service_runtime_network_resource_group"),
resource.TestCheckResourceAttrSet(data.ResourceName, "network.0.app_network_resource_group"),
resource.TestCheckResourceAttrSet(data.ResourceName, "network.0.outbound_ip.0.public_ips.0"),
resource.TestCheckResourceAttrSet(data.ResourceName, "outbound_ip.0.public_ips.0"),
),
},
data.ImportStep(
Expand Down

0 comments on commit d9edb8e

Please sign in to comment.