Skip to content

Commit ea41fa3

Browse files
Merge branch 'main' into dependabot/go_modules/github.com/hashicorp/terraform-plugin-sdk/v2-2.36.1
2 parents 7cab0bf + 4aa605a commit ea41fa3

File tree

37 files changed

+346
-109
lines changed

37 files changed

+346
-109
lines changed

.github/workflows/codeql-analysis.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ jobs:
3939

4040
# Initializes the CodeQL tools for scanning.
4141
- name: Initialize CodeQL
42-
uses: github/codeql-action/init@v2
42+
uses: github/codeql-action/init@v3
4343
with:
4444
languages: ${{ matrix.language }}
4545
# If you wish to specify custom queries, you can do so here or in a config file.
@@ -50,7 +50,7 @@ jobs:
5050
# Autobuild attempts to build any compiled languages (C/C++, C#, or Java).
5151
# If this step fails, then you should remove it and run the build manually (see below)
5252
- name: Autobuild
53-
uses: github/codeql-action/autobuild@v2
53+
uses: github/codeql-action/autobuild@v3
5454

5555
# ℹ️ Command-line programs to run using the OS shell.
5656
# 📚 https://git.io/JvXDl
@@ -64,4 +64,4 @@ jobs:
6464
# make release
6565

6666
- name: Perform CodeQL Analysis
67-
uses: github/codeql-action/analyze@v2
67+
uses: github/codeql-action/analyze@v3

.github/workflows/release.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ jobs:
2626
run: git fetch --prune --unshallow
2727
-
2828
name: Set up Go
29-
uses: actions/setup-go@f111f3307d8850f501ac008e886eec1fd1932a34 # v5.3.0
29+
uses: actions/setup-go@0aaccfd150d50ccaeb58ebd88d36e91967a5f35b # v5.4.0
3030
with:
3131
go-version-file: go.mod
3232
-
@@ -38,7 +38,7 @@ jobs:
3838
PASSPHRASE: ${{ secrets.PASSPHRASE }}
3939
-
4040
name: Run GoReleaser
41-
uses: goreleaser/goreleaser-action@v5.0.0
41+
uses: goreleaser/goreleaser-action@v6.3.0
4242
with:
4343
version: latest
4444
args: release --clean

.github/workflows/terraform_provider.yml

Lines changed: 94 additions & 50 deletions
Original file line numberDiff line numberDiff line change
@@ -11,9 +11,29 @@ on:
1111
- develop
1212
env:
1313
TERRAFORM_VERSION: "1.2.6"
14+
REDISCLOUD_ACCESS_KEY: ${{ secrets.REDISCLOUD_ACCESS_KEY_STAGING }}
15+
REDISCLOUD_SECRET_KEY: ${{ secrets.REDISCLOUD_SECRET_KEY_STAGING }}
16+
REDISCLOUD_URL: ${{ secrets.REDISCLOUD_URL_STAGING }}
17+
AWS_TEST_CLOUD_ACCOUNT_NAME: "${{ secrets.AWS_TEST_CLOUD_ACCOUNT_NAME_STAGING }}"
18+
AWS_PEERING_REGION: ${{ secrets.AWS_PEERING_REGION }}
19+
AWS_ACCOUNT_ID: ${{ secrets.AWS_ACCOUNT_ID }}
20+
AWS_VPC_CIDR: ${{ secrets.AWS_VPC_CIDR }}
21+
AWS_VPC_ID: ${{ secrets.AWS_VPC_ID }}
22+
AWS_TEST_TGW_ID: ${{ secrets.AWS_TEST_TGW_ID_STAGING }}
23+
TF_ACC: true
24+
TF_LOG: info
25+
AWS_ACCESS_KEY_ID: ${{ secrets.CLOUD_ACCOUNT_KEY }}
26+
AWS_ACCESS_SECRET_KEY: ${{ secrets.CLOUD_ACCOUNT_SECRET }}
27+
AWS_CONSOLE_USERNAME: ${{ secrets.CLOUD_ACCOUNT_USERNAME }}
28+
AWS_CONSOLE_PASSWORD: ${{ secrets.CLOUD_ACCOUNT_PASS }}
29+
AWS_SIGNIN_URL: ${{ secrets.CLOUD_ACCOUNT_URL }}
30+
GCP_VPC_PROJECT: ${{ secrets.GCP_VPC_PROJECT }}
31+
GCP_VPC_ID: ${{ secrets.GCP_VPC_ID }}
32+
GCP_PROJECT_ID: ${{ secrets.GCP_PROJECT_ID }}
33+
GOOGLE_CREDENTIALS: ${{ secrets.GOOGLE_CREDENTIALS }}
1434

1535
concurrency:
16-
group: ${{ github.workflow }}-${{ github.ref }}
36+
group: <span class="math-inline">\{\{ github\.workflow \}\}\-</span>{{ github.ref }}
1737
cancel-in-progress: true
1838

1939
jobs:
@@ -22,15 +42,15 @@ jobs:
2242
runs-on: ubuntu-latest
2343
steps:
2444
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
25-
- uses: actions/cache@1bd1e32a3bdc45362d1e726936510720a7c30a57 # v4.2.0
45+
- uses: actions/cache@5a3ec84eff668545956fd18022155c47e93e2684 # v4.2.3
2646
continue-on-error: true
2747
id: cache-terraform-plugin-dir
2848
timeout-minutes: 2
2949
with:
3050
path: terraform-plugin-dir
3151
key: ${{ runner.os }}-terraform-plugin-dir-${{ hashFiles('go.sum') }}-${{ hashFiles('provider/**') }}
3252
- if: steps.cache-terraform-plugin-dir.outputs.cache-hit != 'true' || steps.cache-terraform-plugin-dir.outcome == 'failure'
33-
uses: actions/setup-go@f111f3307d8850f501ac008e886eec1fd1932a34 # v5.3.0
53+
uses: actions/setup-go@0aaccfd150d50ccaeb58ebd88d36e91967a5f35b # v5.4.0
3454
with:
3555
go-version-file: go.mod
3656
- if: steps.cache-terraform-plugin-dir.outputs.cache-hit != 'true' || steps.cache-terraform-plugin-dir.outcome == 'failure'
@@ -46,15 +66,15 @@ jobs:
4666
runs-on: ubuntu-latest
4767
steps:
4868
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
49-
- uses: actions/cache@1bd1e32a3bdc45362d1e726936510720a7c30a57 # v4.2.0
69+
- uses: actions/cache@5a3ec84eff668545956fd18022155c47e93e2684 # v4.2.3
5070
continue-on-error: true
5171
id: cache-terraform-providers-schema
5272
timeout-minutes: 2
5373
with:
5474
path: terraform-providers-schema
5575
key: ${{ runner.os }}-terraform-providers-schema-${{ hashFiles('go.sum') }}-${{ hashFiles('provider/**') }}
5676
- if: steps.cache-terraform-providers-schema.outputs.cache-hit != 'true' || steps.cache-terraform-providers-schema.outcome == 'failure'
57-
uses: actions/cache@1bd1e32a3bdc45362d1e726936510720a7c30a57 # v4.2.0
77+
uses: actions/cache@5a3ec84eff668545956fd18022155c47e93e2684 # v4.2.3
5878
timeout-minutes: 2
5979
with:
6080
path: terraform-plugin-dir
@@ -86,66 +106,90 @@ jobs:
86106
mkdir terraform-providers-schema
87107
terraform providers schema -json > terraform-providers-schema/schema.json
88108
89-
go_test:
90-
name: go test
109+
go_test_databases:
110+
name: go test Databases
91111
needs: [go_build]
92112
runs-on: ubuntu-latest
93113
steps:
94114
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
95-
- uses: actions/setup-go@f111f3307d8850f501ac008e886eec1fd1932a34 # v5.3.0
115+
- uses: actions/setup-go@0aaccfd150d50ccaeb58ebd88d36e91967a5f35b # v5.4.0
96116
with:
97117
go-version-file: go.mod
98-
- uses: dorny/paths-filter@de90cc6fb38fc0963ad72b210f1f284cd68cea36 # v3.0.2
99-
id: filter
118+
- run: EXECUTE_TESTS=true make testacc TESTARGS='-run="TestAcc(DataSource|Resource)RedisCloud(Essentials|Pro|ActiveActive)Database_.*"'
119+
120+
go_test_subscriptions:
121+
name: go test Subscriptions
122+
needs: [go_test_databases]
123+
runs-on: ubuntu-latest
124+
steps:
125+
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
126+
- uses: actions/setup-go@0aaccfd150d50ccaeb58ebd88d36e91967a5f35b # v5.4.0
127+
with:
128+
go-version-file: go.mod
129+
- run: EXECUTE_TESTS=true make testacc TESTARGS='-run="TestAcc(DataSource|Resource)RedisCloud(Essentials|Pro|ActiveActive)Subscription_.*"'
130+
131+
go_test_subscriptions_tls:
132+
name: go test Subscriptions TLS
133+
needs: [go_test_subscriptions]
134+
runs-on: ubuntu-latest
135+
steps:
136+
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
137+
- uses: actions/setup-go@0aaccfd150d50ccaeb58ebd88d36e91967a5f35b # v5.4.0
100138
with:
101-
filters: |
102-
code-changes:
103-
- 'go.mod'
104-
- 'go.sum'
105-
- 'provider/**'
106-
- '*.go'
107-
- '.github/workflows/**'
108-
- run: make testacc
109-
if: steps.filter.outputs.code-changes == 'true'
110-
env:
111-
REDISCLOUD_ACCESS_KEY: ${{ secrets.REDISCLOUD_ACCESS_KEY_STAGING }}
112-
REDISCLOUD_SECRET_KEY: ${{ secrets.REDISCLOUD_SECRET_KEY_STAGING }}
113-
REDISCLOUD_URL: ${{ secrets.REDISCLOUD_URL_STAGING }}
114-
AWS_TEST_CLOUD_ACCOUNT_NAME: "${{ secrets.AWS_TEST_CLOUD_ACCOUNT_NAME_STAGING }}"
115-
AWS_PEERING_REGION: ${{ secrets.AWS_PEERING_REGION }}
116-
AWS_ACCOUNT_ID: ${{ secrets.AWS_ACCOUNT_ID }}
117-
AWS_VPC_CIDR: ${{ secrets.AWS_VPC_CIDR }}
118-
AWS_VPC_ID: ${{ secrets.AWS_VPC_ID }}
119-
AWS_TEST_TGW_ID: ${{ secrets.AWS_TEST_TGW_ID_STAGING }}
120-
TF_ACC: true
121-
TF_LOG: debug
122-
AWS_ACCESS_KEY_ID: ${{ secrets.CLOUD_ACCOUNT_KEY }}
123-
AWS_ACCESS_SECRET_KEY: ${{ secrets.CLOUD_ACCOUNT_SECRET }}
124-
AWS_CONSOLE_USERNAME: ${{ secrets.CLOUD_ACCOUNT_USERNAME }}
125-
AWS_CONSOLE_PASSWORD: ${{ secrets.CLOUD_ACCOUNT_PASS }}
126-
AWS_SIGNIN_URL: ${{ secrets.CLOUD_ACCOUNT_URL }}
127-
GCP_VPC_PROJECT: ${{ secrets.GCP_VPC_PROJECT }}
128-
GCP_VPC_ID: ${{ secrets.GCP_VPC_ID }}
129-
GCP_PROJECT_ID: ${{ secrets.GCP_PROJECT_ID }}
130-
GOOGLE_CREDENTIALS: ${{ secrets.GOOGLE_CREDENTIALS }}
131-
- name: Generate code coverage report
132-
if: steps.filter.outputs.code-changes == 'true' && (success() || failure())
133-
run: make generate_coverage
134-
- name: Upload code coverage report
135-
if: steps.filter.outputs.code-changes == 'true' && (success() || failure())
136-
uses: actions/upload-artifact@65c4c4a1ddee5b72f698fdd19549f0f0fb45cf08 # v4.6.0
139+
go-version-file: go.mod
140+
- run: EXECUTE_TESTS=true make testacc TESTARGS='-run="TestAcc(DataSource|Resource)RedisCloudSubscriptionTls_.*"'
141+
142+
go_test_essentials_plan:
143+
name: go test Essentials Plan
144+
needs: [go_test_subscriptions_tls]
145+
runs-on: ubuntu-latest
146+
steps:
147+
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
148+
- uses: actions/setup-go@0aaccfd150d50ccaeb58ebd88d36e91967a5f35b # v5.4.0
137149
with:
138-
name: coverage.html
139-
path: bin/coverage.html
150+
go-version-file: go.mod
151+
- run: EXECUTE_TESTS=true make testacc TESTARGS='-run="TestAcc(DataSource|Resource)RedisCloudEssentialsPlan_.*"'
152+
153+
go_test_persistence_modules_regions_acl:
154+
name: go test Other
155+
needs: [go_test_essentials_plan]
156+
runs-on: ubuntu-latest
157+
steps:
158+
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
159+
- uses: actions/setup-go@0aaccfd150d50ccaeb58ebd88d36e91967a5f35b # v5.4.0
160+
with:
161+
go-version-file: go.mod
162+
- run: EXECUTE_TESTS=true make testacc TESTARGS='-run="TestAcc(DataSource|Resource)RedisCloud(DataPersistence|DatabaseModules|Regions|Acl).*"'
163+
164+
go_test_cloud_account:
165+
name: go test Cloud Account
166+
needs: [go_test_persistence_modules_regions_acl]
167+
runs-on: ubuntu-latest
168+
steps:
169+
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
170+
- uses: actions/setup-go@0aaccfd150d50ccaeb58ebd88d36e91967a5f35b # v5.4.0
171+
with:
172+
go-version-file: go.mod
173+
- run: EXECUTE_TESTS=true make testacc TESTARGS='-test.short -run="TestAcc(DataSource|Resource)RedisCloud(CloudAccount).*"'
174+
175+
go_test_transit_payment:
176+
name: go test Transit Gateway & Payment
177+
needs: [go_test_cloud_account]
178+
runs-on: ubuntu-latest
179+
steps:
180+
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
181+
- uses: actions/setup-go@0aaccfd150d50ccaeb58ebd88d36e91967a5f35b # v5.4.0
182+
with:
183+
go-version-file: go.mod
184+
- run: EXECUTE_TESTS=true make testacc TESTARGS='-run="TestAcc(DataSource|Resource)RedisCloud(TransitGatewayAttachment|PaymentMethod).*"'
140185

141186
tfproviderlint:
142187
name: tfproviderlint
143188
needs: [go_build]
144189
runs-on: ubuntu-latest
145190
steps:
146191
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
147-
- uses: actions/setup-go@f111f3307d8850f501ac008e886eec1fd1932a34 # v5.3.0
192+
- uses: actions/setup-go@0aaccfd150d50ccaeb58ebd88d36e91967a5f35b # v5.4.0
148193
with:
149194
go-version-file: go.mod
150195
- run: make tfproviderlint
151-

go.mod

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -3,10 +3,10 @@ module github.com/RedisLabs/terraform-provider-rediscloud
33
go 1.22.4
44

55
require (
6-
github.com/RedisLabs/rediscloud-go-api v0.22.0
7-
github.com/bflad/tfproviderlint v0.30.0
8-
github.com/hashicorp/go-cty v1.4.1-0.20200414143053-d3edf31b6320
9-
github.com/hashicorp/terraform-plugin-sdk/v2 v2.36.1
6+
github.com/bflad/tfproviderlint v0.31.0
7+
github.com/RedisLabs/rediscloud-go-api v0.24.0
8+
github.com/hashicorp/go-cty v1.5.0
9+
github.com/hashicorp/terraform-plugin-sdk/v2 v2.36.1
1010
github.com/stretchr/testify v1.10.0
1111
)
1212

@@ -54,12 +54,12 @@ require (
5454
github.com/vmihailenco/tagparser/v2 v2.0.0 // indirect
5555
github.com/zclconf/go-cty v1.16.2 // indirect
5656
golang.org/x/crypto v0.33.0 // indirect
57-
golang.org/x/mod v0.22.0 // indirect
58-
golang.org/x/net v0.34.0 // indirect
57+
golang.org/x/mod v0.23.0 // indirect
58+
golang.org/x/net v0.35.0 // indirect
5959
golang.org/x/sync v0.11.0 // indirect
6060
golang.org/x/sys v0.30.0 // indirect
6161
golang.org/x/text v0.22.0 // indirect
62-
golang.org/x/tools v0.29.0 // indirect
62+
golang.org/x/tools v0.30.0 // indirect
6363
google.golang.org/appengine v1.6.8 // indirect
6464
google.golang.org/genproto/googleapis/rpc v0.0.0-20241015192408-796eee8c2d53 // indirect
6565
google.golang.org/grpc v1.69.4 // indirect

go.sum

Lines changed: 12 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,8 @@ github.com/Microsoft/go-winio v0.6.1 h1:9/kr64B9VUZrLm5YYwbGtUJnMgqWVOdUAXu6Migc
44
github.com/Microsoft/go-winio v0.6.1/go.mod h1:LRdKpFKfdobln8UmuiYcKPot9D2v6svN5+sAH+4kjUM=
55
github.com/ProtonMail/go-crypto v1.1.3 h1:nRBOetoydLeUb4nHajyO2bKqMLfWQ/ZPwkXqXxPxCFk=
66
github.com/ProtonMail/go-crypto v1.1.3/go.mod h1:rA3QumHc/FZ8pAHreoekgiAbzpNsfQAosU5td4SnOrE=
7-
github.com/RedisLabs/rediscloud-go-api v0.22.0 h1:Tb3vMtCq7ks5kpniF/Rkod7TvHhcXZ2oYJJT3pMgyQ8=
8-
github.com/RedisLabs/rediscloud-go-api v0.22.0/go.mod h1:3/oVb71rv2OstFRYEc65QCIbfwnJTgZeQhtPCcdHook=
7+
github.com/RedisLabs/rediscloud-go-api v0.24.0 h1:/cg92RJIcbeFrsE7Z2ShFW3iNHFBiqF+kd2WNe8IX8k=
8+
github.com/RedisLabs/rediscloud-go-api v0.24.0/go.mod h1:3/oVb71rv2OstFRYEc65QCIbfwnJTgZeQhtPCcdHook=
99
github.com/agext/levenshtein v1.2.2 h1:0S/Yg6LYmFJ5stwQeRp6EeOcCbj7xiqQSdNelsXvaqE=
1010
github.com/agext/levenshtein v1.2.2/go.mod h1:JEDfjyjHDjOF/1e4FlBE/PkbqA9OfWu2ki2W0IB5558=
1111
github.com/apparentlymart/go-textseg/v12 v12.0.0/go.mod h1:S/4uRK2UtaQttw1GenVJEynmyUenKwP++x/+DdGV/Ec=
@@ -15,8 +15,8 @@ github.com/avast/retry-go/v4 v4.6.0 h1:K9xNA+KeB8HHc2aWFuLb25Offp+0iVRXEvFx8IinR
1515
github.com/avast/retry-go/v4 v4.6.0/go.mod h1:gvWlPhBVsvBbLkVGDg/KwvBv0bEkCOLRRSHKIr2PyOE=
1616
github.com/bflad/gopaniccheck v0.1.0 h1:tJftp+bv42ouERmUMWLoUn/5bi/iQZjHPznM00cP/bU=
1717
github.com/bflad/gopaniccheck v0.1.0/go.mod h1:ZCj2vSr7EqVeDaqVsWN4n2MwdROx1YL+LFo47TSWtsA=
18-
github.com/bflad/tfproviderlint v0.30.0 h1:XBbTGPS4ZagSt4Qtnus3Vgh5yOeHNLZhnjcTcsSJ7ZM=
19-
github.com/bflad/tfproviderlint v0.30.0/go.mod h1:eBZHT0r7HKPGw1uZEyGMzcR1/d+GAXq9KzQfw0I7wtY=
18+
github.com/bflad/tfproviderlint v0.31.0 h1:9N/dUzFARsTpAQOjdZzIWnHKMzQc7UDDEYrSNV2xnrw=
19+
github.com/bflad/tfproviderlint v0.31.0/go.mod h1:yZQdJs4uobBIgVHt1Tv5OpHhgM8fwh29OgxL/La5BFs=
2020
github.com/bufbuild/protocompile v0.4.0 h1:LbFKd2XowZvQ/kajzguUp2DC9UEIQhIq77fZZlaQsNA=
2121
github.com/bufbuild/protocompile v0.4.0/go.mod h1:3v93+mbWn/v3xzN+31nwkJfrEpAUwp+BagBSZWx+TP8=
2222
github.com/cloudflare/circl v1.3.7 h1:qlCDlTPz2n9fu58M0Nh1J/JzcFpfgkFHHX3O35r5vcU=
@@ -63,8 +63,8 @@ github.com/hashicorp/go-checkpoint v0.5.0/go.mod h1:7nfLNL10NsxqO4iWuW6tWW0HjZuD
6363
github.com/hashicorp/go-cleanhttp v0.5.0/go.mod h1:JpRdi6/HCYpAwUzNwuwqhbovhLtngrth3wmdIIUrZ80=
6464
github.com/hashicorp/go-cleanhttp v0.5.2 h1:035FKYIWjmULyFRBKPs8TBQoi0x6d9G4xc9neXJWAZQ=
6565
github.com/hashicorp/go-cleanhttp v0.5.2/go.mod h1:kO/YDlP8L1346E6Sodw+PrpBSV4/SoxCXGY6BqNFT48=
66-
github.com/hashicorp/go-cty v1.4.1-0.20200414143053-d3edf31b6320 h1:1/D3zfFHttUKaCaGKZ/dR2roBXv0vKbSCnssIldfQdI=
67-
github.com/hashicorp/go-cty v1.4.1-0.20200414143053-d3edf31b6320/go.mod h1:EiZBMaudVLy8fmjf9Npq1dq9RalhveqZG5w/yz3mHWs=
66+
github.com/hashicorp/go-cty v1.5.0 h1:EkQ/v+dDNUqnuVpmS5fPqyY71NXVgT5gf32+57xY8g0=
67+
github.com/hashicorp/go-cty v1.5.0/go.mod h1:lFUCG5kd8exDobgSfyj4ONE/dc822kiYMguVKdHGMLM=
6868
github.com/hashicorp/go-hclog v1.6.3 h1:Qr2kF+eVWjTiYmU7Y31tYlP1h0q/X3Nl3tPGdaB11/k=
6969
github.com/hashicorp/go-hclog v1.6.3/go.mod h1:W4Qnvbt70Wk/zYJryRzDRU/4r0kIg0PVHBcfoyhpF5M=
7070
github.com/hashicorp/go-multierror v1.1.1 h1:H5DkEtf6CXdFp0N0Em5UCwQpXMWke8IA0+lD48awMYo=
@@ -177,14 +177,14 @@ golang.org/x/crypto v0.33.0 h1:IOBPskki6Lysi0lo9qQvbxiQ+FvsCC/YWOecCHAixus=
177177
golang.org/x/crypto v0.33.0/go.mod h1:bVdXmD7IV/4GdElGPozy6U7lWdRXA4qyRVGJV57uQ5M=
178178
golang.org/x/mod v0.1.1-0.20191105210325-c90efee705ee/go.mod h1:QqPTAvyqsEbceGzBzNggFXnrqF1CaUcvgkdR5Ot7KZg=
179179
golang.org/x/mod v0.6.0-dev.0.20220419223038-86c51ed26bb4/go.mod h1:jJ57K6gSWd91VN4djpZkiMVwK6gcyfeH4XE8wZrZaV4=
180-
golang.org/x/mod v0.22.0 h1:D4nJWe9zXqHOmWqj4VMOJhvzj7bEZg4wEYa759z1pH4=
181-
golang.org/x/mod v0.22.0/go.mod h1:6SkKJ3Xj0I0BrPOZoBy3bdMptDDU9oJrpohJ3eWZ1fY=
180+
golang.org/x/mod v0.23.0 h1:Zb7khfcRGKk+kqfxFaP5tZqCnDZMjC5VtUBs87Hr6QM=
181+
golang.org/x/mod v0.23.0/go.mod h1:6SkKJ3Xj0I0BrPOZoBy3bdMptDDU9oJrpohJ3eWZ1fY=
182182
golang.org/x/net v0.0.0-20190404232315-eb5bcb51f2a3/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg=
183183
golang.org/x/net v0.0.0-20190620200207-3b0461eec859/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s=
184184
golang.org/x/net v0.0.0-20210226172049-e18ecbb05110/go.mod h1:m0MpNAwzfU5UDzcl9v0D8zg8gWTRqZa9RBIspLL5mdg=
185185
golang.org/x/net v0.0.0-20220722155237-a158d28d115b/go.mod h1:XRhObCWvk6IyKnWLug+ECip1KBveYUHfp+8e9klMJ9c=
186-
golang.org/x/net v0.34.0 h1:Mb7Mrk043xzHgnRM88suvJFwzVrRfHEHJEl5/71CKw0=
187-
golang.org/x/net v0.34.0/go.mod h1:di0qlW3YNM5oh6GqDGQr92MyTozJPmybPK4Ev/Gm31k=
186+
golang.org/x/net v0.35.0 h1:T5GQRQb2y08kTAByq9L4/bz8cipCdA8FbRTXewonqY8=
187+
golang.org/x/net v0.35.0/go.mod h1:EglIi67kWsHKlRzzVMUD93VMSWGFOMSZgxFjparz1Qk=
188188
golang.org/x/sync v0.0.0-20180314180146-1d60e4601c6f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
189189
golang.org/x/sync v0.0.0-20190423024810-112230192c58/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
190190
golang.org/x/sync v0.0.0-20220722155255-886fb9371eb4/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
@@ -210,7 +210,6 @@ golang.org/x/term v0.0.0-20210927222741-03fcf44c2211/go.mod h1:jbD1KX2456YbFQfuX
210210
golang.org/x/term v0.29.0 h1:L6pJp37ocefwRRtYPKSWOWzOtWSxVajvz2ldH/xi3iU=
211211
golang.org/x/term v0.29.0/go.mod h1:6bl4lRlvVuDgSf3179VpIxBF0o10JUpXWOnI7nErv7s=
212212
golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ=
213-
golang.org/x/text v0.3.2/go.mod h1:bEr9sfX3Q8Zfm5fL9x+3itogRgK3+ptLWKqgva+5dAk=
214213
golang.org/x/text v0.3.3/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ=
215214
golang.org/x/text v0.3.7/go.mod h1:u+2+/6zg+i71rQMx5EYifcz6MCKuco9NR6JIITiCfzQ=
216215
golang.org/x/text v0.3.8/go.mod h1:E6s5w1FMmriuDzIBO73fBruAKo1PCIq6d2Q6DHfQ8WQ=
@@ -220,8 +219,8 @@ golang.org/x/tools v0.0.0-20180917221912-90fa682c2a6e/go.mod h1:n7NCudcB/nEzxVGm
220219
golang.org/x/tools v0.0.0-20191119224855-298f0cb1881e/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo=
221220
golang.org/x/tools v0.0.0-20200214201135-548b770e2dfa/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28=
222221
golang.org/x/tools v0.1.12/go.mod h1:hNGJHUnrk76NpqgfD5Aqm5Crs+Hm0VOH/i9J2+nxYbc=
223-
golang.org/x/tools v0.29.0 h1:Xx0h3TtM9rzQpQuR4dKLrdglAmCEN5Oi+P74JdhdzXE=
224-
golang.org/x/tools v0.29.0/go.mod h1:KMQVMRsVxU6nHCFXrBPhDB8XncLNLM0lIy/F14RP588=
222+
golang.org/x/tools v0.30.0 h1:BgcpHewrV5AUp2G9MebG4XPFI1E2W41zU1SaqVA9vJY=
223+
golang.org/x/tools v0.30.0/go.mod h1:c347cR/OJfw5TI+GfX7RUPNMdDRRbjvYTS0jPyvsVtY=
225224
golang.org/x/xerrors v0.0.0-20190717185122-a985d3407aa7/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0=
226225
golang.org/x/xerrors v0.0.0-20191011141410-1b5146add898/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0=
227226
golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0=
Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
package provider
2+
3+
import (
4+
"fmt"
5+
"github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource"
6+
"regexp"
7+
"testing"
8+
)
9+
10+
func TestAccDataSourceRedisCloudAclRule_ForDefaultRule(t *testing.T) {
11+
12+
testAccRequiresEnvVar(t, "EXECUTE_TESTS")
13+
14+
// This rule already exists
15+
const testName = "Read-Write"
16+
const testRule = "+@all -@dangerous ~*"
17+
getRuleTerraform := fmt.Sprintf(getDefaultDatasourceAclRuleDataSource, testName)
18+
19+
const AclRuleTest = "data.rediscloud_acl_rule.test"
20+
resource.ParallelTest(t, resource.TestCase{
21+
PreCheck: func() { testAccPreCheck(t) },
22+
ProviderFactories: providerFactories,
23+
CheckDestroy: nil, // test doesn't create a resource, so don't need to check anything
24+
Steps: []resource.TestStep{
25+
{
26+
Config: getRuleTerraform,
27+
Check: resource.ComposeAggregateTestCheckFunc(
28+
resource.TestMatchResourceAttr(
29+
AclRuleTest, "id", regexp.MustCompile("^\\d*$")),
30+
resource.TestCheckResourceAttr(AclRuleTest, "name", testName),
31+
resource.TestCheckResourceAttr(AclRuleTest, "rule", testRule),
32+
),
33+
},
34+
},
35+
})
36+
}
37+
38+
const getDefaultDatasourceAclRuleDataSource = `
39+
data "rediscloud_acl_rule" "test" {
40+
name = "%s"
41+
}
42+
`

0 commit comments

Comments
 (0)