Skip to content

Commit

Permalink
azurerm_subscription_cost_management_scheduled_action - New resource (
Browse files Browse the repository at this point in the history
#21325)

* `azurerm_subscription_cost_management_scheduled_action` - New resource

* Importtest

* Docs

* Extend updatetest and extra frequency fields added

* Remove random dot

Co-authored-by: stephybun <[email protected]>

* Improve `view_name` description

Co-authored-by: stephybun <[email protected]>

* Improve `email_addresses` description

Co-authored-by: stephybun <[email protected]>

* Condensing

Co-authored-by: stephybun <[email protected]>

* Condensing some more..

Co-authored-by: stephybun <[email protected]>

* TypeList fixes

* Improve readability

* Refactor view_name to view_id

* Use view scope for general scope of scheduled action

* Refactor base resource into scheduled action

* Docs refactored

* Remove unused generated ID

---------

Co-authored-by: stephybun <[email protected]>
  • Loading branch information
aristosvo and stephybun authored Apr 20, 2023
1 parent b64c146 commit 83613a6
Show file tree
Hide file tree
Showing 32 changed files with 2,493 additions and 6 deletions.
21 changes: 15 additions & 6 deletions internal/services/costmanagement/client/client.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,14 +5,16 @@ import (

"github.com/hashicorp/go-azure-sdk/resource-manager/costmanagement/2021-10-01/exports"
"github.com/hashicorp/go-azure-sdk/resource-manager/costmanagement/2022-06-01-preview/scheduledactions"
scheduledactions_v2022_10_01 "github.com/hashicorp/go-azure-sdk/resource-manager/costmanagement/2022-10-01/scheduledactions"
"github.com/hashicorp/go-azure-sdk/resource-manager/costmanagement/2022-10-01/views"
"github.com/hashicorp/terraform-provider-azurerm/internal/common"
)

type Client struct {
ExportClient *exports.ExportsClient
ScheduledActionsClient *scheduledactions.ScheduledActionsClient
ViewsClient *views.ViewsClient
ExportClient *exports.ExportsClient
ScheduledActionsClient *scheduledactions.ScheduledActionsClient
ScheduledActionsClient_v2022_10_01 *scheduledactions_v2022_10_01.ScheduledActionsClient
ViewsClient *views.ViewsClient
}

func NewClient(o *common.ClientOptions) (*Client, error) {
Expand All @@ -28,15 +30,22 @@ func NewClient(o *common.ClientOptions) (*Client, error) {
}
o.Configure(scheduledActionsClient.Client, o.Authorizers.ResourceManager)

scheduledActionsClient_v2022_10_01, err := scheduledactions_v2022_10_01.NewScheduledActionsClientWithBaseURI(o.Environment.ResourceManager)
if err != nil {
return nil, fmt.Errorf("building ScheduledActions client: %+v", err)
}
o.Configure(scheduledActionsClient_v2022_10_01.Client, o.Authorizers.ResourceManager)

viewsClient, err := views.NewViewsClientWithBaseURI(o.Environment.ResourceManager)
if err != nil {
return nil, fmt.Errorf("building Views client: %+v", err)
}
o.Configure(viewsClient.Client, o.Authorizers.ResourceManager)

return &Client{
ExportClient: exportClient,
ScheduledActionsClient: scheduledActionsClient,
ViewsClient: viewsClient,
ExportClient: exportClient,
ScheduledActionsClient: scheduledActionsClient,
ScheduledActionsClient_v2022_10_01: scheduledActionsClient_v2022_10_01,
ViewsClient: viewsClient,
}, nil
}
1 change: 1 addition & 0 deletions internal/services/costmanagement/registration.go
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ func (r Registration) Resources() []sdk.Resource {
SubscriptionCostManagementExportResource{},
SubscriptionCostManagementViewResource{},
ResourceGroupCostManagementViewResource{},
CostManagementScheduledActionResource{},
AnomalyAlertResource{},
}
}
Expand Down
Loading

0 comments on commit 83613a6

Please sign in to comment.