Skip to content

Commit af23df0

Browse files
authored
TF Module to facilitate creating private service connect resources in (#1)
RedisCloud and GCP
1 parent fe1333f commit af23df0

35 files changed

+1950
-0
lines changed

.github/dependabot.yml

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
version: 2
2+
updates:
3+
- package-ecosystem: "terraform"
4+
directory: "/"
5+
groups:
6+
update-deps:
7+
patterns:
8+
- "*"
9+
update-types:
10+
- "minor"
11+
- "patch"
12+
schedule:
13+
interval: "weekly"
14+
- package-ecosystem: "github-actions"
15+
directory: "/"
16+
schedule:
17+
interval: "weekly"
18+
groups:
19+
actions-deps:
20+
patterns:
21+
- "*"
22+
- package-ecosystem: "gomod"
23+
directory: "/"
24+
schedule:
25+
interval: "weekly"
26+
groups:
27+
gomod-deps:
28+
patterns:
29+
- "*"

.github/workflows/build.yml

Lines changed: 110 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,110 @@
1+
name: Terraform Module Checks
2+
3+
on:
4+
push:
5+
branches:
6+
- main
7+
pull_request:
8+
branches:
9+
- main
10+
11+
concurrency:
12+
group: ${{ github.workflow }}-${{ github.ref }}
13+
cancel-in-progress: true
14+
15+
jobs:
16+
terraform_lint:
17+
name: Terraform Lint
18+
runs-on: ubuntu-latest
19+
steps:
20+
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
21+
22+
- name: Check Terraform docs
23+
uses: terraform-docs/gh-actions@aeae0038ed47a547e0c0fca5c059d3335f48fb25 # v1.3.0
24+
with:
25+
working-dir: .
26+
output-file: README.md
27+
recursive: true
28+
fail-on-diff: true
29+
30+
- uses: hashicorp/setup-terraform@b9cd54a3c349d3f38e8881555d616ced269862dd # v3.1.2
31+
32+
- name: Terraform Format
33+
run: terraform fmt --recursive
34+
35+
- name: Verify Changed files
36+
uses: tj-actions/verify-changed-files@6ed7632824d235029086612d4330d659005af687 # v20.0.1
37+
id: verify-changed-files
38+
with:
39+
files: |
40+
*.tf
41+
42+
- uses: terraform-linters/setup-tflint@8093687ecc9dcbfa88d07c103ad4176739a7287e # v4.1.0
43+
name: Setup TFLint
44+
45+
- name: Lint Terraform
46+
run: tflint --recursive
47+
48+
go_build:
49+
name: go build
50+
runs-on: ubuntu-latest
51+
steps:
52+
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
53+
54+
- uses: actions/cache@1bd1e32a3bdc45362d1e726936510720a7c30a57 # v4.2.0
55+
continue-on-error: true
56+
id: cache-terraform-plugin-dir
57+
timeout-minutes: 2
58+
with:
59+
path: terraform-plugin-dir
60+
key: ${{ runner.os }}-terraform-plugin-dir-${{ hashFiles('go.sum') }}-${{ hashFiles('provider/**') }}
61+
62+
- if: steps.cache-terraform-plugin-dir.outputs.cache-hit != 'true' || steps.cache-terraform-plugin-dir.outcome == 'failure'
63+
uses: actions/setup-go@f111f3307d8850f501ac008e886eec1fd1932a34 # v5.3.0
64+
with:
65+
go-version-file: go.mod
66+
67+
- if: steps.cache-terraform-plugin-dir.outputs.cache-hit != 'true' || steps.cache-terraform-plugin-dir.outcome == 'failure'
68+
name: go mod download
69+
run: go mod download
70+
71+
- if: steps.cache-terraform-plugin-dir.outputs.cache-hit != 'true' || steps.cache-terraform-plugin-dir.outcome == 'failure'
72+
name: go build
73+
run: go build ./...
74+
75+
go_test:
76+
name: go test
77+
needs: [go_build]
78+
runs-on: ubuntu-latest
79+
if: false # TODO Set up acceptance tests
80+
steps:
81+
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
82+
83+
- uses: hashicorp/setup-terraform@b9cd54a3c349d3f38e8881555d616ced269862dd # v3.1.2
84+
85+
- uses: actions/setup-go@f111f3307d8850f501ac008e886eec1fd1932a34 # v5.3.0
86+
with:
87+
go-version-file: go.mod
88+
89+
- uses: dorny/paths-filter@4512585405083f25c027a35db413c2b3b9006d50 # v2.11.1
90+
id: filter
91+
with:
92+
filters: |
93+
code-changes:
94+
- 'go.mod'
95+
- 'go.sum'
96+
- 'test/**'
97+
- '*.tf'
98+
- 'examples/**'
99+
- 'modules/**'
100+
- '.github/workflows/**'
101+
102+
- run: go test ./test
103+
if: steps.filter.outputs.code-changes == 'true'
104+
env:
105+
REDISCLOUD_ACCESS_KEY: ${{ secrets.REDISCLOUD_ACCESS_KEY }}
106+
REDISCLOUD_SECRET_KEY: ${{ secrets.REDISCLOUD_SECRET_KEY }}
107+
REDISCLOUD_URL: ${{ secrets.REDISCLOUD_URL }}
108+
GCP_PROJECT_ID: ${{ secrets.GCP_VPC_PROJECT_ID }}
109+
# TODO
110+
GOOGLE_APPLICATION_CREDENTIALS: ${{ secrets.GOOGLE_APPLICATION_CREDENTIALS }}

.gitignore

Lines changed: 154 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,154 @@
1+
# Created by https://www.toptal.com/developers/gitignore/api/terraform,go,intellij+all
2+
# Edit at https://www.toptal.com/developers/gitignore?templates=terraform,go,intellij+all
3+
4+
### Go ###
5+
# If you prefer the allow list template instead of the deny list, see community template:
6+
# https://github.com/github/gitignore/blob/main/community/Golang/Go.AllowList.gitignore
7+
#
8+
# Binaries for programs and plugins
9+
*.exe
10+
*.exe~
11+
*.dll
12+
*.so
13+
*.dylib
14+
15+
# Test binary, built with `go test -c`
16+
*.test
17+
18+
# Output of the go coverage tool, specifically when used with LiteIDE
19+
*.out
20+
21+
# Dependency directories (remove the comment below to include it)
22+
# vendor/
23+
24+
# Go workspace file
25+
go.work
26+
27+
### Intellij+all ###
28+
# Covers JetBrains IDEs: IntelliJ, RubyMine, PhpStorm, AppCode, PyCharm, CLion, Android Studio, WebStorm and Rider
29+
# Reference: https://intellij-support.jetbrains.com/hc/en-us/articles/206544839
30+
31+
# User-specific stuff
32+
.idea/**/workspace.xml
33+
.idea/**/tasks.xml
34+
.idea/**/usage.statistics.xml
35+
.idea/**/dictionaries
36+
.idea/**/shelf
37+
38+
# AWS User-specific
39+
.idea/**/aws.xml
40+
41+
# Generated files
42+
.idea/**/contentModel.xml
43+
44+
# Sensitive or high-churn files
45+
.idea/**/dataSources/
46+
.idea/**/dataSources.ids
47+
.idea/**/dataSources.local.xml
48+
.idea/**/sqlDataSources.xml
49+
.idea/**/dynamic.xml
50+
.idea/**/uiDesigner.xml
51+
.idea/**/dbnavigator.xml
52+
53+
# Gradle
54+
.idea/**/gradle.xml
55+
.idea/**/libraries
56+
57+
# Gradle and Maven with auto-import
58+
# When using Gradle or Maven with auto-import, you should exclude module files,
59+
# since they will be recreated, and may cause churn. Uncomment if using
60+
# auto-import.
61+
# .idea/artifacts
62+
# .idea/compiler.xml
63+
# .idea/jarRepositories.xml
64+
# .idea/modules.xml
65+
# .idea/*.iml
66+
# .idea/modules
67+
# *.iml
68+
# *.ipr
69+
70+
# CMake
71+
cmake-build-*/
72+
73+
# Mongo Explorer plugin
74+
.idea/**/mongoSettings.xml
75+
76+
# File-based project format
77+
*.iws
78+
79+
# IntelliJ
80+
out/
81+
82+
# mpeltonen/sbt-idea plugin
83+
.idea_modules/
84+
85+
# JIRA plugin
86+
atlassian-ide-plugin.xml
87+
88+
# Cursive Clojure plugin
89+
.idea/replstate.xml
90+
91+
# SonarLint plugin
92+
.idea/sonarlint/
93+
94+
# Crashlytics plugin (for Android Studio and IntelliJ)
95+
com_crashlytics_export_strings.xml
96+
crashlytics.properties
97+
crashlytics-build.properties
98+
fabric.properties
99+
100+
# Editor-based Rest Client
101+
.idea/httpRequests
102+
103+
# Android studio 3.1+ serialized cache file
104+
.idea/caches/build_file_checksums.ser
105+
106+
### Intellij+all Patch ###
107+
# Ignore everything but code style settings and run configurations
108+
# that are supposed to be shared within teams.
109+
110+
.idea/*
111+
112+
!.idea/codeStyles
113+
!.idea/runConfigurations
114+
115+
### Terraform ###
116+
# Local .terraform directories
117+
**/.terraform/*
118+
119+
# .tfstate files
120+
*.tfstate
121+
*.tfstate.*
122+
123+
# Crash log files
124+
crash.log
125+
crash.*.log
126+
127+
# Exclude all .tfvars files, which are likely to contain sensitive data, such as
128+
# password, private keys, and other secrets. These should not be part of version
129+
# control as they are data points which are potentially sensitive and subject
130+
# to change depending on the environment.
131+
*.tfvars
132+
*.tfvars.json
133+
134+
# Ignore override files as they are usually used to override resources locally and so
135+
# are not checked in
136+
override.tf
137+
override.tf.json
138+
*_override.tf
139+
*_override.tf.json
140+
141+
# Include override files you do wish to add to version control using negated pattern
142+
# !example_override.tf
143+
144+
# Include tfplan files to ignore the plan output of command: terraform plan -out=tfplan
145+
# example: *tfplan*
146+
147+
# Ignore CLI configuration files
148+
.terraformrc
149+
terraform.rc
150+
151+
# End of https://www.toptal.com/developers/gitignore/api/terraform,go,intellij+all
152+
153+
**/debug.txt
154+
**/.test-data

0 commit comments

Comments
 (0)