Skip to content

Commit

Permalink
Add private service connect resources and datasources
Browse files Browse the repository at this point in the history
  • Loading branch information
matpimenta committed Jan 27, 2025
1 parent 1527349 commit 39fe628
Show file tree
Hide file tree
Showing 35 changed files with 3,803 additions and 101 deletions.
2 changes: 2 additions & 0 deletions .github/workflows/terraform_provider.yml
Original file line number Diff line number Diff line change
Expand Up @@ -126,6 +126,8 @@ jobs:
AWS_SIGNIN_URL: ${{ secrets.CLOUD_ACCOUNT_URL }}
GCP_VPC_PROJECT: ${{ secrets.GCP_VPC_PROJECT }}
GCP_VPC_ID: ${{ secrets.GCP_VPC_ID }}
# TODO
GOOGLE_APPLICATION_CREDENTIALS: ${{ secrets.GOOGLE_APPLICATION_CREDENTIALS }}
- name: Generate code coverage report
if: steps.filter.outputs.code-changes == 'true' && (success() || failure())
run: make generate_coverage
Expand Down
2 changes: 1 addition & 1 deletion GNUmakefile
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ PLUGINS_PATH = ~/.terraform.d/plugins
PLUGINS_PROVIDER_PATH=$(PROVIDER_HOSTNAME)/$(PROVIDER_NAMESPACE)/$(PROVIDER_TYPE)/$(PROVIDER_VERSION)/$(PROVIDER_TARGET)

# Use a parallelism of 3 by default for tests, overriding whatever GOMAXPROCS is set to.
TEST_PARALLELISM?=3
TEST_PARALLELISM?=6
TESTARGS?=-short

bin:
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ terraform {
source = "RedisLabs/rediscloud"
}
}
required_version = ">= 0.13"
required_version = "~> 1.2"
}
```

Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
---
layout: "rediscloud"
page_title: "Redis Cloud: rediscloud_active_active_private_service_connect"
description: |-
Active-Active Private Service Connect data source in the Redis Cloud Terraform provider.
---

# Data Source: rediscloud_active_active_private_service_connect

The Active-Active Private Service Connect data source allows access to an available the Private Service Connect Service within your Redis Enterprise Subscription.

## Example Usage

```hcl
data "rediscloud_active_active_private_service_connect" "example" {
subscription_id = "1234"
region_id = 1
}
output "rediscloud_psc_status" {
value = data.rediscloud_active_active_private_service_connect.example.status
}
```

## Argument Reference

* `subscription_id` - (Required) The ID of an Active-Active subscription
* `region_id` - (Required) The ID of the GCP region

## Attribute Reference

* `private_service_connect_service_id` - The ID of the Private Service Connect Service relative to the associated subscription
* `connection_host_name` - The connection hostname
* `service_attachment_name` - The service attachment name
* `status` - The Private Service Connect status
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
---
layout: "rediscloud"
page_title: "Redis Cloud: rediscloud_active_active_private_service_connect_endpoints"
description: |-
Active-Active Private Service Connect Endpoints data source in the Redis Cloud Terraform provider.
---

# Data Source: rediscloud_active_active_private_service_connect_endpoints

The Active-Active Private Service Connect Endpoints data source allows access to an available the endpoints within your Redis Enterprise Subscription.

## Example Usage

```hcl
data "rediscloud_active_active_private_service_connect_endpoints" "example" {
subscription_id = "1234"
private_service_connect_service_id = 5678
region_id = 1
}
output "rediscloud_endpoints" {
value = data.rediscloud_active_active_private_service_connect.example.endpoints
}
```

## Argument Reference

* `subscription_id` - (Required) The ID of an Active-Active subscription
* `private_service_connect_service_id` - (Required) The ID of the Private Service Connect Service relative to the associated subscription
* `region_id` - (Required) The ID of the GCP region

## Attribute Reference

* `endpoints` - List of Private Service Connect endpoints, documented below

The `endpoints` object has these attributes:

* `private_service_connect_endpoint_id` - The ID of the Private Service Connect endpoint
* `gcp_project_id` - The Google Cloud Project ID
* `gcp_vpc_name` - The GCP VPC name
* `gcp_vpc_subnet_name` - The GCP Subnet name
* `endpoint_connection_name` - The endpoint connection name
* `status` - The endpoint status
* `service_attachments` - The 40 service attachments that are created for the Private Service Connect endpoint, documented below

The `service_attachments` object has these attributes:

* `name` - Name of the service attachment
* `dns_record` - DNS record for the service attachment
* `ip_address_name` - IP address name for the service attachment
* `forwarding_rule_name` - Name of the forwarding rule for the service attachment
33 changes: 33 additions & 0 deletions docs/data-sources/rediscloud_private_service_connect.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
---
layout: "rediscloud"
page_title: "Redis Cloud: rediscloud_private_service_connect"
description: |-
Private Service Connect data source in the Redis Cloud Terraform provider.
---

# Data Source: rediscloud_private_service_connect

The Private Service Connect data source allows access to an available the Private Service Connect Service within your Redis Enterprise Subscription.

## Example Usage

```hcl
data "rediscloud_private_service_connect" "example" {
subscription_id = "1234"
}
output "rediscloud_psc_status" {
value = data.rediscloud_private_service_connect.example.status
}
```

## Argument Reference

* `subscription_id` - (Required) The ID of a Pro subscription

## Attribute Reference

* `private_service_connect_service_id` - The ID of the Private Service Connect Service relative to the associated subscription
* `connection_host_name` - The connection hostname
* `service_attachment_name` - The service attachment name
* `status` - The Private Service Connect status
49 changes: 49 additions & 0 deletions docs/data-sources/rediscloud_private_service_connect_endpoints.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
---
layout: "rediscloud"
page_title: "Redis Cloud: rediscloud_private_service_connect_endpoints"
description: |-
Private Service Connect Endpoints data source in the Redis Cloud Terraform provider.
---

# Data Source: rediscloud_private_service_connect_endpoints

The Private Service Connect Endpoints data source allows access to an available the endpoints within your Redis Enterprise Subscription.

## Example Usage

```hcl
data "rediscloud_private_service_connect_endpoints" "example" {
subscription_id = "1234"
private_service_connect_service_id = 5678
}
output "rediscloud_endpoints" {
value = data.rediscloud_private_service_connect.example.endpoints
}
```

## Argument Reference

* `subscription_id` - (Required) The ID of a Pro subscription
* `private_service_connect_service_id` - (Required) The ID of the Private Service Connect Service relative to the associated subscription

## Attribute Reference

* `endpoints` - List of Private Service Connect endpoints, documented below

The `endpoints` object has these attributes:

* `private_service_connect_endpoint_id` - The ID of the Private Service Connect endpoint
* `gcp_project_id` - The Google Cloud Project ID
* `gcp_vpc_name` - The GCP VPC name
* `gcp_vpc_subnet_name` - The GCP Subnet name
* `endpoint_connection_name` - The endpoint connection name
* `status` - The endpoint status
* `service_attachments` - The 40 service attachments that are created for the Private Service Connect endpoint, documented below

The `service_attachments` object has these attributes:

* `name` - Name of the service attachment
* `dns_record` - DNS record for the service attachment
* `ip_address_name` - IP address name for the service attachment
* `forwarding_rule_name` - Name of the forwarding rule for the service attachment
31 changes: 31 additions & 0 deletions docs/resources/rediscloud_active_active_private_service_connect.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
---
layout: "rediscloud"
page_title: "Redis Cloud: rediscloud_active_active_private_service_connect"
description: |-
Private Service Connect resource for Active-Active Subscription in the Redis Cloud Terraform provider.
---

# Resource: rediscloud_active_active_private_service_connect

Manages a Private Service Connect to an Active-Active Subscription in your Redis Enterprise Cloud Account.

## Example Usage

[Full example in the `rediscloud_active_active_private_service_connect_endpoint` resource](./rediscloud_active_active_private_service_connect_endpoint.md)

## Argument Reference

* `subscription_id` - (Required) The ID of the Pro subscription to attach **Modifying this attribute will force creation of a new resource.**
* `region_id` - (Required) The ID of the region, as created by the API **Modifying this attribute will force creation of a new resource.**

## Attribute Reference

* `private_service_connect_service_id` - The ID of the Private Service Connect Service relative to the associated subscription

## Import

`rediscloud_active_active_private_service_connect` can be imported using the ID of the Active-Active subscription, the region ID and the ID of the Private Service Connect in the format {subscription ID/region ID/private service connect ID}, e.g.

```
$ terraform import rediscloud_active_active_private_service_connect.id 1000/1/123456
```
Loading

0 comments on commit 39fe628

Please sign in to comment.