├── .editorconfig
├── .github
├── CODEOWNERS
├── dependabot.yml
├── labeler.yaml
├── labels.yaml
└── workflows
│ ├── pull-request-labeler.yaml
│ ├── sync-labels.yaml
│ ├── terraform.integration.yaml
│ ├── welcome.yaml
│ └── yaml.integration.yaml
├── .gitignore
├── .pre-commit-config.yaml
├── .tflint.hcl
├── .yamllint.yaml
├── LICENSE
├── README.md
├── VERSION
├── examples
├── elasticache-redis-full
│ ├── main.tf
│ ├── outputs.tf
│ └── versions.tf
├── elasticache-redis-muti-az
│ ├── main.tf
│ ├── outputs.tf
│ └── versions.tf
├── elasticache-redis-single
│ ├── main.tf
│ ├── outputs.tf
│ └── versions.tf
└── elasticache-redis-with-users
│ ├── main.tf
│ ├── outputs.tf
│ └── versions.tf
└── modules
├── elasticache-redis-cluster
├── README.md
├── main.tf
├── outputs.tf
├── resource-group.tf
├── security-group.tf
├── variables.tf
└── versions.tf
├── elasticache-redis-user-group
├── README.md
├── main.tf
├── outputs.tf
├── resource-group.tf
├── variables.tf
└── versions.tf
└── elasticache-redis-user
├── README.md
├── main.tf
├── outputs.tf
├── resource-group.tf
├── variables.tf
└── versions.tf
/.editorconfig:
--------------------------------------------------------------------------------
1 | # Top-most EditorConfig file
2 | root = true
3 |
4 | [*]
5 | charset = utf-8
6 | end_of_line = lf
7 | indent_style = space
8 | indent_size = 2
9 | trim_trailing_whitespace = true
10 | insert_final_newline = true
11 | max_line_length = 150
12 |
13 | [*.{tf,tfvars}]
14 | indent_size = 2
15 | indent_style = space
16 |
17 | [*.md]
18 | max_line_length = 0
19 |
20 | [COMMIT_EDITMSG]
21 | max_line_length = 0
22 |
--------------------------------------------------------------------------------
/.github/CODEOWNERS:
--------------------------------------------------------------------------------
1 | * @posquit0
2 |
--------------------------------------------------------------------------------
/.github/dependabot.yml:
--------------------------------------------------------------------------------
1 | version: 2
2 | updates:
3 | - package-ecosystem: github-actions
4 | directory: /
5 | schedule:
6 | interval: daily
7 |
8 | - package-ecosystem: terraform
9 | directories:
10 | - /modules/*
11 | schedule:
12 | interval: weekly
13 |
--------------------------------------------------------------------------------
/.github/labeler.yaml:
--------------------------------------------------------------------------------
1 | # Modules
2 | ":floppy_disk: elasticache-redis-cluster":
3 | - changed-files:
4 | - any-glob-to-any-file:
5 | - modules/elasticache-redis-cluster/**/*
6 |
--------------------------------------------------------------------------------
/.github/labels.yaml:
--------------------------------------------------------------------------------
1 | # Warning
2 | - color: "ee0701"
3 | description: "Categorize bug reports."
4 | name: ":warning: bug"
5 | - color: "ee0701"
6 | description: "Categorize vulnerability reports."
7 | name: ":warning: vulnerability"
8 |
9 | # Highlight
10 | - color: "0e8a16"
11 | description: "Good for newcomers."
12 | name: ":fire: good first issue"
13 | - color: "0e8a16"
14 | description: "Extra attention is needed."
15 | name: ":fire: help wanted"
16 |
17 | # Cancel
18 | - color: "b60205"
19 | description: "This issue or pull request already exists."
20 | name: ":pray: duplicate"
21 | - color: "b60205"
22 | description: "This will not be worked on."
23 | name: ":pray: wontfix"
24 |
25 | # Size
26 | - color: "cfd3d7"
27 | description: "Extra Small size issue or PR."
28 | name: "size/XS"
29 | - color: "cfd3d7"
30 | description: "Small size issue or PR."
31 | name: "size/S"
32 | - color: "cfd3d7"
33 | description: "Medium size issue or PR."
34 | name: "size/M"
35 | - color: "cfd3d7"
36 | description: "Large size issue or PR."
37 | name: "size/L"
38 | - color: "cfd3d7"
39 | description: "Extra Large size issue or PR."
40 | name: "size/XL"
41 |
42 | # Modules
43 | - color: "fbca04"
44 | description: "This issue or pull request is related to elasticache-redis-cluster module."
45 | name: ":floppy_disk: elasticache-redis-cluster"
46 |
--------------------------------------------------------------------------------
/.github/workflows/pull-request-labeler.yaml:
--------------------------------------------------------------------------------
1 | name: Label Pull Requests
2 |
3 | on:
4 | - pull_request_target
5 |
6 | jobs:
7 | label-pr:
8 | runs-on: ubuntu-latest
9 |
10 | permissions:
11 | contents: read
12 | pull-requests: write
13 |
14 | steps:
15 | - name: Add Labels for PR
16 | uses: actions/labeler@v5
17 | with:
18 | repo-token: "${{ secrets.GITHUB_TOKEN }}"
19 | configuration-path: .github/labeler.yaml
20 | dot: true
21 | sync-labels: true
22 |
23 | - name: Add PR Size Labels for PR
24 | uses: codelytv/pr-size-labeler@v1
25 | with:
26 | GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
27 | xs_label: 'size/XS'
28 | xs_max_size: '20'
29 | s_label: 'size/S'
30 | s_max_size: '50'
31 | m_label: 'size/M'
32 | m_max_size: '150'
33 | l_label: 'size/L'
34 | l_max_size: '300'
35 | xl_label: 'size/XL'
36 | fail_if_xl: 'false'
37 | message_if_xl: >
38 | 'This PR has too many changes.
39 | Please make sure you are NOT addressing multiple issues with one PR.'
40 |
--------------------------------------------------------------------------------
/.github/workflows/sync-labels.yaml:
--------------------------------------------------------------------------------
1 | name: Sync labels
2 |
3 | on:
4 | push:
5 | branches:
6 | - main
7 | paths:
8 | - .github/labels.yaml
9 | workflow_dispatch: {}
10 |
11 | jobs:
12 | sync-labels:
13 | runs-on: ubuntu-latest
14 |
15 | steps:
16 | - name: Checkout
17 | uses: actions/checkout@v4
18 |
19 | - name: Sync labels
20 | uses: crazy-max/ghaction-github-labeler@v5
21 | with:
22 | github-token: ${{ secrets.GITHUB_TOKEN }}
23 | yaml-file: .github/labels.yaml
24 | skip-delete: false
25 | dry-run: false
26 | # exclude: |
27 |
--------------------------------------------------------------------------------
/.github/workflows/terraform.integration.yaml:
--------------------------------------------------------------------------------
1 | name: Integration (Terraform)
2 |
3 | on:
4 | push:
5 | branches:
6 | - main
7 | pull_request: {}
8 |
9 | concurrency:
10 | group: terraform-integration-${{ github.ref }}
11 | cancel-in-progress: true
12 |
13 | jobs:
14 | changed:
15 | name: Filter Changed Files and Directories
16 | runs-on: ubuntu-latest
17 |
18 | outputs:
19 | changed: ${{ steps.set-outputs.outputs.changed }}
20 | modified: ${{ steps.set-outputs.outputs.modified }}
21 | changed_files: ${{ steps.set-outputs.outputs.changed_files }}
22 | modified_files: ${{ steps.set-outputs.outputs.modified_files }}
23 | changed_directories: ${{ steps.set-outputs.outputs.changed_directories }}
24 | modified_directories: ${{ steps.set-outputs.outputs.modified_directories }}
25 |
26 | steps:
27 | - name: Checkout
28 | uses: actions/checkout@v4
29 | with:
30 | fetch-depth: 0
31 |
32 | - name: Get Changed Files
33 | id: changed-files
34 | uses: tj-actions/changed-files@v42
35 | with:
36 | files: |
37 | modules/**
38 | examples/**
39 | json: true
40 |
41 | - name: Get Changed Directories
42 | id: changed-directories
43 | uses: tj-actions/changed-files@v42
44 | with:
45 | files: |
46 | modules/**
47 | examples/**
48 | dir_names: "true"
49 | dir_names_max_depth: 2
50 | json: true
51 |
52 | - name: Set outputs
53 | id: set-outputs
54 | run: |
55 | echo "changed=${{ steps.changed-directories.outputs.any_changed }}" >> $GITHUB_OUTPUT
56 | echo "modified=${{ steps.changed-directories.outputs.any_modified }}" >> $GITHUB_OUTPUT
57 |
58 | echo "changed_files=${{ steps.changed-files.outputs.all_changed_files }}" >> $GITHUB_OUTPUT
59 | echo "modified_files=${{ steps.changed-files.outputs.all_modified_files }}" >> $GITHUB_OUTPUT
60 |
61 | echo "changed_directories=${{ steps.changed-directories.outputs.all_changed_files }}" >> $GITHUB_OUTPUT
62 | echo "modified_directories=${{ steps.changed-directories.outputs.all_modified_files }}" >> $GITHUB_OUTPUT
63 |
64 |
65 | terraform:
66 | name: Lint (terraform)
67 | needs:
68 | - changed
69 | if: ${{ needs.changed.outputs.modified == 'true' }}
70 | uses: tedilabs/.github/.github/workflows/terraform.terraform.yaml@main
71 |
72 | strategy:
73 | matrix:
74 | path: ${{ fromJson(needs.changed.outputs.modified_directories) }}
75 |
76 | with:
77 | terraform_target_dir: ${{ matrix.path }}
78 | terraform_version: latest
79 | terraform_host: app.terraform.io
80 | secrets:
81 | gh_token: ${{ secrets.GITHUB_TOKEN }}
82 | token: ${{ secrets.GITHUB_TOKEN }}
83 | terraform_token: ${{ secrets.TERRAFORM_TOKEN }}
84 |
85 |
86 | tflint:
87 | name: Lint (tflint)
88 | needs:
89 | - changed
90 | if: ${{ needs.changed.outputs.modified == 'true' }}
91 | uses: tedilabs/.github/.github/workflows/terraform.tflint.yaml@main
92 |
93 | strategy:
94 | matrix:
95 | path: ${{ fromJson(needs.changed.outputs.modified_directories) }}
96 |
97 | with:
98 | tflint_version: latest
99 | tflint_config_file: .tflint.hcl
100 | tflint_target_dir: ${{ matrix.path }}
101 | tflint_recursive_enabled: false
102 | tflint_terraform_init_enabled: true
103 | terraform_version: latest
104 | terraform_host: app.terraform.io
105 | secrets:
106 | gh_token: ${{ secrets.GITHUB_TOKEN }}
107 | token: ${{ secrets.GITHUB_TOKEN }}
108 | terraform_token: ${{ secrets.TERRAFORM_TOKEN }}
109 |
--------------------------------------------------------------------------------
/.github/workflows/welcome.yaml:
--------------------------------------------------------------------------------
1 | name: Welcome for First Issue or Pull Request
2 |
3 | on:
4 | pull_request_target:
5 | types:
6 | - opened
7 | issues:
8 | types:
9 | - opened
10 |
11 | jobs:
12 | welcome:
13 | runs-on: ubuntu-latest
14 |
15 | steps:
16 | - name: Welcome for First Issue or Pull Request
17 | uses: actions/first-interaction@v1
18 | with:
19 | repo-token: ${{ secrets.GITHUB_TOKEN }}
20 | issue-message: |
21 | ### :wave: Welcome! Looks like this is your first issue.
22 |
23 | Hey, thanks for your contribution! Please give us a bit of time to review it. 😄
24 |
25 | **Be sure to follow the issue template!**
26 | pr-message: |
27 | ### :wave: Welcome! Looks like this is your first pull request.
28 |
29 | Hey, thanks for your contribution! Please give us a bit of time to review it. 😄
30 |
31 | **Please check out our contributing guidelines.**
32 |
--------------------------------------------------------------------------------
/.github/workflows/yaml.integration.yaml:
--------------------------------------------------------------------------------
1 | name: Integration (YAML)
2 |
3 | on:
4 | push:
5 | branches:
6 | - main
7 | pull_request: {}
8 |
9 | concurrency:
10 | group: yaml-integration-${{ github.ref }}
11 | cancel-in-progress: true
12 |
13 | jobs:
14 | changed:
15 | name: Filter Changed Files and Directories
16 | runs-on: ubuntu-latest
17 |
18 | outputs:
19 | changed: ${{ steps.set-outputs.outputs.changed }}
20 | modified: ${{ steps.set-outputs.outputs.modified }}
21 | changed_files: ${{ steps.set-outputs.outputs.changed_files }}
22 | modified_files: ${{ steps.set-outputs.outputs.modified_files }}
23 |
24 | steps:
25 | - name: Checkout
26 | uses: actions/checkout@v4
27 | with:
28 | fetch-depth: 0
29 |
30 | - name: Get Changed Files
31 | id: changed-files
32 | uses: tj-actions/changed-files@v42
33 | with:
34 | files: |
35 | **/*.yaml
36 | **/*.yml
37 | json: true
38 |
39 | - name: Set outputs
40 | id: set-outputs
41 | run: |
42 | echo "changed=${{ steps.changed-files.outputs.any_changed }}" >> $GITHUB_OUTPUT
43 | echo "modified=${{ steps.changed-files.outputs.any_modified }}" >> $GITHUB_OUTPUT
44 |
45 | echo "changed_files=${{ steps.changed-files.outputs.all_changed_files }}" >> $GITHUB_OUTPUT
46 | echo "modified_files=${{ steps.changed-files.outputs.all_modified_files }}" >> $GITHUB_OUTPUT
47 |
48 | lint:
49 | name: Lint (yamllint)
50 | needs:
51 | - changed
52 | if: ${{ needs.changed.outputs.modified == 'true' }}
53 | uses: tedilabs/.github/.github/workflows/yaml.yamllint.yaml@main
54 |
55 | with:
56 | yamllint_version: latest
57 | yamllint_config_file: .yamllint.yaml
58 | yamllint_target_dir: ./
59 | secrets:
60 | token: ${{ secrets.GITHUB_TOKEN }}
61 |
--------------------------------------------------------------------------------
/.gitignore:
--------------------------------------------------------------------------------
1 | ### OSX ###
2 | # General
3 | .DS_Store
4 | .AppleDouble
5 | .LSOverride
6 |
7 | # Icon must end with two \r
8 | Icon
9 |
10 | # Thumbnails
11 | ._*
12 |
13 | # Files that might appear in the root of a volume
14 | .DocumentRevisions-V100
15 | .fseventsd
16 | .Spotlight-V100
17 | .TemporaryItems
18 | .Trashes
19 | .VolumeIcon.icns
20 | .com.apple.timemachine.donotpresent
21 |
22 | # Directories potentially created on remote AFP share
23 | .AppleDB
24 | .AppleDesktop
25 | Network Trash Folder
26 | Temporary Items
27 | .apdisk
28 |
29 |
30 | ### Terraform ###
31 | # Lock file
32 | .terraform.lock.hcl
33 |
34 | # Local .terraform directories
35 | **/.terraform/*
36 |
37 | # .tfstate files
38 | *.tfstate
39 | *.tfstate.*
40 |
41 | # Crash log files
42 | crash.log
43 |
44 | # Ignore any .tfvars files that are generated automatically for each Terraform run. Most
45 | # .tfvars files are managed as part of configuration and so should be included in
46 | # version control.
47 | #
48 | # example.tfvars
49 |
50 | # Ignore override files as they are usually used to override resources locally and so
51 | # are not checked in
52 | override.tf
53 | override.tf.json
54 | *_override.tf
55 | *_override.tf.json
56 |
57 | # Include override files you do wish to add to version control using negated pattern
58 | # !example_override.tf
59 |
60 | # Include tfplan files to ignore the plan output of command: terraform plan -out=tfplan
61 | # example: *tfplan*
62 |
63 |
64 | ### Vim ###
65 | # Swap
66 | [._]*.s[a-v][a-z]
67 | !*.svg # comment out if you don't need vector files
68 | [._]*.sw[a-p]
69 | [._]s[a-rt-v][a-z]
70 | [._]ss[a-gi-z]
71 | [._]sw[a-p]
72 |
73 | # Session
74 | Session.vim
75 | Sessionx.vim
76 |
77 | # Temporary
78 | .netrwhist
79 | *~
80 | # Auto-generated tag files
81 | tags
82 | # Persistent undo
83 | [._]*.un~
84 |
--------------------------------------------------------------------------------
/.pre-commit-config.yaml:
--------------------------------------------------------------------------------
1 | default_install_hook_types:
2 | - pre-commit
3 | - commit-msg
4 |
5 | repos:
6 | - repo: https://github.com/antonbabenko/pre-commit-terraform
7 | rev: v1.97.4
8 | hooks:
9 | - id: terraform_fmt
10 | name: (terraform) Format .tf files with `terraform fmt`
11 | args:
12 | - --args=-diff
13 | - id: terraform_validate
14 | name: (terraform) Check with `terraform validate`
15 | args:
16 | - --hook-config=--retry-once-with-cleanup=true
17 | - --tf-init-args=-upgrade
18 | - id: terraform_tflint
19 | name: (terraform) Check with `tflint`
20 | args:
21 | - --args=--config=__GIT_WORKING_DIR__/.tflint.hcl
22 | files: ^modules/
23 | - id: terraform_docs
24 | name: (terraform) Generate docs with `terraform-docs`
25 | args: ["--args=--sort-by required"]
26 |
27 | - repo: https://github.com/adrienverge/yamllint
28 | rev: v1.36.2
29 | hooks:
30 | - id: yamllint
31 | name: (yaml) Check with `yamllint`
32 |
33 | - repo: https://github.com/compilerla/conventional-pre-commit
34 | rev: v4.0.0
35 | hooks:
36 | - id: conventional-pre-commit
37 | name: (commit-message) Check conventional commit
38 | stages: [commit-msg]
39 | args: []
40 |
--------------------------------------------------------------------------------
/.tflint.hcl:
--------------------------------------------------------------------------------
1 | config {
2 | plugin_dir = "~/.tflint.d/plugins"
3 |
4 | format = "compact"
5 | call_module_type = "local"
6 | force = false
7 | disabled_by_default = false
8 |
9 | ignore_module = {}
10 | }
11 |
12 |
13 | ###################################################
14 | # Rule Sets - Terraform
15 | ###################################################
16 |
17 | plugin "terraform" {
18 | enabled = true
19 | preset = "recommended"
20 | }
21 |
22 | rule "terraform_comment_syntax" {
23 | enabled = true
24 | }
25 |
26 | rule "terraform_documented_variables" {
27 | enabled = true
28 | }
29 |
30 | rule "terraform_documented_outputs" {
31 | enabled = true
32 | }
33 |
34 | rule "terraform_naming_convention" {
35 | enabled = true
36 | format = "snake_case"
37 |
38 | custom_formats = {
39 | extended_snake_case = {
40 | description = "Extended snake_case Format which allows double underscore like `a__b`."
41 | regex = "^[a-z][a-z0-9]+([_]{1,2}[a-z0-9]+)*$"
42 | }
43 | }
44 |
45 | module {
46 | format = "extended_snake_case"
47 | }
48 |
49 | resource {
50 | format = "extended_snake_case"
51 | }
52 |
53 | data {
54 | format = "extended_snake_case"
55 | }
56 | }
57 |
58 | rule "terraform_unused_declarations" {
59 | enabled = false
60 | }
61 |
62 | rule "terraform_unused_required_providers" {
63 | enabled = true
64 | }
65 |
66 |
67 | ###################################################
68 | # Rule Sets - AWS
69 | ###################################################
70 |
71 | plugin "aws" {
72 | source = "github.com/terraform-linters/tflint-ruleset-aws"
73 | version = "0.38.0"
74 |
75 | enabled = true
76 | deep_check = false
77 | }
78 |
--------------------------------------------------------------------------------
/.yamllint.yaml:
--------------------------------------------------------------------------------
1 | yaml-files:
2 | - '*.yaml'
3 | - '*.yml'
4 |
5 | rules:
6 | braces:
7 | min-spaces-inside: 0
8 | max-spaces-inside: 1
9 | min-spaces-inside-empty: 0
10 | max-spaces-inside-empty: 0
11 | brackets:
12 | min-spaces-inside: 0
13 | max-spaces-inside: 1
14 | min-spaces-inside-empty: 0
15 | max-spaces-inside-empty: 0
16 | colons:
17 | max-spaces-before: 0
18 | max-spaces-after: 1
19 | commas:
20 | max-spaces-before: 0
21 | comments:
22 | level: warning
23 | require-starting-space: true
24 | min-spaces-from-content: 1
25 | comments-indentation: disable
26 | document-end: disable
27 | document-start: disable
28 | empty-lines:
29 | level: warning
30 | max: 2
31 | max-start: 0
32 | max-end: 1
33 | empty-values:
34 | forbid-in-block-mappings: true
35 | forbid-in-flow-mappings: true
36 | hyphens:
37 | max-spaces-after: 1
38 | indentation:
39 | spaces: consistent
40 | indent-sequences: false
41 | key-duplicates: enable
42 | key-ordering: disable
43 | line-length: disable
44 | new-line-at-end-of-file: enable
45 | # Use UNIX new line characters `\n` instead of DOS new line characters `\r\n`
46 | new-lines:
47 | type: unix
48 | octal-values: disable
49 | quoted-strings:
50 | quote-type: any
51 | required: false
52 | trailing-spaces: enable
53 | truthy: disable
54 |
--------------------------------------------------------------------------------
/LICENSE:
--------------------------------------------------------------------------------
1 | Apache License
2 | Version 2.0, January 2004
3 | http://www.apache.org/licenses/
4 |
5 | TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
6 |
7 | 1. Definitions.
8 |
9 | "License" shall mean the terms and conditions for use, reproduction,
10 | and distribution as defined by Sections 1 through 9 of this document.
11 |
12 | "Licensor" shall mean the copyright owner or entity authorized by
13 | the copyright owner that is granting the License.
14 |
15 | "Legal Entity" shall mean the union of the acting entity and all
16 | other entities that control, are controlled by, or are under common
17 | control with that entity. For the purposes of this definition,
18 | "control" means (i) the power, direct or indirect, to cause the
19 | direction or management of such entity, whether by contract or
20 | otherwise, or (ii) ownership of fifty percent (50%) or more of the
21 | outstanding shares, or (iii) beneficial ownership of such entity.
22 |
23 | "You" (or "Your") shall mean an individual or Legal Entity
24 | exercising permissions granted by this License.
25 |
26 | "Source" form shall mean the preferred form for making modifications,
27 | including but not limited to software source code, documentation
28 | source, and configuration files.
29 |
30 | "Object" form shall mean any form resulting from mechanical
31 | transformation or translation of a Source form, including but
32 | not limited to compiled object code, generated documentation,
33 | and conversions to other media types.
34 |
35 | "Work" shall mean the work of authorship, whether in Source or
36 | Object form, made available under the License, as indicated by a
37 | copyright notice that is included in or attached to the work
38 | (an example is provided in the Appendix below).
39 |
40 | "Derivative Works" shall mean any work, whether in Source or Object
41 | form, that is based on (or derived from) the Work and for which the
42 | editorial revisions, annotations, elaborations, or other modifications
43 | represent, as a whole, an original work of authorship. For the purposes
44 | of this License, Derivative Works shall not include works that remain
45 | separable from, or merely link (or bind by name) to the interfaces of,
46 | the Work and Derivative Works thereof.
47 |
48 | "Contribution" shall mean any work of authorship, including
49 | the original version of the Work and any modifications or additions
50 | to that Work or Derivative Works thereof, that is intentionally
51 | submitted to Licensor for inclusion in the Work by the copyright owner
52 | or by an individual or Legal Entity authorized to submit on behalf of
53 | the copyright owner. For the purposes of this definition, "submitted"
54 | means any form of electronic, verbal, or written communication sent
55 | to the Licensor or its representatives, including but not limited to
56 | communication on electronic mailing lists, source code control systems,
57 | and issue tracking systems that are managed by, or on behalf of, the
58 | Licensor for the purpose of discussing and improving the Work, but
59 | excluding communication that is conspicuously marked or otherwise
60 | designated in writing by the copyright owner as "Not a Contribution."
61 |
62 | "Contributor" shall mean Licensor and any individual or Legal Entity
63 | on behalf of whom a Contribution has been received by Licensor and
64 | subsequently incorporated within the Work.
65 |
66 | 2. Grant of Copyright License. Subject to the terms and conditions of
67 | this License, each Contributor hereby grants to You a perpetual,
68 | worldwide, non-exclusive, no-charge, royalty-free, irrevocable
69 | copyright license to reproduce, prepare Derivative Works of,
70 | publicly display, publicly perform, sublicense, and distribute the
71 | Work and such Derivative Works in Source or Object form.
72 |
73 | 3. Grant of Patent License. Subject to the terms and conditions of
74 | this License, each Contributor hereby grants to You a perpetual,
75 | worldwide, non-exclusive, no-charge, royalty-free, irrevocable
76 | (except as stated in this section) patent license to make, have made,
77 | use, offer to sell, sell, import, and otherwise transfer the Work,
78 | where such license applies only to those patent claims licensable
79 | by such Contributor that are necessarily infringed by their
80 | Contribution(s) alone or by combination of their Contribution(s)
81 | with the Work to which such Contribution(s) was submitted. If You
82 | institute patent litigation against any entity (including a
83 | cross-claim or counterclaim in a lawsuit) alleging that the Work
84 | or a Contribution incorporated within the Work constitutes direct
85 | or contributory patent infringement, then any patent licenses
86 | granted to You under this License for that Work shall terminate
87 | as of the date such litigation is filed.
88 |
89 | 4. Redistribution. You may reproduce and distribute copies of the
90 | Work or Derivative Works thereof in any medium, with or without
91 | modifications, and in Source or Object form, provided that You
92 | meet the following conditions:
93 |
94 | (a) You must give any other recipients of the Work or
95 | Derivative Works a copy of this License; and
96 |
97 | (b) You must cause any modified files to carry prominent notices
98 | stating that You changed the files; and
99 |
100 | (c) You must retain, in the Source form of any Derivative Works
101 | that You distribute, all copyright, patent, trademark, and
102 | attribution notices from the Source form of the Work,
103 | excluding those notices that do not pertain to any part of
104 | the Derivative Works; and
105 |
106 | (d) If the Work includes a "NOTICE" text file as part of its
107 | distribution, then any Derivative Works that You distribute must
108 | include a readable copy of the attribution notices contained
109 | within such NOTICE file, excluding those notices that do not
110 | pertain to any part of the Derivative Works, in at least one
111 | of the following places: within a NOTICE text file distributed
112 | as part of the Derivative Works; within the Source form or
113 | documentation, if provided along with the Derivative Works; or,
114 | within a display generated by the Derivative Works, if and
115 | wherever such third-party notices normally appear. The contents
116 | of the NOTICE file are for informational purposes only and
117 | do not modify the License. You may add Your own attribution
118 | notices within Derivative Works that You distribute, alongside
119 | or as an addendum to the NOTICE text from the Work, provided
120 | that such additional attribution notices cannot be construed
121 | as modifying the License.
122 |
123 | You may add Your own copyright statement to Your modifications and
124 | may provide additional or different license terms and conditions
125 | for use, reproduction, or distribution of Your modifications, or
126 | for any such Derivative Works as a whole, provided Your use,
127 | reproduction, and distribution of the Work otherwise complies with
128 | the conditions stated in this License.
129 |
130 | 5. Submission of Contributions. Unless You explicitly state otherwise,
131 | any Contribution intentionally submitted for inclusion in the Work
132 | by You to the Licensor shall be under the terms and conditions of
133 | this License, without any additional terms or conditions.
134 | Notwithstanding the above, nothing herein shall supersede or modify
135 | the terms of any separate license agreement you may have executed
136 | with Licensor regarding such Contributions.
137 |
138 | 6. Trademarks. This License does not grant permission to use the trade
139 | names, trademarks, service marks, or product names of the Licensor,
140 | except as required for reasonable and customary use in describing the
141 | origin of the Work and reproducing the content of the NOTICE file.
142 |
143 | 7. Disclaimer of Warranty. Unless required by applicable law or
144 | agreed to in writing, Licensor provides the Work (and each
145 | Contributor provides its Contributions) on an "AS IS" BASIS,
146 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
147 | implied, including, without limitation, any warranties or conditions
148 | of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
149 | PARTICULAR PURPOSE. You are solely responsible for determining the
150 | appropriateness of using or redistributing the Work and assume any
151 | risks associated with Your exercise of permissions under this License.
152 |
153 | 8. Limitation of Liability. In no event and under no legal theory,
154 | whether in tort (including negligence), contract, or otherwise,
155 | unless required by applicable law (such as deliberate and grossly
156 | negligent acts) or agreed to in writing, shall any Contributor be
157 | liable to You for damages, including any direct, indirect, special,
158 | incidental, or consequential damages of any character arising as a
159 | result of this License or out of the use or inability to use the
160 | Work (including but not limited to damages for loss of goodwill,
161 | work stoppage, computer failure or malfunction, or any and all
162 | other commercial damages or losses), even if such Contributor
163 | has been advised of the possibility of such damages.
164 |
165 | 9. Accepting Warranty or Additional Liability. While redistributing
166 | the Work or Derivative Works thereof, You may choose to offer,
167 | and charge a fee for, acceptance of support, warranty, indemnity,
168 | or other liability obligations and/or rights consistent with this
169 | License. However, in accepting such obligations, You may act only
170 | on Your own behalf and on Your sole responsibility, not on behalf
171 | of any other Contributor, and only if You agree to indemnify,
172 | defend, and hold each Contributor harmless for any liability
173 | incurred by, or claims asserted against, such Contributor by reason
174 | of your accepting any such warranty or additional liability.
175 |
176 | END OF TERMS AND CONDITIONS
177 |
178 | APPENDIX: How to apply the Apache License to your work.
179 |
180 | To apply the Apache License to your work, attach the following
181 | boilerplate notice, with the fields enclosed by brackets "[]"
182 | replaced with your own identifying information. (Don't include
183 | the brackets!) The text should be enclosed in the appropriate
184 | comment syntax for the file format. We also recommend that a
185 | file or class name and description of purpose be included on the
186 | same "printed page" as the copyright notice for easier
187 | identification within third-party archives.
188 |
189 | Copyright [yyyy] [name of copyright owner]
190 |
191 | Licensed under the Apache License, Version 2.0 (the "License");
192 | you may not use this file except in compliance with the License.
193 | You may obtain a copy of the License at
194 |
195 | http://www.apache.org/licenses/LICENSE-2.0
196 |
197 | Unless required by applicable law or agreed to in writing, software
198 | distributed under the License is distributed on an "AS IS" BASIS,
199 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
200 | See the License for the specific language governing permissions and
201 | limitations under the License.
202 |
--------------------------------------------------------------------------------
/README.md:
--------------------------------------------------------------------------------
1 | # terraform-aws-db
2 |
3 | 
4 | 
5 | [](https://github.com/pre-commit/pre-commit)
6 |
7 | Terraform module which creates db related resources on AWS.
8 |
9 | - [elasticache-redis-cluster](./modules/elasticache-redis-cluster)
10 | - [elasticache-redis-user](./modules/elasticache-redis-user)
11 | - [elasticache-redis-user-group](./modules/elasticache-redis-user-group)
12 |
13 |
14 | ## Target AWS Services
15 |
16 | Terraform Modules from [this package](https://github.com/tedilabs/terraform-aws-db) were written to manage the following AWS Services with Terraform.
17 |
18 | - **AWS RDS (Relational Database Service)**
19 | - (comming sooon!)
20 | - **AWS ElastiCache**
21 | - Redis Cluster
22 | - Redis User RBAC
23 |
24 |
25 | ## Usage
26 |
27 | ### ElastiCache Redis
28 |
29 | ```tf
30 | module "cluster" {
31 | source = "tedilabs/db/aws//modules/elasticache-redis-cluster"
32 | version = "~> 0.2.0"
33 |
34 | name = "example-redis-full"
35 | description = "Managed by Terraform."
36 |
37 | redis_version = "6.2"
38 | node_instance_type = "cache.t4g.micro"
39 | # node_size = 1
40 | sharding = {
41 | enabled = true
42 | shard_size = 3
43 | replicas = 2
44 | }
45 |
46 |
47 | ## Network
48 | port = 6379
49 | vpc_id = null
50 | subnet_group = null
51 | preferred_availability_zones = []
52 |
53 | default_security_group = {
54 | eanbled = true
55 | name = "example-redis-full-default-sg"
56 | description = "Managed by Terraform."
57 |
58 | ingress_rules = [
59 | {
60 | cidr_blocks = ["0.0.0.0/0"]
61 | }
62 | ]
63 | }
64 | security_groups = []
65 |
66 |
67 | ## Parameters
68 | parameter_group = {
69 | enabled = true
70 | name = "example-redis-full-parameter-group"
71 | description = "Managed by Terraform."
72 | parameters = {
73 | "lazyfree-lazy-eviction" = "yes"
74 | "lazyfree-lazy-expire" = "yes"
75 | "lazyfree-lazy-server-del" = "yes"
76 | "rename-commands" = "KEYS BLOCKED"
77 | }
78 | }
79 | custom_parameter_group = null
80 |
81 |
82 | ## Auth
83 | password = sensitive("helloworld!#!!1234")
84 | user_groups = []
85 |
86 |
87 | ## Encryption
88 | encryption_at_rest = {
89 | enabled = true
90 | kms_key = null
91 | }
92 | encryption_in_transit = {
93 | enabled = true
94 | }
95 |
96 |
97 | ## Backup
98 | backup_enabled = true
99 | backup_window = "16:00-17:00"
100 | backup_retention = 1
101 | backup_final_snapshot_name = "example-redis-full-final"
102 |
103 |
104 | ## Source
105 | source_backup_name = null
106 | source_rdb_s3_arns = null
107 |
108 |
109 | ## Maintenance
110 | maintenance_window = "fri:18:00-fri:20:00"
111 | auto_upgrade_minor_version_enabled = true
112 | notification_sns_topic = null
113 |
114 |
115 | ## Logging
116 | logging_slow_log = {
117 | enabled = false
118 | format = "JSON"
119 |
120 | destination_type = "CLOUDWATCH_LOGS"
121 | destination = null
122 | }
123 | logging_engine_log = {
124 | enabled = false
125 | format = "JSON"
126 |
127 | destination_type = "CLOUDWATCH_LOGS"
128 | destination = null
129 | }
130 |
131 |
132 | ## Attributes
133 | multi_az_enabled = true
134 | auto_failover_enabled = true
135 | apply_immediately = true
136 |
137 | timeouts = {
138 | create = "60m"
139 | update = "40m"
140 | delete = "40m"
141 | }
142 |
143 | tags = {
144 | "project" = "terraform-aws-db-examples"
145 | }
146 | }
147 | ```
148 |
149 |
150 | ## Examples
151 |
152 | ### ElastiCache Redis
153 |
154 | - [Singie Redis Instance](./examples/elasticache-redis-single)
155 | - [Multi-AZs Redis Cluster (Sharding Disabled)](./examples/elasticache-redis-multi-az)
156 | - [Full Redis Cluster (Sharding Enabled)](./examples/elasticache-redis-full)
157 | - [Redis Cluster with RBAC(Role Based Access Control)](./examples/elasticache-redis-with-users)
158 |
159 |
160 | ## Self Promotion
161 |
162 | Like this project? Follow the repository on [GitHub](https://github.com/tedilabs/terraform-aws-db). And if you're feeling especially charitable, follow **[posquit0](https://github.com/posquit0)** on GitHub.
163 |
164 |
165 | ## License
166 |
167 | Provided under the terms of the [Apache License](LICENSE).
168 |
169 | Copyright © 2022-2023, [Byungjin Park](https://www.posquit0.com).
170 |
--------------------------------------------------------------------------------
/VERSION:
--------------------------------------------------------------------------------
1 | 0.1.4
2 |
--------------------------------------------------------------------------------
/examples/elasticache-redis-full/main.tf:
--------------------------------------------------------------------------------
1 | provider "aws" {
2 | region = "us-east-1"
3 | }
4 |
5 |
6 | ###################################################
7 | # ElastiCache Redis Cluster
8 | ###################################################
9 |
10 | module "cluster" {
11 | source = "../../modules/elasticache-redis-cluster"
12 | # source = "tedilabs/db/aws//modules/elasticache-redis-cluster"
13 | # version = "~> 0.2.0"
14 |
15 | name = "example-redis-full"
16 | description = "Managed by Terraform."
17 |
18 | redis_version = "6.2"
19 | node_instance_type = "cache.t4g.micro"
20 | # node_size = 1
21 | sharding = {
22 | enabled = true
23 | shard_size = 3
24 | replicas = 2
25 | }
26 |
27 |
28 | ## Network
29 | port = 6379
30 | vpc_id = null
31 | subnet_group = null
32 | preferred_availability_zones = []
33 |
34 | default_security_group = {
35 | eanbled = true
36 | name = "example-redis-full-default-sg"
37 | description = "Managed by Terraform."
38 |
39 | ingress_rules = [
40 | {
41 | cidr_blocks = ["0.0.0.0/0"]
42 | }
43 | ]
44 | }
45 | security_groups = []
46 |
47 |
48 | ## Parameters
49 | parameter_group = {
50 | enabled = true
51 | name = "example-redis-full-parameter-group"
52 | description = "Managed by Terraform."
53 | parameters = {
54 | "lazyfree-lazy-eviction" = "yes"
55 | "lazyfree-lazy-expire" = "yes"
56 | "lazyfree-lazy-server-del" = "yes"
57 | "rename-commands" = "KEYS BLOCKED"
58 | }
59 | }
60 | custom_parameter_group = null
61 |
62 |
63 | ## Auth
64 | password = sensitive("helloworld!#!!1234")
65 | user_groups = []
66 |
67 |
68 | ## Encryption
69 | encryption_at_rest = {
70 | enabled = true
71 | kms_key = null
72 | }
73 | encryption_in_transit = {
74 | enabled = true
75 | }
76 |
77 |
78 | ## Backup
79 | backup_enabled = true
80 | backup_window = "16:00-17:00"
81 | backup_retention = 1
82 | backup_final_snapshot_name = "example-redis-full-final"
83 |
84 |
85 | ## Source
86 | source_backup_name = null
87 | source_rdb_s3_arns = null
88 |
89 |
90 | ## Maintenance
91 | maintenance_window = "fri:18:00-fri:20:00"
92 | auto_upgrade_minor_version_enabled = true
93 | notification_sns_topic = null
94 |
95 |
96 | ## Logging
97 | logging_slow_log = {
98 | enabled = false
99 | format = "JSON"
100 |
101 | destination_type = "CLOUDWATCH_LOGS"
102 | destination = null
103 | }
104 | logging_engine_log = {
105 | enabled = false
106 | format = "JSON"
107 |
108 | destination_type = "CLOUDWATCH_LOGS"
109 | destination = null
110 | }
111 |
112 |
113 | ## Attributes
114 | multi_az_enabled = true
115 | auto_failover_enabled = true
116 | apply_immediately = true
117 |
118 | timeouts = {
119 | create = "60m"
120 | update = "40m"
121 | delete = "40m"
122 | }
123 |
124 | tags = {
125 | "project" = "terraform-aws-db-examples"
126 | }
127 | }
128 |
--------------------------------------------------------------------------------
/examples/elasticache-redis-full/outputs.tf:
--------------------------------------------------------------------------------
1 | output "cluster" {
2 | value = module.cluster
3 | }
4 |
--------------------------------------------------------------------------------
/examples/elasticache-redis-full/versions.tf:
--------------------------------------------------------------------------------
1 | terraform {
2 | required_version = "~> 1.5"
3 |
4 | required_providers {
5 | aws = {
6 | source = "hashicorp/aws"
7 | version = "~> 5.0"
8 | }
9 | }
10 | }
11 |
--------------------------------------------------------------------------------
/examples/elasticache-redis-muti-az/main.tf:
--------------------------------------------------------------------------------
1 | provider "aws" {
2 | region = "us-east-1"
3 | }
4 |
5 |
6 | ###################################################
7 | # ElastiCache Redis Cluster
8 | ###################################################
9 |
10 | module "cluster" {
11 | source = "../../modules/elasticache-redis-cluster"
12 | # source = "tedilabs/db/aws//modules/elasticache-redis-cluster"
13 | # version = "~> 0.2.0"
14 |
15 | name = "example-redis-multi-az"
16 | description = "Managed by Terraform."
17 |
18 | redis_version = "6.2"
19 | node_instance_type = "cache.t4g.micro"
20 | node_size = 2
21 |
22 | multi_az_enabled = true
23 | auto_failover_enabled = true
24 |
25 | tags = {
26 | "project" = "terraform-aws-db-examples"
27 | }
28 | }
29 |
--------------------------------------------------------------------------------
/examples/elasticache-redis-muti-az/outputs.tf:
--------------------------------------------------------------------------------
1 | output "cluster" {
2 | value = module.cluster
3 | }
4 |
--------------------------------------------------------------------------------
/examples/elasticache-redis-muti-az/versions.tf:
--------------------------------------------------------------------------------
1 | terraform {
2 | required_version = "~> 1.5"
3 |
4 | required_providers {
5 | aws = {
6 | source = "hashicorp/aws"
7 | version = "~> 5.0"
8 | }
9 | }
10 | }
11 |
--------------------------------------------------------------------------------
/examples/elasticache-redis-single/main.tf:
--------------------------------------------------------------------------------
1 | provider "aws" {
2 | region = "us-east-1"
3 | }
4 |
5 |
6 | ###################################################
7 | # ElastiCache Redis Cluster
8 | ###################################################
9 |
10 | module "cluster" {
11 | source = "../../modules/elasticache-redis-cluster"
12 | # source = "tedilabs/db/aws//modules/elasticache-redis-cluster"
13 | # version = "~> 0.2.0"
14 |
15 | name = "example-redis-single"
16 | description = "Managed by Terraform."
17 |
18 | redis_version = "6.2"
19 | node_instance_type = "cache.t4g.micro"
20 | node_size = 1
21 |
22 | tags = {
23 | "project" = "terraform-aws-db-examples"
24 | }
25 | }
26 |
--------------------------------------------------------------------------------
/examples/elasticache-redis-single/outputs.tf:
--------------------------------------------------------------------------------
1 | output "cluster" {
2 | value = module.cluster
3 | }
4 |
--------------------------------------------------------------------------------
/examples/elasticache-redis-single/versions.tf:
--------------------------------------------------------------------------------
1 | terraform {
2 | required_version = "~> 1.5"
3 |
4 | required_providers {
5 | aws = {
6 | source = "hashicorp/aws"
7 | version = "~> 5.0"
8 | }
9 | }
10 | }
11 |
--------------------------------------------------------------------------------
/examples/elasticache-redis-with-users/main.tf:
--------------------------------------------------------------------------------
1 | provider "aws" {
2 | region = "us-east-1"
3 | }
4 |
5 |
6 | ###################################################
7 | # ElastiCache Redis Cluster
8 | ###################################################
9 |
10 | module "cluster" {
11 | source = "../../modules/elasticache-redis-cluster"
12 | # source = "tedilabs/db/aws//modules/elasticache-redis-cluster"
13 | # version = "~> 0.2.0"
14 |
15 | name = "example-redis-single"
16 | description = "Managed by Terraform."
17 |
18 | redis_version = "6.2"
19 | node_instance_type = "cache.t4g.micro"
20 | node_size = 1
21 |
22 | user_groups = [module.user_group.id]
23 |
24 | encryption_in_transit = {
25 | enabled = true
26 | }
27 |
28 | tags = {
29 | "project" = "terraform-aws-db-examples"
30 | }
31 | }
32 |
33 |
34 | ###################################################
35 | # Redis User Groups on ElastiCache
36 | ###################################################
37 |
38 | module "user_group" {
39 | source = "../../modules/elasticache-redis-user-group"
40 | # source = "tedilabs/db/aws//modules/elasticache-redis-user-group"
41 | # version = "~> 0.2.0"
42 |
43 | name = "example"
44 | default_user = module.user["example-default"].id
45 | users = [module.user["example-admin"].id]
46 |
47 | tags = {
48 | "project" = "terraform-aws-db-examples"
49 | }
50 | }
51 |
52 |
53 | ###################################################
54 | # Redis Users on ElastiCache
55 | ###################################################
56 |
57 | locals {
58 | users = [
59 | {
60 | id = "example-default"
61 | name = "default"
62 |
63 | access_string = "on ~* -@all +@read"
64 | password_required = false
65 | },
66 | {
67 | id = "example-admin"
68 | name = "admin"
69 |
70 | access_string = "on ~* +@all"
71 | password_required = true
72 | passwords = ["MyPassWord!Q@W#E", "MyPassW0rd!@QW#$ER"]
73 | },
74 | ]
75 | }
76 |
77 | module "user" {
78 | source = "../../modules/elasticache-redis-user"
79 | # source = "tedilabs/db/aws//modules/elasticache-redis-user"
80 | # version = "~> 0.2.0"
81 |
82 | for_each = {
83 | for user in try(local.users, []) :
84 | user.id => user
85 | }
86 |
87 | id = each.key
88 | name = each.value.name
89 |
90 | access_string = try(each.value.access_string, null)
91 | password_required = try(each.value.password_required, true)
92 | passwords = try(each.value.passwords, [])
93 |
94 | tags = {
95 | "project" = "terraform-aws-db-examples"
96 | }
97 | }
98 |
--------------------------------------------------------------------------------
/examples/elasticache-redis-with-users/outputs.tf:
--------------------------------------------------------------------------------
1 | output "cluster" {
2 | value = module.cluster
3 | }
4 |
5 | output "user_group" {
6 | value = module.user_group
7 | }
8 |
9 | output "users" {
10 | value = module.user
11 | }
12 |
--------------------------------------------------------------------------------
/examples/elasticache-redis-with-users/versions.tf:
--------------------------------------------------------------------------------
1 | terraform {
2 | required_version = "~> 1.5"
3 |
4 | required_providers {
5 | aws = {
6 | source = "hashicorp/aws"
7 | version = "~> 5.0"
8 | }
9 | }
10 | }
11 |
--------------------------------------------------------------------------------
/modules/elasticache-redis-cluster/README.md:
--------------------------------------------------------------------------------
1 | # elasticache-redis-cluster
2 |
3 | This module creates following resources.
4 |
5 | - `aws_elasticache_replication_group`
6 | - `aws_elasticache_parameter_group` (optional)
7 | - `aws_security_group` (optional)
8 | - `aws_security_group_rule` (optional)
9 |
10 |
11 | ## Requirements
12 |
13 | | Name | Version |
14 | |------|---------|
15 | | [terraform](#requirement\_terraform) | >= 1.3 |
16 | | [aws](#requirement\_aws) | >= 4.36 |
17 |
18 | ## Providers
19 |
20 | | Name | Version |
21 | |------|---------|
22 | | [aws](#provider\_aws) | 4.34.0 |
23 |
24 | ## Modules
25 |
26 | | Name | Source | Version |
27 | |------|--------|---------|
28 | | [resource\_group](#module\_resource\_group) | tedilabs/misc/aws//modules/resource-group | ~> 0.10.0 |
29 | | [security\_group](#module\_security\_group) | tedilabs/network/aws//modules/security-group | ~> 0.26.0 |
30 |
31 | ## Resources
32 |
33 | | Name | Type |
34 | |------|------|
35 | | [aws_elasticache_parameter_group.this](https://registry.terraform.io/providers/hashicorp/aws/latest/docs/resources/elasticache_parameter_group) | resource |
36 | | [aws_elasticache_replication_group.this](https://registry.terraform.io/providers/hashicorp/aws/latest/docs/resources/elasticache_replication_group) | resource |
37 |
38 | ## Inputs
39 |
40 | | Name | Description | Type | Default | Required |
41 | |------|-------------|------|---------|:--------:|
42 | | [name](#input\_name) | (Required) The name of the ElastiCache Redis cluster. This parameter is stored as a lowercase string. | `string` | n/a | yes |
43 | | [node\_instance\_type](#input\_node\_instance\_type) | (Required) The instance type to be deployed for the ElastiCache Redis cluster. | `string` | n/a | yes |
44 | | [apply\_immediately](#input\_apply\_immediately) | (Optional) Whether any modifications are applied immediately, or during the next maintenance window. Default to `false`. | `bool` | `false` | no |
45 | | [auto\_failover\_enabled](#input\_auto\_failover\_enabled) | (Optional) Whether a read-only replica will be automatically promoted to read/write primary if the existing primary fails. If enabled, `node_size` must be greater than 1. Must be enabled for Redis (cluster mode enabled) cluster. Defaults to `false`. ElastiCache Auto Failover provides enhanced high availability through automatic failover to a read replica in case of a primary node failover. | `bool` | `false` | no |
46 | | [auto\_upgrade\_minor\_version\_enabled](#input\_auto\_upgrade\_minor\_version\_enabled) | (Optional) Whether automatically schedule cluster upgrade to the latest minor version, once it becomes available. Cluster upgrade will only be scheduled during the maintenance window. Defaults to `true`. Only supported if the redis version is 6 or higher. | `bool` | `true` | no |
47 | | [backup\_enabled](#input\_backup\_enabled) | (Optional) Whether to automatically create a daily backup of a set of replicas. Defaults to `false`. | `bool` | `false` | no |
48 | | [backup\_final\_snapshot\_name](#input\_backup\_final\_snapshot\_name) | (Optional) The name of your final node group (shard) snapshot. ElastiCache creates the snapshot from the primary node in the cluster. If omitted, no final snapshot will be made. | `string` | `null` | no |
49 | | [backup\_retention](#input\_backup\_retention) | (Optional) The number of days for which automated backups are retained before they are automatically deleted. Valid value is between `1` and `35`. Defaults to 1. | `number` | `1` | no |
50 | | [backup\_window](#input\_backup\_window) | (Optional) The daily time range (in UTC) during which ElastiCache will begin taking a daily snapshot of the ElastiCache Redis cluster. The minimum snapshot window is a 60 minute period. Example: 05:00-09:00. Defaults to `16:00-17:00`. | `string` | `"16:00-17:00"` | no |
51 | | [custom\_parameter\_group](#input\_custom\_parameter\_group) | (Optional) The name of the parameter group to associate with the ElastiCache Redis cluster. If this argument is omitted, the default cache parameter group for the specified engine is used. To enable `cluster mode` (sharding), use a parameter group that has the parameter `cluster-enabled` set to `true`. | `string` | `null` | no |
52 | | [default\_security\_group](#input\_default\_security\_group) | (Optional) The configuration of the default security group for the ElastiCache Redis cluster. `default_security_group` block as defined below.
(Optional) `enabled` - Whether to use the default security group. Defaults to `true`.
(Optional) `name` - The name of the default security group. If not provided, the cluster name is used for the name of security group.
(Optional) `description` - The description of the default security group.
(Optional) `ingress_rules` - A list of ingress rules in a security group. You don't need to specify `protocol`, `from_port`, `to_port`. Just specify source information. Defauls to `[{ cidr_blocks = "0.0.0.0/0" }]`. |
object({| `{}` | no | 53 | | [description](#input\_description) | (Optional) The description of the ElastiCache Redis cluster. | `string` | `"Managed by Terraform."` | no | 54 | | [encryption\_at\_rest](#input\_encryption\_at\_rest) | The configuration for at-rest encryption of the ElastiCache Redis cluster.
enabled = optional(bool, true)
name = optional(string, null)
description = optional(string, "Managed by Terraform.")
ingress_rules = optional(any, [{
cidr_blocks = ["0.0.0.0/0"]
}])
})
object({| `{}` | no | 55 | | [encryption\_in\_transit](#input\_encryption\_in\_transit) | The configuration for in-transit encryption of the ElastiCache Redis cluster.
enabled = optional(bool, false)
kms_key = optional(string, null)
})
object({| `{}` | no | 56 | | [logging\_engine\_log](#input\_logging\_engine\_log) | The configuration for streaming Redis Engine Log of the ElastiCache Redis cluster.
enabled = optional(bool, false)
})
object({| `{}` | no | 57 | | [logging\_slow\_log](#input\_logging\_slow\_log) | The configuration for streaming Redis Slow Log of the ElastiCache Redis cluster.
enabled = optional(bool, false)
format = optional(string, "JSON")
destination_type = optional(string, "CLOUDWATCH_LOGS")
destination = optional(string, null)
})
object({| `{}` | no | 58 | | [maintenance\_window](#input\_maintenance\_window) | (Optional) The weekly time range for when maintenance on the ElastiCache Redis cluster is performed. The format is `ddd:hh24:mi-ddd:hh24:mi` (24H Clock UTC). The minimum maintenance window is a 60 minute period. Example: `sun:05:00-sun:09:00`. Defaults to `fri:18:00-fri:20:00`. | `string` | `"fri:18:00-fri:20:00"` | no | 59 | | [module\_tags\_enabled](#input\_module\_tags\_enabled) | (Optional) Whether to create AWS Resource Tags for the module informations. | `bool` | `true` | no | 60 | | [multi\_az\_enabled](#input\_multi\_az\_enabled) | (Optional) Whether to enable Multi-AZ Support for the ElastiCache Redis cluster. If true, `auto_failover_enabled` must also be enabled. Defaults to `false`. | `bool` | `false` | no | 61 | | [node\_size](#input\_node\_size) | (Optional) The number of cache nodes (primary and replicas) for this ElastiCache Redis cluster will have. If Multi-AZ is enabled, this value must be at least 2. Updates will occur before other modifications. Defaults to `1`. | `number` | `1` | no | 62 | | [notification\_sns\_topic](#input\_notification\_sns\_topic) | (Optional) The ARN of an SNS topic to send ElastiCache notifications to. | `string` | `null` | no | 63 | | [parameter\_group](#input\_parameter\_group) | The configuration for parameter group of the ElastiCache Redis cluster.
enabled = optional(bool, false)
format = optional(string, "JSON")
destination_type = optional(string, "CLOUDWATCH_LOGS")
destination = optional(string, null)
})
object({| `{}` | no | 64 | | [password](#input\_password) | (Optional) Password used to access a password protected ElastiCache Redis cluster. Can be specified only if `encryption_in_transit.enabled` is `true`. | `string` | `""` | no | 65 | | [port](#input\_port) | (Optional) The port number on which each of the cache nodes will accept connections. The default port is `6379`. | `number` | `6379` | no | 66 | | [preferred\_availability\_zones](#input\_preferred\_availability\_zones) | (Optional) A list of AZs(Availability Zones) in which the ElastiCache Redis cluster nodes will be created. The order of the availability zones in the list is considered. The first item in the list will be the primary node. Ignored when updating. | `list(string)` | `[]` | no | 67 | | [redis\_version](#input\_redis\_version) | (Optional) The version number of Redis to be used for each nodes in the ElastiCache Redis cluster. If the version is 6 or higher, the major and minor version can be set, e.g., 6.2, or the minor version can be unspecified which will use the latest version at creation time, e.g., 6.x. Otherwise, specify the full version desired, e.g., 5.0.6. The actual engine version used is returned in the attribute `redis_version_actual`. | `string` | `"7.0"` | no | 68 | | [resource\_group\_description](#input\_resource\_group\_description) | (Optional) The description of Resource Group. | `string` | `"Managed by Terraform."` | no | 69 | | [resource\_group\_enabled](#input\_resource\_group\_enabled) | (Optional) Whether to create Resource Group to find and group AWS resources which are created by this module. | `bool` | `true` | no | 70 | | [resource\_group\_name](#input\_resource\_group\_name) | (Optional) The name of Resource Group. A Resource Group name can have a maximum of 127 characters, including letters, numbers, hyphens, dots, and underscores. The name cannot start with `AWS` or `aws`. | `string` | `""` | no | 71 | | [security\_groups](#input\_security\_groups) | (Optional) A list of security group IDs to assign to the instance. | `list(string)` | `[]` | no | 72 | | [sharding](#input\_sharding) | The configuration for sharding of the ElastiCache Redis cluster.
enabled = optional(bool, true)
name = optional(string, "")
description = optional(string, "")
parameters = optional(map(string), {})
})
object({| `{}` | no | 73 | | [source\_backup\_name](#input\_source\_backup\_name) | (Optional) The name of a snapshot from which to restore data into the new node group. Changing the `source_backup_name` forces a new resource. | `string` | `null` | no | 74 | | [source\_rdb\_s3\_arns](#input\_source\_rdb\_s3\_arns) | (Optional) A list of ARNs that identify Redis RDB snapshot files stored in Amazon S3. The object names cannot contain any commas. | `list(string)` | `[]` | no | 75 | | [subnet\_group](#input\_subnet\_group) | (Optional) The name of the cache subnet group to be used for the ElastiCache Redis cluster. If not provided, configured to use `default` subnet group in the default VPC. | `string` | `null` | no | 76 | | [tags](#input\_tags) | (Optional) A map of tags to add to all resources. | `map(string)` | `{}` | no | 77 | | [timeouts](#input\_timeouts) | (Optional) How long to wait for the instance to be created/updated/deleted. |
enabled = optional(bool, false)
shard_size = optional(number, 3)
replicas = optional(number, 2)
})
object({| `{}` | no | 78 | | [user\_groups](#input\_user\_groups) | (Optional) A set of User Group IDs to associate with the ElastiCache Redis cluster. Only a maximum of one user group ID is valid. The AWS specification allows for multiple IDs, but AWS only allows a maximum size of one. | `set(string)` | `[]` | no | 79 | | [vpc\_id](#input\_vpc\_id) | (Optional) The ID of the associated VPC. You must provide the `vpc_id` when `default_security_group.enabled` is `true`. It will used to provision the default security group. | `string` | `null` | no | 80 | 81 | ## Outputs 82 | 83 | | Name | Description | 84 | |------|-------------| 85 | | [arn](#output\_arn) | The ARN of the ElastiCache Redis cluster. | 86 | | [attributes](#output\_attributes) | A set of attributes that applied to the ElastiCache Redis cluster. | 87 | | [auth](#output\_auth) | The configuration for auth of the ElastiCache Redis cluster.
create = optional(string, "60m")
update = optional(string, "40m")
delete = optional(string, "40m")
})