diff --git a/internal/services/monitor/client/client.go b/internal/services/monitor/client/client.go index ade711e39245..f7d7e933dd7e 100644 --- a/internal/services/monitor/client/client.go +++ b/internal/services/monitor/client/client.go @@ -16,10 +16,10 @@ import ( "github.com/hashicorp/go-azure-sdk/resource-manager/insights/2018-03-01/metricalerts" scheduledqueryrules2018 "github.com/hashicorp/go-azure-sdk/resource-manager/insights/2018-04-16/scheduledqueryrules" "github.com/hashicorp/go-azure-sdk/resource-manager/insights/2019-10-17-preview/privatelinkscopedresources" - "github.com/hashicorp/go-azure-sdk/resource-manager/insights/2019-10-17-preview/privatelinkscopesapis" "github.com/hashicorp/go-azure-sdk/resource-manager/insights/2020-10-01/activitylogalertsapis" diagnosticSettingClient "github.com/hashicorp/go-azure-sdk/resource-manager/insights/2021-05-01-preview/diagnosticsettings" diagnosticCategoryClient "github.com/hashicorp/go-azure-sdk/resource-manager/insights/2021-05-01-preview/diagnosticsettingscategories" + "github.com/hashicorp/go-azure-sdk/resource-manager/insights/2021-07-01-preview/privatelinkscopesapis" "github.com/hashicorp/go-azure-sdk/resource-manager/insights/2022-06-01/datacollectionendpoints" "github.com/hashicorp/go-azure-sdk/resource-manager/insights/2022-06-01/datacollectionruleassociations" "github.com/hashicorp/go-azure-sdk/resource-manager/insights/2022-06-01/datacollectionrules" diff --git a/internal/services/monitor/monitor_private_link_scope_resource.go b/internal/services/monitor/monitor_private_link_scope_resource.go index 9725fef35995..0e85d81bdede 100644 --- a/internal/services/monitor/monitor_private_link_scope_resource.go +++ b/internal/services/monitor/monitor_private_link_scope_resource.go @@ -10,12 +10,13 @@ import ( "github.com/hashicorp/go-azure-helpers/lang/response" "github.com/hashicorp/go-azure-helpers/resourcemanager/commonschema" - "github.com/hashicorp/go-azure-sdk/resource-manager/insights/2019-10-17-preview/privatelinkscopesapis" + "github.com/hashicorp/go-azure-sdk/resource-manager/insights/2021-07-01-preview/privatelinkscopesapis" "github.com/hashicorp/terraform-provider-azurerm/helpers/tf" "github.com/hashicorp/terraform-provider-azurerm/internal/clients" "github.com/hashicorp/terraform-provider-azurerm/internal/services/monitor/validate" "github.com/hashicorp/terraform-provider-azurerm/internal/tags" "github.com/hashicorp/terraform-provider-azurerm/internal/tf/pluginsdk" + "github.com/hashicorp/terraform-provider-azurerm/internal/tf/validation" "github.com/hashicorp/terraform-provider-azurerm/internal/timeouts" "github.com/hashicorp/terraform-provider-azurerm/utils" ) @@ -47,6 +48,20 @@ func resourceMonitorPrivateLinkScope() *pluginsdk.Resource { ValidateFunc: validate.PrivateLinkScopeName, }, + "ingestion_access_mode": { + Type: pluginsdk.TypeString, + Optional: true, + Default: string(privatelinkscopesapis.AccessModeOpen), + ValidateFunc: validation.StringInSlice(privatelinkscopesapis.PossibleValuesForAccessMode(), false), + }, + + "query_access_mode": { + Type: pluginsdk.TypeString, + Optional: true, + Default: string(privatelinkscopesapis.AccessModeOpen), + ValidateFunc: validation.StringInSlice(privatelinkscopesapis.PossibleValuesForAccessMode(), false), + }, + "resource_group_name": commonschema.ResourceGroupName(), "tags": tags.Schema(), @@ -78,9 +93,19 @@ func resourceMonitorPrivateLinkScopeCreateUpdate(d *pluginsdk.ResourceData, meta } } + ingestionAccessMode := privatelinkscopesapis.AccessMode(d.Get("ingestion_access_mode").(string)) + queryaccessMode := privatelinkscopesapis.AccessMode(d.Get("query_access_mode").(string)) + parameters := privatelinkscopesapis.AzureMonitorPrivateLinkScope{ + Name: &name, Location: "Global", Tags: utils.ExpandPtrMapStringString(d.Get("tags").(map[string]interface{})), + Properties: privatelinkscopesapis.AzureMonitorPrivateLinkScopeProperties{ + AccessModeSettings: privatelinkscopesapis.AccessModeSettings{ + IngestionAccessMode: ingestionAccessMode, + QueryAccessMode: queryaccessMode, + }, + }, } if _, err := client.PrivateLinkScopesCreateOrUpdate(ctx, id, parameters); err != nil { @@ -119,6 +144,11 @@ func resourceMonitorPrivateLinkScopeRead(d *pluginsdk.ResourceData, meta interfa if err = d.Set("tags", utils.FlattenPtrMapStringString(model.Tags)); err != nil { return err } + + props := model.Properties + d.Set("ingestion_access_mode", string(props.AccessModeSettings.IngestionAccessMode)) + d.Set("query_access_mode", string(props.AccessModeSettings.QueryAccessMode)) + } return nil diff --git a/internal/services/monitor/monitor_private_link_scope_resource_test.go b/internal/services/monitor/monitor_private_link_scope_resource_test.go index d525ab82edcb..673479d24b58 100644 --- a/internal/services/monitor/monitor_private_link_scope_resource_test.go +++ b/internal/services/monitor/monitor_private_link_scope_resource_test.go @@ -9,7 +9,7 @@ import ( "testing" "github.com/hashicorp/go-azure-helpers/lang/response" - "github.com/hashicorp/go-azure-sdk/resource-manager/insights/2019-10-17-preview/privatelinkscopesapis" + "github.com/hashicorp/go-azure-sdk/resource-manager/insights/2021-07-01-preview/privatelinkscopesapis" "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" @@ -55,7 +55,7 @@ func TestAccMonitorPrivateLinkScope_complete(t *testing.T) { data.ResourceTest(t, r, []acceptance.TestStep{ { - Config: r.complete(data, "Test"), + Config: r.complete(data, "Test", "Open", "Open"), Check: acceptance.ComposeTestCheckFunc( check.That(data.ResourceName).ExistsInAzure(r), ), @@ -70,14 +70,14 @@ func TestAccMonitorPrivateLinkScope_update(t *testing.T) { data.ResourceTest(t, r, []acceptance.TestStep{ { - Config: r.complete(data, "Test1"), + Config: r.complete(data, "Test1", "Open", "Open"), Check: acceptance.ComposeTestCheckFunc( check.That(data.ResourceName).ExistsInAzure(r), ), }, data.ImportStep(), { - Config: r.complete(data, "Test2"), + Config: r.complete(data, "Test2", "PrivateOnly", "PrivateOnly"), Check: acceptance.ComposeTestCheckFunc( check.That(data.ResourceName).ExistsInAzure(r), ), @@ -123,6 +123,7 @@ func (r MonitorPrivateLinkScopeResource) basic(data acceptance.TestData) string resource "azurerm_monitor_private_link_scope" "test" { name = "acctest-ampls-%d" resource_group_name = azurerm_resource_group.test.name + } `, r.template(data), data.RandomInteger) } @@ -134,11 +135,12 @@ func (r MonitorPrivateLinkScopeResource) requiresImport(data acceptance.TestData resource "azurerm_monitor_private_link_scope" "import" { name = azurerm_monitor_private_link_scope.test.name resource_group_name = azurerm_monitor_private_link_scope.test.resource_group_name + } `, r.basic(data)) } -func (r MonitorPrivateLinkScopeResource) complete(data acceptance.TestData, tag string) string { +func (r MonitorPrivateLinkScopeResource) complete(data acceptance.TestData, tag string, ingestionAccessMode string, queryAccessMode string) string { return fmt.Sprintf(` %s @@ -146,9 +148,12 @@ resource "azurerm_monitor_private_link_scope" "test" { name = "acctest-AMPLS-%d" resource_group_name = azurerm_resource_group.test.name + ingestion_access_mode = "%s" + query_access_mode = "%s" + tags = { ENV = "%s" } } -`, r.template(data), data.RandomInteger, tag) +`, r.template(data), data.RandomInteger, ingestionAccessMode, queryAccessMode, tag) } diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/insights/2019-10-17-preview/privatelinkscopesapis/model_privateendpointconnectionproperties.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/insights/2019-10-17-preview/privatelinkscopesapis/model_privateendpointconnectionproperties.go deleted file mode 100644 index 5327d36f0a1c..000000000000 --- a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/insights/2019-10-17-preview/privatelinkscopesapis/model_privateendpointconnectionproperties.go +++ /dev/null @@ -1,10 +0,0 @@ -package privatelinkscopesapis - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type PrivateEndpointConnectionProperties struct { - PrivateEndpoint *PrivateEndpointProperty `json:"privateEndpoint,omitempty"` - PrivateLinkServiceConnectionState *PrivateLinkServiceConnectionStateProperty `json:"privateLinkServiceConnectionState,omitempty"` - ProvisioningState *string `json:"provisioningState,omitempty"` -} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/insights/2019-10-17-preview/privatelinkscopesapis/model_privatelinkserviceconnectionstateproperty.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/insights/2019-10-17-preview/privatelinkscopesapis/model_privatelinkserviceconnectionstateproperty.go deleted file mode 100644 index d47e02eded87..000000000000 --- a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/insights/2019-10-17-preview/privatelinkscopesapis/model_privatelinkserviceconnectionstateproperty.go +++ /dev/null @@ -1,10 +0,0 @@ -package privatelinkscopesapis - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type PrivateLinkServiceConnectionStateProperty struct { - ActionsRequired *string `json:"actionsRequired,omitempty"` - Description string `json:"description"` - Status string `json:"status"` -} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/insights/2019-10-17-preview/privatelinkscopesapis/README.md b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/insights/2021-07-01-preview/privatelinkscopesapis/README.md similarity index 94% rename from vendor/github.com/hashicorp/go-azure-sdk/resource-manager/insights/2019-10-17-preview/privatelinkscopesapis/README.md rename to vendor/github.com/hashicorp/go-azure-sdk/resource-manager/insights/2021-07-01-preview/privatelinkscopesapis/README.md index de817a131921..f6e04d93b747 100644 --- a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/insights/2019-10-17-preview/privatelinkscopesapis/README.md +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/insights/2021-07-01-preview/privatelinkscopesapis/README.md @@ -1,7 +1,7 @@ -## `github.com/hashicorp/go-azure-sdk/resource-manager/insights/2019-10-17-preview/privatelinkscopesapis` Documentation +## `github.com/hashicorp/go-azure-sdk/resource-manager/insights/2021-07-01-preview/privatelinkscopesapis` Documentation -The `privatelinkscopesapis` SDK allows for interaction with the Azure Resource Manager Service `insights` (API Version `2019-10-17-preview`). +The `privatelinkscopesapis` SDK allows for interaction with the Azure Resource Manager Service `insights` (API Version `2021-07-01-preview`). This readme covers example usages, but further information on [using this SDK can be found in the project root](https://github.com/hashicorp/go-azure-sdk/tree/main/docs). @@ -9,7 +9,7 @@ This readme covers example usages, but further information on [using this SDK ca ```go import "github.com/hashicorp/go-azure-helpers/resourcemanager/commonids" -import "github.com/hashicorp/go-azure-sdk/resource-manager/insights/2019-10-17-preview/privatelinkscopesapis" +import "github.com/hashicorp/go-azure-sdk/resource-manager/insights/2021-07-01-preview/privatelinkscopesapis" ``` diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/insights/2019-10-17-preview/privatelinkscopesapis/client.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/insights/2021-07-01-preview/privatelinkscopesapis/client.go similarity index 100% rename from vendor/github.com/hashicorp/go-azure-sdk/resource-manager/insights/2019-10-17-preview/privatelinkscopesapis/client.go rename to vendor/github.com/hashicorp/go-azure-sdk/resource-manager/insights/2021-07-01-preview/privatelinkscopesapis/client.go diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/insights/2021-07-01-preview/privatelinkscopesapis/constants.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/insights/2021-07-01-preview/privatelinkscopesapis/constants.go new file mode 100644 index 000000000000..1ab8e4fd3076 --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/insights/2021-07-01-preview/privatelinkscopesapis/constants.go @@ -0,0 +1,142 @@ +package privatelinkscopesapis + +import ( + "encoding/json" + "fmt" + "strings" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type AccessMode string + +const ( + AccessModeOpen AccessMode = "Open" + AccessModePrivateOnly AccessMode = "PrivateOnly" +) + +func PossibleValuesForAccessMode() []string { + return []string{ + string(AccessModeOpen), + string(AccessModePrivateOnly), + } +} + +func (s *AccessMode) UnmarshalJSON(bytes []byte) error { + var decoded string + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + out, err := parseAccessMode(decoded) + if err != nil { + return fmt.Errorf("parsing %q: %+v", decoded, err) + } + *s = *out + return nil +} + +func parseAccessMode(input string) (*AccessMode, error) { + vals := map[string]AccessMode{ + "open": AccessModeOpen, + "privateonly": AccessModePrivateOnly, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := AccessMode(input) + return &out, nil +} + +type PrivateEndpointConnectionProvisioningState string + +const ( + PrivateEndpointConnectionProvisioningStateCreating PrivateEndpointConnectionProvisioningState = "Creating" + PrivateEndpointConnectionProvisioningStateDeleting PrivateEndpointConnectionProvisioningState = "Deleting" + PrivateEndpointConnectionProvisioningStateFailed PrivateEndpointConnectionProvisioningState = "Failed" + PrivateEndpointConnectionProvisioningStateSucceeded PrivateEndpointConnectionProvisioningState = "Succeeded" +) + +func PossibleValuesForPrivateEndpointConnectionProvisioningState() []string { + return []string{ + string(PrivateEndpointConnectionProvisioningStateCreating), + string(PrivateEndpointConnectionProvisioningStateDeleting), + string(PrivateEndpointConnectionProvisioningStateFailed), + string(PrivateEndpointConnectionProvisioningStateSucceeded), + } +} + +func (s *PrivateEndpointConnectionProvisioningState) UnmarshalJSON(bytes []byte) error { + var decoded string + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + out, err := parsePrivateEndpointConnectionProvisioningState(decoded) + if err != nil { + return fmt.Errorf("parsing %q: %+v", decoded, err) + } + *s = *out + return nil +} + +func parsePrivateEndpointConnectionProvisioningState(input string) (*PrivateEndpointConnectionProvisioningState, error) { + vals := map[string]PrivateEndpointConnectionProvisioningState{ + "creating": PrivateEndpointConnectionProvisioningStateCreating, + "deleting": PrivateEndpointConnectionProvisioningStateDeleting, + "failed": PrivateEndpointConnectionProvisioningStateFailed, + "succeeded": PrivateEndpointConnectionProvisioningStateSucceeded, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := PrivateEndpointConnectionProvisioningState(input) + return &out, nil +} + +type PrivateEndpointServiceConnectionStatus string + +const ( + PrivateEndpointServiceConnectionStatusApproved PrivateEndpointServiceConnectionStatus = "Approved" + PrivateEndpointServiceConnectionStatusPending PrivateEndpointServiceConnectionStatus = "Pending" + PrivateEndpointServiceConnectionStatusRejected PrivateEndpointServiceConnectionStatus = "Rejected" +) + +func PossibleValuesForPrivateEndpointServiceConnectionStatus() []string { + return []string{ + string(PrivateEndpointServiceConnectionStatusApproved), + string(PrivateEndpointServiceConnectionStatusPending), + string(PrivateEndpointServiceConnectionStatusRejected), + } +} + +func (s *PrivateEndpointServiceConnectionStatus) UnmarshalJSON(bytes []byte) error { + var decoded string + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + out, err := parsePrivateEndpointServiceConnectionStatus(decoded) + if err != nil { + return fmt.Errorf("parsing %q: %+v", decoded, err) + } + *s = *out + return nil +} + +func parsePrivateEndpointServiceConnectionStatus(input string) (*PrivateEndpointServiceConnectionStatus, error) { + vals := map[string]PrivateEndpointServiceConnectionStatus{ + "approved": PrivateEndpointServiceConnectionStatusApproved, + "pending": PrivateEndpointServiceConnectionStatusPending, + "rejected": PrivateEndpointServiceConnectionStatusRejected, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := PrivateEndpointServiceConnectionStatus(input) + return &out, nil +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/insights/2019-10-17-preview/privatelinkscopesapis/id_privatelinkscope.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/insights/2021-07-01-preview/privatelinkscopesapis/id_privatelinkscope.go similarity index 100% rename from vendor/github.com/hashicorp/go-azure-sdk/resource-manager/insights/2019-10-17-preview/privatelinkscopesapis/id_privatelinkscope.go rename to vendor/github.com/hashicorp/go-azure-sdk/resource-manager/insights/2021-07-01-preview/privatelinkscopesapis/id_privatelinkscope.go diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/insights/2019-10-17-preview/privatelinkscopesapis/method_privatelinkscopescreateorupdate.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/insights/2021-07-01-preview/privatelinkscopesapis/method_privatelinkscopescreateorupdate.go similarity index 100% rename from vendor/github.com/hashicorp/go-azure-sdk/resource-manager/insights/2019-10-17-preview/privatelinkscopesapis/method_privatelinkscopescreateorupdate.go rename to vendor/github.com/hashicorp/go-azure-sdk/resource-manager/insights/2021-07-01-preview/privatelinkscopesapis/method_privatelinkscopescreateorupdate.go diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/insights/2019-10-17-preview/privatelinkscopesapis/method_privatelinkscopesdelete.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/insights/2021-07-01-preview/privatelinkscopesapis/method_privatelinkscopesdelete.go similarity index 100% rename from vendor/github.com/hashicorp/go-azure-sdk/resource-manager/insights/2019-10-17-preview/privatelinkscopesapis/method_privatelinkscopesdelete.go rename to vendor/github.com/hashicorp/go-azure-sdk/resource-manager/insights/2021-07-01-preview/privatelinkscopesapis/method_privatelinkscopesdelete.go diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/insights/2019-10-17-preview/privatelinkscopesapis/method_privatelinkscopesget.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/insights/2021-07-01-preview/privatelinkscopesapis/method_privatelinkscopesget.go similarity index 100% rename from vendor/github.com/hashicorp/go-azure-sdk/resource-manager/insights/2019-10-17-preview/privatelinkscopesapis/method_privatelinkscopesget.go rename to vendor/github.com/hashicorp/go-azure-sdk/resource-manager/insights/2021-07-01-preview/privatelinkscopesapis/method_privatelinkscopesget.go diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/insights/2019-10-17-preview/privatelinkscopesapis/method_privatelinkscopeslist.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/insights/2021-07-01-preview/privatelinkscopesapis/method_privatelinkscopeslist.go similarity index 100% rename from vendor/github.com/hashicorp/go-azure-sdk/resource-manager/insights/2019-10-17-preview/privatelinkscopesapis/method_privatelinkscopeslist.go rename to vendor/github.com/hashicorp/go-azure-sdk/resource-manager/insights/2021-07-01-preview/privatelinkscopesapis/method_privatelinkscopeslist.go diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/insights/2019-10-17-preview/privatelinkscopesapis/method_privatelinkscopeslistbyresourcegroup.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/insights/2021-07-01-preview/privatelinkscopesapis/method_privatelinkscopeslistbyresourcegroup.go similarity index 100% rename from vendor/github.com/hashicorp/go-azure-sdk/resource-manager/insights/2019-10-17-preview/privatelinkscopesapis/method_privatelinkscopeslistbyresourcegroup.go rename to vendor/github.com/hashicorp/go-azure-sdk/resource-manager/insights/2021-07-01-preview/privatelinkscopesapis/method_privatelinkscopeslistbyresourcegroup.go diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/insights/2019-10-17-preview/privatelinkscopesapis/method_privatelinkscopesupdatetags.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/insights/2021-07-01-preview/privatelinkscopesapis/method_privatelinkscopesupdatetags.go similarity index 100% rename from vendor/github.com/hashicorp/go-azure-sdk/resource-manager/insights/2019-10-17-preview/privatelinkscopesapis/method_privatelinkscopesupdatetags.go rename to vendor/github.com/hashicorp/go-azure-sdk/resource-manager/insights/2021-07-01-preview/privatelinkscopesapis/method_privatelinkscopesupdatetags.go diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/insights/2021-07-01-preview/privatelinkscopesapis/model_accessmodesettings.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/insights/2021-07-01-preview/privatelinkscopesapis/model_accessmodesettings.go new file mode 100644 index 000000000000..07ba24268a13 --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/insights/2021-07-01-preview/privatelinkscopesapis/model_accessmodesettings.go @@ -0,0 +1,10 @@ +package privatelinkscopesapis + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type AccessModeSettings struct { + Exclusions *[]AccessModeSettingsExclusion `json:"exclusions,omitempty"` + IngestionAccessMode AccessMode `json:"ingestionAccessMode"` + QueryAccessMode AccessMode `json:"queryAccessMode"` +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/insights/2021-07-01-preview/privatelinkscopesapis/model_accessmodesettingsexclusion.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/insights/2021-07-01-preview/privatelinkscopesapis/model_accessmodesettingsexclusion.go new file mode 100644 index 000000000000..88d4c3105144 --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/insights/2021-07-01-preview/privatelinkscopesapis/model_accessmodesettingsexclusion.go @@ -0,0 +1,10 @@ +package privatelinkscopesapis + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type AccessModeSettingsExclusion struct { + IngestionAccessMode *AccessMode `json:"ingestionAccessMode,omitempty"` + PrivateEndpointConnectionName *string `json:"privateEndpointConnectionName,omitempty"` + QueryAccessMode *AccessMode `json:"queryAccessMode,omitempty"` +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/insights/2019-10-17-preview/privatelinkscopesapis/model_azuremonitorprivatelinkscope.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/insights/2021-07-01-preview/privatelinkscopesapis/model_azuremonitorprivatelinkscope.go similarity index 80% rename from vendor/github.com/hashicorp/go-azure-sdk/resource-manager/insights/2019-10-17-preview/privatelinkscopesapis/model_azuremonitorprivatelinkscope.go rename to vendor/github.com/hashicorp/go-azure-sdk/resource-manager/insights/2021-07-01-preview/privatelinkscopesapis/model_azuremonitorprivatelinkscope.go index 05dc395af691..7cba58daad2d 100644 --- a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/insights/2019-10-17-preview/privatelinkscopesapis/model_azuremonitorprivatelinkscope.go +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/insights/2021-07-01-preview/privatelinkscopesapis/model_azuremonitorprivatelinkscope.go @@ -1,5 +1,9 @@ package privatelinkscopesapis +import ( + "github.com/hashicorp/go-azure-helpers/resourcemanager/systemdata" +) + // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See NOTICE.txt in the project root for license information. @@ -8,6 +12,7 @@ type AzureMonitorPrivateLinkScope struct { Location string `json:"location"` Name *string `json:"name,omitempty"` Properties AzureMonitorPrivateLinkScopeProperties `json:"properties"` + SystemData *systemdata.SystemData `json:"systemData,omitempty"` Tags *map[string]string `json:"tags,omitempty"` Type *string `json:"type,omitempty"` } diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/insights/2019-10-17-preview/privatelinkscopesapis/model_azuremonitorprivatelinkscopeproperties.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/insights/2021-07-01-preview/privatelinkscopesapis/model_azuremonitorprivatelinkscopeproperties.go similarity index 83% rename from vendor/github.com/hashicorp/go-azure-sdk/resource-manager/insights/2019-10-17-preview/privatelinkscopesapis/model_azuremonitorprivatelinkscopeproperties.go rename to vendor/github.com/hashicorp/go-azure-sdk/resource-manager/insights/2021-07-01-preview/privatelinkscopesapis/model_azuremonitorprivatelinkscopeproperties.go index b67211c04c5c..dfe3d8176dbf 100644 --- a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/insights/2019-10-17-preview/privatelinkscopesapis/model_azuremonitorprivatelinkscopeproperties.go +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/insights/2021-07-01-preview/privatelinkscopesapis/model_azuremonitorprivatelinkscopeproperties.go @@ -4,6 +4,7 @@ package privatelinkscopesapis // Licensed under the MIT License. See NOTICE.txt in the project root for license information. type AzureMonitorPrivateLinkScopeProperties struct { + AccessModeSettings AccessModeSettings `json:"accessModeSettings"` PrivateEndpointConnections *[]PrivateEndpointConnection `json:"privateEndpointConnections,omitempty"` ProvisioningState *string `json:"provisioningState,omitempty"` } diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/insights/2019-10-17-preview/privatelinkscopesapis/model_privateendpointproperty.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/insights/2021-07-01-preview/privatelinkscopesapis/model_privateendpoint.go similarity index 85% rename from vendor/github.com/hashicorp/go-azure-sdk/resource-manager/insights/2019-10-17-preview/privatelinkscopesapis/model_privateendpointproperty.go rename to vendor/github.com/hashicorp/go-azure-sdk/resource-manager/insights/2021-07-01-preview/privatelinkscopesapis/model_privateendpoint.go index 2a7b2b2d0f8e..dfd52c0bcc63 100644 --- a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/insights/2019-10-17-preview/privatelinkscopesapis/model_privateendpointproperty.go +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/insights/2021-07-01-preview/privatelinkscopesapis/model_privateendpoint.go @@ -3,6 +3,6 @@ package privatelinkscopesapis // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See NOTICE.txt in the project root for license information. -type PrivateEndpointProperty struct { +type PrivateEndpoint struct { Id *string `json:"id,omitempty"` } diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/insights/2019-10-17-preview/privatelinkscopesapis/model_privateendpointconnection.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/insights/2021-07-01-preview/privatelinkscopesapis/model_privateendpointconnection.go similarity index 100% rename from vendor/github.com/hashicorp/go-azure-sdk/resource-manager/insights/2019-10-17-preview/privatelinkscopesapis/model_privateendpointconnection.go rename to vendor/github.com/hashicorp/go-azure-sdk/resource-manager/insights/2021-07-01-preview/privatelinkscopesapis/model_privateendpointconnection.go diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/insights/2021-07-01-preview/privatelinkscopesapis/model_privateendpointconnectionproperties.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/insights/2021-07-01-preview/privatelinkscopesapis/model_privateendpointconnectionproperties.go new file mode 100644 index 000000000000..e02ccfddf479 --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/insights/2021-07-01-preview/privatelinkscopesapis/model_privateendpointconnectionproperties.go @@ -0,0 +1,10 @@ +package privatelinkscopesapis + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type PrivateEndpointConnectionProperties struct { + PrivateEndpoint *PrivateEndpoint `json:"privateEndpoint,omitempty"` + PrivateLinkServiceConnectionState PrivateLinkServiceConnectionState `json:"privateLinkServiceConnectionState"` + ProvisioningState *PrivateEndpointConnectionProvisioningState `json:"provisioningState,omitempty"` +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/insights/2021-07-01-preview/privatelinkscopesapis/model_privatelinkserviceconnectionstate.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/insights/2021-07-01-preview/privatelinkscopesapis/model_privatelinkserviceconnectionstate.go new file mode 100644 index 000000000000..f292a48bd57b --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/insights/2021-07-01-preview/privatelinkscopesapis/model_privatelinkserviceconnectionstate.go @@ -0,0 +1,10 @@ +package privatelinkscopesapis + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type PrivateLinkServiceConnectionState struct { + ActionsRequired *string `json:"actionsRequired,omitempty"` + Description *string `json:"description,omitempty"` + Status *PrivateEndpointServiceConnectionStatus `json:"status,omitempty"` +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/insights/2019-10-17-preview/privatelinkscopesapis/model_tagsresource.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/insights/2021-07-01-preview/privatelinkscopesapis/model_tagsresource.go similarity index 100% rename from vendor/github.com/hashicorp/go-azure-sdk/resource-manager/insights/2019-10-17-preview/privatelinkscopesapis/model_tagsresource.go rename to vendor/github.com/hashicorp/go-azure-sdk/resource-manager/insights/2021-07-01-preview/privatelinkscopesapis/model_tagsresource.go diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/insights/2019-10-17-preview/privatelinkscopesapis/predicates.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/insights/2021-07-01-preview/privatelinkscopesapis/predicates.go similarity index 100% rename from vendor/github.com/hashicorp/go-azure-sdk/resource-manager/insights/2019-10-17-preview/privatelinkscopesapis/predicates.go rename to vendor/github.com/hashicorp/go-azure-sdk/resource-manager/insights/2021-07-01-preview/privatelinkscopesapis/predicates.go diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/insights/2019-10-17-preview/privatelinkscopesapis/version.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/insights/2021-07-01-preview/privatelinkscopesapis/version.go similarity index 87% rename from vendor/github.com/hashicorp/go-azure-sdk/resource-manager/insights/2019-10-17-preview/privatelinkscopesapis/version.go rename to vendor/github.com/hashicorp/go-azure-sdk/resource-manager/insights/2021-07-01-preview/privatelinkscopesapis/version.go index 856718170aa7..e6c1b6f869f1 100644 --- a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/insights/2019-10-17-preview/privatelinkscopesapis/version.go +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/insights/2021-07-01-preview/privatelinkscopesapis/version.go @@ -5,7 +5,7 @@ import "fmt" // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See NOTICE.txt in the project root for license information. -const defaultApiVersion = "2019-10-17-preview" +const defaultApiVersion = "2021-07-01-preview" func userAgent() string { return fmt.Sprintf("hashicorp/go-azure-sdk/privatelinkscopesapis/%s", defaultApiVersion) diff --git a/vendor/modules.txt b/vendor/modules.txt index 8365cd9e9e1f..6f1922ab6c44 100644 --- a/vendor/modules.txt +++ b/vendor/modules.txt @@ -563,10 +563,10 @@ github.com/hashicorp/go-azure-sdk/resource-manager/insights/2016-03-01/logprofil github.com/hashicorp/go-azure-sdk/resource-manager/insights/2018-03-01/metricalerts github.com/hashicorp/go-azure-sdk/resource-manager/insights/2018-04-16/scheduledqueryrules github.com/hashicorp/go-azure-sdk/resource-manager/insights/2019-10-17-preview/privatelinkscopedresources -github.com/hashicorp/go-azure-sdk/resource-manager/insights/2019-10-17-preview/privatelinkscopesapis github.com/hashicorp/go-azure-sdk/resource-manager/insights/2020-10-01/activitylogalertsapis github.com/hashicorp/go-azure-sdk/resource-manager/insights/2021-05-01-preview/diagnosticsettings github.com/hashicorp/go-azure-sdk/resource-manager/insights/2021-05-01-preview/diagnosticsettingscategories +github.com/hashicorp/go-azure-sdk/resource-manager/insights/2021-07-01-preview/privatelinkscopesapis github.com/hashicorp/go-azure-sdk/resource-manager/insights/2022-06-01/datacollectionendpoints github.com/hashicorp/go-azure-sdk/resource-manager/insights/2022-06-01/datacollectionruleassociations github.com/hashicorp/go-azure-sdk/resource-manager/insights/2022-06-01/datacollectionrules diff --git a/website/docs/r/monitor_private_link_scope.html.markdown b/website/docs/r/monitor_private_link_scope.html.markdown index a2f014e7ccc6..aed44fa99a41 100644 --- a/website/docs/r/monitor_private_link_scope.html.markdown +++ b/website/docs/r/monitor_private_link_scope.html.markdown @@ -21,6 +21,9 @@ resource "azurerm_resource_group" "example" { resource "azurerm_monitor_private_link_scope" "example" { name = "example-ampls" resource_group_name = azurerm_resource_group.example.name + + ingestion_access_mode = "PrivateOnly" + query_access_mode = "Open" } ``` @@ -32,6 +35,10 @@ The following arguments are supported: * `resource_group_name` - (Required) The name of the Resource Group where the Azure Monitor Private Link Scope should exist. Changing this forces a new resource to be created. +* `ingestion_access_mode` - (Optional) The default ingestion access mode for the associated private endpoints in scope. Possible values are `Open` and `PrivateOnly`. Defaults to `Open`. + +* `query_access_mode` - (Optional) The default query access mode for hte associated private endpoints in scope. Possible values are `Open` and `PrivateOnly`. Defaults to `Open`. + * `tags` - (Optional) A mapping of tags which should be assigned to the Azure Monitor Private Link Scope. ## Attributes Reference @@ -55,4 +62,4 @@ Azure Monitor Private Link Scopes can be imported using the `resource id`, e.g. ```shell terraform import azurerm_monitor_private_link_scope.example /subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/group1/providers/Microsoft.Insights/privateLinkScopes/pls1 -``` +``` \ No newline at end of file