Skip to content

Commit

Permalink
fix: id changed to subscription_id
Browse files Browse the repository at this point in the history
  • Loading branch information
burythehammer committed Jul 9, 2024
1 parent 970c4e6 commit afe8335
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion provider/datasource_rediscloud_essentials_plan.go
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,12 @@ func dataSourceRedisCloudEssentialsPlan() *schema.Resource {
Computed: true,
Optional: true,
},
"subscription_id": {
Description: "ID of the subscription that the database belongs to",
Type: schema.TypeInt,
Computed: true,
Optional: true,
},
"cloud_provider": {
Description: "The cloud provider: 'AWS', 'GCP' or 'Azure'",
Type: schema.TypeString,
Expand Down Expand Up @@ -296,7 +302,7 @@ func getResourceList(ctx context.Context, d *schema.ResourceData, api *apiClient
var list []*plans.GetPlanResponse
var err error

if id, ok := d.GetOk("id"); ok {
if id, ok := d.GetOk("subscription_id"); ok {
list, err = api.client.FixedPlanSubscriptions.List(ctx, id.(int))
} else if provider, ok := d.GetOk("cloud_provider"); ok {
list, err = api.client.FixedPlans.ListWithProvider(ctx, strings.ToUpper(provider.(string)))
Expand Down

0 comments on commit afe8335

Please sign in to comment.