Skip to content

Commit

Permalink
Merge pull request #245 from Juniper/bug/244
Browse files Browse the repository at this point in the history
Copy missing `id` field from API response into `apstra_datacenter_routing_zone`
  • Loading branch information
chrismarget-j authored Aug 4, 2023
2 parents 095fa71 + 5450afa commit f13b705
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 4 deletions.
4 changes: 2 additions & 2 deletions apstra/blueprint/datacenter_routing_zone.go
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ func (o DatacenterRoutingZone) DataSourceAttributes() map[string]dataSourceSchem
},
"had_prior_vlan_id_config": dataSourceSchema.BoolAttribute{
MarkdownDescription: "Used to trigger plan modification when `vlan_id` has been removed from the " +
"configuration in managed resource context, this attribute will always be `false` and should be " +
"configuration in managed resource context, this attribute will always be `null` and should be " +
"ignored in data source context.",
Computed: true,
},
Expand All @@ -87,7 +87,7 @@ func (o DatacenterRoutingZone) DataSourceAttributes() map[string]dataSourceSchem
},
"had_prior_vni_config": dataSourceSchema.BoolAttribute{
MarkdownDescription: "Used to trigger plan modification when `vni` has been removed from the " +
"configuration in managed resource context, this attribute will always be `false` and should be " +
"configuration in managed resource context, this attribute will always be `null` and should be " +
"ignored in data source context.",
Computed: true,
},
Expand Down
3 changes: 3 additions & 0 deletions apstra/data_source_datacenter_routing_zone.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ import (
"github.com/hashicorp/terraform-plugin-framework/datasource"
"github.com/hashicorp/terraform-plugin-framework/datasource/schema"
"github.com/hashicorp/terraform-plugin-framework/path"
"github.com/hashicorp/terraform-plugin-framework/types"
"terraform-provider-apstra/apstra/blueprint"
"terraform-provider-apstra/apstra/utils"
)
Expand Down Expand Up @@ -86,6 +87,8 @@ func (o *dataSourceDatacenterRoutingZone) Read(ctx context.Context, req datasour
return
}
}

config.Id = types.StringValue(api.Id.String())
config.LoadApiData(ctx, api.Data, &resp.Diagnostics)
if resp.Diagnostics.HasError() {
return
Expand Down
4 changes: 2 additions & 2 deletions docs/data-sources/datacenter_routing_zone.md
Original file line number Diff line number Diff line change
Expand Up @@ -60,8 +60,8 @@ output "routing_zone" {
### Read-Only

- `dhcp_servers` (Set of String) Set of DHCP server IPv4 or IPv6 addresses of DHCP servers.
- `had_prior_vlan_id_config` (Boolean) Used to trigger plan modification when `vlan_id` has been removed from the configuration in managed resource context, this attribute will always be `false` and should be ignored in data source context.
- `had_prior_vni_config` (Boolean) Used to trigger plan modification when `vni` has been removed from the configuration in managed resource context, this attribute will always be `false` and should be ignored in data source context.
- `had_prior_vlan_id_config` (Boolean) Used to trigger plan modification when `vlan_id` has been removed from the configuration in managed resource context, this attribute will always be `null` and should be ignored in data source context.
- `had_prior_vni_config` (Boolean) Used to trigger plan modification when `vni` has been removed from the configuration in managed resource context, this attribute will always be `null` and should be ignored in data source context.
- `routing_policy_id` (String) Non-EVPN blueprints must use the default policy, so this field must be null. Set this attribute in an EVPN blueprint to use a non-default policy.
- `vlan_id` (Number) Used for VLAN tagged Layer 3 links on external connections. Leave this field blank to have it automatically assigned from a static pool in the range of 2-4094), or enter a specific value.
- `vni` (Number) VxLAN VNI associated with the routing zone. Leave this field blank to have it automatically assigned from an allocated resource pool, or enter a specific value.

0 comments on commit f13b705

Please sign in to comment.