-
Notifications
You must be signed in to change notification settings - Fork 4.6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
azurerm_spring_cloud_gateway
- support for the application_performance_monitoring_ids
property
#24919
azurerm_spring_cloud_gateway
- support for the application_performance_monitoring_ids
property
#24919
Changes from 2 commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -129,6 +129,48 @@ func TestAccSpringCloudGateway_responseCache(t *testing.T) { | |
}) | ||
} | ||
|
||
func TestAccSpringCloudGateway_apms(t *testing.T) { | ||
data := acceptance.BuildTestData(t, "azurerm_spring_cloud_gateway", "test") | ||
r := SpringCloudGatewayResource{} | ||
data.ResourceTest(t, r, []acceptance.TestStep{ | ||
{ | ||
Config: r.apms(data), | ||
Check: acceptance.ComposeTestCheckFunc( | ||
check.That(data.ResourceName).ExistsInAzure(r), | ||
), | ||
}, | ||
data.ImportStep(), | ||
}) | ||
} | ||
|
||
func TestAccSpringCloudGateway_apmsUpdate(t *testing.T) { | ||
data := acceptance.BuildTestData(t, "azurerm_spring_cloud_gateway", "test") | ||
r := SpringCloudGatewayResource{} | ||
data.ResourceTest(t, r, []acceptance.TestStep{ | ||
{ | ||
Config: r.basic(data), | ||
Check: acceptance.ComposeTestCheckFunc( | ||
check.That(data.ResourceName).ExistsInAzure(r), | ||
), | ||
}, | ||
data.ImportStep(), | ||
{ | ||
Config: r.apms(data), | ||
Check: acceptance.ComposeTestCheckFunc( | ||
check.That(data.ResourceName).ExistsInAzure(r), | ||
), | ||
}, | ||
data.ImportStep(), | ||
{ | ||
Config: r.basic(data), | ||
Check: acceptance.ComposeTestCheckFunc( | ||
check.That(data.ResourceName).ExistsInAzure(r), | ||
), | ||
}, | ||
data.ImportStep(), | ||
}) | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. could we include a step where we update the value of |
||
} | ||
|
||
func (r SpringCloudGatewayResource) Exists(ctx context.Context, client *clients.Client, state *pluginsdk.InstanceState) (*bool, error) { | ||
id, err := appplatform.ParseGatewayID(state.ID) | ||
if err != nil { | ||
|
@@ -166,6 +208,14 @@ resource "azurerm_spring_cloud_service" "test" { | |
resource_group_name = azurerm_resource_group.test.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 | ||
tenant = "test-tenant" | ||
tenant_token = "dt0s01.AAAAAAAAAAAAAAAAAAAAAAAA.BBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBB" | ||
connection_point = "https://example.live.dynatrace.com:443" | ||
} | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. should we move this to |
||
`, data.Locations.Primary, data.RandomInteger) | ||
} | ||
|
||
|
@@ -250,6 +300,19 @@ resource "azurerm_spring_cloud_gateway" "test" { | |
`, template, clientId, clientSecret) | ||
} | ||
|
||
func (r SpringCloudGatewayResource) apms(data acceptance.TestData) string { | ||
template := r.template(data) | ||
return fmt.Sprintf(` | ||
%[1]s | ||
|
||
resource "azurerm_spring_cloud_gateway" "test" { | ||
name = "default" | ||
spring_cloud_service_id = azurerm_spring_cloud_service.test.id | ||
application_performance_monitoring_ids = [azurerm_spring_cloud_dynatrace_application_performance_monitoring.test.id] | ||
} | ||
`, template, data.RandomInteger) | ||
} | ||
|
||
func (r SpringCloudGatewayResource) clientAuth(data acceptance.TestData) string { | ||
template := r.template(data) | ||
return fmt.Sprintf(` | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.