-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathredis-cloud.tf
39 lines (33 loc) · 1.1 KB
/
redis-cloud.tf
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
terraform {
required_providers {
rediscloud = {
source = "RedisLabs/rediscloud"
version = "1.8.1"
}
}
}
provider "rediscloud" {
}
locals {
redis_database_password = "See_H0w_Fast_Fee1s"
}
data "rediscloud_essentials_plan" "rediscloud_essentials_plan_30mb" {
name = "30MB"
cloud_provider = "AWS"
region = "us-east-1"
}
resource "rediscloud_essentials_subscription" "rediscloud_essentials_plan_30mb" {
name = "rediscloud_essentials_plan_30mb"
plan_id = data.rediscloud_essentials_plan.rediscloud_essentials_plan_30mb.id
}
resource "rediscloud_essentials_database" "redis_database" {
subscription_id = rediscloud_essentials_subscription.rediscloud_essentials_plan_30mb.id
name = "redisjson-for-gophers"
enable_default_user = true
password = local.redis_database_password
data_persistence = "none"
replication = false
}
output "Export_Redis_Connection_URL" {
value = "export REDIS_CONNECTION_URL=redis://default:${local.redis_database_password}@${rediscloud_essentials_database.redis_database.public_endpoint}"
}