Skip to content

RedisLabs/terraform-rediscloud-private-service-connect

Repository files navigation

Redis Cloud Private Service Connect Module

This module creates Private Service Connect service and endpoints in Redis Cloud and also provisions IP Address, forwarding rules and DNS entries a particular GCP subnetwork. It can create those resources in Active-Active and Pro subscriptions depending on the module rediscloud_subscription_type.

Usage

For a complete examples, see: examples/active_active and examples/pro

provider "gcp" {
  region = var.region
}

module "psc" {
  source  = "RedisLabs/private-service-connect/rediscloud"

  rediscloud_subscription_type = "active-active"
  rediscloud_subscription_id   = var.subscription_id
  rediscloud_region_id         = var.region_id
  
  gcp_region = var.gcp_region
  
  endpoints = [
    {
        gcp_project_id          = var.gcp_project_id
        gcp_vpc_name            = var.gcp_vpc_name
        gcp_vpc_subnetwork_name = var.gcp_vpc_subnetwork_name
    }
  ]
}

Requirements

Name Version
terraform ~> 1.2

Providers

No providers.

Modules

Name Source Version
active_active_psc ./modules/active_active_private_service_connect n/a
psc ./modules/private_service_connect n/a

Resources

No resources.

Inputs

Name Description Type Default Required
dns_record_ttl TTL for the DNS A Record number 300 no
endpoints List of endpoints to provision
list(object({
gcp_project_id = string # The Google Cloud Project ID
gcp_vpc_name = string # The GCP VPC Network name
gcp_vpc_subnetwork_name = string # The GCP VPC Subnetwork name
gcp_response_policy_name = string # The DNS Response Policy Name
}))
[] no
gcp_region The GCP Region to use string n/a yes
rediscloud_region_id The ID of the Region associated with Active-Active Subscription. This is required for active-active subscription type number null no
rediscloud_subscription_id The ID of the Active-Active subscription string n/a yes
rediscloud_subscription_type The subscription type - active-active or pro string n/a yes

Outputs

Name Description
private_service_connect_endpoint_ids The IDs of the Private Service Connect Endpoints
private_service_connect_service_id The ID of the Private Service Connect
redis_dns_records List of Redis DNS records for each endpoint

Development

Requirements

Formatting

terraform fmt  --recursive
terraform-docs markdown --recursive . --output-file README.md
tflint --recursive

Testing the Module

Environment Variables

  • REDISCLOUD_ACCESS_KEY - Account Cloud API Access Key
  • REDISCLOUD_SECRET_KEY - Individual user Cloud API Secret Key
  • REDISCLOUD_URL - (Optional) Redis Cloud API Base URL
  • GCP_PROJECT_ID - The GCP project ID
  • GOOGLE_CREDENTIALS or other supported environment variables described in Terraform GCP Provider
go test ./test

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Packages

No packages published