Skip to content

Commit 0c35155

Browse files
tombuildsstuffstack72
authored andcommitted
provider/azurerm: Container Service (hashicorp#10820)
* Importing v7.0.1 of the SDK * Configuring the Container Service Client * Scaffolding the Container Service resource * Scaffolding the Website documentation * Completing the documentation * Acceptance Tests for Kubernetes Azure Container Service * DCOS / Swarm tests * Parsing values back from the API properly * Fixing the test * Service Principal can be optional. Because of course it can. * Validation for the Container Service Count's * Updating the docs * Updating the field required values * Making the documentation more explicit * Fixing the build * Examples for DCOS and Swarm * Removing storage_uri for now * Making the SSH Key required as per the docs * Resolving the merge conflicts * Removing the unused error's * Adding Hash's to the schema's * Switching out the provider registration * Fixing the hash definitions * Updating keydata to match * Client Secret is sensitive * List -> Set * Using the first item for the diagnostic_profile * Helps if you actually update the type * Updating the docs to include the Computed fields * Fixing comments / removing redundant optional checks * Removing the FQDN's from the examples * Moving the Container resources together
1 parent ae7c771 commit 0c35155

11 files changed

Lines changed: 2080 additions & 0 deletions

File tree

builtin/providers/azurerm/config.go

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ import (
1010
"github.com/Azure/azure-sdk-for-go/arm/cdn"
1111
"github.com/Azure/azure-sdk-for-go/arm/compute"
1212
"github.com/Azure/azure-sdk-for-go/arm/containerregistry"
13+
"github.com/Azure/azure-sdk-for-go/arm/containerservice"
1314
"github.com/Azure/azure-sdk-for-go/arm/eventhub"
1415
"github.com/Azure/azure-sdk-for-go/arm/keyvault"
1516
"github.com/Azure/azure-sdk-for-go/arm/network"
@@ -66,6 +67,7 @@ type ArmClient struct {
6667
cdnEndpointsClient cdn.EndpointsClient
6768

6869
containerRegistryClient containerregistry.RegistriesClient
70+
containerServicesClient containerservice.ContainerServicesClient
6971

7072
eventHubClient eventhub.EventHubsClient
7173
eventHubConsumerGroupClient eventhub.ConsumerGroupsClient
@@ -237,6 +239,12 @@ func (c *Config) getArmClient() (*ArmClient, error) {
237239
crc.Sender = autorest.CreateSender(withRequestLogging())
238240
client.containerRegistryClient = crc
239241

242+
csc := containerservice.NewContainerServicesClientWithBaseURI(endpoint, c.SubscriptionID)
243+
setUserAgent(&csc.Client)
244+
csc.Authorizer = spt
245+
csc.Sender = autorest.CreateSender(withRequestLogging())
246+
client.containerServicesClient = csc
247+
240248
ehc := eventhub.NewEventHubsClientWithBaseURI(endpoint, c.SubscriptionID)
241249
setUserAgent(&ehc.Client)
242250
ehc.Authorizer = spt

builtin/providers/azurerm/provider.go

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -68,6 +68,7 @@ func Provider() terraform.ResourceProvider {
6868
"azurerm_cdn_endpoint": resourceArmCdnEndpoint(),
6969
"azurerm_cdn_profile": resourceArmCdnProfile(),
7070
"azurerm_container_registry": resourceArmContainerRegistry(),
71+
"azurerm_container_service": resourceArmContainerService(),
7172

7273
"azurerm_eventhub": resourceArmEventHub(),
7374
"azurerm_eventhub_authorization_rule": resourceArmEventHubAuthorizationRule(),
@@ -232,6 +233,7 @@ func registerAzureResourceProvidersWithSubscription(providerList []resources.Pro
232233
"Microsoft.Compute": struct{}{},
233234
"Microsoft.Cache": struct{}{},
234235
"Microsoft.ContainerRegistry": struct{}{},
236+
"Microsoft.ContainerService": struct{}{},
235237
"Microsoft.Network": struct{}{},
236238
"Microsoft.Cdn": struct{}{},
237239
"Microsoft.Storage": struct{}{},

0 commit comments

Comments
 (0)