Skip to content

Commit 9fdd8e9

Browse files
authored
Merge pull request #582 from RedisLabs/private-service-connection
Add private service connect resources and datasources
2 parents d528c05 + febf5b9 commit 9fdd8e9

File tree

37 files changed

+3819
-117
lines changed

37 files changed

+3819
-117
lines changed

.github/workflows/codeql-analysis.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ jobs:
3535

3636
steps:
3737
- name: Checkout repository
38-
uses: actions/checkout@v4.1.1
38+
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
3939

4040
# Initializes the CodeQL tools for scanning.
4141
- name: Initialize CodeQL

.github/workflows/release.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,13 +20,13 @@ jobs:
2020
steps:
2121
-
2222
name: Checkout
23-
uses: actions/checkout@v4.1.1
23+
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
2424
-
2525
name: Unshallow
2626
run: git fetch --prune --unshallow
2727
-
2828
name: Set up Go
29-
uses: actions/setup-go@v4
29+
uses: actions/setup-go@f111f3307d8850f501ac008e886eec1fd1932a34 # v5.3.0
3030
with:
3131
go-version-file: go.mod
3232
-

.github/workflows/terraform_provider.yml

Lines changed: 15 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -21,16 +21,16 @@ jobs:
2121
name: go build
2222
runs-on: ubuntu-latest
2323
steps:
24-
- uses: actions/checkout@v4.1.1
25-
- uses: actions/cache@v3.3.2
24+
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
25+
- uses: actions/cache@1bd1e32a3bdc45362d1e726936510720a7c30a57 # v4.2.0
2626
continue-on-error: true
2727
id: cache-terraform-plugin-dir
2828
timeout-minutes: 2
2929
with:
3030
path: terraform-plugin-dir
3131
key: ${{ runner.os }}-terraform-plugin-dir-${{ hashFiles('go.sum') }}-${{ hashFiles('provider/**') }}
3232
- if: steps.cache-terraform-plugin-dir.outputs.cache-hit != 'true' || steps.cache-terraform-plugin-dir.outcome == 'failure'
33-
uses: actions/setup-go@v4
33+
uses: actions/setup-go@f111f3307d8850f501ac008e886eec1fd1932a34 # v5.3.0
3434
with:
3535
go-version-file: go.mod
3636
- if: steps.cache-terraform-plugin-dir.outputs.cache-hit != 'true' || steps.cache-terraform-plugin-dir.outcome == 'failure'
@@ -45,22 +45,22 @@ jobs:
4545
needs: [go_build]
4646
runs-on: ubuntu-latest
4747
steps:
48-
- uses: actions/checkout@v4.1.1
49-
- uses: actions/cache@v3.3.2
48+
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
49+
- uses: actions/cache@1bd1e32a3bdc45362d1e726936510720a7c30a57 # v4.2.0
5050
continue-on-error: true
5151
id: cache-terraform-providers-schema
5252
timeout-minutes: 2
5353
with:
5454
path: terraform-providers-schema
5555
key: ${{ runner.os }}-terraform-providers-schema-${{ hashFiles('go.sum') }}-${{ hashFiles('provider/**') }}
5656
- if: steps.cache-terraform-providers-schema.outputs.cache-hit != 'true' || steps.cache-terraform-providers-schema.outcome == 'failure'
57-
uses: actions/cache@v3.3.2
57+
uses: actions/cache@1bd1e32a3bdc45362d1e726936510720a7c30a57 # v4.2.0
5858
timeout-minutes: 2
5959
with:
6060
path: terraform-plugin-dir
6161
key: ${{ runner.os }}-terraform-plugin-dir-${{ hashFiles('go.sum') }}-${{ hashFiles('provider/**') }}
6262
- if: steps.cache-terraform-providers-schema.outputs.cache-hit != 'true' || steps.cache-terraform-providers-schema.outcome == 'failure'
63-
uses: hashicorp/setup-terraform@v3.0.0
63+
uses: hashicorp/setup-terraform@b9cd54a3c349d3f38e8881555d616ced269862dd # v3.1.2
6464
with:
6565
terraform_version: ${{ env.TERRAFORM_VERSION }}
6666
terraform_wrapper: false
@@ -91,11 +91,11 @@ jobs:
9191
needs: [go_build]
9292
runs-on: ubuntu-latest
9393
steps:
94-
- uses: actions/checkout@v4.1.1
95-
- uses: actions/setup-go@v4
94+
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
95+
- uses: actions/setup-go@f111f3307d8850f501ac008e886eec1fd1932a34 # v5.3.0
9696
with:
9797
go-version-file: go.mod
98-
- uses: dorny/paths-filter@v2.11.1
98+
- uses: dorny/paths-filter@de90cc6fb38fc0963ad72b210f1f284cd68cea36 # v3.0.2
9999
id: filter
100100
with:
101101
filters: |
@@ -126,12 +126,14 @@ jobs:
126126
AWS_SIGNIN_URL: ${{ secrets.CLOUD_ACCOUNT_URL }}
127127
GCP_VPC_PROJECT: ${{ secrets.GCP_VPC_PROJECT }}
128128
GCP_VPC_ID: ${{ secrets.GCP_VPC_ID }}
129+
GCP_PROJECT_ID: ${{ secrets.GCP_PROJECT_ID }}
130+
GOOGLE_CREDENTIALS: ${{ secrets.GOOGLE_CREDENTIALS }}
129131
- name: Generate code coverage report
130132
if: steps.filter.outputs.code-changes == 'true' && (success() || failure())
131133
run: make generate_coverage
132134
- name: Upload code coverage report
133135
if: steps.filter.outputs.code-changes == 'true' && (success() || failure())
134-
uses: actions/upload-artifact@v3
136+
uses: actions/upload-artifact@65c4c4a1ddee5b72f698fdd19549f0f0fb45cf08 # v4.6.0
135137
with:
136138
name: coverage.html
137139
path: bin/coverage.html
@@ -141,8 +143,8 @@ jobs:
141143
needs: [go_build]
142144
runs-on: ubuntu-latest
143145
steps:
144-
- uses: actions/checkout@v4.1.1
145-
- uses: actions/setup-go@v4
146+
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
147+
- uses: actions/setup-go@f111f3307d8850f501ac008e886eec1fd1932a34 # v5.3.0
146148
with:
147149
go-version-file: go.mod
148150
- run: make tfproviderlint

GNUmakefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ PLUGINS_PATH = ~/.terraform.d/plugins
1010
PLUGINS_PROVIDER_PATH=$(PROVIDER_HOSTNAME)/$(PROVIDER_NAMESPACE)/$(PROVIDER_TYPE)/$(PROVIDER_VERSION)/$(PROVIDER_TARGET)
1111

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

1616
bin:

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,7 @@ terraform {
7474
source = "RedisLabs/rediscloud"
7575
}
7676
}
77-
required_version = ">= 0.13"
77+
required_version = "~> 1.2"
7878
}
7979
```
8080

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
---
2+
layout: "rediscloud"
3+
page_title: "Redis Cloud: rediscloud_active_active_private_service_connect"
4+
description: |-
5+
Active-Active Private Service Connect data source in the Redis Cloud Terraform provider.
6+
---
7+
8+
# Data Source: rediscloud_active_active_private_service_connect
9+
10+
The Active-Active Private Service Connect data source allows access to an available the Private Service Connect Service within your Redis Enterprise Subscription.
11+
12+
## Example Usage
13+
14+
```hcl
15+
data "rediscloud_active_active_private_service_connect" "example" {
16+
subscription_id = "1234"
17+
region_id = 1
18+
}
19+
20+
output "rediscloud_psc_status" {
21+
value = data.rediscloud_active_active_private_service_connect.example.status
22+
}
23+
```
24+
25+
## Argument Reference
26+
27+
* `subscription_id` - (Required) The ID of an Active-Active subscription
28+
* `region_id` - (Required) The ID of the GCP region
29+
30+
## Attribute Reference
31+
32+
* `private_service_connect_service_id` - The ID of the Private Service Connect Service relative to the associated subscription
33+
* `connection_host_name` - The connection hostname
34+
* `service_attachment_name` - The service attachment name
35+
* `status` - The Private Service Connect status
Lines changed: 51 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,51 @@
1+
---
2+
layout: "rediscloud"
3+
page_title: "Redis Cloud: rediscloud_active_active_private_service_connect_endpoints"
4+
description: |-
5+
Active-Active Private Service Connect Endpoints data source in the Redis Cloud Terraform provider.
6+
---
7+
8+
# Data Source: rediscloud_active_active_private_service_connect_endpoints
9+
10+
The Active-Active Private Service Connect Endpoints data source allows access to an available the endpoints within your Redis Enterprise Subscription.
11+
12+
## Example Usage
13+
14+
```hcl
15+
data "rediscloud_active_active_private_service_connect_endpoints" "example" {
16+
subscription_id = "1234"
17+
private_service_connect_service_id = 5678
18+
region_id = 1
19+
}
20+
21+
output "rediscloud_endpoints" {
22+
value = data.rediscloud_active_active_private_service_connect.example.endpoints
23+
}
24+
```
25+
26+
## Argument Reference
27+
28+
* `subscription_id` - (Required) The ID of an Active-Active subscription
29+
* `private_service_connect_service_id` - (Required) The ID of the Private Service Connect Service relative to the associated subscription
30+
* `region_id` - (Required) The ID of the GCP region
31+
32+
## Attribute Reference
33+
34+
* `endpoints` - List of Private Service Connect endpoints, documented below
35+
36+
The `endpoints` object has these attributes:
37+
38+
* `private_service_connect_endpoint_id` - The ID of the Private Service Connect endpoint
39+
* `gcp_project_id` - The Google Cloud Project ID
40+
* `gcp_vpc_name` - The GCP VPC name
41+
* `gcp_vpc_subnet_name` - The GCP Subnet name
42+
* `endpoint_connection_name` - The endpoint connection name
43+
* `status` - The endpoint status
44+
* `service_attachments` - The 40 service attachments that are created for the Private Service Connect endpoint, documented below
45+
46+
The `service_attachments` object has these attributes:
47+
48+
* `name` - Name of the service attachment
49+
* `dns_record` - DNS record for the service attachment
50+
* `ip_address_name` - IP address name for the service attachment
51+
* `forwarding_rule_name` - Name of the forwarding rule for the service attachment
Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
---
2+
layout: "rediscloud"
3+
page_title: "Redis Cloud: rediscloud_private_service_connect"
4+
description: |-
5+
Private Service Connect data source in the Redis Cloud Terraform provider.
6+
---
7+
8+
# Data Source: rediscloud_private_service_connect
9+
10+
The Private Service Connect data source allows access to an available the Private Service Connect Service within your Redis Enterprise Subscription.
11+
12+
## Example Usage
13+
14+
```hcl
15+
data "rediscloud_private_service_connect" "example" {
16+
subscription_id = "1234"
17+
}
18+
19+
output "rediscloud_psc_status" {
20+
value = data.rediscloud_private_service_connect.example.status
21+
}
22+
```
23+
24+
## Argument Reference
25+
26+
* `subscription_id` - (Required) The ID of a Pro subscription
27+
28+
## Attribute Reference
29+
30+
* `private_service_connect_service_id` - The ID of the Private Service Connect Service relative to the associated subscription
31+
* `connection_host_name` - The connection hostname
32+
* `service_attachment_name` - The service attachment name
33+
* `status` - The Private Service Connect status
Lines changed: 49 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,49 @@
1+
---
2+
layout: "rediscloud"
3+
page_title: "Redis Cloud: rediscloud_private_service_connect_endpoints"
4+
description: |-
5+
Private Service Connect Endpoints data source in the Redis Cloud Terraform provider.
6+
---
7+
8+
# Data Source: rediscloud_private_service_connect_endpoints
9+
10+
The Private Service Connect Endpoints data source allows access to an available the endpoints within your Redis Enterprise Subscription.
11+
12+
## Example Usage
13+
14+
```hcl
15+
data "rediscloud_private_service_connect_endpoints" "example" {
16+
subscription_id = "1234"
17+
private_service_connect_service_id = 5678
18+
}
19+
20+
output "rediscloud_endpoints" {
21+
value = data.rediscloud_private_service_connect.example.endpoints
22+
}
23+
```
24+
25+
## Argument Reference
26+
27+
* `subscription_id` - (Required) The ID of a Pro subscription
28+
* `private_service_connect_service_id` - (Required) The ID of the Private Service Connect Service relative to the associated subscription
29+
30+
## Attribute Reference
31+
32+
* `endpoints` - List of Private Service Connect endpoints, documented below
33+
34+
The `endpoints` object has these attributes:
35+
36+
* `private_service_connect_endpoint_id` - The ID of the Private Service Connect endpoint
37+
* `gcp_project_id` - The Google Cloud Project ID
38+
* `gcp_vpc_name` - The GCP VPC name
39+
* `gcp_vpc_subnet_name` - The GCP Subnet name
40+
* `endpoint_connection_name` - The endpoint connection name
41+
* `status` - The endpoint status
42+
* `service_attachments` - The 40 service attachments that are created for the Private Service Connect endpoint, documented below
43+
44+
The `service_attachments` object has these attributes:
45+
46+
* `name` - Name of the service attachment
47+
* `dns_record` - DNS record for the service attachment
48+
* `ip_address_name` - IP address name for the service attachment
49+
* `forwarding_rule_name` - Name of the forwarding rule for the service attachment
Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
---
2+
layout: "rediscloud"
3+
page_title: "Redis Cloud: rediscloud_active_active_private_service_connect"
4+
description: |-
5+
Private Service Connect resource for Active-Active Subscription in the Redis Cloud Terraform provider.
6+
---
7+
8+
# Resource: rediscloud_active_active_private_service_connect
9+
10+
Manages a Private Service Connect to an Active-Active Subscription in your Redis Enterprise Cloud Account.
11+
12+
## Example Usage
13+
14+
[Full example in the `rediscloud_active_active_private_service_connect_endpoint` resource](./rediscloud_active_active_private_service_connect_endpoint.md)
15+
16+
## Argument Reference
17+
18+
* `subscription_id` - (Required) The ID of the Pro subscription to attach **Modifying this attribute will force creation of a new resource.**
19+
* `region_id` - (Required) The ID of the region, as created by the API **Modifying this attribute will force creation of a new resource.**
20+
21+
## Attribute Reference
22+
23+
* `private_service_connect_service_id` - The ID of the Private Service Connect Service relative to the associated subscription
24+
25+
## Import
26+
27+
`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.
28+
29+
```
30+
$ terraform import rediscloud_active_active_private_service_connect.id 1000/1/123456
31+
```

0 commit comments

Comments
 (0)