Skip to content

Commit

Permalink
new resource: `azurerm_spring_cloud_application_insights_application_…
Browse files Browse the repository at this point in the history
…performance_monitoring` (hashicorp#23107)
  • Loading branch information
ms-henglu authored Oct 2, 2023
1 parent a1537c3 commit 0963d65
Show file tree
Hide file tree
Showing 412 changed files with 26,000 additions and 4 deletions.
2 changes: 1 addition & 1 deletion .github/labeler-issue-triage.yml
Original file line number Diff line number Diff line change
Expand Up @@ -316,7 +316,7 @@ service/signalr:
- '### (|New or )Affected Resource\(s\)\/Data Source\(s\)((.|\n)*)azurerm_(signalr_s|web_pubsub)((.|\n)*)###'

service/spring:
- '### (|New or )Affected Resource\(s\)\/Data Source\(s\)((.|\n)*)azurerm_(spring_cloud_accelerator\W+|spring_cloud_active_deployment\W+|spring_cloud_api_portal\W+|spring_cloud_api_portal_custom_domain\W+|spring_cloud_app\W+|spring_cloud_app_cosmosdb_association\W+|spring_cloud_app_mysql_association\W+|spring_cloud_app_redis_association\W+|spring_cloud_application_live_view\W+|spring_cloud_build_deployment\W+|spring_cloud_build_pack_binding\W+|spring_cloud_builder\W+|spring_cloud_certificate\W+|spring_cloud_configuration_service\W+|spring_cloud_container_deployment\W+|spring_cloud_custom_domain\W+|spring_cloud_customized_accelerator\W+|spring_cloud_dev_tool_portal\W+|spring_cloud_gateway\W+|spring_cloud_gateway_custom_domain\W+|spring_cloud_gateway_route_config\W+|spring_cloud_java_deployment\W+|spring_cloud_service\W+|spring_cloud_storage\W+)((.|\n)*)###'
- '### (|New or )Affected Resource\(s\)\/Data Source\(s\)((.|\n)*)azurerm_(spring_cloud_accelerator\W+|spring_cloud_active_deployment\W+|spring_cloud_api_portal\W+|spring_cloud_api_portal_custom_domain\W+|spring_cloud_app\W+|spring_cloud_app_cosmosdb_association\W+|spring_cloud_app_mysql_association\W+|spring_cloud_app_redis_association\W+|spring_cloud_application_insights_application_performance_monitoring\W+|spring_cloud_application_live_view\W+|spring_cloud_build_deployment\W+|spring_cloud_build_pack_binding\W+|spring_cloud_builder\W+|spring_cloud_certificate\W+|spring_cloud_configuration_service\W+|spring_cloud_container_deployment\W+|spring_cloud_custom_domain\W+|spring_cloud_customized_accelerator\W+|spring_cloud_dev_tool_portal\W+|spring_cloud_gateway\W+|spring_cloud_gateway_custom_domain\W+|spring_cloud_gateway_route_config\W+|spring_cloud_java_deployment\W+|spring_cloud_service\W+|spring_cloud_storage\W+)((.|\n)*)###'

service/sql:
- '### (|New or )Affected Resource\(s\)\/Data Source\(s\)((.|\n)*)azurerm_sql_((.|\n)*)###'
Expand Down
4 changes: 3 additions & 1 deletion internal/clients/client.go
Original file line number Diff line number Diff line change
Expand Up @@ -314,7 +314,9 @@ func (client *Client) Build(ctx context.Context, o *common.ClientOptions) error
if client.AppInsights, err = applicationInsights.NewClient(o); err != nil {
return fmt.Errorf("building clients for ApplicationInsights: %+v", err)
}
client.AppPlatform = appPlatform.NewClient(o)
if client.AppPlatform, err = appPlatform.NewClient(o); err != nil {
return fmt.Errorf("building clients for AppPlatform: %+v", err)
}
client.AppService = appService.NewClient(o)
if client.ArcKubernetes, err = arckubernetes.NewClient(o); err != nil {
return fmt.Errorf("building clients for ArcKubernetes: %+v", err)
Expand Down
19 changes: 17 additions & 2 deletions internal/services/springcloud/client/client.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,17 @@
package client

import (
"fmt"

appplatform2 "github.com/hashicorp/go-azure-sdk/resource-manager/appplatform/2023-07-01-preview/appplatform"
"github.com/hashicorp/terraform-provider-azurerm/internal/common"
"github.com/tombuildsstuff/kermit/sdk/appplatform/2023-05-01-preview/appplatform"
)

type Client struct {
AppPlatformClient *appplatform2.AppPlatformClient

// TODO: convert to using hashicorp/go-azure-sdk
APIPortalClient *appplatform.APIPortalsClient
APIPortalCustomDomainClient *appplatform.APIPortalCustomDomainsClient
ApplicationAcceleratorClient *appplatform.ApplicationAcceleratorsClient
Expand Down Expand Up @@ -36,7 +42,13 @@ type Client struct {
StoragesClient *appplatform.StoragesClient
}

func NewClient(o *common.ClientOptions) *Client {
func NewClient(o *common.ClientOptions) (*Client, error) {
appPlatformClient, err := appplatform2.NewAppPlatformClientWithBaseURI(o.Environment.ResourceManager)
if err != nil {
return nil, fmt.Errorf("building AppPlatform client: %+v", err)
}
o.Configure(appPlatformClient.Client, o.Authorizers.ResourceManager)

apiPortalClient := appplatform.NewAPIPortalsClientWithBaseURI(o.ResourceManagerEndpoint, o.SubscriptionId)
o.ConfigureClient(&apiPortalClient.Client, o.ResourceManagerAuthorizer)

Expand Down Expand Up @@ -113,6 +125,9 @@ func NewClient(o *common.ClientOptions) *Client {
o.ConfigureClient(&storageClient.Client, o.ResourceManagerAuthorizer)

return &Client{
AppPlatformClient: appPlatformClient,

// TODO: port to `hashicorp/go-azure-sdk`
APIPortalClient: &apiPortalClient,
APIPortalCustomDomainClient: &apiPortalCustomDomainClient,
ApplicationAcceleratorClient: &applicationAcceleratorClient,
Expand All @@ -138,5 +153,5 @@ func NewClient(o *common.ClientOptions) *Client {
ServicesClient: &servicesClient,
ServiceRegistryClient: &serviceRegistryClient,
StoragesClient: &storageClient,
}
}, nil
}
1 change: 1 addition & 0 deletions internal/services/springcloud/registration.go
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,7 @@ func (r Registration) DataSources() []sdk.DataSource {

func (r Registration) Resources() []sdk.Resource {
return []sdk.Resource{
SpringCloudApplicationInsightsApplicationPerformanceMonitoringResource{},
SpringCloudAcceleratorResource{},
SpringCloudApplicationLiveViewResource{},
SpringCloudDevToolPortalResource{},
Expand Down
Loading

0 comments on commit 0963d65

Please sign in to comment.