Skip to content
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

rename azurerm_graph_account to azurerm_graph_services_account #22665

Merged
merged 5 commits into from
Aug 7, 2023
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 5 additions & 2 deletions .github/labeler-issue-triage.yml
Original file line number Diff line number Diff line change
Expand Up @@ -142,7 +142,7 @@ service/frontdoor:
- '### (|New or )Affected Resource\(s\)\/Data Source\(s\)((.|\n)*)azurerm_frontdoor((.|\n)*)###'

service/graph:
- '### (|New or )Affected Resource\(s\)\/Data Source\(s\)((.|\n)*)azurerm_graph_account((.|\n)*)###'
- '### (|New or )Affected Resource\(s\)\/Data Source\(s\)((.|\n)*)azurerm_graph_((.|\n)*)###'

service/hdinsight:
- '### (|New or )Affected Resource\(s\)\/Data Source\(s\)((.|\n)*)azurerm_hdinsight_((.|\n)*)###'
Expand Down Expand Up @@ -238,7 +238,10 @@ service/netapp:
- '### (|New or )Affected Resource\(s\)\/Data Source\(s\)((.|\n)*)azurerm_netapp_((.|\n)*)###'

service/network:
- '### (|New or )Affected Resource\(s\)\/Data Source\(s\)((.|\n)*)azurerm_(application_gateway\W+|application_security_group\W+|bastion_host|express_route_|ip_group|local_network_gateway|nat_gateway|network_|point_to_site_vpn_gateway|private_endpoint\W+|private_endpoint_application_security_group_association\W+|private_endpoint_connection\W+|private_link_service\W+|private_link_service_endpoint_connections\W+|public_ip|route|subnet|virtual_hub\W+|virtual_hub_bgp_connection\W+|virtual_hub_connection\W+|virtual_hub_ip\W+|virtual_hub_route_table\W+|virtual_hub_route_table_route\W+|virtual_hub_security_partner_provider\W+|virtual_machine_packet_capture\W+|virtual_machine_scale_set_packet_capture\W+|virtual_network\W+|virtual_network_dns_servers\W+|virtual_network_gateway\W+|virtual_network_gateway_connection\W+|virtual_network_gateway_nat_rule\W+|virtual_network_peering\W+|virtual_wan\W+|vpn_|web_application_firewall_policy)((.|\n)*)###'
- '### (|New or )Affected Resource\(s\)\/Data Source\(s\)((.|\n)*)azurerm_(application_gateway\W+|application_security_group\W+|bastion_host|express_route_|ip_group|local_network_gateway|nat_gateway|network_connection_monitor\W+|network_ddos_protection_plan\W+|network_interface\W+|network_interface_application_gateway_backend_address_pool_association\W+|network_interface_application_security_group_association\W+|network_interface_backend_address_pool_association\W+|network_interface_nat_rule_association\W+|network_interface_security_group_association\W+|network_manager\W+|network_manager_admin_rule\W+|network_manager_admin_rule_collection\W+|network_manager_connectivity_configuration\W+|network_manager_deployment\W+|network_manager_management_group_connection\W+|network_manager_network_group\W+|network_manager_network_group\W+|network_manager_scope_connection\W+|network_manager_security_admin_configuration\W+|network_manager_static_member\W+|network_manager_subscription_connection\W+|network_packet_capture\W+|network_profile\W+|network_security_group\W+|network_security_rule\W+|network_service_tags\W+|network_watcher\W+|network_watcher_flow_log\W+|point_to_site_vpn_gateway|private_endpoint\W+|private_endpoint_application_security_group_association\W+|private_endpoint_connection\W+|private_link_service\W+|private_link_service_endpoint_connections\W+|public_ip|route|subnet|virtual_hub\W+|virtual_hub_bgp_connection\W+|virtual_hub_connection\W+|virtual_hub_ip\W+|virtual_hub_route_table\W+|virtual_hub_route_table_route\W+|virtual_hub_security_partner_provider\W+|virtual_machine_packet_capture\W+|virtual_machine_scale_set_packet_capture\W+|virtual_network\W+|virtual_network_dns_servers\W+|virtual_network_gateway\W+|virtual_network_gateway_connection\W+|virtual_network_gateway_nat_rule\W+|virtual_network_peering\W+|virtual_wan\W+|vpn_|web_application_firewall_policy)((.|\n)*)###'

service/network-function:
- '### (|New or )Affected Resource\(s\)\/Data Source\(s\)((.|\n)*)azurerm_network_function_azure_traffic_collector((.|\n)*)###'

service/nginx:
- '### (|New or )Affected Resource\(s\)\/Data Source\(s\)((.|\n)*)azurerm_nginx_((.|\n)*)###'
Expand Down
2 changes: 1 addition & 1 deletion .teamcity/components/generated/services.kt
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ var services = mapOf(
"firewall" to "Firewall",
"fluidrelay" to "Fluid Relay",
"frontdoor" to "FrontDoor",
"graph" to "Graph",
"graph" to "Graph Services",
"hdinsight" to "HDInsight",
"hpccache" to "HPC Cache",
"hsm" to "Hardware Security Module",
Expand Down
2 changes: 1 addition & 1 deletion internal/clients/client.go
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ import (
firewall "github.com/hashicorp/terraform-provider-azurerm/internal/services/firewall/client"
fluidrelay "github.com/hashicorp/terraform-provider-azurerm/internal/services/fluidrelay/client"
frontdoor "github.com/hashicorp/terraform-provider-azurerm/internal/services/frontdoor/client"
graph "github.com/hashicorp/terraform-provider-azurerm/internal/services/graph/client"
graph "github.com/hashicorp/terraform-provider-azurerm/internal/services/graphservices/client"
hdinsight "github.com/hashicorp/terraform-provider-azurerm/internal/services/hdinsight/client"
healthcare "github.com/hashicorp/terraform-provider-azurerm/internal/services/healthcare/client"
hpccache "github.com/hashicorp/terraform-provider-azurerm/internal/services/hpccache/client"
Expand Down
4 changes: 2 additions & 2 deletions internal/provider/services.go
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ import (
"github.com/hashicorp/terraform-provider-azurerm/internal/services/firewall"
"github.com/hashicorp/terraform-provider-azurerm/internal/services/fluidrelay"
"github.com/hashicorp/terraform-provider-azurerm/internal/services/frontdoor"
"github.com/hashicorp/terraform-provider-azurerm/internal/services/graph"
"github.com/hashicorp/terraform-provider-azurerm/internal/services/graphservices"
"github.com/hashicorp/terraform-provider-azurerm/internal/services/hdinsight"
"github.com/hashicorp/terraform-provider-azurerm/internal/services/healthcare"
"github.com/hashicorp/terraform-provider-azurerm/internal/services/hpccache"
Expand Down Expand Up @@ -157,7 +157,7 @@ func SupportedTypedServices() []sdk.TypedServiceRegistration {
domainservices.Registration{},
eventhub.Registration{},
fluidrelay.Registration{},
graph.Registration{},
graphservices.Registration{},
hybridcompute.Registration{},
iothub.Registration{},
iotcentral.Registration{},
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package graph
package graphservices

import (
"context"
Expand All @@ -16,11 +16,27 @@ import (
"github.com/hashicorp/terraform-provider-azurerm/internal/tf/pluginsdk"
)

var _ sdk.Resource = ServicesAccountResource{}
var _ sdk.ResourceWithUpdate = ServicesAccountResource{}

type ServicesAccountResource struct {
AccountResource
}

func (r ServicesAccountResource) ResourceType() string {
return "azurerm_graph_services_account"
}

var _ sdk.Resource = AccountResource{}
var _ sdk.ResourceWithUpdate = AccountResource{}
var _ sdk.ResourceWithDeprecationReplacedBy = AccountResource{}

type AccountResource struct{}

func (r AccountResource) DeprecatedInFavourOfResource() string {
return "azurerm_graph_services_account"
}

func (r AccountResource) ModelObject() interface{} {
return &AccountResourceSchema{}
}
Expand Down Expand Up @@ -90,7 +106,7 @@ func (r AccountResource) Create() sdk.ResourceFunc {
}
}
if !response.WasNotFound(existing.HttpResponse) {
return metadata.ResourceRequiresImport(r.ResourceType(), id)
return metadata.ResourceRequiresImport("azurerm_graph_services_account", id)
}

payload := graphservicesprods.AccountResource{
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package graph_test
package graphservices_test

import (
"context"
Expand Down Expand Up @@ -30,7 +30,7 @@ func TestAccGraphAccount(t *testing.T) {
type AccountTestResource struct{}

func testAccGraphAccount_basic(t *testing.T) {
data := acceptance.BuildTestData(t, "azurerm_graph_account", "test")
data := acceptance.BuildTestData(t, "azurerm_graph_services_account", "test")
r := AccountTestResource{}

data.ResourceSequentialTest(t, r, []acceptance.TestStep{
Expand All @@ -45,7 +45,7 @@ func testAccGraphAccount_basic(t *testing.T) {
}

func testAccGraphAccount_requiresImport(t *testing.T) {
data := acceptance.BuildTestData(t, "azurerm_graph_account", "test")
data := acceptance.BuildTestData(t, "azurerm_graph_services_account", "test")

r := AccountTestResource{}

Expand All @@ -61,7 +61,7 @@ func testAccGraphAccount_requiresImport(t *testing.T) {
}

func testAccGraphAccount_complete(t *testing.T) {
data := acceptance.BuildTestData(t, "azurerm_graph_account", "test")
data := acceptance.BuildTestData(t, "azurerm_graph_services_account", "test")
r := AccountTestResource{}

data.ResourceSequentialTest(t, r, []acceptance.TestStep{
Expand All @@ -76,7 +76,7 @@ func testAccGraphAccount_complete(t *testing.T) {
}

func testAccGraphAccount_update(t *testing.T) {
data := acceptance.BuildTestData(t, "azurerm_graph_account", "test")
data := acceptance.BuildTestData(t, "azurerm_graph_services_account", "test")
r := AccountTestResource{}

data.ResourceSequentialTest(t, r, []acceptance.TestStep{
Expand Down Expand Up @@ -120,7 +120,7 @@ func (r AccountTestResource) basic(data acceptance.TestData) string {
return fmt.Sprintf(`
%s

resource "azurerm_graph_account" "test" {
resource "azurerm_graph_services_account" "test" {
name = "acctesta-%[2]d"
application_id = "%[3]s"
resource_group_name = azurerm_resource_group.test.name
Expand All @@ -132,10 +132,10 @@ func (r AccountTestResource) requiresImport(data acceptance.TestData) string {
return fmt.Sprintf(`
%s

resource "azurerm_graph_account" "import" {
application_id = azurerm_graph_account.test.application_id
name = azurerm_graph_account.test.name
resource_group_name = azurerm_graph_account.test.resource_group_name
resource "azurerm_graph_services_account" "import" {
application_id = azurerm_graph_services_account.test.application_id
name = azurerm_graph_services_account.test.name
resource_group_name = azurerm_graph_services_account.test.resource_group_name
}
`, r.basic(data))
}
Expand All @@ -144,7 +144,7 @@ func (r AccountTestResource) complete(data acceptance.TestData) string {
return fmt.Sprintf(`
%s

resource "azurerm_graph_account" "test" {
resource "azurerm_graph_services_account" "test" {
name = "acctesta-%[2]d"
resource_group_name = azurerm_resource_group.test.name
application_id = "%[3]s"
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package graph
package graphservices

import (
"github.com/hashicorp/terraform-provider-azurerm/internal/sdk"
Expand All @@ -14,12 +14,12 @@ func (r Registration) AssociatedGitHubLabel() string {

// Name is the name of this Service
func (r Registration) Name() string {
return "Graph"
return "Graph Services"
}

// WebsiteCategories returns a list of categories which can be used for the sidebar
func (r Registration) WebsiteCategories() []string {
return []string{"Graph"}
return []string{"Graph Services"}
}

// DataSources returns a list of Data Sources supported by this Service
Expand All @@ -31,5 +31,6 @@ func (r Registration) DataSources() []sdk.DataSource {
func (r Registration) Resources() []sdk.Resource {
return []sdk.Resource{
AccountResource{},
ServicesAccountResource{},
}
}
2 changes: 1 addition & 1 deletion website/allowed-subcategories
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ Digital Twins
Disks
Elastic
Fluid Relay
Graph
Graph Services
HDInsight
Hardware Security Module
Healthcare
Expand Down
8 changes: 5 additions & 3 deletions website/docs/r/graph_account.html.markdown
Original file line number Diff line number Diff line change
@@ -1,14 +1,16 @@
---
subcategory: "Graph"
subcategory: "Graph Services"
layout: "azurerm"
page_title: "Azure Resource Manager: azurerm_graph_account"
description: |-
Manages a Account.
Manages a Microsoft Graph Services Account.
---

# azurerm_graph_account

Manages a Graph Account.
Manages a Microsoft Graph Services Account.

!> **NOTE:** This resource has been deprecated in version 3.0 of the AzureRM provider and will be removed in version 4.0. Please use [`azurerm_graph_services_account`](https://registry.terraform.io/providers/hashicorp/azurerm/latest/docs/resources/graph_services_account) resources instead.

## Example Usage

Expand Down
70 changes: 70 additions & 0 deletions website/docs/r/graph_services_account.html.markdown
Original file line number Diff line number Diff line change
@@ -0,0 +1,70 @@
---
subcategory: "Graph Services"
layout: "azurerm"
page_title: "Azure Resource Manager: azurerm_graph_services_account"
description: |-
Manages a Microsoft Graph Services Account.
---

# azurerm_graph_services_account

Manages a Microsoft Graph Services Account.

## Example Usage

```hcl
resource "azuread_application" "example" {
display_name = "example-app"
}
resource "azurerm_resource_group" "example" {
name = "example-resources"
location = "West Europe"
}
resource "azurerm_graph_services_account" "example" {
name = "example"
resource_group_name = azurerm_resource_group.example.name
application_id = azuread_application.example.application_id
tags = {
environment = "Production"
}
}
```

## Arguments Reference

The following arguments are supported:

* `name` - (Required) Specifies the name of this Account. Changing this forces a new Account to be created.

* `resource_group_name` - (Required) Specifies the name of the Resource Group within which this Account should exist. Changing this forces a new Account to be created.

* `application_id` - (Required) Customer owned application ID. Changing this forces a new Account to be created.

* `tags` - (Optional) A mapping of tags which should be assigned to the Account.

## Attributes Reference

In addition to the Arguments listed above - the following Attributes are exported:

* `id` - The ID of the Account.

* `billing_plan_id` - Billing Plan Id.

---

## Timeouts

The `timeouts` block allows you to specify [timeouts](https://www.terraform.io/docs/configuration/resources.html#timeouts) for certain actions:

* `create` - (Defaults to 30 minutes) Used when creating this Account.
* `delete` - (Defaults to 30 minutes) Used when deleting this Account.
* `read` - (Defaults to 5 minutes) Used when retrieving this Account.
* `update` - (Defaults to 30 minutes) Used when updating this Account.

## Import

An existing Account can be imported into Terraform using the `resource id`, e.g.

```shell
terraform import azurerm_graph_services_account.example /subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.GraphServices/accounts/account1
```