From 79a62089b7db7a702665126f6ea4a2120ad0d0b3 Mon Sep 17 00:00:00 2001 From: Heng Lu Date: Thu, 12 Oct 2023 09:51:23 +0800 Subject: [PATCH 1/8] new resource: `azurerm_spring_cloud_dynatrace_application_performance_monitoring` --- internal/services/springcloud/registration.go | 1 + ...ication_performance_monitoring_resource.go | 349 ++++++++++++++++++ ...on_performance_monitoring_resource_test.go | 175 +++++++++ ...ation_performance_monitoring.html.markdown | 92 +++++ 4 files changed, 617 insertions(+) create mode 100644 internal/services/springcloud/spring_cloud_dynatrace_application_performance_monitoring_resource.go create mode 100644 internal/services/springcloud/spring_cloud_dynatrace_application_performance_monitoring_resource_test.go create mode 100644 website/docs/r/spring_cloud_dynatrace_application_performance_monitoring.html.markdown diff --git a/internal/services/springcloud/registration.go b/internal/services/springcloud/registration.go index dd27876dad11..43e7b22ea91e 100644 --- a/internal/services/springcloud/registration.go +++ b/internal/services/springcloud/registration.go @@ -71,6 +71,7 @@ func (r Registration) DataSources() []sdk.DataSource { func (r Registration) Resources() []sdk.Resource { return []sdk.Resource{ + SpringCloudDynatraceApplicationPerformanceMonitoringResource{}, SpringCloudApplicationInsightsApplicationPerformanceMonitoringResource{}, SpringCloudAcceleratorResource{}, SpringCloudApplicationLiveViewResource{}, diff --git a/internal/services/springcloud/spring_cloud_dynatrace_application_performance_monitoring_resource.go b/internal/services/springcloud/spring_cloud_dynatrace_application_performance_monitoring_resource.go new file mode 100644 index 000000000000..f2e2e56c7084 --- /dev/null +++ b/internal/services/springcloud/spring_cloud_dynatrace_application_performance_monitoring_resource.go @@ -0,0 +1,349 @@ +package springcloud + +import ( + "context" + "fmt" + "time" + + "github.com/hashicorp/go-azure-helpers/lang/response" + "github.com/hashicorp/go-azure-sdk/resource-manager/appplatform/2023-09-01-preview/appplatform" + "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" + "github.com/hashicorp/terraform-provider-azurerm/internal/sdk" + "github.com/hashicorp/terraform-provider-azurerm/internal/services/springcloud/validate" + "github.com/hashicorp/terraform-provider-azurerm/internal/tf/pluginsdk" + "github.com/hashicorp/terraform-provider-azurerm/internal/tf/validation" + "github.com/hashicorp/terraform-provider-azurerm/utils" +) + +type SpringCloudDynatraceApplicationPerformanceMonitoringModel struct { + Name string `tfschema:"name"` + SpringCloudServiceId string `tfschema:"spring_cloud_service_id"` + GloballyEnabled bool `tfschema:"globally_enabled"` + ApiUrl string `tfschema:"api_url"` + ApiToken string `tfschema:"api_token"` + ConnectionPoint string `tfschema:"connection_point"` + EnvironmentId string `tfschema:"environment_id"` + Tenant string `tfschema:"tenant"` + TenantToken string `tfschema:"tenant_token"` +} + +type SpringCloudDynatraceApplicationPerformanceMonitoringResource struct{} + +var _ sdk.ResourceWithUpdate = SpringCloudDynatraceApplicationPerformanceMonitoringResource{} + +func (s SpringCloudDynatraceApplicationPerformanceMonitoringResource) ResourceType() string { + return "azurerm_spring_cloud_dynatrace_application_performance_monitoring" +} + +func (s SpringCloudDynatraceApplicationPerformanceMonitoringResource) ModelObject() interface{} { + return &SpringCloudDynatraceApplicationPerformanceMonitoringModel{} +} + +func (s SpringCloudDynatraceApplicationPerformanceMonitoringResource) IDValidationFunc() pluginsdk.SchemaValidateFunc { + return appplatform.ValidateApmID +} + +func (s SpringCloudDynatraceApplicationPerformanceMonitoringResource) Arguments() map[string]*schema.Schema { + return map[string]*pluginsdk.Schema{ + "name": { + Type: pluginsdk.TypeString, + Required: true, + ForceNew: true, + ValidateFunc: validation.StringIsNotEmpty, + }, + + "spring_cloud_service_id": { + Type: pluginsdk.TypeString, + Required: true, + ForceNew: true, + ValidateFunc: validate.SpringCloudServiceID, + }, + + "globally_enabled": { + Type: pluginsdk.TypeBool, + Optional: true, + Default: false, + }, + + "connection_point": { + Type: pluginsdk.TypeString, + Required: true, + ValidateFunc: validation.StringIsNotEmpty, + }, + + "environment_id": { + Type: pluginsdk.TypeString, + Optional: true, + ValidateFunc: validation.StringIsNotEmpty, + }, + + "tenant_token": { + Type: pluginsdk.TypeString, + Required: true, + ValidateFunc: validation.StringIsNotEmpty, + }, + + "api_url": { + Type: pluginsdk.TypeString, + Optional: true, + ValidateFunc: validation.StringIsNotEmpty, + }, + + "api_token": { + Type: pluginsdk.TypeString, + Optional: true, + ValidateFunc: validation.StringIsNotEmpty, + }, + + "tenant": { + Type: pluginsdk.TypeString, + Required: true, + ValidateFunc: validation.StringIsNotEmpty, + }, + } +} + +func (s SpringCloudDynatraceApplicationPerformanceMonitoringResource) Attributes() map[string]*schema.Schema { + return map[string]*pluginsdk.Schema{} +} + +func (s SpringCloudDynatraceApplicationPerformanceMonitoringResource) Create() sdk.ResourceFunc { + return sdk.ResourceFunc{ + Timeout: 30 * time.Minute, + Func: func(ctx context.Context, metadata sdk.ResourceMetaData) error { + var model SpringCloudDynatraceApplicationPerformanceMonitoringModel + if err := metadata.Decode(&model); err != nil { + return fmt.Errorf("decoding: %+v", err) + } + + client := metadata.Client.AppPlatform.AppPlatformClient + springId, err := appplatform.ParseSpringID(model.SpringCloudServiceId) + if err != nil { + return fmt.Errorf("parsing spring service ID: %+v", err) + } + id := appplatform.NewApmID(springId.SubscriptionId, springId.ResourceGroupName, springId.SpringName, model.Name) + + existing, err := client.ApmsGet(ctx, id) + if err != nil && !response.WasNotFound(existing.HttpResponse) { + return fmt.Errorf("checking for existing %s: %+v", id, err) + } + if !response.WasNotFound(existing.HttpResponse) { + return metadata.ResourceRequiresImport(s.ResourceType(), id) + } + + resource := appplatform.ApmResource{ + Properties: &appplatform.ApmProperties{ + Type: "Dynatrace", + Properties: utils.ToPtr(map[string]string{ + "api-url": model.ApiUrl, + "connection_point": model.ConnectionPoint, + "environment-id": model.EnvironmentId, + }), + Secrets: utils.ToPtr(map[string]string{ + "api-token": model.ApiToken, + "tenanttoken": model.TenantToken, + "tenant": model.Tenant, + }), + }, + } + err = client.ApmsCreateOrUpdateThenPoll(ctx, id, resource) + if err != nil { + return fmt.Errorf("creating %s: %+v", id, err) + } + + if model.GloballyEnabled { + apmReference := appplatform.ApmReference{ + ResourceId: id.ID(), + } + err = client.ServicesEnableApmGloballyThenPoll(ctx, *springId, apmReference) + if err != nil { + return fmt.Errorf("enabling %s globally: %+v", id, err) + } + } + + metadata.SetID(id) + return nil + }, + } +} + +func (s SpringCloudDynatraceApplicationPerformanceMonitoringResource) Update() sdk.ResourceFunc { + return sdk.ResourceFunc{ + Timeout: 30 * time.Minute, + Func: func(ctx context.Context, metadata sdk.ResourceMetaData) error { + client := metadata.Client.AppPlatform.AppPlatformClient + + id, err := appplatform.ParseApmID(metadata.ResourceData.Id()) + if err != nil { + return err + } + + var model SpringCloudDynatraceApplicationPerformanceMonitoringModel + if err := metadata.Decode(&model); err != nil { + return fmt.Errorf("decoding: %+v", err) + } + + resp, err := client.ApmsGet(ctx, *id) + if err != nil { + return fmt.Errorf("retrieving %s: %+v", *id, err) + } + + properties := resp.Model.Properties + if properties == nil { + return fmt.Errorf("retrieving %s: properties was nil", id) + } + if properties.Properties == nil { + properties.Properties = utils.ToPtr(map[string]string{}) + } + if properties.Secrets == nil { + properties.Secrets = utils.ToPtr(map[string]string{}) + } + + if metadata.ResourceData.HasChange("api_url") { + (*properties.Properties)["api-url"] = model.ApiUrl + } + + if metadata.ResourceData.HasChange("api_token") { + (*properties.Secrets)["api-token"] = model.ApiToken + } + + if metadata.ResourceData.HasChange("connection_point") { + (*properties.Properties)["connection_point"] = model.ConnectionPoint + } + + if metadata.ResourceData.HasChange("environment_id") { + (*properties.Properties)["environment-id"] = model.EnvironmentId + } + + if metadata.ResourceData.HasChange("tenant") { + (*properties.Secrets)["tenant"] = model.Tenant + } + + if metadata.ResourceData.HasChange("tenant_token") { + (*properties.Secrets)["tenanttoken"] = model.TenantToken + } + + resource := appplatform.ApmResource{ + Properties: properties, + } + + err = client.ApmsCreateOrUpdateThenPoll(ctx, *id, resource) + if err != nil { + return fmt.Errorf("updating %s: %+v", id, err) + } + + if metadata.ResourceData.HasChange("globally_enabled") { + apmReference := appplatform.ApmReference{ + ResourceId: id.ID(), + } + springId := appplatform.NewSpringID(id.SubscriptionId, id.ResourceGroupName, id.SpringName) + if model.GloballyEnabled { + err := client.ServicesEnableApmGloballyThenPoll(ctx, springId, apmReference) + if err != nil { + return fmt.Errorf("enabling %s globally: %+v", id, err) + } + } else { + err := client.ServicesDisableApmGloballyThenPoll(ctx, springId, apmReference) + if err != nil { + return fmt.Errorf("disabling %s globally: %+v", id, err) + } + } + } + + return nil + }, + } +} + +func (s SpringCloudDynatraceApplicationPerformanceMonitoringResource) Read() sdk.ResourceFunc { + return sdk.ResourceFunc{ + Timeout: 5 * time.Minute, + Func: func(ctx context.Context, metadata sdk.ResourceMetaData) error { + client := metadata.Client.AppPlatform.AppPlatformClient + + id, err := appplatform.ParseApmID(metadata.ResourceData.Id()) + if err != nil { + return err + } + + resp, err := client.ApmsGet(ctx, *id) + if err != nil { + if response.WasNotFound(resp.HttpResponse) { + return metadata.MarkAsGone(id) + } + + return fmt.Errorf("retrieving %s: %+v", *id, err) + } + + springId := appplatform.NewSpringID(id.SubscriptionId, id.ResourceGroupName, id.SpringName) + result, err := client.ServicesListGloballyEnabledApms(ctx, springId) + if err != nil { + return fmt.Errorf("listing globally enabled apms: %+v", err) + } + globallyEnabled := false + if result.Model != nil && result.Model.Value != nil { + for _, value := range *result.Model.Value { + apmId, err := appplatform.ParseApmIDInsensitively(value) + if err == nil && apmId.ID() == id.ID() { + globallyEnabled = true + break + } + } + } + + var model SpringCloudDynatraceApplicationPerformanceMonitoringModel + if err := metadata.Decode(&model); err != nil { + return fmt.Errorf("decoding: %+v", err) + } + + state := SpringCloudDynatraceApplicationPerformanceMonitoringModel{ + Name: id.ApmName, + SpringCloudServiceId: springId.ID(), + GloballyEnabled: globallyEnabled, + ApiToken: model.ApiToken, + TenantToken: model.TenantToken, + Tenant: model.Tenant, + } + + if props := resp.Model.Properties; props != nil { + if props.Type != "Dynatrace" { + return fmt.Errorf("retrieving %s: type was not Dynatrace", *id) + } + if props.Properties != nil { + if value, ok := (*props.Properties)["api-url"]; ok { + state.ApiUrl = value + } + if value, ok := (*props.Properties)["connection_point"]; ok { + state.ConnectionPoint = value + } + if value, ok := (*props.Properties)["environment-id"]; ok { + state.EnvironmentId = value + } + } + } + + return metadata.Encode(&state) + }, + } +} + +func (s SpringCloudDynatraceApplicationPerformanceMonitoringResource) Delete() sdk.ResourceFunc { + return sdk.ResourceFunc{ + Timeout: 30 * time.Minute, + Func: func(ctx context.Context, metadata sdk.ResourceMetaData) error { + client := metadata.Client.AppPlatform.AppPlatformClient + + id, err := appplatform.ParseApmID(metadata.ResourceData.Id()) + if err != nil { + return err + } + + err = client.ApmsDeleteThenPoll(ctx, *id) + if err != nil { + return fmt.Errorf("deleting %s: %+v", *id, err) + } + + return nil + }, + } +} diff --git a/internal/services/springcloud/spring_cloud_dynatrace_application_performance_monitoring_resource_test.go b/internal/services/springcloud/spring_cloud_dynatrace_application_performance_monitoring_resource_test.go new file mode 100644 index 000000000000..72177d470f94 --- /dev/null +++ b/internal/services/springcloud/spring_cloud_dynatrace_application_performance_monitoring_resource_test.go @@ -0,0 +1,175 @@ +package springcloud_test + +import ( + "context" + "fmt" + "testing" + + "github.com/hashicorp/go-azure-helpers/lang/response" + "github.com/hashicorp/go-azure-sdk/resource-manager/appplatform/2023-09-01-preview/appplatform" + "github.com/hashicorp/terraform-provider-azurerm/internal/acceptance" + "github.com/hashicorp/terraform-provider-azurerm/internal/acceptance/check" + "github.com/hashicorp/terraform-provider-azurerm/internal/clients" + "github.com/hashicorp/terraform-provider-azurerm/internal/tf/pluginsdk" + "github.com/hashicorp/terraform-provider-azurerm/utils" +) + +type SpringCloudDynatraceApplicationPerformanceMonitoringResource struct{} + +func TestAccSpringCloudDynatraceApplicationPerformanceMonitoringPerformanceMonitoring_basic(t *testing.T) { + data := acceptance.BuildTestData(t, "azurerm_spring_cloud_dynatrace_application_performance_monitoring", "test") + r := SpringCloudDynatraceApplicationPerformanceMonitoringResource{} + data.ResourceTest(t, r, []acceptance.TestStep{ + { + Config: r.basic(data), + Check: acceptance.ComposeTestCheckFunc( + check.That(data.ResourceName).ExistsInAzure(r), + ), + }, + data.ImportStep("api_token", "tenant_token", "tenant"), + }) +} + +func TestAccSpringCloudDynatraceApplicationPerformanceMonitoringPerformanceMonitoring_requiresImport(t *testing.T) { + data := acceptance.BuildTestData(t, "azurerm_spring_cloud_dynatrace_application_performance_monitoring", "test") + r := SpringCloudDynatraceApplicationPerformanceMonitoringResource{} + data.ResourceTest(t, r, []acceptance.TestStep{ + { + Config: r.basic(data), + Check: acceptance.ComposeTestCheckFunc( + check.That(data.ResourceName).ExistsInAzure(r), + ), + }, + data.RequiresImportErrorStep(r.requiresImport), + }) +} + +func TestAccSpringCloudDynatraceApplicationPerformanceMonitoringPerformanceMonitoring_complete(t *testing.T) { + data := acceptance.BuildTestData(t, "azurerm_spring_cloud_dynatrace_application_performance_monitoring", "test") + r := SpringCloudDynatraceApplicationPerformanceMonitoringResource{} + data.ResourceTest(t, r, []acceptance.TestStep{ + { + Config: r.complete(data), + Check: acceptance.ComposeTestCheckFunc( + check.That(data.ResourceName).ExistsInAzure(r), + ), + }, + data.ImportStep("api_token", "tenant_token", "tenant"), + }) +} + +func TestAccSpringCloudDynatraceApplicationPerformanceMonitoringPerformanceMonitoring_update(t *testing.T) { + data := acceptance.BuildTestData(t, "azurerm_spring_cloud_dynatrace_application_performance_monitoring", "test") + r := SpringCloudDynatraceApplicationPerformanceMonitoringResource{} + data.ResourceTest(t, r, []acceptance.TestStep{ + { + Config: r.basic(data), + Check: acceptance.ComposeTestCheckFunc( + check.That(data.ResourceName).ExistsInAzure(r), + ), + }, + data.ImportStep("api_token", "tenant_token", "tenant"), + { + Config: r.complete(data), + Check: acceptance.ComposeTestCheckFunc( + check.That(data.ResourceName).ExistsInAzure(r), + ), + }, + data.ImportStep("api_token", "tenant_token", "tenant"), + { + Config: r.basic(data), + Check: acceptance.ComposeTestCheckFunc( + check.That(data.ResourceName).ExistsInAzure(r), + ), + }, + data.ImportStep("api_token", "tenant_token", "tenant"), + }) +} + +func (r SpringCloudDynatraceApplicationPerformanceMonitoringResource) Exists(ctx context.Context, client *clients.Client, state *pluginsdk.InstanceState) (*bool, error) { + id, err := appplatform.ParseApmID(state.ID) + if err != nil { + return nil, err + } + resp, err := client.AppPlatform.AppPlatformClient.ApmsGet(ctx, *id) + if err != nil { + if response.WasNotFound(resp.HttpResponse) { + return utils.Bool(false), nil + } + return nil, fmt.Errorf("retrieving %s: %+v", id, err) + } + return utils.Bool(true), nil +} + +func (r SpringCloudDynatraceApplicationPerformanceMonitoringResource) template(data acceptance.TestData) string { + return fmt.Sprintf(` +provider "azurerm" { + features { + resource_group { + prevent_deletion_if_contains_resources = false + } + } +} + +resource "azurerm_resource_group" "test" { + name = "acctestRG-spring-%[2]d" + location = "%[1]s" +} + +resource "azurerm_spring_cloud_service" "test" { + name = "acctest-sc-%[2]d" + location = azurerm_resource_group.test.location + resource_group_name = azurerm_resource_group.test.name + sku_name = "E0" +} +`, data.Locations.Primary, data.RandomInteger) +} + +func (r SpringCloudDynatraceApplicationPerformanceMonitoringResource) basic(data acceptance.TestData) string { + template := r.template(data) + return fmt.Sprintf(` +%s + +resource "azurerm_spring_cloud_dynatrace_application_performance_monitoring" "test" { + name = "acctest-apm-%[2]d" + spring_cloud_service_id = azurerm_spring_cloud_service.test.id + tenant = "test-tenant" + tenant_token = "test-tenant-token" + connection_point = "test-connection-endpoint" +} +`, template, data.RandomInteger) +} + +func (r SpringCloudDynatraceApplicationPerformanceMonitoringResource) requiresImport(data acceptance.TestData) string { + config := r.basic(data) + return fmt.Sprintf(` +%s + +resource "azurerm_spring_cloud_dynatrace_application_performance_monitoring" "import" { + name = azurerm_spring_cloud_dynatrace_application_performance_monitoring.test.name + spring_cloud_service_id = azurerm_spring_cloud_dynatrace_application_performance_monitoring.test.spring_cloud_service_id + tenant = "test-tenant" + tenant_token = "test-tenant-token" + connection_point = "test-connection-endpoint" +} +`, config) +} + +func (r SpringCloudDynatraceApplicationPerformanceMonitoringResource) complete(data acceptance.TestData) string { + template := r.template(data) + return fmt.Sprintf(` +%s + +resource "azurerm_spring_cloud_dynatrace_application_performance_monitoring" "test" { + name = "acctest-apm-%[2]d" + spring_cloud_service_id = azurerm_spring_cloud_service.test.id + globally_enabled = true + api_url = "https://test-api-url.com" + api_token = "test-api-token" + environment_id = "test-environment-id" + tenant = "test-tenant" + tenant_token = "test-tenant-token" + connection_point = "test-connection-endpoint" +} +`, template, data.RandomInteger) +} diff --git a/website/docs/r/spring_cloud_dynatrace_application_performance_monitoring.html.markdown b/website/docs/r/spring_cloud_dynatrace_application_performance_monitoring.html.markdown new file mode 100644 index 000000000000..6db464f0ca04 --- /dev/null +++ b/website/docs/r/spring_cloud_dynatrace_application_performance_monitoring.html.markdown @@ -0,0 +1,92 @@ +--- +subcategory: "Spring Cloud" +layout: "azurerm" +page_title: "Azure Resource Manager: azurerm_spring_cloud_dynatrace_application_performance_monitoring" +description: |- + Manages a Spring Cloud Application Performance Monitoring resource for Dynatrace. +--- + +# azurerm_spring_cloud_dynatrace_application_performance_monitoring + +-> **NOTE:** This resource is only applicable for Spring Cloud Service enterprise tier + +Manages a Spring Cloud Application Performance Monitoring resource for Dynatrace. + +## Example Usage + +```hcl +provider "azurerm" { + features {} +} + +resource "azurerm_resource_group" "example" { + name = "example" + location = "West Europe" +} + +resource "azurerm_spring_cloud_service" "example" { + name = "example" + location = azurerm_resource_group.example.location + resource_group_name = azurerm_resource_group.example.name + sku_name = "E0" +} + +resource "azurerm_spring_cloud_dynatrace_application_performance_monitoring" "test" { + name = "acctest-apm-%[2]d" + spring_cloud_service_id = azurerm_spring_cloud_service.test.id + globally_enabled = true + api_url = "https://test-api-url.com" + api_token = "test-api-token" + environment_id = "test-environment-id" + tenant = "test-tenant" + tenant_token = "test-tenant-token" + connection_point = "test-connection-endpoint" +} +``` + +## Arguments Reference + +The following arguments are supported: + +* `name` - (Required) The name which should be used for this Spring Cloud Application Performance Monitoring resource for Dynatrace. Changing this forces a new resource to be created. + +* `spring_cloud_service_id` - (Required) The ID of the Spring Cloud Service. Changing this forces a new resource to be created. + +* `tenant` - (Required) Specifies the Dynatrace tenant. + +* `tenant_token` - (Required) Specifies the internal token that is used for authentication when OneAgent connects to the Dynatrace cluster to send data. + +* `connection_point` - (Required) Specifies the endpoint to connect to the Dynatrace environment. + +--- + +* `globally_enabled` - (Optional) Specifies whether the Spring Cloud Application Performance Monitoring resource for Application Insights is enabled globally. Defaults to `false`. + +* `api_url` - (Optional) Specifies the API Url of the Dynatrace environment. + +* `api_token` - (Optional) Specifies the API token of the Dynatrace environment. + +* `environment_id` - (Optional) Specifies the Dynatrace environment ID. + +## Attributes Reference + +In addition to the Arguments listed above - the following Attributes are exported: + +* `id` - The ID of the Spring Cloud Application Performance Monitoring resource for Dynatrace. + +## Timeouts + +The `timeouts` block allows you to specify [timeouts](https://www.terraform.io/language/resources/syntax#operation-timeouts) for certain actions: + +* `create` - (Defaults to 30 minutes) Used when creating the Spring Cloud Application Performance Monitoring resource for Dynatrace. +* `read` - (Defaults to 5 minutes) Used when retrieving the Spring Cloud Application Performance Monitoring resource for Dynatrace. +* `update` - (Defaults to 30 minutes) Used when updating the Spring Cloud Application Performance Monitoring resource for Dynatrace. +* `delete` - (Defaults to 30 minutes) Used when deleting the Spring Cloud Application Performance Monitoring resource for Dynatrace. + +## Import + +Spring Cloud Application Performance Monitoring resource for Dynatrace can be imported using the `resource id`, e.g. + +```shell +terraform import azurerm_spring_cloud_dynatrace_application_performance_monitoring.example /subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/mygroup1/providers/Microsoft.AppPlatform/spring/service1/apms/apm1 +``` From 54864912d2d61b958cd7ea6123cc067a67a690b8 Mon Sep 17 00:00:00 2001 From: Heng Lu Date: Tue, 14 Nov 2023 16:00:34 +0800 Subject: [PATCH 2/8] make generate --- .github/labeler-issue-triage.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/labeler-issue-triage.yml b/.github/labeler-issue-triage.yml index ab3c8e3cd5c9..7ca817ce94e9 100644 --- a/.github/labeler-issue-triage.yml +++ b/.github/labeler-issue-triage.yml @@ -319,7 +319,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_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)*)###' + - '### (|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_dynatrace_application_performance_monitoring\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)*)###' From fbb153a8b80cc05764bae95e207376d18a46c6ff Mon Sep 17 00:00:00 2001 From: Heng Lu Date: Tue, 14 Nov 2023 16:10:42 +0800 Subject: [PATCH 3/8] update --- ...atrace_application_performance_monitoring_resource.go | 9 ++------- 1 file changed, 2 insertions(+), 7 deletions(-) diff --git a/internal/services/springcloud/spring_cloud_dynatrace_application_performance_monitoring_resource.go b/internal/services/springcloud/spring_cloud_dynatrace_application_performance_monitoring_resource.go index f2e2e56c7084..a2b8d5cb2c5d 100644 --- a/internal/services/springcloud/spring_cloud_dynatrace_application_performance_monitoring_resource.go +++ b/internal/services/springcloud/spring_cloud_dynatrace_application_performance_monitoring_resource.go @@ -6,10 +6,10 @@ import ( "time" "github.com/hashicorp/go-azure-helpers/lang/response" + "github.com/hashicorp/go-azure-helpers/resourcemanager/commonschema" "github.com/hashicorp/go-azure-sdk/resource-manager/appplatform/2023-09-01-preview/appplatform" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" "github.com/hashicorp/terraform-provider-azurerm/internal/sdk" - "github.com/hashicorp/terraform-provider-azurerm/internal/services/springcloud/validate" "github.com/hashicorp/terraform-provider-azurerm/internal/tf/pluginsdk" "github.com/hashicorp/terraform-provider-azurerm/internal/tf/validation" "github.com/hashicorp/terraform-provider-azurerm/utils" @@ -52,12 +52,7 @@ func (s SpringCloudDynatraceApplicationPerformanceMonitoringResource) Arguments( ValidateFunc: validation.StringIsNotEmpty, }, - "spring_cloud_service_id": { - Type: pluginsdk.TypeString, - Required: true, - ForceNew: true, - ValidateFunc: validate.SpringCloudServiceID, - }, + "spring_cloud_service_id": commonschema.ResourceIDReferenceRequiredForceNew(appplatform.SpringId{}), "globally_enabled": { Type: pluginsdk.TypeBool, From 90e5ceb965aedc8415a01267cd93e5ffef50d9dd Mon Sep 17 00:00:00 2001 From: Heng Lu Date: Wed, 15 Nov 2023 12:22:09 +0800 Subject: [PATCH 4/8] update --- ...ication_performance_monitoring_resource.go | 41 ++++++++++--------- ...on_performance_monitoring_resource_test.go | 6 +-- ...ation_performance_monitoring.html.markdown | 18 ++++---- 3 files changed, 32 insertions(+), 33 deletions(-) diff --git a/internal/services/springcloud/spring_cloud_dynatrace_application_performance_monitoring_resource.go b/internal/services/springcloud/spring_cloud_dynatrace_application_performance_monitoring_resource.go index a2b8d5cb2c5d..a56c7ee695a1 100644 --- a/internal/services/springcloud/spring_cloud_dynatrace_application_performance_monitoring_resource.go +++ b/internal/services/springcloud/spring_cloud_dynatrace_application_performance_monitoring_resource.go @@ -5,14 +5,13 @@ import ( "fmt" "time" + "github.com/hashicorp/go-azure-helpers/lang/pointer" "github.com/hashicorp/go-azure-helpers/lang/response" "github.com/hashicorp/go-azure-helpers/resourcemanager/commonschema" "github.com/hashicorp/go-azure-sdk/resource-manager/appplatform/2023-09-01-preview/appplatform" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" "github.com/hashicorp/terraform-provider-azurerm/internal/sdk" "github.com/hashicorp/terraform-provider-azurerm/internal/tf/pluginsdk" "github.com/hashicorp/terraform-provider-azurerm/internal/tf/validation" - "github.com/hashicorp/terraform-provider-azurerm/utils" ) type SpringCloudDynatraceApplicationPerformanceMonitoringModel struct { @@ -43,7 +42,7 @@ func (s SpringCloudDynatraceApplicationPerformanceMonitoringResource) IDValidati return appplatform.ValidateApmID } -func (s SpringCloudDynatraceApplicationPerformanceMonitoringResource) Arguments() map[string]*schema.Schema { +func (s SpringCloudDynatraceApplicationPerformanceMonitoringResource) Arguments() map[string]*pluginsdk.Schema { return map[string]*pluginsdk.Schema{ "name": { Type: pluginsdk.TypeString, @@ -54,27 +53,23 @@ func (s SpringCloudDynatraceApplicationPerformanceMonitoringResource) Arguments( "spring_cloud_service_id": commonschema.ResourceIDReferenceRequiredForceNew(appplatform.SpringId{}), - "globally_enabled": { - Type: pluginsdk.TypeBool, - Optional: true, - Default: false, - }, - "connection_point": { Type: pluginsdk.TypeString, Required: true, ValidateFunc: validation.StringIsNotEmpty, }, - "environment_id": { + "tenant": { Type: pluginsdk.TypeString, - Optional: true, + Required: true, + Sensitive: true, ValidateFunc: validation.StringIsNotEmpty, }, "tenant_token": { Type: pluginsdk.TypeString, Required: true, + Sensitive: true, ValidateFunc: validation.StringIsNotEmpty, }, @@ -87,18 +82,25 @@ func (s SpringCloudDynatraceApplicationPerformanceMonitoringResource) Arguments( "api_token": { Type: pluginsdk.TypeString, Optional: true, + Sensitive: true, ValidateFunc: validation.StringIsNotEmpty, }, - "tenant": { + "environment_id": { Type: pluginsdk.TypeString, - Required: true, + Optional: true, ValidateFunc: validation.StringIsNotEmpty, }, + + "globally_enabled": { + Type: pluginsdk.TypeBool, + Optional: true, + Default: false, + }, } } -func (s SpringCloudDynatraceApplicationPerformanceMonitoringResource) Attributes() map[string]*schema.Schema { +func (s SpringCloudDynatraceApplicationPerformanceMonitoringResource) Attributes() map[string]*pluginsdk.Schema { return map[string]*pluginsdk.Schema{} } @@ -129,12 +131,12 @@ func (s SpringCloudDynatraceApplicationPerformanceMonitoringResource) Create() s resource := appplatform.ApmResource{ Properties: &appplatform.ApmProperties{ Type: "Dynatrace", - Properties: utils.ToPtr(map[string]string{ + Properties: pointer.To(map[string]string{ "api-url": model.ApiUrl, "connection_point": model.ConnectionPoint, "environment-id": model.EnvironmentId, }), - Secrets: utils.ToPtr(map[string]string{ + Secrets: pointer.To(map[string]string{ "api-token": model.ApiToken, "tenanttoken": model.TenantToken, "tenant": model.Tenant, @@ -146,6 +148,8 @@ func (s SpringCloudDynatraceApplicationPerformanceMonitoringResource) Create() s return fmt.Errorf("creating %s: %+v", id, err) } + metadata.SetID(id) + if model.GloballyEnabled { apmReference := appplatform.ApmReference{ ResourceId: id.ID(), @@ -156,7 +160,6 @@ func (s SpringCloudDynatraceApplicationPerformanceMonitoringResource) Create() s } } - metadata.SetID(id) return nil }, } @@ -188,10 +191,10 @@ func (s SpringCloudDynatraceApplicationPerformanceMonitoringResource) Update() s return fmt.Errorf("retrieving %s: properties was nil", id) } if properties.Properties == nil { - properties.Properties = utils.ToPtr(map[string]string{}) + properties.Properties = pointer.To(map[string]string{}) } if properties.Secrets == nil { - properties.Secrets = utils.ToPtr(map[string]string{}) + properties.Secrets = pointer.To(map[string]string{}) } if metadata.ResourceData.HasChange("api_url") { diff --git a/internal/services/springcloud/spring_cloud_dynatrace_application_performance_monitoring_resource_test.go b/internal/services/springcloud/spring_cloud_dynatrace_application_performance_monitoring_resource_test.go index 72177d470f94..7376b471bfa2 100644 --- a/internal/services/springcloud/spring_cloud_dynatrace_application_performance_monitoring_resource_test.go +++ b/internal/services/springcloud/spring_cloud_dynatrace_application_performance_monitoring_resource_test.go @@ -104,11 +104,7 @@ func (r SpringCloudDynatraceApplicationPerformanceMonitoringResource) Exists(ctx func (r SpringCloudDynatraceApplicationPerformanceMonitoringResource) template(data acceptance.TestData) string { return fmt.Sprintf(` provider "azurerm" { - features { - resource_group { - prevent_deletion_if_contains_resources = false - } - } + features {} } resource "azurerm_resource_group" "test" { diff --git a/website/docs/r/spring_cloud_dynatrace_application_performance_monitoring.html.markdown b/website/docs/r/spring_cloud_dynatrace_application_performance_monitoring.html.markdown index 6db464f0ca04..468d626c4178 100644 --- a/website/docs/r/spring_cloud_dynatrace_application_performance_monitoring.html.markdown +++ b/website/docs/r/spring_cloud_dynatrace_application_performance_monitoring.html.markdown @@ -31,16 +31,16 @@ resource "azurerm_spring_cloud_service" "example" { sku_name = "E0" } -resource "azurerm_spring_cloud_dynatrace_application_performance_monitoring" "test" { - name = "acctest-apm-%[2]d" - spring_cloud_service_id = azurerm_spring_cloud_service.test.id +resource "azurerm_spring_cloud_dynatrace_application_performance_monitoring" "example" { + name = "example" + spring_cloud_service_id = azurerm_spring_cloud_service.example.id globally_enabled = true - api_url = "https://test-api-url.com" - api_token = "test-api-token" - environment_id = "test-environment-id" - tenant = "test-tenant" - tenant_token = "test-tenant-token" - connection_point = "test-connection-endpoint" + api_url = "https://example-api-url.com" + api_token = "example-api-token" + environment_id = "example-environment-id" + tenant = "example-tenant" + tenant_token = "example-tenant-token" + connection_point = "example-connection-endpoint" } ``` From 2be27d6bd6f7674f69205639a75baef38782b13f Mon Sep 17 00:00:00 2001 From: Heng Lu Date: Thu, 28 Dec 2023 10:43:56 +0800 Subject: [PATCH 5/8] update --- ...ace_application_performance_monitoring_resource.go | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/internal/services/springcloud/spring_cloud_dynatrace_application_performance_monitoring_resource.go b/internal/services/springcloud/spring_cloud_dynatrace_application_performance_monitoring_resource.go index a56c7ee695a1..61e2891c599a 100644 --- a/internal/services/springcloud/spring_cloud_dynatrace_application_performance_monitoring_resource.go +++ b/internal/services/springcloud/spring_cloud_dynatrace_application_performance_monitoring_resource.go @@ -3,6 +3,7 @@ package springcloud import ( "context" "fmt" + "github.com/hashicorp/go-azure-helpers/resourcemanager/commonids" "time" "github.com/hashicorp/go-azure-helpers/lang/pointer" @@ -51,7 +52,7 @@ func (s SpringCloudDynatraceApplicationPerformanceMonitoringResource) Arguments( ValidateFunc: validation.StringIsNotEmpty, }, - "spring_cloud_service_id": commonschema.ResourceIDReferenceRequiredForceNew(appplatform.SpringId{}), + "spring_cloud_service_id": commonschema.ResourceIDReferenceRequiredForceNew(commonids.SpringCloudServiceId{}), "connection_point": { Type: pluginsdk.TypeString, @@ -114,11 +115,11 @@ func (s SpringCloudDynatraceApplicationPerformanceMonitoringResource) Create() s } client := metadata.Client.AppPlatform.AppPlatformClient - springId, err := appplatform.ParseSpringID(model.SpringCloudServiceId) + springId, err := commonids.ParseSpringCloudServiceID(model.SpringCloudServiceId) if err != nil { return fmt.Errorf("parsing spring service ID: %+v", err) } - id := appplatform.NewApmID(springId.SubscriptionId, springId.ResourceGroupName, springId.SpringName, model.Name) + id := appplatform.NewApmID(springId.SubscriptionId, springId.ResourceGroupName, springId.ServiceName, model.Name) existing, err := client.ApmsGet(ctx, id) if err != nil && !response.WasNotFound(existing.HttpResponse) { @@ -234,7 +235,7 @@ func (s SpringCloudDynatraceApplicationPerformanceMonitoringResource) Update() s apmReference := appplatform.ApmReference{ ResourceId: id.ID(), } - springId := appplatform.NewSpringID(id.SubscriptionId, id.ResourceGroupName, id.SpringName) + springId := commonids.NewSpringCloudServiceID(id.SubscriptionId, id.ResourceGroupName, id.SpringName) if model.GloballyEnabled { err := client.ServicesEnableApmGloballyThenPoll(ctx, springId, apmReference) if err != nil { @@ -273,7 +274,7 @@ func (s SpringCloudDynatraceApplicationPerformanceMonitoringResource) Read() sdk return fmt.Errorf("retrieving %s: %+v", *id, err) } - springId := appplatform.NewSpringID(id.SubscriptionId, id.ResourceGroupName, id.SpringName) + springId := commonids.NewSpringCloudServiceID(id.SubscriptionId, id.ResourceGroupName, id.SpringName) result, err := client.ServicesListGloballyEnabledApms(ctx, springId) if err != nil { return fmt.Errorf("listing globally enabled apms: %+v", err) From 4d95e0dc344b2d4a8df06ba62963c2b35084c830 Mon Sep 17 00:00:00 2001 From: Heng Lu Date: Wed, 3 Jan 2024 10:16:59 +0800 Subject: [PATCH 6/8] import format --- ...oud_dynatrace_application_performance_monitoring_resource.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/internal/services/springcloud/spring_cloud_dynatrace_application_performance_monitoring_resource.go b/internal/services/springcloud/spring_cloud_dynatrace_application_performance_monitoring_resource.go index 61e2891c599a..983c785e8dfc 100644 --- a/internal/services/springcloud/spring_cloud_dynatrace_application_performance_monitoring_resource.go +++ b/internal/services/springcloud/spring_cloud_dynatrace_application_performance_monitoring_resource.go @@ -3,11 +3,11 @@ package springcloud import ( "context" "fmt" - "github.com/hashicorp/go-azure-helpers/resourcemanager/commonids" "time" "github.com/hashicorp/go-azure-helpers/lang/pointer" "github.com/hashicorp/go-azure-helpers/lang/response" + "github.com/hashicorp/go-azure-helpers/resourcemanager/commonids" "github.com/hashicorp/go-azure-helpers/resourcemanager/commonschema" "github.com/hashicorp/go-azure-sdk/resource-manager/appplatform/2023-09-01-preview/appplatform" "github.com/hashicorp/terraform-provider-azurerm/internal/sdk" From 0693bea6d134696c9238450247adfb6b430a4608 Mon Sep 17 00:00:00 2001 From: Heng Lu Date: Mon, 8 Jan 2024 13:22:22 +0800 Subject: [PATCH 7/8] update validation and tests --- ...natrace_application_performance_monitoring_resource.go | 2 +- ...ce_application_performance_monitoring_resource_test.go | 8 ++++---- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/internal/services/springcloud/spring_cloud_dynatrace_application_performance_monitoring_resource.go b/internal/services/springcloud/spring_cloud_dynatrace_application_performance_monitoring_resource.go index 983c785e8dfc..4de4a4970658 100644 --- a/internal/services/springcloud/spring_cloud_dynatrace_application_performance_monitoring_resource.go +++ b/internal/services/springcloud/spring_cloud_dynatrace_application_performance_monitoring_resource.go @@ -77,7 +77,7 @@ func (s SpringCloudDynatraceApplicationPerformanceMonitoringResource) Arguments( "api_url": { Type: pluginsdk.TypeString, Optional: true, - ValidateFunc: validation.StringIsNotEmpty, + ValidateFunc: validation.IsURLWithHTTPorHTTPS, }, "api_token": { diff --git a/internal/services/springcloud/spring_cloud_dynatrace_application_performance_monitoring_resource_test.go b/internal/services/springcloud/spring_cloud_dynatrace_application_performance_monitoring_resource_test.go index 7376b471bfa2..f70ce7d69bda 100644 --- a/internal/services/springcloud/spring_cloud_dynatrace_application_performance_monitoring_resource_test.go +++ b/internal/services/springcloud/spring_cloud_dynatrace_application_performance_monitoring_resource_test.go @@ -130,7 +130,7 @@ resource "azurerm_spring_cloud_dynatrace_application_performance_monitoring" "te name = "acctest-apm-%[2]d" spring_cloud_service_id = azurerm_spring_cloud_service.test.id tenant = "test-tenant" - tenant_token = "test-tenant-token" + tenant_token = "dt0s01.ST2EY72KQINMH574WMNVI7YN.G3DFPBEJYMODIDAEX454M7YWBUVEFOWKPRVMWFASS64NFH52PX6BNDVFFM572RZM" connection_point = "test-connection-endpoint" } `, template, data.RandomInteger) @@ -145,7 +145,7 @@ resource "azurerm_spring_cloud_dynatrace_application_performance_monitoring" "im name = azurerm_spring_cloud_dynatrace_application_performance_monitoring.test.name spring_cloud_service_id = azurerm_spring_cloud_dynatrace_application_performance_monitoring.test.spring_cloud_service_id tenant = "test-tenant" - tenant_token = "test-tenant-token" + tenant_token = "dt0s01.ST2EY72KQINMH574WMNVI7YN.G3DFPBEJYMODIDAEX454M7YWBUVEFOWKPRVMWFASS64NFH52PX6BNDVFFM572RZM" connection_point = "test-connection-endpoint" } `, config) @@ -161,10 +161,10 @@ resource "azurerm_spring_cloud_dynatrace_application_performance_monitoring" "te spring_cloud_service_id = azurerm_spring_cloud_service.test.id globally_enabled = true api_url = "https://test-api-url.com" - api_token = "test-api-token" + api_token = "dt0s01.ST2EY72KQINMH574WMNVI7YN.G3DFPBEJYMODIDAEX454M7YWBUVEFOWKPRVMWFASS64NFH52PX6BNDVFFM572RZM" environment_id = "test-environment-id" tenant = "test-tenant" - tenant_token = "test-tenant-token" + tenant_token = "dt0s01.ST2EY72KQINMH574WMNVI7YN.G3DFPBEJYMODIDAEX454M7YWBUVEFOWKPRVMWFASS64NFH52PX6BNDVFFM572RZM" connection_point = "test-connection-endpoint" } `, template, data.RandomInteger) From 662e1334a61ebb29333f064e9689eb837a548e65 Mon Sep 17 00:00:00 2001 From: Heng Lu Date: Wed, 10 Jan 2024 13:24:44 +0800 Subject: [PATCH 8/8] update test --- ...plication_performance_monitoring_resource_test.go | 12 ++++++------ ..._application_performance_monitoring.html.markdown | 6 +++--- 2 files changed, 9 insertions(+), 9 deletions(-) diff --git a/internal/services/springcloud/spring_cloud_dynatrace_application_performance_monitoring_resource_test.go b/internal/services/springcloud/spring_cloud_dynatrace_application_performance_monitoring_resource_test.go index f70ce7d69bda..148254dcf574 100644 --- a/internal/services/springcloud/spring_cloud_dynatrace_application_performance_monitoring_resource_test.go +++ b/internal/services/springcloud/spring_cloud_dynatrace_application_performance_monitoring_resource_test.go @@ -130,8 +130,8 @@ resource "azurerm_spring_cloud_dynatrace_application_performance_monitoring" "te name = "acctest-apm-%[2]d" spring_cloud_service_id = azurerm_spring_cloud_service.test.id tenant = "test-tenant" - tenant_token = "dt0s01.ST2EY72KQINMH574WMNVI7YN.G3DFPBEJYMODIDAEX454M7YWBUVEFOWKPRVMWFASS64NFH52PX6BNDVFFM572RZM" - connection_point = "test-connection-endpoint" + tenant_token = "dt0s01.AAAAAAAAAAAAAAAAAAAAAAAA.BBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBB" + connection_point = "https://example.live.dynatrace.com:443" } `, template, data.RandomInteger) } @@ -146,7 +146,7 @@ resource "azurerm_spring_cloud_dynatrace_application_performance_monitoring" "im spring_cloud_service_id = azurerm_spring_cloud_dynatrace_application_performance_monitoring.test.spring_cloud_service_id tenant = "test-tenant" tenant_token = "dt0s01.ST2EY72KQINMH574WMNVI7YN.G3DFPBEJYMODIDAEX454M7YWBUVEFOWKPRVMWFASS64NFH52PX6BNDVFFM572RZM" - connection_point = "test-connection-endpoint" + connection_point = "https://example.live.dynatrace.com:443" } `, config) } @@ -161,11 +161,11 @@ resource "azurerm_spring_cloud_dynatrace_application_performance_monitoring" "te spring_cloud_service_id = azurerm_spring_cloud_service.test.id globally_enabled = true api_url = "https://test-api-url.com" - api_token = "dt0s01.ST2EY72KQINMH574WMNVI7YN.G3DFPBEJYMODIDAEX454M7YWBUVEFOWKPRVMWFASS64NFH52PX6BNDVFFM572RZM" + api_token = "dt0s01.AAAAAAAAAAAAAAAAAAAAAAAA.BBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBB" environment_id = "test-environment-id" tenant = "test-tenant" - tenant_token = "dt0s01.ST2EY72KQINMH574WMNVI7YN.G3DFPBEJYMODIDAEX454M7YWBUVEFOWKPRVMWFASS64NFH52PX6BNDVFFM572RZM" - connection_point = "test-connection-endpoint" + tenant_token = "dt0s01.AAAAAAAAAAAAAAAAAAAAAAAA.BBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBB" + connection_point = "https://example.live.dynatrace.com:443" } `, template, data.RandomInteger) } diff --git a/website/docs/r/spring_cloud_dynatrace_application_performance_monitoring.html.markdown b/website/docs/r/spring_cloud_dynatrace_application_performance_monitoring.html.markdown index 468d626c4178..07fc87e0a455 100644 --- a/website/docs/r/spring_cloud_dynatrace_application_performance_monitoring.html.markdown +++ b/website/docs/r/spring_cloud_dynatrace_application_performance_monitoring.html.markdown @@ -36,11 +36,11 @@ resource "azurerm_spring_cloud_dynatrace_application_performance_monitoring" "ex spring_cloud_service_id = azurerm_spring_cloud_service.example.id globally_enabled = true api_url = "https://example-api-url.com" - api_token = "example-api-token" + api_token = "dt0s01.AAAAAAAAAAAAAAAAAAAAAAAA.BBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBB" environment_id = "example-environment-id" tenant = "example-tenant" - tenant_token = "example-tenant-token" - connection_point = "example-connection-endpoint" + tenant_token = "dt0s01.AAAAAAAAAAAAAAAAAAAAAAAA.BBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBB" + connection_point = "https://example.live.dynatrace.com:443" } ```