azurermSpringCloudAppRedisAssociation
Associates a Spring Cloud Application with a Redis Cache.
Example Usage
/*Provider bindings are generated by running cdktf get.
See https://cdk.tf/provider-generation for more details.*/
import * as azurerm from "./.gen/providers/azurerm";
/*The following providers are missing schema information and might need manual adjustments to synthesize correctly: azurerm.
For a more precise conversion please use the --provider flag in convert.*/
new azurerm.provider.AzurermProvider(this, "azurerm", {
features: [{}],
});
const azurermResourceGroupExample = new azurerm.resourceGroup.ResourceGroup(
this,
"example",
{
location: "West Europe",
name: "example-resources",
}
);
const azurermSpringCloudServiceExample =
new azurerm.springCloudService.SpringCloudService(this, "example_2", {
location: azurermResourceGroupExample.location,
name: "example-springcloud",
resource_group_name: azurermResourceGroupExample.name,
});
/*This allows the Terraform resource name to match the original name. You can remove the call if you don't need them to match.*/
azurermSpringCloudServiceExample.overrideLogicalId("example");
const azurermRedisCacheExample = new azurerm.redisCache.RedisCache(
this,
"example_3",
{
capacity: 0,
enable_non_ssl_port: true,
family: "C",
location: azurermResourceGroupExample.location,
name: "example-cache",
resource_group_name: azurermResourceGroupExample.name,
sku_name: "Basic",
}
);
/*This allows the Terraform resource name to match the original name. You can remove the call if you don't need them to match.*/
azurermRedisCacheExample.overrideLogicalId("example");
const azurermSpringCloudAppExample = new azurerm.springCloudApp.SpringCloudApp(
this,
"example_4",
{
name: "example-springcloudapp",
resource_group_name: azurermResourceGroupExample.name,
service_name: azurermSpringCloudServiceExample.name,
}
);
/*This allows the Terraform resource name to match the original name. You can remove the call if you don't need them to match.*/
azurermSpringCloudAppExample.overrideLogicalId("example");
const azurermSpringCloudAppRedisAssociationExample =
new azurerm.springCloudAppRedisAssociation.SpringCloudAppRedisAssociation(
this,
"example_5",
{
name: "example-bind",
redis_access_key: azurermRedisCacheExample.primaryAccessKey,
redis_cache_id: azurermRedisCacheExample.id,
spring_cloud_app_id: azurermSpringCloudAppExample.id,
ssl_enabled: true,
}
);
/*This allows the Terraform resource name to match the original name. You can remove the call if you don't need them to match.*/
azurermSpringCloudAppRedisAssociationExample.overrideLogicalId("example");
Argument Reference
The following arguments are supported:
-
name
- (Required) Specifies the name of the Spring Cloud Application Association. Changing this forces a new resource to be created. -
springCloudAppId
- (Required) Specifies the Spring Cloud Application resource ID in which the Association is created. Changing this forces a new resource to be created. -
redisCacheId
- (Required) Specifies the Redis Cache resource ID. Changing this forces a new resource to be created. -
redisAccessKey
- (Required) Specifies the Redis Cache access key. -
sslEnabled
- (Optional) Should SSL be used when connecting to Redis? Defaults totrue
.
Attributes Reference
The following attributes are exported:
id
- The ID of the Spring Cloud Application Redis Association.
Timeouts
The timeouts
block allows you to specify timeouts for certain actions:
create
- (Defaults to 30 minutes) Used when creating the Spring Cloud Application Redis Association.read
- (Defaults to 5 minutes) Used when retrieving the Spring Cloud Application Redis Association.update
- (Defaults to 30 minutes) Used when updating the Spring Cloud Application Redis Association.delete
- (Defaults to 30 minutes) Used when deleting the Spring Cloud Application Redis Association.
Import
Spring Cloud Application Redis Association can be imported using the resourceId
, e.g.