From 9282f55cbf083e29742cb8b0534f3cc67b1b3629 Mon Sep 17 00:00:00 2001 From: njucz Date: Wed, 18 Dec 2019 18:25:27 +0800 Subject: [PATCH] update --- website/docs/d/spring_cloud.html.markdown | 12 ++++++++ .../spring_cloud_config_server.html.markdown | 9 ++++++ website/docs/r/spring_cloud.html.markdown | 29 ++++++++++++++++++- .../spring_cloud_config_server.html.markdown | 24 +++++++++++++++ 4 files changed, 73 insertions(+), 1 deletion(-) diff --git a/website/docs/d/spring_cloud.html.markdown b/website/docs/d/spring_cloud.html.markdown index 8602d784cacc2..78002e8b7aedf 100644 --- a/website/docs/d/spring_cloud.html.markdown +++ b/website/docs/d/spring_cloud.html.markdown @@ -10,6 +10,18 @@ description: |- Use this data source to access information about an existing Spring Cloud Service. +## Example Usage + +```hcl +data "azurerm_spring_cloud" "example" { + name = azurerm_spring_cloud.example.name + resource_group_name = azurerm_resource_group.example.name +} + +output "spring_cloud_id" { + value = "${data.azurerm_spring_cloud.example.id}" +} +``` ## Argument Reference diff --git a/website/docs/d/spring_cloud_config_server.html.markdown b/website/docs/d/spring_cloud_config_server.html.markdown index 6c786be63ff3c..4c67641194be2 100644 --- a/website/docs/d/spring_cloud_config_server.html.markdown +++ b/website/docs/d/spring_cloud_config_server.html.markdown @@ -10,6 +10,15 @@ description: |- Use this data source to access information about an existing Spring Cloud Config Server. +```hcl +data "azurerm_spring_cloud_config_server" "example" { + spring_cloud_id = azurerm_spring_cloud.example.id +} + +output "spring_cloud_config_server_label" { + value = "${data.azurerm_spring_cloud_config_server.example.label}" +} +``` ## Argument Reference diff --git a/website/docs/r/spring_cloud.html.markdown b/website/docs/r/spring_cloud.html.markdown index 5f48507c04ef3..4ea13080e64b8 100644 --- a/website/docs/r/spring_cloud.html.markdown +++ b/website/docs/r/spring_cloud.html.markdown @@ -11,6 +11,25 @@ description: |- Manage Azure Spring Cloud Service instance. Azure Spring Cloud provides a managed service that enables Java developers to easily build and run Spring-boot based microservices on Azure with no code changes. Within an azure spring cloud service, users can manage config server, manage multiple spring cloud apps and manage deployments +## Example Usage + +```hcl +resource "azurerm_resource_group" "example" { + name = "resGroup" + location = "Southeast Asia" +} + +resource "azurerm_spring_cloud" "example" { + name = "sc-example" + resource_group_name = azurerm_resource_group.example.name + location = azurerm_resource_group.example.location + + tags = { + environment = "staging" + } +} +``` + ## Argument Reference The following arguments are supported: @@ -19,7 +38,7 @@ The following arguments are supported: * `resource_group_name` - (Required) The name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or the portal. Changing this forces a new resource to be created. -* `location` - (Optional) The GEO location of the resource. Changing this forces a new resource to be created. +* `location` - (Optional) The GEO location of the resource. Changing this forces a new resource to be created. Until November 20, 2019 4:20 PM, only `East US`, `Southeast Asia`, `West Europe`, `West US 2` following locations are supported. * `tags` - (Optional) Tags of the service which is a list of key value pairs that describe the resource. Changing this forces a new resource to be created. @@ -34,3 +53,11 @@ The following attributes are exported: * `id` - Fully qualified resource Id for the resource. * `name` - The name of the resource. + +## Import + +Spring Cloud services can be imported using the `resource id`, e.g. + +```shell +terraform import azurerm_spring_cloud.example /subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/terraform-signalr/providers/Microsoft.AppPlatform/Spring/myspringservice +``` diff --git a/website/docs/r/spring_cloud_config_server.html.markdown b/website/docs/r/spring_cloud_config_server.html.markdown index c7de6dacfb09e..1fc8be266aba8 100644 --- a/website/docs/r/spring_cloud_config_server.html.markdown +++ b/website/docs/r/spring_cloud_config_server.html.markdown @@ -16,6 +16,30 @@ Azure Spring Cloud Config Server supports Public repository, Private repository Azure Spring Cloud Config Server also supports multiple repositories with Pattern Matching +## Example Usage + +```hcl +resource "azurerm_resource_group" "example" { + name = "resGroup" + location = "Southeast Asia" +} + +resource "azurerm_spring_cloud" "example" { + name = "sc-example" + resource_group_name = azurerm_resource_group.example.name + location = azurerm_resource_group.example.location + + tags = { + environment = "staging" + } +} + +resource "azurerm_spring_cloud_config_server" "test" { + label = "config" + spring_cloud_id = "azurerm_spring_cloud.example.id + uri = "https://github.com/Azure-Samples/piggymetrics" +} +``` ## Argument Reference