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

New Resource: azurerm_workloads_sap_single_node_virtual_instance #24331

Merged
Merged
Show file tree
Hide file tree
Changes from 4 commits
Commits
Show all changes
28 commits
Select commit Hold shift + click to select a range
535281f
New Resource: azurerm_workloads_sap_deployment_virtual_instance
neil-yechenwei Dec 26, 2023
de68357
update code
neil-yechenwei Dec 26, 2023
9348661
update code
neil-yechenwei Dec 27, 2023
db59dae
update code
neil-yechenwei Dec 27, 2023
731cf81
update code
neil-yechenwei Jan 2, 2024
df444f3
update code
neil-yechenwei Jan 2, 2024
77361a1
update code
neil-yechenwei Jan 3, 2024
e5f3366
update code
neil-yechenwei Jan 4, 2024
9336a8d
update code
neil-yechenwei Jan 4, 2024
73eeb08
update code
neil-yechenwei Jan 9, 2024
0171d48
update code
neil-yechenwei Jan 10, 2024
4e45d3c
update code
neil-yechenwei Jan 10, 2024
8555ba1
update code
neil-yechenwei Jan 12, 2024
1fe46f1
Merge remote-tracking branch 'upstream/main' into 2sapvideploymentwit…
neil-yechenwei Jan 12, 2024
505e40b
update code
neil-yechenwei Jan 12, 2024
745aff8
update code
neil-yechenwei Jan 18, 2024
2c6d89d
Merge remote-tracking branch 'upstream/main' into 2sapvideploymentwit…
neil-yechenwei Jan 22, 2024
aa2224e
update code
neil-yechenwei Jan 22, 2024
02c9744
update code
neil-yechenwei Jan 26, 2024
41c1e89
update code
neil-yechenwei Jan 29, 2024
23c6795
update code
neil-yechenwei Feb 2, 2024
1c80ce6
update code
neil-yechenwei Feb 18, 2024
12a9b2a
update code
neil-yechenwei Mar 4, 2024
d5ea0fb
update code
neil-yechenwei Mar 6, 2024
8e99b02
update code
neil-yechenwei Mar 6, 2024
a6bf34b
update code
neil-yechenwei Mar 6, 2024
573373d
update code
neil-yechenwei Mar 7, 2024
a3d74f9
Update workloads_sap_single_node_virtual_instance.html.markdown
catriona-m Mar 7, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
3 changes: 3 additions & 0 deletions .github/labeler-issue-triage.yml
Original file line number Diff line number Diff line change
Expand Up @@ -347,3 +347,6 @@ service/virtual-desktops:

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

service/workloads:
- '### (|New or )Affected Resource\(s\)\/Data Source\(s\)((.|\n)*)azurerm_workloads_sap_deployment_virtual_instance((.|\n)*)###'
5 changes: 5 additions & 0 deletions .github/labeler-pull-request-triage.yml
Original file line number Diff line number Diff line change
Expand Up @@ -584,3 +584,8 @@ service/vmware:
- changed-files:
- any-glob-to-any-file:
- internal/services/vmware/**/*

service/workloads:
- changed-files:
- any-glob-to-any-file:
- internal/services/workloads/**/*
3 changes: 2 additions & 1 deletion .teamcity/components/generated/services.kt
Original file line number Diff line number Diff line change
Expand Up @@ -128,5 +128,6 @@ var services = mapOf(
"vmware" to "VMware",
"videoanalyzer" to "Video Analyzer",
"voiceservices" to "Voice Services",
"web" to "Web"
"web" to "Web",
"workloads" to "Workloads"
)
5 changes: 4 additions & 1 deletion .teamcity/components/settings.kt
Original file line number Diff line number Diff line change
Expand Up @@ -186,5 +186,8 @@ var serviceTestConfigurationOverrides = mapOf(
"voiceservices" to testConfiguration(parallelism = 3, locationOverride = LocationConfiguration("westcentralus", "westcentralus", "westcentralus", false)),

// Offset start hour to avoid collision with new App Service, reduce frequency of testing days
"web" to testConfiguration(startHour = 3, daysOfWeek = "1,3,5", locationOverride = LocationConfiguration("westeurope", "francecentral", "eastus2", true))
"web" to testConfiguration(startHour = 3, daysOfWeek = "1,3,5", locationOverride = LocationConfiguration("westeurope", "francecentral", "eastus2", true)),

// Workloads has quota available in certain locations
"workloads" to testConfiguration(parallelism = 1, locationOverride = LocationConfiguration("eastus", "westeurope", "francecentral", false))
)
4 changes: 4 additions & 0 deletions internal/acceptance/testcase.go
Original file line number Diff line number Diff line change
Expand Up @@ -143,5 +143,9 @@ func (td TestData) externalProviders() map[string]resource.ExternalProvider {
VersionConstraint: "=0.9.1",
Source: "registry.terraform.io/hashicorp/time",
},
"tls": {
VersionConstraint: "=4.0.4",
Source: "registry.terraform.io/hashicorp/tls",
},
}
}
7 changes: 7 additions & 0 deletions internal/clients/client.go
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ import (
servicenetworking_v2023_05_01_preview "github.com/hashicorp/go-azure-sdk/resource-manager/servicenetworking/2023-05-01-preview"
storagecache_2023_05_01 "github.com/hashicorp/go-azure-sdk/resource-manager/storagecache/2023-05-01"
timeseriesinsights_v2020_05_15 "github.com/hashicorp/go-azure-sdk/resource-manager/timeseriesinsights/2020-05-15"
workloads_v2023_04_01 "github.com/hashicorp/go-azure-sdk/resource-manager/workloads/2023-04-01"
"github.com/hashicorp/terraform-provider-azurerm/internal/common"
"github.com/hashicorp/terraform-provider-azurerm/internal/features"
aadb2c "github.com/hashicorp/terraform-provider-azurerm/internal/services/aadb2c/client"
Expand Down Expand Up @@ -144,6 +145,7 @@ import (
vmware "github.com/hashicorp/terraform-provider-azurerm/internal/services/vmware/client"
voiceServices "github.com/hashicorp/terraform-provider-azurerm/internal/services/voiceservices/client"
web "github.com/hashicorp/terraform-provider-azurerm/internal/services/web/client"
workloads "github.com/hashicorp/terraform-provider-azurerm/internal/services/workloads/client"
)

type Client struct {
Expand Down Expand Up @@ -276,6 +278,7 @@ type Client struct {
Vmware *vmware.Client
VoiceServices *voiceServices.Client
Web *web.Client
Workloads *workloads_v2023_04_01.Client
}

// NOTE: it should be possible for this method to become Private once the top level Client's removed
Expand Down Expand Up @@ -614,5 +617,9 @@ func (client *Client) Build(ctx context.Context, o *common.ClientOptions) error
}
client.Web = web.NewClient(o)

if client.Workloads, err = workloads.NewClient(o); err != nil {
return fmt.Errorf("building clients for Workloads: %+v", err)
}

return nil
}
2 changes: 2 additions & 0 deletions internal/provider/services.go
Original file line number Diff line number Diff line change
Expand Up @@ -129,6 +129,7 @@ import (
"github.com/hashicorp/terraform-provider-azurerm/internal/services/vmware"
"github.com/hashicorp/terraform-provider-azurerm/internal/services/voiceservices"
"github.com/hashicorp/terraform-provider-azurerm/internal/services/web"
"github.com/hashicorp/terraform-provider-azurerm/internal/services/workloads"
)

//go:generate go run ../tools/generator-services/main.go -path=../../
Expand Down Expand Up @@ -208,6 +209,7 @@ func SupportedTypedServices() []sdk.TypedServiceRegistration {
vmware.Registration{},
voiceservices.Registration{},
web.Registration{},
workloads.Registration{},
}
services = append(services, autoRegisteredTypedServices()...)
return services
Expand Down
16 changes: 16 additions & 0 deletions internal/services/network/validate/network_interface_name.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
package validate

import (
"fmt"
"regexp"
)

func NetworkInterfaceName(v interface{}, k string) (warnings []string, errors []error) {
value := v.(string)

if matched := regexp.MustCompile(`^[0-9a-zA-Z][0-9a-zA-Z_.-]{0,62}[0-9a-zA-Z_]$`).Match([]byte(value)); !matched {
errors = append(errors, fmt.Errorf("%q must begin with a letter or number, end with a letter, number or underscore, and may contain only letters, numbers, underscores, periods or hyphens", k))
neil-yechenwei marked this conversation as resolved.
Show resolved Hide resolved
}

return warnings, errors
}
56 changes: 56 additions & 0 deletions internal/services/network/validate/network_interface_name_test.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
package validate

import (
"strings"
"testing"
)

func TestNetworkInterfaceName(t *testing.T) {
cases := []struct {
Input string
Valid bool
}{
{
Input: "",
Valid: false,
},
{
Input: "-a",
Valid: false,
},
{
Input: "1_n.i-c",
Valid: true,
},
{
Input: "01nic",
Valid: true,
},
{
Input: "01nic01",
Valid: true,
},
{
Input: strings.Repeat("s", 63),
Valid: true,
},
{
Input: strings.Repeat("s", 64),
Valid: true,
},
{
Input: strings.Repeat("s", 65),
Valid: false,
},
}

for _, tc := range cases {
t.Logf("[DEBUG] Testing Value %s", tc.Input)
_, errors := NetworkInterfaceName(tc.Input, "name")
valid := len(errors) == 0

if tc.Valid != valid {
t.Fatalf("Expected %t but got %t", tc.Valid, valid)
}
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,84 @@
// Copyright (c) HashiCorp, Inc.
// SPDX-License-Identifier: MPL-2.0

package parse

// NOTE: this file is generated via 'go:generate' - manual changes will be overwritten

import (
"fmt"
"strings"

"github.com/hashicorp/go-azure-helpers/resourcemanager/resourceids"
)

type LegacyStorageShareResourceManagerId struct {
SubscriptionId string
ResourceGroup string
StorageAccountName string
FileServiceName string
ShareName string
}

func NewLegacyStorageShareResourceManagerID(subscriptionId, resourceGroup, storageAccountName, fileServiceName, shareName string) LegacyStorageShareResourceManagerId {
return LegacyStorageShareResourceManagerId{
SubscriptionId: subscriptionId,
ResourceGroup: resourceGroup,
StorageAccountName: storageAccountName,
FileServiceName: fileServiceName,
ShareName: shareName,
}
}

func (id LegacyStorageShareResourceManagerId) String() string {
segments := []string{
fmt.Sprintf("Share Name %q", id.ShareName),
fmt.Sprintf("File Service Name %q", id.FileServiceName),
fmt.Sprintf("Storage Account Name %q", id.StorageAccountName),
fmt.Sprintf("Resource Group %q", id.ResourceGroup),
}
segmentsStr := strings.Join(segments, " / ")
return fmt.Sprintf("%s: (%s)", "Legacy Storage Share Resource Manager", segmentsStr)
}

func (id LegacyStorageShareResourceManagerId) ID() string {
fmtString := "/subscriptions/%s/resourceGroups/%s/providers/Microsoft.Storage/storageAccounts/%s/fileServices/%s/shares/%s"
return fmt.Sprintf(fmtString, id.SubscriptionId, id.ResourceGroup, id.StorageAccountName, id.FileServiceName, id.ShareName)
}

// LegacyStorageShareResourceManagerID parses a LegacyStorageShareResourceManager ID into an LegacyStorageShareResourceManagerId struct
func LegacyStorageShareResourceManagerID(input string) (*LegacyStorageShareResourceManagerId, error) {
id, err := resourceids.ParseAzureResourceID(input)
if err != nil {
return nil, fmt.Errorf("parsing %q as an LegacyStorageShareResourceManager ID: %+v", input, err)
}

resourceId := LegacyStorageShareResourceManagerId{
SubscriptionId: id.SubscriptionID,
ResourceGroup: id.ResourceGroup,
}

if resourceId.SubscriptionId == "" {
return nil, fmt.Errorf("ID was missing the 'subscriptions' element")
}

if resourceId.ResourceGroup == "" {
return nil, fmt.Errorf("ID was missing the 'resourceGroups' element")
}

if resourceId.StorageAccountName, err = id.PopSegment("storageAccounts"); err != nil {
return nil, err
}
if resourceId.FileServiceName, err = id.PopSegment("fileServices"); err != nil {
return nil, err
}
if resourceId.ShareName, err = id.PopSegment("shares"); err != nil {
return nil, err
}

if err := id.ValidateNoEmptySegments(input); err != nil {
return nil, err
}

return &resourceId, nil
}
Loading
Loading