Skip to content

Commit

Permalink
Add TemplateSpec Support for Template Deployments (#10603)
Browse files Browse the repository at this point in the history
* templatespec added to template deployments

* added tests for new resources and fixed error message typos

* update source templatespec for rg test

* tests updates

* add template_body and tags to data source, add test

* lintignore on json statefunc

* add and update docs for template deployments

* add validation for templatespec name and versionname

* go mod vendor

* fix output tests while I'm here

* review updates

* docs update for clarity

* update managementgroup deployment tests for property change
  • Loading branch information
jackofallops authored Mar 25, 2021
1 parent bbb0b85 commit dcfbaec
Show file tree
Hide file tree
Showing 43 changed files with 4,951 additions and 37 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -36,3 +36,14 @@ func ManagementGroupID(input string) (*ManagementGroupId, error) {

return &id, nil
}

func NewManagementGroupId(managementGroupName string) ManagementGroupId {
return ManagementGroupId{
Name: managementGroupName,
}
}

func (r ManagementGroupId) ID() string {
managemntGroupIdFmt := "/providers/Microsoft.Management/managementGroups/%s"
return fmt.Sprintf(managemntGroupIdFmt, r.Name)
}
26 changes: 16 additions & 10 deletions azurerm/internal/services/resource/client/client.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,17 +2,19 @@ package client

import (
providers "github.com/Azure/azure-sdk-for-go/profiles/2017-03-09/resources/mgmt/resources"
"github.com/Azure/azure-sdk-for-go/services/preview/resources/mgmt/2019-06-01-preview/templatespecs"
"github.com/Azure/azure-sdk-for-go/services/resources/mgmt/2016-09-01/locks"
"github.com/Azure/azure-sdk-for-go/services/resources/mgmt/2020-06-01/resources"
"github.com/terraform-providers/terraform-provider-azurerm/azurerm/internal/common"
)

type Client struct {
DeploymentsClient *resources.DeploymentsClient
GroupsClient *resources.GroupsClient
LocksClient *locks.ManagementLocksClient
ProvidersClient *providers.ProvidersClient
ResourcesClient *resources.Client
DeploymentsClient *resources.DeploymentsClient
GroupsClient *resources.GroupsClient
LocksClient *locks.ManagementLocksClient
ProvidersClient *providers.ProvidersClient
ResourcesClient *resources.Client
TemplateSpecsVersionsClient *templatespecs.VersionsClient
}

func NewClient(o *common.ClientOptions) *Client {
Expand All @@ -32,11 +34,15 @@ func NewClient(o *common.ClientOptions) *Client {
resourcesClient := resources.NewClientWithBaseURI(o.ResourceManagerEndpoint, o.SubscriptionId)
o.ConfigureClient(&resourcesClient.Client, o.ResourceManagerAuthorizer)

templatespecsVersionsClient := templatespecs.NewVersionsClientWithBaseURI(o.ResourceManagerEndpoint, o.SubscriptionId)
o.ConfigureClient(&templatespecsVersionsClient.Client, o.ResourceManagerAuthorizer)

return &Client{
GroupsClient: &groupsClient,
DeploymentsClient: &deploymentsClient,
LocksClient: &locksClient,
ProvidersClient: &providersClient,
ResourcesClient: &resourcesClient,
GroupsClient: &groupsClient,
DeploymentsClient: &deploymentsClient,
LocksClient: &locksClient,
ProvidersClient: &providersClient,
ResourcesClient: &resourcesClient,
TemplateSpecsVersionsClient: &templatespecsVersionsClient,
}
}
Loading

0 comments on commit dcfbaec

Please sign in to comment.