Skip to content

Commit

Permalink
add zone_balancing to ds
Browse files Browse the repository at this point in the history
  • Loading branch information
jackofallops committed Apr 5, 2022
1 parent 1d75e4b commit 3b7c137
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 6 deletions.
16 changes: 10 additions & 6 deletions internal/services/appservice/service_plan_data_source.go
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ type ServicePlanDataSourceModel struct {
Reserved bool `tfschema:"reserved"`
WorkerCount int `tfschema:"worker_count"`
MaximumElasticWorkerCount int `tfschema:"maximum_elastic_worker_count"`
ZoneBalancing bool `tfschema:"zone_balancing_enabled"`
Tags map[string]string `tfschema:"tags"`
}

Expand Down Expand Up @@ -98,6 +99,11 @@ func (r ServicePlanDataSource) Attributes() map[string]*pluginsdk.Schema {
Computed: true,
},

"zone_balancing_enabled": {
Type: pluginsdk.TypeBool,
Computed: true,
},

"tags": tags.SchemaDataSource(),
}
}
Expand Down Expand Up @@ -147,13 +153,11 @@ func (r ServicePlanDataSource) Read() sdk.ResourceFunc {
servicePlan.AppServiceEnvironmentId = utils.NormalizeNilableString(props.HostingEnvironmentProfile.ID)
}

if v := props.PerSiteScaling; v != nil {
servicePlan.PerSiteScaling = *v
}
servicePlan.PerSiteScaling = utils.NormaliseNilableBool(props.PerSiteScaling)

if v := props.Reserved; v != nil {
servicePlan.Reserved = *v
}
servicePlan.Reserved = utils.NormaliseNilableBool(props.Reserved)

servicePlan.ZoneBalancing = utils.NormaliseNilableBool(props.ZoneRedundant)

servicePlan.MaximumElasticWorkerCount = int(utils.NormaliseNilableInt32(props.MaximumElasticWorkerCount))
}
Expand Down
2 changes: 2 additions & 0 deletions website/docs/d/service_plan.html.markdown
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,8 @@ In addition to the Arguments listed above - the following Attributes are exporte

* `sku_name` - The SKU for the Service Plan.

* `zone_balancing_enabled` - Is the Service Plan balance across Availability Zones in the region?

* `tags` - A mapping of tags assigned to the Service Plan.

## Timeouts
Expand Down

0 comments on commit 3b7c137

Please sign in to comment.