Skip to content

Commit 776e76f

Browse files
tombuildsstuffstack72
authored andcommitted
provider/azurerm: Redis Cache (hashicorp#10184)
* Implementing Redis Cache * Properties should never be nil * Updating the SDK to 7.0.1 * Redis Cache updated for SDK 7.0.1 * Fixing the max memory validation tests * Cleaning up * Adding tests for Standard with Tags * Int's -> Strings for the moment * Making the RedisConfiguration object mandatory * Only parse out redis configuration values if they're set * Updating the RedisConfiguration object to be required in the documentaqtion * Adding Tags to the Standard tests / importing excluding the redisConfiguration * Removing support for import for Redis Cache for now * Removed a scaling test
1 parent 89f4424 commit 776e76f

12 files changed

Lines changed: 2403 additions & 2 deletions

File tree

builtin/providers/azurerm/config.go

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ import (
1212
"github.com/Azure/azure-sdk-for-go/arm/eventhub"
1313
"github.com/Azure/azure-sdk-for-go/arm/keyvault"
1414
"github.com/Azure/azure-sdk-for-go/arm/network"
15+
"github.com/Azure/azure-sdk-for-go/arm/redis"
1516
"github.com/Azure/azure-sdk-for-go/arm/resources/resources"
1617
"github.com/Azure/azure-sdk-for-go/arm/scheduler"
1718
"github.com/Azure/azure-sdk-for-go/arm/servicebus"
@@ -78,6 +79,8 @@ type ArmClient struct {
7879

7980
deploymentsClient resources.DeploymentsClient
8081

82+
redisClient redis.Client
83+
8184
trafficManagerProfilesClient trafficmanager.ProfilesClient
8285
trafficManagerEndpointsClient trafficmanager.EndpointsClient
8386

@@ -385,6 +388,12 @@ func (c *Config) getArmClient() (*ArmClient, error) {
385388
tmec.Sender = autorest.CreateSender(withRequestLogging())
386389
client.trafficManagerEndpointsClient = tmec
387390

391+
rdc := redis.NewClient(c.SubscriptionID)
392+
setUserAgent(&rdc.Client)
393+
rdc.Authorizer = spt
394+
rdc.Sender = autorest.CreateSender(withRequestLogging())
395+
client.redisClient = rdc
396+
388397
sbnc := servicebus.NewNamespacesClient(c.SubscriptionID)
389398
setUserAgent(&sbnc.Client)
390399
sbnc.Authorizer = spt

builtin/providers/azurerm/provider.go

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -71,6 +71,7 @@ func Provider() terraform.ResourceProvider {
7171
"azurerm_network_security_group": resourceArmNetworkSecurityGroup(),
7272
"azurerm_network_security_rule": resourceArmNetworkSecurityRule(),
7373
"azurerm_public_ip": resourceArmPublicIp(),
74+
"azurerm_redis_cache": resourceArmRedisCache(),
7475
"azurerm_route": resourceArmRoute(),
7576
"azurerm_route_table": resourceArmRouteTable(),
7677
"azurerm_servicebus_namespace": resourceArmServiceBusNamespace(),
@@ -205,7 +206,18 @@ func registerAzureResourceProvidersWithSubscription(client *riviera.Client) erro
205206
var err error
206207
providerRegistrationOnce.Do(func() {
207208
// We register Microsoft.Compute during client initialization
208-
providers := []string{"Microsoft.Network", "Microsoft.Cdn", "Microsoft.Storage", "Microsoft.Sql", "Microsoft.Search", "Microsoft.Resources", "Microsoft.ServiceBus", "Microsoft.KeyVault", "Microsoft.EventHub"}
209+
providers := []string{
210+
"Microsoft.Cache",
211+
"Microsoft.Network",
212+
"Microsoft.Cdn",
213+
"Microsoft.Storage",
214+
"Microsoft.Sql",
215+
"Microsoft.Search",
216+
"Microsoft.Resources",
217+
"Microsoft.ServiceBus",
218+
"Microsoft.KeyVault",
219+
"Microsoft.EventHub",
220+
}
209221

210222
var wg sync.WaitGroup
211223
wg.Add(len(providers))

0 commit comments

Comments
 (0)