Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add private service connect resources and datasources #582

Merged
merged 3 commits into from
Feb 5, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/codeql-analysis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ jobs:

steps:
- name: Checkout repository
uses: actions/checkout@v4.1.1
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2

# Initializes the CodeQL tools for scanning.
- name: Initialize CodeQL
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,13 +20,13 @@ jobs:
steps:
-
name: Checkout
uses: actions/checkout@v4.1.1
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
-
name: Unshallow
run: git fetch --prune --unshallow
-
name: Set up Go
uses: actions/setup-go@v4
uses: actions/setup-go@f111f3307d8850f501ac008e886eec1fd1932a34 # v5.3.0
with:
go-version-file: go.mod
-
Expand Down
28 changes: 15 additions & 13 deletions .github/workflows/terraform_provider.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,16 +21,16 @@ jobs:
name: go build
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4.1.1
- uses: actions/cache@v3.3.2
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
- uses: actions/cache@1bd1e32a3bdc45362d1e726936510720a7c30a57 # v4.2.0
continue-on-error: true
id: cache-terraform-plugin-dir
timeout-minutes: 2
with:
path: terraform-plugin-dir
key: ${{ runner.os }}-terraform-plugin-dir-${{ hashFiles('go.sum') }}-${{ hashFiles('provider/**') }}
- if: steps.cache-terraform-plugin-dir.outputs.cache-hit != 'true' || steps.cache-terraform-plugin-dir.outcome == 'failure'
uses: actions/setup-go@v4
uses: actions/setup-go@f111f3307d8850f501ac008e886eec1fd1932a34 # v5.3.0
with:
go-version-file: go.mod
- if: steps.cache-terraform-plugin-dir.outputs.cache-hit != 'true' || steps.cache-terraform-plugin-dir.outcome == 'failure'
Expand All @@ -45,22 +45,22 @@ jobs:
needs: [go_build]
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4.1.1
- uses: actions/cache@v3.3.2
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
- uses: actions/cache@1bd1e32a3bdc45362d1e726936510720a7c30a57 # v4.2.0
continue-on-error: true
id: cache-terraform-providers-schema
timeout-minutes: 2
with:
path: terraform-providers-schema
key: ${{ runner.os }}-terraform-providers-schema-${{ hashFiles('go.sum') }}-${{ hashFiles('provider/**') }}
- if: steps.cache-terraform-providers-schema.outputs.cache-hit != 'true' || steps.cache-terraform-providers-schema.outcome == 'failure'
uses: actions/cache@v3.3.2
uses: actions/cache@1bd1e32a3bdc45362d1e726936510720a7c30a57 # v4.2.0
timeout-minutes: 2
with:
path: terraform-plugin-dir
key: ${{ runner.os }}-terraform-plugin-dir-${{ hashFiles('go.sum') }}-${{ hashFiles('provider/**') }}
- if: steps.cache-terraform-providers-schema.outputs.cache-hit != 'true' || steps.cache-terraform-providers-schema.outcome == 'failure'
uses: hashicorp/setup-terraform@v3.0.0
uses: hashicorp/setup-terraform@b9cd54a3c349d3f38e8881555d616ced269862dd # v3.1.2
with:
terraform_version: ${{ env.TERRAFORM_VERSION }}
terraform_wrapper: false
Expand Down Expand Up @@ -91,11 +91,11 @@ jobs:
needs: [go_build]
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4.1.1
- uses: actions/setup-go@v4
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
- uses: actions/setup-go@f111f3307d8850f501ac008e886eec1fd1932a34 # v5.3.0
with:
go-version-file: go.mod
- uses: dorny/paths-filter@v2.11.1
- uses: dorny/paths-filter@de90cc6fb38fc0963ad72b210f1f284cd68cea36 # v3.0.2
id: filter
with:
filters: |
Expand Down Expand Up @@ -126,12 +126,14 @@ jobs:
AWS_SIGNIN_URL: ${{ secrets.CLOUD_ACCOUNT_URL }}
GCP_VPC_PROJECT: ${{ secrets.GCP_VPC_PROJECT }}
GCP_VPC_ID: ${{ secrets.GCP_VPC_ID }}
GCP_PROJECT_ID: ${{ secrets.GCP_PROJECT_ID }}
GOOGLE_CREDENTIALS: ${{ secrets.GOOGLE_CREDENTIALS }}
- name: Generate code coverage report
if: steps.filter.outputs.code-changes == 'true' && (success() || failure())
run: make generate_coverage
- name: Upload code coverage report
if: steps.filter.outputs.code-changes == 'true' && (success() || failure())
uses: actions/upload-artifact@v3
uses: actions/upload-artifact@65c4c4a1ddee5b72f698fdd19549f0f0fb45cf08 # v4.6.0
with:
name: coverage.html
path: bin/coverage.html
Expand All @@ -141,8 +143,8 @@ jobs:
needs: [go_build]
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4.1.1
- uses: actions/setup-go@v4
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
- uses: actions/setup-go@f111f3307d8850f501ac008e886eec1fd1932a34 # v5.3.0
with:
go-version-file: go.mod
- run: make tfproviderlint
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
Loading