diff --git a/go.mod b/go.mod index 9c2db0c52f18..df7f7d1d64f8 100644 --- a/go.mod +++ b/go.mod @@ -13,8 +13,8 @@ require ( github.com/gofrs/uuid v4.0.0+incompatible github.com/google/go-cmp v0.5.9 github.com/google/uuid v1.1.2 - github.com/hashicorp/go-azure-helpers v0.52.0 - github.com/hashicorp/go-azure-sdk v0.20230301.1141943 + github.com/hashicorp/go-azure-helpers v0.55.0 + github.com/hashicorp/go-azure-sdk v0.20230306.1165107 github.com/hashicorp/go-multierror v1.1.1 github.com/hashicorp/go-uuid v1.0.3 github.com/hashicorp/go-version v1.6.0 diff --git a/go.sum b/go.sum index 79f24b8a434c..19f0aa885df8 100644 --- a/go.sum +++ b/go.sum @@ -134,10 +134,10 @@ github.com/hashicorp/errwrap v1.0.0/go.mod h1:YH+1FKiLXxHSkmPseP+kNlulaMuP3n2brv github.com/hashicorp/errwrap v1.1.0 h1:OxrOeh75EUXMY8TBjag2fzXGZ40LB6IKw45YeGUDY2I= github.com/hashicorp/errwrap v1.1.0/go.mod h1:YH+1FKiLXxHSkmPseP+kNlulaMuP3n2brvKWEqk/Jc4= github.com/hashicorp/go-azure-helpers v0.12.0/go.mod h1:Zc3v4DNeX6PDdy7NljlYpnrdac1++qNW0I4U+ofGwpg= -github.com/hashicorp/go-azure-helpers v0.52.0 h1:2xIjsPpDbZf5dFLEdqOy5akfdnh8M/6mQtVWhkpM3hM= -github.com/hashicorp/go-azure-helpers v0.52.0/go.mod h1:lsykLR4KjTUO7MiRmNWiTiX8QQtw3ILjyOvT0f5h3rw= -github.com/hashicorp/go-azure-sdk v0.20230301.1141943 h1:VUGSij0wpGbUkAMS5l5yOLohm8+YbeIPEaBpprmx0hU= -github.com/hashicorp/go-azure-sdk v0.20230301.1141943/go.mod h1:lU3F9c+qXc7iqMayTNmUP/VDc0H6f95mkhv4u35zV8I= +github.com/hashicorp/go-azure-helpers v0.55.0 h1:2A2KWPiaDC5kQWr6tYHTD/P1k9bO0HvflEb/Nc1yLeU= +github.com/hashicorp/go-azure-helpers v0.55.0/go.mod h1:RQugkG8wEcNIjYmcBLHpuEI/u2mTJwO4r37rR/OKRpo= +github.com/hashicorp/go-azure-sdk v0.20230306.1165107 h1:DUGdCQR1MMBqTTNa12y4btFRV78bAI6skjGrQ4MbIVA= +github.com/hashicorp/go-azure-sdk v0.20230306.1165107/go.mod h1:L9JXVUcnL0GjMizCnngYUlMp1lLhDBNgSTvn6Of/5O4= github.com/hashicorp/go-checkpoint v0.5.0 h1:MFYpPZCnQqQTE18jFwSII6eUQrD/oxMFp3mlgcqk5mU= github.com/hashicorp/go-checkpoint v0.5.0/go.mod h1:7nfLNL10NsxqO4iWuW6tWW0HjZuDrwkBuEQsVcpCOgg= github.com/hashicorp/go-cleanhttp v0.5.0/go.mod h1:JpRdi6/HCYpAwUzNwuwqhbovhLtngrth3wmdIIUrZ80= diff --git a/vendor/github.com/hashicorp/go-azure-helpers/resourcemanager/commonids/hyperv_site_job.go b/vendor/github.com/hashicorp/go-azure-helpers/resourcemanager/commonids/hyperv_site_job.go index 3c8f1cf55218..281ac5b7f221 100644 --- a/vendor/github.com/hashicorp/go-azure-helpers/resourcemanager/commonids/hyperv_site_job.go +++ b/vendor/github.com/hashicorp/go-azure-helpers/resourcemanager/commonids/hyperv_site_job.go @@ -1,3 +1,6 @@ +// Copyright (c) HashiCorp, Inc. +// SPDX-License-Identifier: MPL-2.0 + package commonids import ( diff --git a/vendor/github.com/hashicorp/go-azure-helpers/resourcemanager/commonids/hyperv_site_machine.go b/vendor/github.com/hashicorp/go-azure-helpers/resourcemanager/commonids/hyperv_site_machine.go index 1e9205ce34a2..61bbb666a90e 100644 --- a/vendor/github.com/hashicorp/go-azure-helpers/resourcemanager/commonids/hyperv_site_machine.go +++ b/vendor/github.com/hashicorp/go-azure-helpers/resourcemanager/commonids/hyperv_site_machine.go @@ -1,3 +1,6 @@ +// Copyright (c) HashiCorp, Inc. +// SPDX-License-Identifier: MPL-2.0 + package commonids import ( diff --git a/vendor/github.com/hashicorp/go-azure-helpers/resourcemanager/commonids/hyperv_site_runasaccount.go b/vendor/github.com/hashicorp/go-azure-helpers/resourcemanager/commonids/hyperv_site_runasaccount.go index 19a2956d2b0d..494d3b877052 100644 --- a/vendor/github.com/hashicorp/go-azure-helpers/resourcemanager/commonids/hyperv_site_runasaccount.go +++ b/vendor/github.com/hashicorp/go-azure-helpers/resourcemanager/commonids/hyperv_site_runasaccount.go @@ -1,3 +1,6 @@ +// Copyright (c) HashiCorp, Inc. +// SPDX-License-Identifier: MPL-2.0 + package commonids import ( diff --git a/vendor/github.com/hashicorp/go-azure-helpers/resourcemanager/commonids/key_vault.go b/vendor/github.com/hashicorp/go-azure-helpers/resourcemanager/commonids/key_vault.go new file mode 100644 index 000000000000..8a4a408d4ef0 --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-helpers/resourcemanager/commonids/key_vault.go @@ -0,0 +1,127 @@ +// Copyright (c) HashiCorp, Inc. +// SPDX-License-Identifier: MPL-2.0 + +package commonids + +import ( + "fmt" + "strings" + + "github.com/hashicorp/go-azure-helpers/resourcemanager/resourceids" +) + +var _ resourceids.ResourceId = KeyVaultId{} + +// KeyVaultId is a struct representing the Resource ID for a Key Vault +type KeyVaultId struct { + SubscriptionId string + ResourceGroupName string + VaultName string +} + +// NewKeyVaultID returns a new KeyVaultId struct +func NewKeyVaultID(subscriptionId string, resourceGroupName string, vaultName string) KeyVaultId { + return KeyVaultId{ + SubscriptionId: subscriptionId, + ResourceGroupName: resourceGroupName, + VaultName: vaultName, + } +} + +// ParseKeyVaultID parses 'input' into a KeyVaultId +func ParseKeyVaultID(input string) (*KeyVaultId, error) { + parser := resourceids.NewParserFromResourceIdType(KeyVaultId{}) + parsed, err := parser.Parse(input, false) + if err != nil { + return nil, fmt.Errorf("parsing %q: %+v", input, err) + } + + var ok bool + id := KeyVaultId{} + + if id.SubscriptionId, ok = parsed.Parsed["subscriptionId"]; !ok { + return nil, fmt.Errorf("the segment 'subscriptionId' was not found in the resource id %q", input) + } + + if id.ResourceGroupName, ok = parsed.Parsed["resourceGroupName"]; !ok { + return nil, fmt.Errorf("the segment 'resourceGroupName' was not found in the resource id %q", input) + } + + if id.VaultName, ok = parsed.Parsed["vaultName"]; !ok { + return nil, fmt.Errorf("the segment 'vaultName' was not found in the resource id %q", input) + } + + return &id, nil +} + +// ParseKeyVaultIDInsensitively parses 'input' case-insensitively into a KeyVaultId +// note: this method should only be used for API response data and not user input +func ParseKeyVaultIDInsensitively(input string) (*KeyVaultId, error) { + parser := resourceids.NewParserFromResourceIdType(KeyVaultId{}) + parsed, err := parser.Parse(input, true) + if err != nil { + return nil, fmt.Errorf("parsing %q: %+v", input, err) + } + + var ok bool + id := KeyVaultId{} + + if id.SubscriptionId, ok = parsed.Parsed["subscriptionId"]; !ok { + return nil, fmt.Errorf("the segment 'subscriptionId' was not found in the resource id %q", input) + } + + if id.ResourceGroupName, ok = parsed.Parsed["resourceGroupName"]; !ok { + return nil, fmt.Errorf("the segment 'resourceGroupName' was not found in the resource id %q", input) + } + + if id.VaultName, ok = parsed.Parsed["vaultName"]; !ok { + return nil, fmt.Errorf("the segment 'vaultName' was not found in the resource id %q", input) + } + + return &id, nil +} + +// ValidateKeyVaultID checks that 'input' can be parsed as a Key Vault ID +func ValidateKeyVaultID(input interface{}, key string) (warnings []string, errors []error) { + v, ok := input.(string) + if !ok { + errors = append(errors, fmt.Errorf("expected %q to be a string", key)) + return + } + + if _, err := ParseKeyVaultID(v); err != nil { + errors = append(errors, err) + } + + return +} + +// ID returns the formatted Key Vault ID +func (id KeyVaultId) ID() string { + fmtString := "/subscriptions/%s/resourceGroups/%s/providers/Microsoft.KeyVault/vaults/%s" + return fmt.Sprintf(fmtString, id.SubscriptionId, id.ResourceGroupName, id.VaultName) +} + +// Segments returns a slice of Resource ID Segments which comprise this Key Vault ID +func (id KeyVaultId) Segments() []resourceids.Segment { + return []resourceids.Segment{ + resourceids.StaticSegment("staticSubscriptions", "subscriptions", "subscriptions"), + resourceids.SubscriptionIdSegment("subscriptionId", "12345678-1234-9876-4563-123456789012"), + resourceids.StaticSegment("staticResourceGroups", "resourceGroups", "resourceGroups"), + resourceids.ResourceGroupSegment("resourceGroupName", "example-resource-group"), + resourceids.StaticSegment("staticProviders", "providers", "providers"), + resourceids.ResourceProviderSegment("staticMicrosoftKeyVault", "Microsoft.KeyVault", "Microsoft.KeyVault"), + resourceids.StaticSegment("staticVaults", "vaults", "vaults"), + resourceids.UserSpecifiedSegment("vaultName", "vaultValue"), + } +} + +// String returns a human-readable description of this Key Vault ID +func (id KeyVaultId) String() string { + components := []string{ + fmt.Sprintf("Subscription: %q", id.SubscriptionId), + fmt.Sprintf("Resource Group Name: %q", id.ResourceGroupName), + fmt.Sprintf("Key Vault Name: %q", id.VaultName), + } + return fmt.Sprintf("Key Vault (%s)", strings.Join(components, "\n")) +} diff --git a/vendor/github.com/hashicorp/go-azure-helpers/resourcemanager/commonids/key_vault_key.go b/vendor/github.com/hashicorp/go-azure-helpers/resourcemanager/commonids/key_vault_key.go new file mode 100644 index 000000000000..836fcb383f5f --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-helpers/resourcemanager/commonids/key_vault_key.go @@ -0,0 +1,140 @@ +// Copyright (c) HashiCorp, Inc. +// SPDX-License-Identifier: MPL-2.0 + +package commonids + +import ( + "fmt" + "strings" + + "github.com/hashicorp/go-azure-helpers/resourcemanager/resourceids" +) + +var _ resourceids.ResourceId = KeyVaultKeyId{} + +// KeyVaultKeyId is a struct representing the Resource ID for a Key +type KeyVaultKeyId struct { + SubscriptionId string + ResourceGroupName string + VaultName string + KeyName string +} + +// NewKeyVaultKeyID returns a new KeyVaultKeyId struct +func NewKeyVaultKeyID(subscriptionId string, resourceGroupName string, vaultName string, keyName string) KeyVaultKeyId { + return KeyVaultKeyId{ + SubscriptionId: subscriptionId, + ResourceGroupName: resourceGroupName, + VaultName: vaultName, + KeyName: keyName, + } +} + +// ParseKeyVaultKeyID parses 'input' into a KeyVaultKeyId +func ParseKeyVaultKeyID(input string) (*KeyVaultKeyId, error) { + parser := resourceids.NewParserFromResourceIdType(KeyVaultKeyId{}) + parsed, err := parser.Parse(input, false) + if err != nil { + return nil, fmt.Errorf("parsing %q: %+v", input, err) + } + + var ok bool + id := KeyVaultKeyId{} + + if id.SubscriptionId, ok = parsed.Parsed["subscriptionId"]; !ok { + return nil, fmt.Errorf("the segment 'subscriptionId' was not found in the resource id %q", input) + } + + if id.ResourceGroupName, ok = parsed.Parsed["resourceGroupName"]; !ok { + return nil, fmt.Errorf("the segment 'resourceGroupName' was not found in the resource id %q", input) + } + + if id.VaultName, ok = parsed.Parsed["vaultName"]; !ok { + return nil, fmt.Errorf("the segment 'vaultName' was not found in the resource id %q", input) + } + + if id.KeyName, ok = parsed.Parsed["keyName"]; !ok { + return nil, fmt.Errorf("the segment 'keyName' was not found in the resource id %q", input) + } + + return &id, nil +} + +// ParseKeyVaultKeyIDInsensitively parses 'input' case-insensitively into a KeyVaultKeyId +// note: this method should only be used for API response data and not user input +func ParseKeyVaultKeyIDInsensitively(input string) (*KeyVaultKeyId, error) { + parser := resourceids.NewParserFromResourceIdType(KeyVaultKeyId{}) + parsed, err := parser.Parse(input, true) + if err != nil { + return nil, fmt.Errorf("parsing %q: %+v", input, err) + } + + var ok bool + id := KeyVaultKeyId{} + + if id.SubscriptionId, ok = parsed.Parsed["subscriptionId"]; !ok { + return nil, fmt.Errorf("the segment 'subscriptionId' was not found in the resource id %q", input) + } + + if id.ResourceGroupName, ok = parsed.Parsed["resourceGroupName"]; !ok { + return nil, fmt.Errorf("the segment 'resourceGroupName' was not found in the resource id %q", input) + } + + if id.VaultName, ok = parsed.Parsed["vaultName"]; !ok { + return nil, fmt.Errorf("the segment 'vaultName' was not found in the resource id %q", input) + } + + if id.KeyName, ok = parsed.Parsed["keyName"]; !ok { + return nil, fmt.Errorf("the segment 'keyName' was not found in the resource id %q", input) + } + + return &id, nil +} + +// ValidateKeyVaultKeyID checks that 'input' can be parsed as a Key ID +func ValidateKeyVaultKeyID(input interface{}, key string) (warnings []string, errors []error) { + v, ok := input.(string) + if !ok { + errors = append(errors, fmt.Errorf("expected %q to be a string", key)) + return + } + + if _, err := ParseKeyVaultKeyID(v); err != nil { + errors = append(errors, err) + } + + return +} + +// ID returns the formatted Key ID +func (id KeyVaultKeyId) ID() string { + fmtString := "/subscriptions/%s/resourceGroups/%s/providers/Microsoft.KeyVault/vaults/%s/keys/%s" + return fmt.Sprintf(fmtString, id.SubscriptionId, id.ResourceGroupName, id.VaultName, id.KeyName) +} + +// Segments returns a slice of Resource ID Segments which comprise this Key ID +func (id KeyVaultKeyId) Segments() []resourceids.Segment { + return []resourceids.Segment{ + resourceids.StaticSegment("staticSubscriptions", "subscriptions", "subscriptions"), + resourceids.SubscriptionIdSegment("subscriptionId", "12345678-1234-9876-4563-123456789012"), + resourceids.StaticSegment("staticResourceGroups", "resourceGroups", "resourceGroups"), + resourceids.ResourceGroupSegment("resourceGroupName", "example-resource-group"), + resourceids.StaticSegment("staticProviders", "providers", "providers"), + resourceids.ResourceProviderSegment("staticMicrosoftKeyVault", "Microsoft.KeyVault", "Microsoft.KeyVault"), + resourceids.StaticSegment("staticVaults", "vaults", "vaults"), + resourceids.UserSpecifiedSegment("vaultName", "vaultValue"), + resourceids.StaticSegment("staticKeys", "keys", "keys"), + resourceids.UserSpecifiedSegment("keyName", "keyValue"), + } +} + +// String returns a human-readable description of this Key ID +func (id KeyVaultKeyId) String() string { + components := []string{ + fmt.Sprintf("Subscription: %q", id.SubscriptionId), + fmt.Sprintf("Resource Group Name: %q", id.ResourceGroupName), + fmt.Sprintf("Key Vault Name: %q", id.VaultName), + fmt.Sprintf("Key Name: %q", id.KeyName), + } + return fmt.Sprintf("Key Vault Key (%s)", strings.Join(components, "\n")) +} diff --git a/vendor/github.com/hashicorp/go-azure-helpers/resourcemanager/commonids/key_vault_key_version.go b/vendor/github.com/hashicorp/go-azure-helpers/resourcemanager/commonids/key_vault_key_version.go new file mode 100644 index 000000000000..d9e8693cf39e --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-helpers/resourcemanager/commonids/key_vault_key_version.go @@ -0,0 +1,156 @@ +// Copyright (c) HashiCorp, Inc. +// SPDX-License-Identifier: MPL-2.0 + +package commonids + +import ( + "fmt" + "strings" + + "github.com/hashicorp/go-azure-helpers/resourcemanager/resourceids" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ resourceids.ResourceId = KeyVaultKeyVersionId{} + +// KeyVaultKeyVersionId is a struct representing the Resource ID for a Version +type KeyVaultKeyVersionId struct { + SubscriptionId string + ResourceGroupName string + VaultName string + KeyName string + VersionName string +} + +// NewKeyVaultKeyVersionID returns a new KeyVaultKeyVersionId struct +func NewKeyVaultKeyVersionID(subscriptionId string, resourceGroupName string, vaultName string, keyName string, versionName string) KeyVaultKeyVersionId { + return KeyVaultKeyVersionId{ + SubscriptionId: subscriptionId, + ResourceGroupName: resourceGroupName, + VaultName: vaultName, + KeyName: keyName, + VersionName: versionName, + } +} + +// ParseKeyVaultKeyVersionID parses 'input' into a KeyVaultKeyVersionId +func ParseKeyVaultKeyVersionID(input string) (*KeyVaultKeyVersionId, error) { + parser := resourceids.NewParserFromResourceIdType(KeyVaultKeyVersionId{}) + parsed, err := parser.Parse(input, false) + if err != nil { + return nil, fmt.Errorf("parsing %q: %+v", input, err) + } + + var ok bool + id := KeyVaultKeyVersionId{} + + if id.SubscriptionId, ok = parsed.Parsed["subscriptionId"]; !ok { + return nil, fmt.Errorf("the segment 'subscriptionId' was not found in the resource id %q", input) + } + + if id.ResourceGroupName, ok = parsed.Parsed["resourceGroupName"]; !ok { + return nil, fmt.Errorf("the segment 'resourceGroupName' was not found in the resource id %q", input) + } + + if id.VaultName, ok = parsed.Parsed["vaultName"]; !ok { + return nil, fmt.Errorf("the segment 'vaultName' was not found in the resource id %q", input) + } + + if id.KeyName, ok = parsed.Parsed["keyName"]; !ok { + return nil, fmt.Errorf("the segment 'keyName' was not found in the resource id %q", input) + } + + if id.VersionName, ok = parsed.Parsed["versionName"]; !ok { + return nil, fmt.Errorf("the segment 'versionName' was not found in the resource id %q", input) + } + + return &id, nil +} + +// ParseKeyVaultKeyVersionIDInsensitively parses 'input' case-insensitively into a KeyVaultKeyVersionId +// note: this method should only be used for API response data and not user input +func ParseKeyVaultKeyVersionIDInsensitively(input string) (*KeyVaultKeyVersionId, error) { + parser := resourceids.NewParserFromResourceIdType(KeyVaultKeyVersionId{}) + parsed, err := parser.Parse(input, true) + if err != nil { + return nil, fmt.Errorf("parsing %q: %+v", input, err) + } + + var ok bool + id := KeyVaultKeyVersionId{} + + if id.SubscriptionId, ok = parsed.Parsed["subscriptionId"]; !ok { + return nil, fmt.Errorf("the segment 'subscriptionId' was not found in the resource id %q", input) + } + + if id.ResourceGroupName, ok = parsed.Parsed["resourceGroupName"]; !ok { + return nil, fmt.Errorf("the segment 'resourceGroupName' was not found in the resource id %q", input) + } + + if id.VaultName, ok = parsed.Parsed["vaultName"]; !ok { + return nil, fmt.Errorf("the segment 'vaultName' was not found in the resource id %q", input) + } + + if id.KeyName, ok = parsed.Parsed["keyName"]; !ok { + return nil, fmt.Errorf("the segment 'keyName' was not found in the resource id %q", input) + } + + if id.VersionName, ok = parsed.Parsed["versionName"]; !ok { + return nil, fmt.Errorf("the segment 'versionName' was not found in the resource id %q", input) + } + + return &id, nil +} + +// ValidateKeyVaultKeyVersionID checks that 'input' can be parsed as a Version ID +func ValidateKeyVaultKeyVersionID(input interface{}, key string) (warnings []string, errors []error) { + v, ok := input.(string) + if !ok { + errors = append(errors, fmt.Errorf("expected %q to be a string", key)) + return + } + + if _, err := ParseKeyVaultKeyVersionID(v); err != nil { + errors = append(errors, err) + } + + return +} + +// ID returns the formatted Version ID +func (id KeyVaultKeyVersionId) ID() string { + fmtString := "/subscriptions/%s/resourceGroups/%s/providers/Microsoft.KeyVault/vaults/%s/keys/%s/versions/%s" + return fmt.Sprintf(fmtString, id.SubscriptionId, id.ResourceGroupName, id.VaultName, id.KeyName, id.VersionName) +} + +// Segments returns a slice of Resource ID Segments which comprise this Version ID +func (id KeyVaultKeyVersionId) Segments() []resourceids.Segment { + return []resourceids.Segment{ + resourceids.StaticSegment("staticSubscriptions", "subscriptions", "subscriptions"), + resourceids.SubscriptionIdSegment("subscriptionId", "12345678-1234-9876-4563-123456789012"), + resourceids.StaticSegment("staticResourceGroups", "resourceGroups", "resourceGroups"), + resourceids.ResourceGroupSegment("resourceGroupName", "example-resource-group"), + resourceids.StaticSegment("staticProviders", "providers", "providers"), + resourceids.ResourceProviderSegment("staticMicrosoftKeyVault", "Microsoft.KeyVault", "Microsoft.KeyVault"), + resourceids.StaticSegment("staticVaults", "vaults", "vaults"), + resourceids.UserSpecifiedSegment("vaultName", "vaultValue"), + resourceids.StaticSegment("staticKeys", "keys", "keys"), + resourceids.UserSpecifiedSegment("keyName", "keyValue"), + resourceids.StaticSegment("staticVersions", "versions", "versions"), + resourceids.UserSpecifiedSegment("versionName", "versionValue"), + } +} + +// String returns a human-readable description of this Version ID +func (id KeyVaultKeyVersionId) String() string { + components := []string{ + fmt.Sprintf("Subscription: %q", id.SubscriptionId), + fmt.Sprintf("Resource Group Name: %q", id.ResourceGroupName), + fmt.Sprintf("Vault Name: %q", id.VaultName), + fmt.Sprintf("Key Name: %q", id.KeyName), + fmt.Sprintf("Version Name: %q", id.VersionName), + } + return fmt.Sprintf("Version (%s)", strings.Join(components, "\n")) +} diff --git a/vendor/github.com/hashicorp/go-azure-helpers/resourcemanager/commonids/key_vault_private_endpoint_connection.go b/vendor/github.com/hashicorp/go-azure-helpers/resourcemanager/commonids/key_vault_private_endpoint_connection.go new file mode 100644 index 000000000000..440c90881289 --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-helpers/resourcemanager/commonids/key_vault_private_endpoint_connection.go @@ -0,0 +1,140 @@ +// Copyright (c) HashiCorp, Inc. +// SPDX-License-Identifier: MPL-2.0 + +package commonids + +import ( + "fmt" + "strings" + + "github.com/hashicorp/go-azure-helpers/resourcemanager/resourceids" +) + +var _ resourceids.ResourceId = KeyVaultPrivateEndpointConnectionId{} + +// KeyVaultPrivateEndpointConnectionId is a struct representing the Resource ID for a Key Vault Private Endpoint Connection +type KeyVaultPrivateEndpointConnectionId struct { + SubscriptionId string + ResourceGroupName string + VaultName string + PrivateEndpointConnectionName string +} + +// NewKeyVaultPrivateEndpointConnectionID returns a new KeyVaultPrivateEndpointConnectionId struct +func NewKeyVaultPrivateEndpointConnectionID(subscriptionId string, resourceGroupName string, vaultName string, privateEndpointConnectionName string) KeyVaultPrivateEndpointConnectionId { + return KeyVaultPrivateEndpointConnectionId{ + SubscriptionId: subscriptionId, + ResourceGroupName: resourceGroupName, + VaultName: vaultName, + PrivateEndpointConnectionName: privateEndpointConnectionName, + } +} + +// ParseKeyVaultPrivateEndpointConnectionID parses 'input' into a KeyVaultPrivateEndpointConnectionId +func ParseKeyVaultPrivateEndpointConnectionID(input string) (*KeyVaultPrivateEndpointConnectionId, error) { + parser := resourceids.NewParserFromResourceIdType(KeyVaultPrivateEndpointConnectionId{}) + parsed, err := parser.Parse(input, false) + if err != nil { + return nil, fmt.Errorf("parsing %q: %+v", input, err) + } + + var ok bool + id := KeyVaultPrivateEndpointConnectionId{} + + if id.SubscriptionId, ok = parsed.Parsed["subscriptionId"]; !ok { + return nil, fmt.Errorf("the segment 'subscriptionId' was not found in the resource id %q", input) + } + + if id.ResourceGroupName, ok = parsed.Parsed["resourceGroupName"]; !ok { + return nil, fmt.Errorf("the segment 'resourceGroupName' was not found in the resource id %q", input) + } + + if id.VaultName, ok = parsed.Parsed["vaultName"]; !ok { + return nil, fmt.Errorf("the segment 'vaultName' was not found in the resource id %q", input) + } + + if id.PrivateEndpointConnectionName, ok = parsed.Parsed["privateEndpointConnectionName"]; !ok { + return nil, fmt.Errorf("the segment 'privateEndpointConnectionName' was not found in the resource id %q", input) + } + + return &id, nil +} + +// ParseKeyVaultPrivateEndpointConnectionIDInsensitively parses 'input' case-insensitively into a KeyVaultPrivateEndpointConnectionId +// note: this method should only be used for API response data and not user input +func ParseKeyVaultPrivateEndpointConnectionIDInsensitively(input string) (*KeyVaultPrivateEndpointConnectionId, error) { + parser := resourceids.NewParserFromResourceIdType(KeyVaultPrivateEndpointConnectionId{}) + parsed, err := parser.Parse(input, true) + if err != nil { + return nil, fmt.Errorf("parsing %q: %+v", input, err) + } + + var ok bool + id := KeyVaultPrivateEndpointConnectionId{} + + if id.SubscriptionId, ok = parsed.Parsed["subscriptionId"]; !ok { + return nil, fmt.Errorf("the segment 'subscriptionId' was not found in the resource id %q", input) + } + + if id.ResourceGroupName, ok = parsed.Parsed["resourceGroupName"]; !ok { + return nil, fmt.Errorf("the segment 'resourceGroupName' was not found in the resource id %q", input) + } + + if id.VaultName, ok = parsed.Parsed["vaultName"]; !ok { + return nil, fmt.Errorf("the segment 'vaultName' was not found in the resource id %q", input) + } + + if id.PrivateEndpointConnectionName, ok = parsed.Parsed["privateEndpointConnectionName"]; !ok { + return nil, fmt.Errorf("the segment 'privateEndpointConnectionName' was not found in the resource id %q", input) + } + + return &id, nil +} + +// ValidateKeyVaultPrivateEndpointConnectionID checks that 'input' can be parsed as a Key Vault Private Endpoint Connection ID +func ValidateKeyVaultPrivateEndpointConnectionID(input interface{}, key string) (warnings []string, errors []error) { + v, ok := input.(string) + if !ok { + errors = append(errors, fmt.Errorf("expected %q to be a string", key)) + return + } + + if _, err := ParseKeyVaultPrivateEndpointConnectionID(v); err != nil { + errors = append(errors, err) + } + + return +} + +// ID returns the formatted Key Vault Private Endpoint Connection ID +func (id KeyVaultPrivateEndpointConnectionId) ID() string { + fmtString := "/subscriptions/%s/resourceGroups/%s/providers/Microsoft.KeyVault/vaults/%s/privateEndpointConnections/%s" + return fmt.Sprintf(fmtString, id.SubscriptionId, id.ResourceGroupName, id.VaultName, id.PrivateEndpointConnectionName) +} + +// Segments returns a slice of Resource ID Segments which comprise this Key Vault Private Endpoint Connection ID +func (id KeyVaultPrivateEndpointConnectionId) Segments() []resourceids.Segment { + return []resourceids.Segment{ + resourceids.StaticSegment("staticSubscriptions", "subscriptions", "subscriptions"), + resourceids.SubscriptionIdSegment("subscriptionId", "12345678-1234-9876-4563-123456789012"), + resourceids.StaticSegment("staticResourceGroups", "resourceGroups", "resourceGroups"), + resourceids.ResourceGroupSegment("resourceGroupName", "example-resource-group"), + resourceids.StaticSegment("staticProviders", "providers", "providers"), + resourceids.ResourceProviderSegment("staticMicrosoftKeyVault", "Microsoft.KeyVault", "Microsoft.KeyVault"), + resourceids.StaticSegment("staticVaults", "vaults", "vaults"), + resourceids.UserSpecifiedSegment("vaultName", "vaultValue"), + resourceids.StaticSegment("staticPrivateEndpointConnections", "privateEndpointConnections", "privateEndpointConnections"), + resourceids.UserSpecifiedSegment("privateEndpointConnectionName", "privateEndpointConnectionValue"), + } +} + +// String returns a human-readable description of this Key Vault Private Endpoint Connection ID +func (id KeyVaultPrivateEndpointConnectionId) String() string { + components := []string{ + fmt.Sprintf("Subscription: %q", id.SubscriptionId), + fmt.Sprintf("Resource Group Name: %q", id.ResourceGroupName), + fmt.Sprintf("Vault Name: %q", id.VaultName), + fmt.Sprintf("Private Endpoint Connection Name: %q", id.PrivateEndpointConnectionName), + } + return fmt.Sprintf("Private Endpoint Connection (%s)", strings.Join(components, "\n")) +} diff --git a/vendor/github.com/hashicorp/go-azure-helpers/resourcemanager/commonids/vmware_site_job.go b/vendor/github.com/hashicorp/go-azure-helpers/resourcemanager/commonids/vmware_site_job.go index 6b02a27b7676..4888c185cd9f 100644 --- a/vendor/github.com/hashicorp/go-azure-helpers/resourcemanager/commonids/vmware_site_job.go +++ b/vendor/github.com/hashicorp/go-azure-helpers/resourcemanager/commonids/vmware_site_job.go @@ -1,3 +1,6 @@ +// Copyright (c) HashiCorp, Inc. +// SPDX-License-Identifier: MPL-2.0 + package commonids import ( diff --git a/vendor/github.com/hashicorp/go-azure-helpers/resourcemanager/commonids/vmware_site_machine.go b/vendor/github.com/hashicorp/go-azure-helpers/resourcemanager/commonids/vmware_site_machine.go index 57897933157f..44051daa82e6 100644 --- a/vendor/github.com/hashicorp/go-azure-helpers/resourcemanager/commonids/vmware_site_machine.go +++ b/vendor/github.com/hashicorp/go-azure-helpers/resourcemanager/commonids/vmware_site_machine.go @@ -1,3 +1,6 @@ +// Copyright (c) HashiCorp, Inc. +// SPDX-License-Identifier: MPL-2.0 + package commonids import ( diff --git a/vendor/github.com/hashicorp/go-azure-helpers/resourcemanager/commonids/vmware_site_runasaccount.go b/vendor/github.com/hashicorp/go-azure-helpers/resourcemanager/commonids/vmware_site_runasaccount.go index 16be086e7686..23cebe099750 100644 --- a/vendor/github.com/hashicorp/go-azure-helpers/resourcemanager/commonids/vmware_site_runasaccount.go +++ b/vendor/github.com/hashicorp/go-azure-helpers/resourcemanager/commonids/vmware_site_runasaccount.go @@ -1,3 +1,6 @@ +// Copyright (c) HashiCorp, Inc. +// SPDX-License-Identifier: MPL-2.0 + package commonids import ( diff --git a/vendor/github.com/hashicorp/go-azure-sdk/sdk/odata/types.go b/vendor/github.com/hashicorp/go-azure-sdk/sdk/odata/types.go index 70b1ee01393f..a2d5d4fc6816 100644 --- a/vendor/github.com/hashicorp/go-azure-sdk/sdk/odata/types.go +++ b/vendor/github.com/hashicorp/go-azure-sdk/sdk/odata/types.go @@ -47,43 +47,45 @@ const ( type Type = string const ( - TypeAccessPackage Type = "#microsoft.graph.accessPackage" - TypeAccessPackageAssignmentPolicy Type = "#microsoft.graph.accessPackageAssignmentPolicy" - TypeAccessPackageCatalog Type = "#microsoft.graph.accessPackageCatalog" - TypeAccessPackageMultipleChoiceQuestion Type = "#microsoft.graph.accessPackageMultipleChoiceQuestion" - TypeAccessPackageQuestion Type = "#microsoft.graph.accessPackageQuestion" - TypeAccessPackageResourceRequest Type = "#microsoft.graph.accessPackageResourceRequest" - TypeAccessPackageTextInputQuestion Type = "#microsoft.graph.accessPackageTextInputQuestion" - TypeAdministrativeUnit Type = "#microsoft.graph.administrativeUnit" - TypeApplication Type = "#microsoft.graph.application" - TypeAzureActiveDirectoryTenant Type = "#microsoft.graph.azureActiveDirectoryTenant" - TypeConditionalAccessPolicy Type = "#microsoft.graph.conditionalAccessPolicy" - TypeConnectedOrganizationMembers Type = "#microsoft.graph.connectedOrganizationMembers" - TypeConnectionInfo Type = "#microsoft.graph.connectionInfo" - TypeCountryNamedLocation Type = "#microsoft.graph.countryNamedLocation" - TypeDevice Type = "#microsoft.graph.device" - TypeDirectoryRole Type = "#microsoft.graph.directoryRole" - TypeDirectoryRoleTemplate Type = "#microsoft.graph.directoryRoleTemplate" - TypeDomain Type = "#microsoft.graph.domain" - TypeDomainIdentitySource Type = "#microsoft.graph.domainIdentitySource" - TypeEmailAuthenticationMethod Type = "#microsoft.graph.emailAuthenticationMethod" - TypeExternalDomainFederation Type = "#microsoft.graph.externalDomainFederation" - TypeExternalSponsors Type = "#microsoft.graph.externalSponsors" - TypeFido2AuthenticationMethod Type = "#microsoft.graph.fido2AuthenticationMethod" - TypeGroup Type = "#microsoft.graph.group" - TypeGroupMembers Type = "#microsoft.graph.groupMembers" - TypeInternalSponsors Type = "#microsoft.graph.internalSponsors" - TypeIpNamedLocation Type = "#microsoft.graph.ipNamedLocation" - TypeMicrosoftAuthenticatorAuthenticationMethod Type = "#microsoft.graph.microsoftAuthenticatorAuthenticationMethod" - TypeNamedLocation Type = "#microsoft.graph.namedLocation" - TypeOrganization Type = "#microsoft.graph.organization" - TypePasswordAuthenticationMethod Type = "#microsoft.graph.passwordAuthenticationMethod" - TypePhoneAuthenticationMethod Type = "#microsoft.graph.phoneAuthenticationMethod" - TypeRequestorManager Type = "#microsoft.graph.requestorManager" - TypeServicePrincipal Type = "#microsoft.graph.servicePrincipal" - TypeSingleUser Type = "#microsoft.graph.singleUser" - TypeSocialIdentityProvider Type = "#microsoft.graph.socialIdentityProvider" - TypeTemporaryAccessPassAuthenticationMethod Type = "#microsoft.graph.temporaryAccessPassAuthenticationMethod" - TypeUser Type = "#microsoft.graph.user" - TypeWindowsHelloForBusinessAuthenticationMethod Type = "#microsoft.graph.windowsHelloForBusinessAuthenticationMethod" + TypeAccessPackage Type = "#microsoft.graph.accessPackage" + TypeAccessPackageAssignmentPolicy Type = "#microsoft.graph.accessPackageAssignmentPolicy" + TypeAccessPackageCatalog Type = "#microsoft.graph.accessPackageCatalog" + TypeAccessPackageMultipleChoiceQuestion Type = "#microsoft.graph.accessPackageMultipleChoiceQuestion" + TypeAccessPackageQuestion Type = "#microsoft.graph.accessPackageQuestion" + TypeAccessPackageResourceRequest Type = "#microsoft.graph.accessPackageResourceRequest" + TypeAccessPackageTextInputQuestion Type = "#microsoft.graph.accessPackageTextInputQuestion" + TypeActiveDirectoryWindowsAutopilotDeploymentProfile Type = "#microsoft.graph.activeDirectoryWindowsAutopilotDeploymentProfile" + TypeAdministrativeUnit Type = "#microsoft.graph.administrativeUnit" + TypeApplication Type = "#microsoft.graph.application" + TypeAzureActiveDirectoryTenant Type = "#microsoft.graph.azureActiveDirectoryTenant" + TypeAzureADWindowsAutopilotDeploymentProfile Type = "#microsoft.graph.azureADWindowsAutopilotDeploymentProfile" + TypeConditionalAccessPolicy Type = "#microsoft.graph.conditionalAccessPolicy" + TypeConnectedOrganizationMembers Type = "#microsoft.graph.connectedOrganizationMembers" + TypeConnectionInfo Type = "#microsoft.graph.connectionInfo" + TypeCountryNamedLocation Type = "#microsoft.graph.countryNamedLocation" + TypeDevice Type = "#microsoft.graph.device" + TypeDirectoryRole Type = "#microsoft.graph.directoryRole" + TypeDirectoryRoleTemplate Type = "#microsoft.graph.directoryRoleTemplate" + TypeDomain Type = "#microsoft.graph.domain" + TypeDomainIdentitySource Type = "#microsoft.graph.domainIdentitySource" + TypeEmailAuthenticationMethod Type = "#microsoft.graph.emailAuthenticationMethod" + TypeExternalDomainFederation Type = "#microsoft.graph.externalDomainFederation" + TypeExternalSponsors Type = "#microsoft.graph.externalSponsors" + TypeFido2AuthenticationMethod Type = "#microsoft.graph.fido2AuthenticationMethod" + TypeGroup Type = "#microsoft.graph.group" + TypeGroupMembers Type = "#microsoft.graph.groupMembers" + TypeInternalSponsors Type = "#microsoft.graph.internalSponsors" + TypeIpNamedLocation Type = "#microsoft.graph.ipNamedLocation" + TypeMicrosoftAuthenticatorAuthenticationMethod Type = "#microsoft.graph.microsoftAuthenticatorAuthenticationMethod" + TypeNamedLocation Type = "#microsoft.graph.namedLocation" + TypeOrganization Type = "#microsoft.graph.organization" + TypePasswordAuthenticationMethod Type = "#microsoft.graph.passwordAuthenticationMethod" + TypePhoneAuthenticationMethod Type = "#microsoft.graph.phoneAuthenticationMethod" + TypeRequestorManager Type = "#microsoft.graph.requestorManager" + TypeServicePrincipal Type = "#microsoft.graph.servicePrincipal" + TypeSingleUser Type = "#microsoft.graph.singleUser" + TypeSocialIdentityProvider Type = "#microsoft.graph.socialIdentityProvider" + TypeTemporaryAccessPassAuthenticationMethod Type = "#microsoft.graph.temporaryAccessPassAuthenticationMethod" + TypeUser Type = "#microsoft.graph.user" + TypeWindowsHelloForBusinessAuthenticationMethod Type = "#microsoft.graph.windowsHelloForBusinessAuthenticationMethod" ) diff --git a/vendor/modules.txt b/vendor/modules.txt index 1d90f8b44974..8413ee3607ba 100644 --- a/vendor/modules.txt +++ b/vendor/modules.txt @@ -128,7 +128,7 @@ github.com/google/uuid # github.com/hashicorp/errwrap v1.1.0 ## explicit github.com/hashicorp/errwrap -# github.com/hashicorp/go-azure-helpers v0.52.0 +# github.com/hashicorp/go-azure-helpers v0.55.0 ## explicit; go 1.19 github.com/hashicorp/go-azure-helpers/authentication github.com/hashicorp/go-azure-helpers/lang/dates @@ -148,7 +148,7 @@ github.com/hashicorp/go-azure-helpers/resourcemanager/zones github.com/hashicorp/go-azure-helpers/resourceproviders github.com/hashicorp/go-azure-helpers/sender github.com/hashicorp/go-azure-helpers/storage -# github.com/hashicorp/go-azure-sdk v0.20230301.1141943 +# github.com/hashicorp/go-azure-sdk v0.20230306.1165107 ## explicit; go 1.19 github.com/hashicorp/go-azure-sdk/resource-manager/aad/2021-05-01/domainservices github.com/hashicorp/go-azure-sdk/resource-manager/aadb2c/2021-04-01-preview