├── .deepsource.toml ├── .editorconfig ├── .github ├── CODEOWNERS ├── PULL_REQUEST_TEMPLATE.md ├── dependabot.yml └── workflows │ ├── auto_assignee.yml │ ├── automerge.yml │ ├── changelog.yml │ ├── readme.yml │ ├── tf-checks.yml │ ├── tflint.yml │ └── tfsec.yml ├── .gitignore ├── .pre-commit-config.yaml ├── CHANGELOG.md ├── LICENSE ├── Makefile ├── README.md ├── README.yaml ├── docs └── io.md ├── examples ├── memcached │ ├── example.tf │ ├── outputs.tf │ └── versions.tf ├── redis-cluster │ ├── example.tf │ ├── outputs.tf │ └── versions.tf └── redis │ ├── example.tf │ ├── outputs.tf │ └── versions.tf ├── main.tf ├── outputs.tf ├── variables.tf └── versions.tf /.deepsource.toml: -------------------------------------------------------------------------------- 1 | version = 1 2 | 3 | [[analyzers]] 4 | name = "terraform" 5 | -------------------------------------------------------------------------------- /.editorconfig: -------------------------------------------------------------------------------- 1 | # EditorConfig is awesome: http://EditorConfig.org 2 | # Uses editorconfig to maintain consistent coding styles 3 | 4 | # top-most EditorConfig file 5 | root = true 6 | 7 | # Unix-style newlines with a newline ending every file 8 | [*] 9 | charset = utf-8 10 | end_of_line = lf 11 | indent_size = 2 12 | indent_style = space 13 | insert_final_newline = true 14 | max_line_length = 80 15 | trim_trailing_whitespace = true 16 | 17 | [*.{tf,tfvars}] 18 | indent_size = 2 19 | indent_style = space 20 | 21 | [*.md] 22 | max_line_length = 0 23 | trim_trailing_whitespace = false 24 | 25 | [Makefile] 26 | tab_width = 2 27 | indent_style = tab 28 | 29 | [COMMIT_EDITMSG] 30 | max_line_length = 0 31 | -------------------------------------------------------------------------------- /.github/CODEOWNERS: -------------------------------------------------------------------------------- 1 | # These owners will be the default owners for everything in the repo. 2 | * @anmolnagpal @clouddrove/approvers @clouddrove-ci 3 | -------------------------------------------------------------------------------- /.github/PULL_REQUEST_TEMPLATE.md: -------------------------------------------------------------------------------- 1 | ## what 2 | * Describe high-level what changed as a result of these commits (i.e. in plain-english, what do these changes mean?) 3 | * Use bullet points to be concise and to the point. 4 | 5 | ## why 6 | * Provide the justifications for the changes (e.g. business case). 7 | * Describe why these changes were made (e.g. why do these commits fix the problem?) 8 | * Use bullet points to be concise and to the point. 9 | 10 | ## references 11 | * Link to any supporting jira issues or helpful documentation to add some context (e.g. stackoverflow). 12 | * Use `closes #123`, if this PR closes a Jira issue `#123` 13 | -------------------------------------------------------------------------------- /.github/dependabot.yml: -------------------------------------------------------------------------------- 1 | # To get started with Dependabot version updates, you'll need to specify which 2 | # package ecosystems to update and where the package manifests are located. 3 | # Please see the documentation for all configuration options: 4 | # https://docs.github.com/github/administering-a-repository/configuration-options-for-dependency-updates 5 | 6 | version: 2 7 | updates: 8 | - package-ecosystem: "terraform" # See documentation for possible values 9 | directory: "/" # Location of package manifests 10 | schedule: 11 | interval: "weekly" 12 | # Add assignees 13 | assignees: 14 | - "clouddrove-ci" 15 | # Add reviewer 16 | reviewers: 17 | - "approvers" 18 | - package-ecosystem: "terraform" # See documentation for possible values 19 | directory: "examples/memcached" # Location of package manifests 20 | schedule: 21 | interval: "weekly" 22 | # Add assignees 23 | assignees: 24 | - "clouddrove-ci" 25 | # Add reviewer 26 | reviewers: 27 | - "approvers" 28 | - package-ecosystem: "terraform" # See documentation for possible values 29 | directory: "examples/redis" # Location of package manifests 30 | schedule: 31 | interval: "weekly" 32 | # Add assignees 33 | assignees: 34 | - "clouddrove-ci" 35 | # Add reviewer 36 | reviewers: 37 | - "approvers" 38 | - package-ecosystem: "terraform" # See documentation for possible values 39 | directory: "examples/redis-cluster" # Location of package manifests 40 | schedule: 41 | interval: "weekly" 42 | # Add assignees 43 | assignees: 44 | - "clouddrove-ci" 45 | # Add reviewer 46 | reviewers: 47 | - "approvers" 48 | -------------------------------------------------------------------------------- /.github/workflows/auto_assignee.yml: -------------------------------------------------------------------------------- 1 | name: Auto Assign PRs 2 | 3 | on: 4 | pull_request: 5 | types: [opened, reopened] 6 | 7 | workflow_dispatch: 8 | jobs: 9 | assignee: 10 | uses: clouddrove/github-shared-workflows/.github/workflows/auto_assignee.yml@master 11 | secrets: 12 | GITHUB: ${{ secrets.GITHUB }} 13 | with: 14 | assignees: 'clouddrove-ci' 15 | -------------------------------------------------------------------------------- /.github/workflows/automerge.yml: -------------------------------------------------------------------------------- 1 | --- 2 | name: Auto merge 3 | on: 4 | pull_request: 5 | jobs: 6 | auto-merge: 7 | uses: clouddrove/github-shared-workflows/.github/workflows/auto_merge.yml@master 8 | secrets: 9 | GITHUB: ${{ secrets.GITHUB }} 10 | with: 11 | tfcheck: 'redis-cluster / Check code format' 12 | ... 13 | -------------------------------------------------------------------------------- /.github/workflows/changelog.yml: -------------------------------------------------------------------------------- 1 | name: changelog 2 | permissions: write-all 3 | on: 4 | push: 5 | tags: 6 | - "*" 7 | workflow_dispatch: 8 | jobs: 9 | changelog: 10 | uses: clouddrove/github-shared-workflows/.github/workflows/changelog.yml@master 11 | secrets: inherit 12 | with: 13 | branch: 'master' 14 | -------------------------------------------------------------------------------- /.github/workflows/readme.yml: -------------------------------------------------------------------------------- 1 | name: Readme Workflow 2 | on: 3 | push: 4 | branches: 5 | - master 6 | paths-ignore: 7 | - 'README.md' 8 | - 'docs/**' 9 | workflow_dispatch: 10 | jobs: 11 | README: 12 | uses: clouddrove/github-shared-workflows/.github/workflows/readme.yml@master 13 | secrets: 14 | TOKEN : ${{ secrets.GITHUB }} 15 | SLACK_WEBHOOK_TERRAFORM: ${{ secrets.SLACK_WEBHOOK_TERRAFORM }} 16 | -------------------------------------------------------------------------------- /.github/workflows/tf-checks.yml: -------------------------------------------------------------------------------- 1 | name: tf-checks 2 | on: 3 | push: 4 | branches: [ master ] 5 | pull_request: 6 | workflow_dispatch: 7 | jobs: 8 | memcached: 9 | uses: clouddrove/github-shared-workflows/.github/workflows/tf-checks.yml@master 10 | with: 11 | working_directory: './examples/memcached/' 12 | redis: 13 | uses: clouddrove/github-shared-workflows/.github/workflows/tf-checks.yml@master 14 | with: 15 | working_directory: './examples/redis/' 16 | redis-cluster: 17 | uses: clouddrove/github-shared-workflows/.github/workflows/tf-checks.yml@master 18 | with: 19 | working_directory: './examples/redis-cluster/' 20 | -------------------------------------------------------------------------------- /.github/workflows/tflint.yml: -------------------------------------------------------------------------------- 1 | name: tf-lint 2 | on: 3 | push: 4 | branches: [ master ] 5 | pull_request: 6 | workflow_dispatch: 7 | jobs: 8 | tf-lint: 9 | uses: clouddrove/github-shared-workflows/.github/workflows/tf-lint.yml@master 10 | secrets: 11 | GITHUB: ${{ secrets.GITHUB }} -------------------------------------------------------------------------------- /.github/workflows/tfsec.yml: -------------------------------------------------------------------------------- 1 | name: tfsec 2 | permissions: write-all 3 | on: 4 | pull_request: 5 | workflow_dispatch: 6 | jobs: 7 | tfsec: 8 | uses: clouddrove/github-shared-workflows/.github/workflows/tfsec.yml@master 9 | secrets: inherit 10 | with: 11 | working_directory: '.' 12 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | # ignored files 2 | *~ 3 | 4 | # temporary files which can be created if a process still has a handle open of a deleted file 5 | .fuse_hidden* 6 | 7 | # KDE directory preferences 8 | .directory 9 | 10 | # Linux trash folder which might appear on any partition or disk 11 | .Trash-* 12 | 13 | # .nfs files are created when an open file is removed but is still being accessed 14 | .nfs* 15 | ### Eclipse template 16 | 17 | .metadata 18 | bin/ 19 | tmp/ 20 | *.tmp 21 | *.bak 22 | *.swp 23 | *~.nib 24 | local.properties 25 | .settings/ 26 | .loadpath 27 | .recommenders 28 | 29 | # External tool builders 30 | .externalToolBuilders/ 31 | 32 | # Locally stored "Eclipse launch configurations" 33 | *.launch 34 | 35 | # PyDev specific (Python IDE for Eclipse) 36 | *.pydevproject 37 | 38 | # CDT-specific (C/C++ Development Tooling) 39 | .cproject 40 | 41 | # Java annotation processor (APT) 42 | .factorypath 43 | 44 | # PDT-specific (PHP Development Tools) 45 | .buildpath 46 | 47 | # sbteclipse plugin 48 | .target 49 | 50 | # Tern plugin 51 | .tern-project 52 | 53 | # TeXlipse plugin 54 | .texlipse 55 | 56 | # STS (Spring Tool Suite) 57 | .springBeans 58 | 59 | # Code Recommenders 60 | .recommenders/ 61 | 62 | # Scala IDE specific (Scala & Java development for Eclipse) 63 | .cache-main 64 | .scala_dependencies 65 | .worksheet 66 | ### Windows template 67 | # Windows thumbnail cache files 68 | Thumbs.db 69 | ehthumbs.db 70 | ehthumbs_vista.db 71 | 72 | # Dump file 73 | *.stackdump 74 | 75 | # Folder config file 76 | [Dd]esktop.ini 77 | 78 | # Recycle Bin used on file shares 79 | $RECYCLE.BIN/ 80 | 81 | # Windows Installer files 82 | *.cab 83 | *.msi 84 | *.msm 85 | *.msp 86 | 87 | # Windows shortcuts 88 | *.lnk 89 | ### Ansible template 90 | *.retry 91 | ### macOS template 92 | # General 93 | .DS_Store 94 | .AppleDouble 95 | .LSOverride 96 | 97 | # Icon must end with two \r 98 | Icon 99 | 100 | # Thumbnails 101 | ._* 102 | 103 | # Files that might appear in the root of a volume 104 | .DocumentRevisions-V100 105 | .fseventsd 106 | .Spotlight-V100 107 | .TemporaryItems 108 | .Trashes 109 | .VolumeIcon.icns 110 | .com.apple.timemachine.donotpresent 111 | 112 | # Directories potentially created on remote AFP share 113 | .AppleDB 114 | .AppleDesktop 115 | Network Trash Folder 116 | Temporary Items 117 | .apdisk 118 | ### Archives template 119 | # It's better to unpack these files and commit the raw source because 120 | # git has its own built in compression methods. 121 | *.7z 122 | *.jar 123 | *.rar 124 | *.zip 125 | *.gz 126 | *.tgz 127 | *.bzip 128 | *.bz2 129 | *.xz 130 | *.lzma 131 | *.cab 132 | 133 | # Packing-only formats 134 | *.iso 135 | *.tar 136 | 137 | # Package management formats 138 | *.dmg 139 | *.xpi 140 | *.gem 141 | *.egg 142 | *.deb 143 | *.rpm 144 | *.msi 145 | *.msm 146 | *.msp 147 | ### JetBrains template 148 | # Covers JetBrains IDEs: IntelliJ, RubyMine, PhpStorm, AppCode, PyCharm, CLion, Android Studio and Webstorm 149 | # Reference: https://intellij-support.jetbrains.com/hc/en-us/articles/206544839 150 | 151 | /.idea/ 152 | # User-specific stuff: 153 | .idea/**/workspace.xml 154 | .idea/**/tasks.xml 155 | .idea/dictionaries 156 | 157 | # Sensitive or high-churn files: 158 | .idea/**/dataSources/ 159 | .idea/**/dataSources.ids 160 | .idea/**/dataSources.xml 161 | .idea/**/dataSources.local.xml 162 | .idea/**/sqlDataSources.xml 163 | .idea/**/dynamic.xml 164 | .idea/**/uiDesigner.xml 165 | 166 | # Gradle: 167 | .idea/**/gradle.xml 168 | .idea/**/libraries 169 | 170 | # CMake 171 | cmake-build-debug/ 172 | 173 | # Mongo Explorer plugin: 174 | .idea/**/mongoSettings.xml 175 | 176 | ## File-based project format: 177 | *.iws 178 | 179 | ## Plugin-specific files: 180 | 181 | # IntelliJ 182 | out/ 183 | 184 | # mpeltonen/sbt-idea plugin 185 | .idea_modules/ 186 | # User-specific stuff: 187 | .idea/* 188 | # JIRA plugin 189 | atlassian-ide-plugin.xml 190 | 191 | # Cursive Clojure plugin 192 | .idea/replstate.xml 193 | 194 | # TFstste 195 | *.tfstate* 196 | 197 | deployment/_logs/ansible-log.json 198 | deployment/_logs/ansible-log.log 199 | deployment/_logs/facts/* 200 | deployment/_logs/retry/* 201 | _app/* 202 | ansible-log.json 203 | .terraform 204 | terraform.tfstate 205 | 206 | *.tfstate 207 | *.tfstate.backup 208 | *.iml 209 | *.terraform.lock.hcl 210 | *.lock.hcl 211 | -------------------------------------------------------------------------------- /.pre-commit-config.yaml: -------------------------------------------------------------------------------- 1 | repos: 2 | 3 | - repo: https://github.com/gruntwork-io/pre-commit 4 | rev: v0.1.12 # Get the latest from: https://github.com/gruntwork-io/pre-commit/releases 5 | hooks: 6 | - id: terraform-fmt 7 | - id: shellcheck 8 | - id: tflint 9 | 10 | - repo: git://github.com/pre-commit/pre-commit-hooks 11 | rev: v4.0.1 # Use the ref you want to point at 12 | hooks: 13 | - id: end-of-file-fixer 14 | - id: trailing-whitespace 15 | - id: mixed-line-ending 16 | - id: check-byte-order-marker 17 | - id: check-executables-have-shebangs 18 | - id: check-merge-conflict 19 | - id: debug-statements 20 | - id: check-yaml 21 | - id: check-added-large-files 22 | -------------------------------------------------------------------------------- /CHANGELOG.md: -------------------------------------------------------------------------------- 1 | # Changelog 2 | All notable changes to this project will be documented in this file. 3 | 4 | The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), 5 | and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). 6 | 7 | ## [2.0.1] - 2023-09-06 8 | ### :sparkles: New Features 9 | - [`2cf4567`](https://github.com/clouddrove/terraform-aws-elasticache/commit/2cf45679cfea7af4ff2f03dec5af7b7f0933f710) - added new vpc tag *(commit by [@theprashantyadav](https://github.com/theprashantyadav))* 10 | - [`41613e6`](https://github.com/clouddrove/terraform-aws-elasticache/commit/41613e6fdfc838c68deae1dd129fd4990916a145) - added version.tf in example *(commit by [@theprashantyadav](https://github.com/theprashantyadav))* 11 | - [`7cccf78`](https://github.com/clouddrove/terraform-aws-elasticache/commit/7cccf7891f77866e900950b4b153b5b3c531e824) - added version.tf in example *(commit by [@theprashantyadav](https://github.com/theprashantyadav))* 12 | - [`25246da`](https://github.com/clouddrove/terraform-aws-elasticache/commit/25246da8a8ad9eacb51cfcf306371a892cbf0f41) - added version.tf in example *(commit by [@theprashantyadav](https://github.com/theprashantyadav))* 13 | - [`59b4d1b`](https://github.com/clouddrove/terraform-aws-elasticache/commit/59b4d1b62beeb7f0a05134cdf5fa2a3408914b00) - Added the random password resource block to genrate the auth token *(commit by [@test-vaibhav](https://github.com/test-vaibhav))* 14 | 15 | ### :bug: Bug Fixes 16 | - [`3d26d69`](https://github.com/clouddrove/terraform-aws-elasticache/commit/3d26d69dbcaa8ae2067c44d599a1b1338123b23a) - Removed the unwanted commits *(commit by [@vaibhav7797](https://github.com/vaibhav7797))* 17 | - [`ca0d035`](https://github.com/clouddrove/terraform-aws-elasticache/commit/ca0d03556ea7c81e06f72c3818229ebce3d5d99f) - fix the tf code format by running terraform fmt *(commit by [@vaibhav7797](https://github.com/vaibhav7797))* 18 | - [`a7f5aec`](https://github.com/clouddrove/terraform-aws-elasticache/commit/a7f5aecd1038bb4000e373faba47bbf89a04a82a) - Updated the random_password resource with variables and change the example file names main.tf -> example.tf *(commit by [@vaibhav7797](https://github.com/vaibhav7797))* 19 | - [`6fec54b`](https://github.com/clouddrove/terraform-aws-elasticache/commit/6fec54b5cc79f5a8bad28ca128ffa341c7423f1c) - Removed the unused variable *(commit by [@vaibhav7797](https://github.com/vaibhav7797))* 20 | 21 | ### :memo: Documentation Changes 22 | - [`cbd18d4`](https://github.com/clouddrove/terraform-aws-elasticache/commit/cbd18d457f2cec2bc041600c23fe05af4d14a92a) - update CHANGELOG.md for 2.0.0 *(commit by [@clouddrove-ci](https://github.com/clouddrove-ci))* 23 | 24 | 25 | ## [2.0.0] - 2023-06-19 26 | ### :sparkles: New Features 27 | - [`9ca888d`](https://github.com/clouddrove/terraform-aws-elasticache/commit/9ca888d1c01f6d1f45928e44f04edc69c9b10c2b) - auto changelog action added and _example main.tf updated *(commit by [@mamrajyadav](https://github.com/mamrajyadav))* 28 | - [`9f450d2`](https://github.com/clouddrove/terraform-aws-elasticache/commit/9f450d2d11a5d1da7587bc0767ab7eb5df2aeb77) - added dependabot.yml file *(commit by [@mamrajyadav](https://github.com/mamrajyadav))* 29 | - [`d46e96a`](https://github.com/clouddrove/terraform-aws-elasticache/commit/d46e96a64de6f7bcf847a94bcd39692f78217c29) - auto changelog action added and _example main.tf updated *(commit by [@mamrajyadav](https://github.com/mamrajyadav))* 30 | - [`d447dd3`](https://github.com/clouddrove/terraform-aws-elasticache/commit/d447dd33c3f91f7a9e4e2a10b3b60a36573db910) - added kms module and update module *(commit by [@theprashantyadav](https://github.com/theprashantyadav))* 31 | - [`d6e181b`](https://github.com/clouddrove/terraform-aws-elasticache/commit/d6e181bea6dc667ce181bb6ddacb6f4c5a87e0db) - added kms module and update module *(commit by [@theprashantyadav](https://github.com/theprashantyadav))* 32 | - [`c1d5f84`](https://github.com/clouddrove/terraform-aws-elasticache/commit/c1d5f847b219442b75d0dbf8f6a1d9a96ceba24b) - added kms module and update module *(commit by [@theprashantyadav](https://github.com/theprashantyadav))* 33 | - [`f96fd99`](https://github.com/clouddrove/terraform-aws-elasticache/commit/f96fd998441e1b23c3333511f2d471bff0ae1c83) - "add deepsource & added assignees,reviewer in dependabot " *(commit by [@Tanveer143s](https://github.com/Tanveer143s))* 34 | - [`9c04448`](https://github.com/clouddrove/terraform-aws-elasticache/commit/9c04448c4aa109c43a03ec869ebe78961df9648e) - add deepsource & added assignees,reviewer in dependabot *(commit by [@Tanveer143s](https://github.com/Tanveer143s))* 35 | - [`1b53d4e`](https://github.com/clouddrove/terraform-aws-elasticache/commit/1b53d4e1b78aebbfa88ad50e43fab36d2392d573) - update and added resource description *(commit by [@anmolnagpal](https://github.com/anmolnagpal))* 36 | - [`ff0a764`](https://github.com/clouddrove/terraform-aws-elasticache/commit/ff0a764344accd989f1b3b9e6ffc5ef87bcadf64) - update and added resource description *(commit by [@anmolnagpal](https://github.com/anmolnagpal))* 37 | - [`29384c0`](https://github.com/clouddrove/terraform-aws-elasticache/commit/29384c02859e0f89117a5470b27da21a141dfc3c) - update and added resource description *(commit by [@anmolnagpal](https://github.com/anmolnagpal))* 38 | - [`945832d`](https://github.com/clouddrove/terraform-aws-elasticache/commit/945832d6a8d106be1f56c4312da712e8f38e1e5a) - update and added resource description *(commit by [@anmolnagpal](https://github.com/anmolnagpal))* 39 | - [`a8e02ec`](https://github.com/clouddrove/terraform-aws-elasticache/commit/a8e02ecdcfbe4deb32b577ea401f7d6d54c5e87a) - update and added resource description *(commit by [@anmolnagpal](https://github.com/anmolnagpal))* 40 | - [`b9b1b1e`](https://github.com/clouddrove/terraform-aws-elasticache/commit/b9b1b1e8b5e9cca6e8419daceaa75fd71bd3a89c) - update and added resource description *(commit by [@anmolnagpal](https://github.com/anmolnagpal))* 41 | - [`65c85ef`](https://github.com/clouddrove/terraform-aws-elasticache/commit/65c85ef2246968c760f8a5b48aa7caafc43c3534) - update and added resource description *(commit by [@anmolnagpal](https://github.com/anmolnagpal))* 42 | - [`dce80c6`](https://github.com/clouddrove/terraform-aws-elasticache/commit/dce80c6116bde84e2e8cfa6f0dd06f18ce41a874) - update and added resource description *(commit by [@anmolnagpal](https://github.com/anmolnagpal))* 43 | - [`3051bcc`](https://github.com/clouddrove/terraform-aws-elasticache/commit/3051bcc1667b486193803981551b84d3ec8054e8) - update readme.yaml *(commit by [@anmolnagpal](https://github.com/anmolnagpal))* 44 | - [`d88cfde`](https://github.com/clouddrove/terraform-aws-elasticache/commit/d88cfde014cee5ee126fb452706627315f462d54) - update value route-53 *(commit by [@anmolnagpal](https://github.com/anmolnagpal))* 45 | - [`85f0d25`](https://github.com/clouddrove/terraform-aws-elasticache/commit/85f0d25e522910c94c2c9f0a14deb7fb8a7b192c) - update value route-53 *(commit by [@anmolnagpal](https://github.com/anmolnagpal))* 46 | - [`e89ccdd`](https://github.com/clouddrove/terraform-aws-elasticache/commit/e89ccdd03b92daa0dccfcf8bdbc9a9ba8e96b687) - update value route-53 *(commit by [@anmolnagpal](https://github.com/anmolnagpal))* 47 | - [`d80101b`](https://github.com/clouddrove/terraform-aws-elasticache/commit/d80101bc5db03e3a6ae532d0f9bb551d8c2a44a2) - update value route-53 *(commit by [@anmolnagpal](https://github.com/anmolnagpal))* 48 | - [`bdee82e`](https://github.com/clouddrove/terraform-aws-elasticache/commit/bdee82e635251dd69f2aea3367302bbb0d33e57f) - added sg description *(commit by [@anmolnagpal](https://github.com/anmolnagpal))* 49 | - [`ec5239d`](https://github.com/clouddrove/terraform-aws-elasticache/commit/ec5239dc9262d0964829d1a19ba211c6e73244e9) - added sg description *(commit by [@anmolnagpal](https://github.com/anmolnagpal))* 50 | - [`54c817a`](https://github.com/clouddrove/terraform-aws-elasticache/commit/54c817acd8621f738c28f585acdf43cb5d702200) - added sg description *(commit by [@anmolnagpal](https://github.com/anmolnagpal))* 51 | - [`3105e30`](https://github.com/clouddrove/terraform-aws-elasticache/commit/3105e30c4cbf37281683c22ec2129f4420f714e7) - added sg description *(commit by [@anmolnagpal](https://github.com/anmolnagpal))* 52 | - [`c8d6088`](https://github.com/clouddrove/terraform-aws-elasticache/commit/c8d608824b2ff18bf8b2ff22e967f400a011f382) - added sg description *(commit by [@anmolnagpal](https://github.com/anmolnagpal))* 53 | - [`c244c45`](https://github.com/clouddrove/terraform-aws-elasticache/commit/c244c457e6a51e872e3c2fbae7fb3085f3d0c15c) - added sg description *(commit by [@anmolnagpal](https://github.com/anmolnagpal))* 54 | - [`cd65a47`](https://github.com/clouddrove/terraform-aws-elasticache/commit/cd65a477b9beed6f27dd7fb608071ed085f9163a) - added sg description *(commit by [@anmolnagpal](https://github.com/anmolnagpal))* 55 | - [`e8c4286`](https://github.com/clouddrove/terraform-aws-elasticache/commit/e8c4286ecbb0a1130255646f919ae152cab8d7ec) - added sg description *(commit by [@anmolnagpal](https://github.com/anmolnagpal))* 56 | - [`09cc74c`](https://github.com/clouddrove/terraform-aws-elasticache/commit/09cc74c02f7446f55cccbfc696fa977e6d16ec44) - added sg description *(commit by [@anmolnagpal](https://github.com/anmolnagpal))* 57 | - [`5862485`](https://github.com/clouddrove/terraform-aws-elasticache/commit/586248531dc26fa9a2ea429776f48a804d884e15) - added sg description *(commit by [@anmolnagpal](https://github.com/anmolnagpal))* 58 | - [`2c325f4`](https://github.com/clouddrove/terraform-aws-elasticache/commit/2c325f4f26bec988a87a1de59e69fadfcc938533) - added sg description *(commit by [@anmolnagpal](https://github.com/anmolnagpal))* 59 | - [`f22dbb2`](https://github.com/clouddrove/terraform-aws-elasticache/commit/f22dbb24fd7860395b7e2dc69580fe40950fb69e) - added sg description *(commit by [@anmolnagpal](https://github.com/anmolnagpal))* 60 | - [`00bcc96`](https://github.com/clouddrove/terraform-aws-elasticache/commit/00bcc96ed9df33cc85c21ca5a3559429db1ad126) - added sg description *(commit by [@anmolnagpal](https://github.com/anmolnagpal))* 61 | - [`04d4b04`](https://github.com/clouddrove/terraform-aws-elasticache/commit/04d4b04fa2196a76bd7bd4dfa5e3dd512d31206c) - added sg description *(commit by [@anmolnagpal](https://github.com/anmolnagpal))* 62 | - [`5a0cf3a`](https://github.com/clouddrove/terraform-aws-elasticache/commit/5a0cf3adf82b174ff4bd1caff1202bd33443a212) - added sg description *(commit by [@anmolnagpal](https://github.com/anmolnagpal))* 63 | - [`9b1ade1`](https://github.com/clouddrove/terraform-aws-elasticache/commit/9b1ade172c8b4803d1fee252afb26c40b1446d22) - added sg description *(commit by [@anmolnagpal](https://github.com/anmolnagpal))* 64 | - [`866a803`](https://github.com/clouddrove/terraform-aws-elasticache/commit/866a803328297b873cf16ba28c7a8fa5594100f6) - added sg description *(commit by [@anmolnagpal](https://github.com/anmolnagpal))* 65 | - [`072bcf0`](https://github.com/clouddrove/terraform-aws-elasticache/commit/072bcf0b43f4fa3c2f67557eaccfc2227fe25d5e) - added outputs ssm and route-53 *(commit by [@anmolnagpal](https://github.com/anmolnagpal))* 66 | - [`82501f2`](https://github.com/clouddrove/terraform-aws-elasticache/commit/82501f22b512d79e3651794e917551a466514087) - added outputs ssm and route-53 *(commit by [@anmolnagpal](https://github.com/anmolnagpal))* 67 | - [`28718b4`](https://github.com/clouddrove/terraform-aws-elasticache/commit/28718b45836face2f1d91e28e20d8c6b142adf65) - added outputs ssm and route-53 *(commit by [@anmolnagpal](https://github.com/anmolnagpal))* 68 | 69 | 70 | ## [1.0.4] - 2023-04-05 71 | ### :bug: Bug Fixes 72 | - [`019d7dd`](https://github.com/clouddrove/terraform-aws-elasticache/commit/019d7dd7daae3b49a1a24e94adf7f56c657ffdc6) - updated deprecated variables 73 | - [`55d833a`](https://github.com/clouddrove/terraform-aws-elasticache/commit/55d833a0fac8420284db0a06379c750b215d511a) - update workflows 74 | 75 | ## [1.0.3] - 2022-09-16 76 | ### :bug: Bug Fixes 77 | - [`72c7b9f`](https://github.com/clouddrove/terraform-aws-elasticache/commit/72c7b9f70a3e9dfe5a6d1e41535575cbc2cb6668) - added arn outputs for redis/memcache 78 | 79 | ## [1.0.2] - 2022-08-18 80 | ### :sparkles: New Features 81 | - [`93a2d36`](https://github.com/clouddrove/terraform-aws-elasticache/commit/93a2d36bc8dc8e153f04b4b286143c6fe7ecb940) - added retention_in_days 82 | 83 | 84 | ## [1.0.1] - 2022-05-19 85 | ### :sparkles: New Features 86 | - [`272aa17`](https://github.com/clouddrove/terraform-aws-elasticache/commit/272aa17ab7d4a038cf0e37ebd7d1abf25c30095d) - add cloudwatch_log_group and enabled redis logs 87 | 88 | ## [0.15.1] - 2021-12-03 89 | ### :bug: Bug Fixes 90 | - [`41eb6a8`](https://github.com/clouddrove/terraform-aws-elasticache/commit/41eb6a841f205e5c15ebccec260e8aabcbb3988c) - update version 91 | - [`6157bfa`](https://github.com/clouddrove/terraform-aws-elasticache/commit/6157bfa79ca7a3a607daacac9e8fbfe385c03813) - update github-action 92 | 93 | 94 | ## [0.12.7] - 2021-08-17 95 | 96 | ## [0.15.0] - 2021-01-24 97 | ### :bug: Bug Fixes 98 | - [`c5f7937`](https://github.com/clouddrove/terraform-aws-elasticache/commit/c5f7937cfc2215201c2f9d8a035b9de96139cd89) - added extra_tags variable for custom tags 99 | - [`6405934`](https://github.com/clouddrove/terraform-aws-elasticache/commit/640593463a0c125818ed536da31be5e8180dca98) - update example.tf and added coustom tags with tag variable 100 | - [`f2076be`](https://github.com/clouddrove/terraform-aws-elasticache/commit/f2076be7d25a2d757d10841f49100888e0a1bd36) - fix terratest 101 | - [`1a9f237`](https://github.com/clouddrove/terraform-aws-elasticache/commit/1a9f2375e111d41ad63062223eb53afd5a669a4d) - fix terratest 102 | 103 | ## [0.14.0] - 2021-05-10 104 | ### :bug: Bug Fixes 105 | - [`9d3aea3`](https://github.com/clouddrove/terraform-aws-elasticache/commit/9d3aea30030b2a5e59a8e44163477eb416690ef5) - upgrade redis version in example 106 | - [`eef1a37`](https://github.com/clouddrove/terraform-aws-elasticache/commit/eef1a37695dce7012188f9e919de0626ca780117) - upgrade terraform version 0.15 107 | 108 | ## [0.13.0] - 2020-20-23 109 | ### :bug: Bug Fixes 110 | - [`85acad0`](https://github.com/clouddrove/terraform-aws-elasticache/commit/85acad025ecdcb09520ba534cf9ed76c3424411f) - snapshot_retention_limit 111 | - [`3c7cd8a`](https://github.com/clouddrove/terraform-aws-elasticache/commit/3c7cd8aa922f0d83552ba34f4e46b9a91c4533e9) - fix the security bugs 112 | - [`0f9e401`](https://github.com/clouddrove/terraform-aws-elasticache/commit/0f9e401c990bfdf346ebfdde8fed91bd5e51a335) - Upgrade terraform version to 0.14 and update 113 | - [`dda84e7`](https://github.com/clouddrove/terraform-aws-elasticache/commit/dda84e77616114c7120000955d1fd960475b30e8) - precommit updated 114 | 115 | ## [0.12.6] - 2020-06-10 116 | ### :bug: Bug Fixes 117 | - [`03ab463`](https://github.com/clouddrove/terraform-aws-elasticache/commit/03ab463cd2e94cba60ff796a037c967c39bd2b97) - terraform.yml changes 118 | - [`4b5613a`](https://github.com/clouddrove/terraform-aws-elasticache/commit/4b5613aacb419cde8ba7a994578c5847a8dd79a4) - upgrade terrafomr to 0.13 119 | 120 | ## [0.12.5] - 2020-05-25 121 | ### :sparkles: New Features 122 | - [`7295372`](https://github.com/clouddrove/terraform-aws-elasticache/commit/72953724964b3890f53ed09cb959d2e1963cabc1) - add kms for encryption 123 | 124 | ## [0.12.4] - 2020-03-30 125 | ### :bug: Bug Fixes 126 | - [`5af4c3d`](https://github.com/clouddrove/terraform-aws-elasticache/commit/5af4c3dc475fe8699f61d4d4984d73dbe738066e) - create variable for description 127 | - [`dbad321`](https://github.com/clouddrove/terraform-aws-elasticache/commit/dbad321e2b42942b866ca278f740de205d502adb) - Split endpoint to redis_endpoint_address and memcached_endpoint_address 128 | - [`d8ffe30`](https://github.com/clouddrove/terraform-aws-elasticache/commit/d8ffe304d87caed73d18dd8195d393dbf5f0f5eb) - Add endpoint address 129 | 130 | ## [0.12.3] - 2020-01-23 131 | ### :bug: Bug Fixes 132 | - [`50ee184`](https://github.com/clouddrove/terraform-aws-elasticache/commit/50ee184da31b10caccde1608a4219c1fb98a48f2) - fix labels managedby variables 133 | 134 | ## [0.12.2] - 2019-12-30 135 | ### :bug: Bug Fixes 136 | - [`3fdc09a`](https://github.com/clouddrove/terraform-aws-elasticache/commit/3fdc09aa401b09129bafbb88c10e64c149f52b43) - add bool option 137 | 138 | ## [0.12.1] - 2019-09-24 139 | ### :bug: Bug Fixes 140 | - [`aafb837`](https://github.com/clouddrove/terraform-aws-elasticache/commit/aafb8370afe4e4c3f9b914d77e61b2a86b2c456d) - github action 141 | 142 | ## [0.12.0] - 2019-09-12 143 | ### :bug: Bug Fixes 144 | - [`e3a1d17`](https://github.com/clouddrove/terraform-aws-elasticache/commit/e3a1d171cbec5d78b69f662497cad25a8c9f4d30) - change output syntax 145 | 146 | 147 | [0.12.0]: https://github.com/clouddrove/terraform-aws-elasticache/compare/0.12.0...master 148 | [0.12.1]: https://github.com/clouddrove/terraform-aws-elasticache/compare/0.12.1...master 149 | [0.12.2]: https://github.com/clouddrove/terraform-aws-elasticache/compare/0.12.2...master 150 | [0.12.3]: https://github.com/clouddrove/terraform-aws-elasticache/compare/0.12.3...master 151 | [0.12.4]: https://github.com/clouddrove/terraform-aws-elasticache/compare/0.12.4...master 152 | [0.12.5]: https://github.com/clouddrove/terraform-aws-elasticache/compare/0.12.5...master 153 | [0.12.6]: https://github.com/clouddrove/terraform-aws-elasticache/compare/0.12.6...master 154 | [0.13.0]: https://github.com/clouddrove/terraform-aws-elasticache/compare/0.13.0...master 155 | [0.14.0]: https://github.com/clouddrove/terraform-aws-elasticache/compare/0.14.0...master 156 | [0.15.0]: https://github.com/clouddrove/terraform-aws-elasticache/compare/0.15.0...master 157 | [0.12.7]: https://github.com/clouddrove/terraform-aws-elasticache/releases/tag/0.12.7 158 | [0.15.1]: https://github.com/clouddrove/terraform-aws-elasticache/compare/0.15.1...master 159 | [1.0.1]: https://github.com/clouddrove/terraform-aws-elasticache/compare/1.0.1...master 160 | [1.0.2]: https://github.com/clouddrove/terraform-aws-elasticache/compare/1.0.2...master 161 | [1.0.3]: https://github.com/clouddrove/terraform-aws-elasticache/compare/1.0.3...master 162 | [1.0.4]: https://github.com/clouddrove/terraform-aws-elasticache/compare/1.0.4...master 163 | 164 | 165 | [2.0.0]: https://github.com/clouddrove/terraform-aws-elasticache/compare/1.0.4...2.0.0 166 | [2.0.1]: https://github.com/clouddrove/terraform-aws-elasticache/compare/2.0.0...2.0.1 -------------------------------------------------------------------------------- /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 2021 CloudDrove Inc. 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 | -------------------------------------------------------------------------------- /Makefile: -------------------------------------------------------------------------------- 1 | export GENIE_PATH ?= $(shell 'pwd')/../../../genie 2 | 3 | include $(GENIE_PATH)/Makefile 4 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | 2 | [][website] 3 |
8 | With our comprehensive DevOps toolkit - streamline operations, automate workflows, enhance collaboration and, most importantly, deploy with confidence. 9 |
10 | 11 | 12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
23 |
24 |
25 |
26 |
27 |
28 |
30 |
31 |
32 |
33 |
34 |
35 |
36 |
37 |
38 |
39 |
40 |
41 |
42 |
43 |
44 |
We are The Cloud Experts!
181 |We ❤️ Open Source and you can check out our other modules to get help with your new Cloud ideas.
183 | 184 | [website]: https://clouddrove.com 185 | [blog]: https://blog.clouddrove.com 186 | [slack]: https://www.launchpass.com/devops-talks 187 | [github]: https://github.com/clouddrove 188 | [linkedin]: https://cpco.io/linkedin 189 | [twitter]: https://twitter.com/clouddrove/ 190 | [email]: https://clouddrove.com/contact-us.html 191 | [terraform_modules]: https://github.com/clouddrove?utf8=%E2%9C%93&q=terraform-&type=&language= 192 | -------------------------------------------------------------------------------- /README.yaml: -------------------------------------------------------------------------------- 1 | --- 2 | # 3 | # This is the canonical configuration for the `README.md` 4 | # Run `make readme` to rebuild the `README.md` 5 | # 6 | 7 | # Name of this project 8 | name: Terraform AWS Elasticache 9 | 10 | # License of this project 11 | license: "APACHE" 12 | 13 | # Canonical GitHub repo 14 | github_repo: clouddrove/terraform-aws-elasticache 15 | 16 | # Badges to display 17 | badges: 18 | - name: "Latest Release" 19 | image: "https://img.shields.io/github/release/clouddrove/terraform-aws-elasticache.svg" 20 | url: "https://github.com/clouddrove/terraform-aws-elasticache/releases/latest" 21 | - name: "tfsec" 22 | image: "https://github.com/clouddrove/terraform-aws-elasticache/actions/workflows/tfsec.yml/badge.svg" 23 | url: "https://github.com/clouddrove/terraform-aws-elasticache/actions/workflows/tfsec.yml" 24 | - name: "Licence" 25 | image: "https://img.shields.io/badge/License-APACHE-blue.svg" 26 | url: "LICENSE.md" 27 | - name: "Changelog" 28 | image: "https://img.shields.io/badge/Changelog-blue" 29 | url: "CHANGELOG.md" 30 | 31 | prerequesties: 32 | - name: Terraform 33 | url: https://learn.hashicorp.com/terraform/getting-started/install.html 34 | version: ">= 1.6.5" 35 | 36 | providers: 37 | - name: aws 38 | url: https://aws.amazon.com/ 39 | version: ">= 5.31.0" 40 | 41 | module_dependencies: 42 | - name: Labels Module 43 | url: https://github.com/clouddrove/terraform-aws-labels 44 | description: Provides resource tagging. 45 | # description of this project 46 | description: |- 47 | Terraform module to create Elasticache Cluster and replica for Redis and Memcache. 48 | 49 | # extra content 50 | include: 51 | - "terraform.md" 52 | 53 | # How to use this project 54 | # How to use this project 55 | usage : |- 56 | Here are some examples of how you can use this module in your inventory structure: 57 | ### Redis 58 | ```hcl 59 | module "redis" { 60 | source = "clouddrove/elasticache/aws 61 | version = "1.3.0" 62 | 63 | name = "redis" 64 | environment = "test" 65 | label_order = ["name", "environment"] 66 | 67 | vpc_id = module.vpc.vpc_id 68 | allowed_ip = [module.vpc.vpc_cidr_block] 69 | allowed_ports = [6379] 70 | 71 | cluster_replication_enabled = true 72 | engine = "redis" 73 | engine_version = "7.0" 74 | parameter_group_name = "default.redis7" 75 | port = 6379 76 | node_type = "cache.t2.micro" 77 | subnet_ids = module.subnets.public_subnet_id 78 | availability_zones = [""] 79 | automatic_failover_enabled = false 80 | multi_az_enabled = false 81 | num_cache_clusters = 1 82 | retention_in_days = 0 83 | snapshot_retention_limit = 7 84 | 85 | log_delivery_configuration = [ 86 | { 87 | destination_type = "cloudwatch-logs" 88 | log_format = "json" 89 | log_type = "slow-log" 90 | }, 91 | { 92 | destination_type = "cloudwatch-logs" 93 | log_format = "json" 94 | log_type = "engine-log" 95 | } 96 | ] 97 | extra_tags = { 98 | Application = "CloudDrove" 99 | } 100 | route53_record_enabled = true 101 | ssm_parameter_endpoint_enabled = true 102 | dns_record_name = "prod" 103 | route53_ttl = "300" 104 | route53_type = "CNAME" 105 | route53_zone_id = "Z017xxxxDLxxx0GH04" 106 | } 107 | 108 | ``` 109 | ### Redis Cluster 110 | ```hcl 111 | module "redis-cluster" { 112 | source = "clouddrove/elasticache/aws 113 | version = "1.3.0" 114 | 115 | name = "redis-cluster" 116 | environment = "test" 117 | label_order = ["environment", "name"] 118 | 119 | vpc_id = module.vpc.vpc_id 120 | allowed_ip = [module.vpc.vpc_cidr_block] 121 | allowed_ports = [6379] 122 | 123 | cluster_replication_enabled = true 124 | engine = "redis" 125 | engine_version = "7.0" 126 | parameter_group_name = "default.redis7.cluster.on" 127 | port = 6379 128 | node_type = "cache.t2.micro" 129 | subnet_ids = module.subnets.public_subnet_id 130 | availability_zones = ["eu-west-1a", "eu-west-1b"] 131 | num_cache_nodes = 1 132 | snapshot_retention_limit = 7 133 | automatic_failover_enabled = true 134 | extra_tags = { 135 | Application = "CloudDrove" 136 | } 137 | 138 | route53_record_enabled = false 139 | ssm_parameter_endpoint_enabled = false 140 | dns_record_name = "prod" 141 | route53_ttl = "300" 142 | route53_type = "CNAME" 143 | route53_zone_id = "SERFxxxx6XCsY9Lxxxxx" 144 | } 145 | ``` 146 | ### Memcache 147 | ```hcl 148 | module "memcached" { 149 | source = "clouddrove/elasticache/aws 150 | version = "1.3.0" 151 | 152 | name = "memcached" 153 | environment = "test" 154 | label_order = ["name", "environment"] 155 | 156 | vpc_id = module.vpc.vpc_id 157 | allowed_ip = [module.vpc.vpc_cidr_block] 158 | allowed_ports = [11211] 159 | 160 | cluster_enabled = true 161 | memcached_ssm_parameter_endpoint_enabled = true 162 | memcached_route53_record_enabled = true 163 | engine = "memcached" 164 | engine_version = "1.6.17" 165 | family = "memcached1.5" 166 | parameter_group_name = "" 167 | az_mode = "cross-az" 168 | port = 11211 169 | node_type = "cache.t2.micro" 170 | num_cache_nodes = 2 171 | subnet_ids = module.subnets.public_subnet_id 172 | availability_zones = ["eu-west-1a", "eu-west-1b"] 173 | extra_tags = { 174 | Application = "CloudDrove" 175 | } 176 | route53_record_enabled = false 177 | ssm_parameter_endpoint_enabled = false 178 | dns_record_name = "prod" 179 | route53_ttl = "300" 180 | route53_type = "CNAME" 181 | route53_zone_id = "SERFxxxx6XCsY9Lxxxxx" 182 | 183 | } 184 | ``` 185 | -------------------------------------------------------------------------------- /docs/io.md: -------------------------------------------------------------------------------- 1 | ## Inputs 2 | 3 | | Name | Description | Type | Default | Required | 4 | |------|-------------|------|---------|:--------:| 5 | | alias | The display name of the alias. The name must start with the word `alias` followed by a forward slash. | `string` | `"alias/redis"` | no | 6 | | allowed\_ip | List of allowed ip. | `list(any)` | `[]` | no | 7 | | allowed\_ports | List of allowed ingress ports | `list(any)` | `[]` | no | 8 | | auth\_token | The password used to access a password protected server. Can be specified only if transit\_encryption\_enabled = true. Find auto generated auth\_token in terraform.tfstate or in AWS SSM Parameter Store. | `string` | `null` | no | 9 | | auth\_token\_enable | Flag to specify whether to create auth token (password) protected cluster. Can be specified only if transit\_encryption\_enabled = true. | `bool` | `true` | no | 10 | | availability\_zones | A list of EC2 availability zones in which the replication group's cache clusters will be created. The order of the availability zones in the list is not important. | `list(string)` | n/a | yes | 11 | | az\_mode | (Memcached only) Specifies whether the nodes in this Memcached node group are created in a single Availability Zone or created across multiple Availability Zones in the cluster's region. Valid values for this parameter are single-az or cross-az, default is single-az. If you want to choose cross-az, num\_cache\_nodes must be greater than 1. | `string` | `"single-az"` | no | 12 | | cluster\_enabled | (Memcache only) Enabled or disabled cluster. | `bool` | `false` | no | 13 | | cluster\_replication\_enabled | (Redis only) Enabled or disabled replication\_group for redis cluster. | `bool` | `false` | no | 14 | | customer\_master\_key\_spec | Specifies whether the key contains a symmetric key or an asymmetric key pair and the encryption algorithms or signing algorithms that the key supports. Valid values: SYMMETRIC\_DEFAULT, RSA\_2048, RSA\_3072, RSA\_4096, ECC\_NIST\_P256, ECC\_NIST\_P384, ECC\_NIST\_P521, or ECC\_SECG\_P256K1. Defaults to SYMMETRIC\_DEFAULT. | `string` | `"SYMMETRIC_DEFAULT"` | no | 15 | | deletion\_window\_in\_days | Duration in days after which the key is deleted after destruction of the resource. | `number` | `7` | no | 16 | | egress\_rule | Enable to create egress rule | `bool` | `true` | no | 17 | | enable | Enable or disable of elasticache | `bool` | `true` | no | 18 | | enable\_key\_rotation | Specifies whether key rotation is enabled. | `string` | `true` | no | 19 | | enable\_security\_group | Enable default Security Group with only Egress traffic allowed. | `bool` | `true` | no | 20 | | environment | Environment (e.g. `prod`, `dev`, `staging`). | `string` | `""` | no | 21 | | extra\_tags | Additional tags (e.g. map(`BusinessUnit`,`XYZ`). | `map(string)` | `{}` | no | 22 | | is\_enabled | Specifies whether the key is enabled. | `bool` | `true` | no | 23 | | is\_external | enable to udated existing security Group | `bool` | `false` | no | 24 | | key\_usage | Specifies the intended use of the key. Defaults to ENCRYPT\_DECRYPT, and only symmetric encryption and decryption are supported. | `string` | `"ENCRYPT_DECRYPT"` | no | 25 | | kms\_description | The description of the key as viewed in AWS console. | `string` | `"Parameter Store KMS master key"` | no | 26 | | kms\_key\_enabled | Specifies whether the kms is enabled or disabled. | `bool` | `true` | no | 27 | | kms\_key\_id | The ARN of the key that you wish to use if encrypting at rest. If not supplied, uses service managed encryption. Can be specified only if at\_rest\_encryption\_enabled = true. | `string` | `""` | no | 28 | | kms\_multi\_region | Indicates whether the KMS key is a multi-Region (true) or regional (false) key. | `bool` | `false` | no | 29 | | label\_order | Label order, e.g. `name`,`application`. | `list(any)` |[| no | 30 | | length | n/a | `number` | `25` | no | 31 | | log\_delivery\_configuration | The log\_delivery\_configuration block allows the streaming of Redis SLOWLOG or Redis Engine Log to CloudWatch Logs or Kinesis Data Firehose. Max of 2 blocks. | `list(map(any))` | `[]` | no | 32 | | managedby | ManagedBy, eg 'CloudDrove' or 'AnmolNagpal'. | `string` | `"anmol@clouddrove.com"` | no | 33 | | memcached\_route53\_record\_enabled | Whether to create Route53 record memcached set. | `bool` | `false` | no | 34 | | memcached\_ssm\_parameter\_endpoint\_enabled | Name of the parameter. | `bool` | `false` | no | 35 | | name | Name (e.g. `app` or `cluster`). | `string` | `""` | no | 36 | | network\_type | value of the network type. Valid values are ipv4, ipv6 or dual\_stack. | `string` | `"ipv4"` | no | 37 | | num\_cache\_nodes | (Required unless replication\_group\_id is provided) The initial number of cache nodes that the cache cluster will have. For Redis, this value must be 1. For Memcache, this value must be between 1 and 20. If this number is reduced on subsequent runs, the highest numbered nodes will be removed. | `number` | `1` | no | 38 | | protocol | The protocol. If not icmp, tcp, udp, or all use the. | `string` | `"tcp"` | no | 39 | | replication\_group | n/a | `map(any)` | `{}` | no | 40 | | repository | Terraform current module repo | `string` | `"https://github.com/clouddrove/terraform-aws-elasticache"` | no | 41 | | retention\_in\_days | Specifies the number of days you want to retain log events in the specified log group. | `number` | `0` | no | 42 | | route53 | Route53 Configurations. | `map(any)` | `{}` | no | 43 | | route53\_record\_enabled | Whether to create Route53 record set. | `bool` | `false` | no | 44 | | security\_group\_names | A list of cache security group names to associate with this replication group. | `list(string)` | `null` | no | 45 | | sg\_description | The security group description. | `string` | `"Instance default security group (only egress access is allowed)."` | no | 46 | | sg\_egress\_description | Description of the egress and ingress rule | `string` | `"Description of the rule."` | no | 47 | | sg\_egress\_ipv6\_description | Description of the egress\_ipv6 rule | `string` | `"Description of the rule."` | no | 48 | | sg\_ids | of the security group id. | `list(any)` | `[]` | no | 49 | | sg\_ingress\_description | Description of the ingress rule | `string` | `"Description of the ingress rule use elasticache."` | no | 50 | | snapshot\_arns | A single-element string list containing an Amazon Resource Name (ARN) of a Redis RDB snapshot file stored in Amazon S3. | `list(string)` | `null` | no | 51 | | special | n/a | `bool` | `false` | no | 52 | | ssm\_parameter\_description | SSM Parameters can be imported using. | `string` | `"Description of the parameter."` | no | 53 | | ssm\_parameter\_endpoint\_enabled | Name of the parameter. | `bool` | `false` | no | 54 | | ssm\_parameter\_type | Type of the parameter. | `string` | `"SecureString"` | no | 55 | | subnet\_group\_description | Description for the cache subnet group. Defaults to `Managed by Terraform`. | `string` | `"The Description of the ElastiCache Subnet Group."` | no | 56 | | subnet\_ids | List of VPC Subnet IDs for the cache subnet group. | `list(any)` | `[]` | no | 57 | | user\_group\_ids | User Group ID to associate with the replication group. | `list(string)` | `null` | no | 58 | | vpc\_id | The ID of the VPC that the instance security group belongs to. | `string` | `""` | no | 59 | 60 | ## Outputs 61 | 62 | | Name | Description | 63 | |------|-------------| 64 | | Memcached\_ssm\_name | A list of all of the parameter values | 65 | | auth\_token | Auth token generated value | 66 | | hostname | DNS hostname | 67 | | id | Redis cluster id. | 68 | | memcached\_arn | Memcached arn | 69 | | memcached\_endpoint | Memcached endpoint address. | 70 | | memcached\_hostname | DNS hostname | 71 | | port | Redis port. | 72 | | redis\_arn | Redis arn | 73 | | redis\_endpoint | Redis endpoint address. | 74 | | redis\_ssm\_name | A list of all of the parameter values | 75 | | sg\_id | n/a | 76 | | tags | A mapping of tags to assign to the resource. | 77 | 78 | -------------------------------------------------------------------------------- /examples/memcached/example.tf: -------------------------------------------------------------------------------- 1 | ####---------------------------------------------------------------------------------- 2 | ## Provider block added, Use the Amazon Web Services (AWS) provider to interact with the many resources supported by AWS. 3 | ####---------------------------------------------------------------------------------- 4 | provider "aws" { 5 | region = local.region 6 | } 7 | locals { 8 | name = "memcached" 9 | environment = "test" 10 | region = "eu-west-1" 11 | } 12 | ####---------------------------------------------------------------------------------- 13 | ## A VPC is a virtual network that closely resembles a traditional network that you'd operate in your own data center. 14 | ####---------------------------------------------------------------------------------- 15 | module "vpc" { 16 | source = "clouddrove/vpc/aws" 17 | version = "2.0.0" 18 | 19 | name = "${local.name}-vpc" 20 | environment = local.environment 21 | cidr_block = "10.0.0.0/16" 22 | } 23 | 24 | ####---------------------------------------------------------------------------------- 25 | ## A subnet is a range of IP addresses in your VPC. 26 | ####---------------------------------------------------------------------------------- 27 | module "subnets" { 28 | source = "clouddrove/subnet/aws" 29 | version = "2.0.0" 30 | 31 | name = "${local.name}-subnets" 32 | environment = local.environment 33 | availability_zones = ["eu-west-1a", "eu-west-1b", "eu-west-1c"] 34 | vpc_id = module.vpc.vpc_id 35 | type = "public" 36 | igw_id = module.vpc.igw_id 37 | cidr_block = module.vpc.vpc_cidr_block 38 | ipv6_cidr_block = module.vpc.ipv6_cidr_block 39 | } 40 | 41 | ####---------------------------------------------------------------------------------- 42 | ## Memcached holds its data in memory. 43 | ####---------------------------------------------------------------------------------- 44 | module "memcached" { 45 | source = "./../../" 46 | 47 | name = local.name 48 | environment = local.environment 49 | ####---------------------------------------------------------------------------------- 50 | ## Below A security group controls the traffic that is allowed to reach and leave the resources that it is associated with. 51 | ####---------------------------------------------------------------------------------- 52 | vpc_id = module.vpc.vpc_id 53 | allowed_ip = [module.vpc.vpc_cidr_block] 54 | allowed_ports = [11211] 55 | 56 | cluster_enabled = true 57 | memcached_ssm_parameter_endpoint_enabled = true 58 | memcached_route53_record_enabled = false 59 | 60 | replication_group = { 61 | engine = "memcached" 62 | engine_version = "1.6.17" 63 | parameter_group_name = "" 64 | port = 11211 65 | node_type = "cache.t2.micro" 66 | parameter_group_name = "" 67 | } 68 | 69 | az_mode = "cross-az" 70 | num_cache_nodes = 2 71 | subnet_ids = module.subnets.public_subnet_id 72 | availability_zones = ["eu-west-1a", "eu-west-1b"] 73 | extra_tags = { 74 | Application = "CloudDrove" 75 | } 76 | 77 | ####---------------------------------------------------------------------------------- 78 | ## will create ROUTE-53 for redis which will add the dns of the cluster. 79 | ####---------------------------------------------------------------------------------- 80 | route53_record_enabled = false 81 | ssm_parameter_endpoint_enabled = false 82 | route53 = { 83 | dns_record_name = "prod" 84 | route53_ttl = "300" 85 | route53_type = "CNAME" 86 | route53_zone_id = "SERFxxxx6XCsY9Lxxxxx" # Change Zone ID with Route53 Zone ID from looking at AWS Console 87 | } 88 | } 89 | -------------------------------------------------------------------------------- /examples/memcached/outputs.tf: -------------------------------------------------------------------------------- 1 | output "id" { 2 | value = module.memcached[*].id 3 | description = "memcached id." 4 | } 5 | 6 | output "tags" { 7 | value = module.memcached.tags 8 | description = "A mapping of tags to assign to the resource." 9 | } 10 | 11 | output "memcached_endpoint" { 12 | value = module.memcached.memcached_endpoint 13 | description = "Memcached endpoint address." 14 | } 15 | 16 | output "hostname" { 17 | value = module.memcached.hostname 18 | description = "DNS hostname" 19 | } 20 | 21 | output "redis_ssm_arn" { 22 | value = module.memcached.Memcached_ssm_name 23 | description = "A map of the names and ARNs created" 24 | } 25 | -------------------------------------------------------------------------------- /examples/memcached/versions.tf: -------------------------------------------------------------------------------- 1 | # Terraform version 2 | terraform { 3 | required_version = ">= 1.6.5" 4 | 5 | required_providers { 6 | aws = { 7 | source = "hashicorp/aws" 8 | version = ">= 5.31.0" 9 | } 10 | } 11 | } 12 | -------------------------------------------------------------------------------- /examples/redis-cluster/example.tf: -------------------------------------------------------------------------------- 1 | ####---------------------------------------------------------------------------------- 2 | ## Provider block added, Use the Amazon Web Services (AWS) provider to interact with the many resources supported by AWS. 3 | ####---------------------------------------------------------------------------------- 4 | provider "aws" { 5 | region = local.region 6 | } 7 | locals { 8 | name = "redis-cluster" 9 | environment = "test" 10 | region = "eu-west-1" 11 | } 12 | ####---------------------------------------------------------------------------------- 13 | ## A VPC is a virtual network that closely resembles a traditional network that you'd operate in your own data center. 14 | ####---------------------------------------------------------------------------------- 15 | module "vpc" { 16 | source = "clouddrove/vpc/aws" 17 | version = "2.0.0" 18 | 19 | name = "${local.name}-vpc" 20 | environment = local.environment 21 | cidr_block = "10.0.0.0/16" 22 | } 23 | 24 | ####---------------------------------------------------------------------------------- 25 | ## A subnet is a range of IP addresses in your VPC. 26 | ####---------------------------------------------------------------------------------- 27 | module "subnets" { 28 | source = "clouddrove/subnet/aws" 29 | version = "2.0.1" 30 | 31 | name = "${local.name}-subnets" 32 | environment = local.environment 33 | availability_zones = ["eu-west-1a", "eu-west-1b", "eu-west-1c"] 34 | vpc_id = module.vpc.vpc_id 35 | type = "public" 36 | igw_id = module.vpc.igw_id 37 | cidr_block = module.vpc.vpc_cidr_block 38 | ipv6_cidr_block = module.vpc.ipv6_cidr_block 39 | } 40 | 41 | ###---------------------------------------------------------------------------------- 42 | # Amazon ElastiCache [REDIS-CLUSTER] is a fully managed in-memory data store and cache service by Amazon Web Services. 43 | # The service improves the performance of web applications by retrieving information from managed in-memory caches, 44 | # instead of relying entirely on slower disk-based databases. 45 | ###---------------------------------------------------------------------------------- 46 | module "redis-cluster" { 47 | source = "./../../" 48 | 49 | name = local.name 50 | environment = local.environment 51 | 52 | ###---------------------------------------------------------------------------------- 53 | # Below A security group controls the traffic that is allowed to reach and leave the resources that it is associated with. 54 | ###---------------------------------------------------------------------------------- 55 | vpc_id = module.vpc.vpc_id 56 | allowed_ip = [module.vpc.vpc_cidr_block] 57 | allowed_ports = [6379] 58 | 59 | cluster_replication_enabled = true 60 | 61 | replication_group = { 62 | engine = "redis" 63 | engine_version = "7.0" 64 | parameter_group_name = "default.redis7.cluster.on" 65 | port = 6379 66 | node_type = "cache.t2.micro" 67 | snapshot_retention_limit = 7 68 | automatic_failover_enabled = true 69 | } 70 | 71 | subnet_ids = module.subnets.public_subnet_id 72 | availability_zones = ["eu-west-1a", "eu-west-1b"] 73 | num_cache_nodes = 1 74 | extra_tags = { 75 | Application = "CloudDrove" 76 | } 77 | 78 | ###---------------------------------------------------------------------------------- 79 | # will create ROUTE-53 for redis which will add the dns of the cluster. 80 | ###---------------------------------------------------------------------------------- 81 | route53_record_enabled = false 82 | ssm_parameter_endpoint_enabled = false 83 | route53 = { 84 | dns_record_name = "prod" 85 | route53_ttl = "300" 86 | route53_type = "CNAME" 87 | route53_zone_id = "SERFxxxx6XCsY9Lxxxxx" 88 | } 89 | } 90 | -------------------------------------------------------------------------------- /examples/redis-cluster/outputs.tf: -------------------------------------------------------------------------------- 1 | output "id" { 2 | value = module.redis-cluster.id 3 | description = "Redis cluster id." 4 | } 5 | 6 | output "tags" { 7 | value = module.redis-cluster.tags 8 | description = "A mapping of tags to assign to the resource." 9 | } 10 | 11 | output "redis_endpoint" { 12 | value = module.redis-cluster[*].redis_endpoint 13 | description = "Redis endpoint address." 14 | } 15 | 16 | output "hostname" { 17 | value = module.redis-cluster.hostname 18 | description = "DNS hostname" 19 | } 20 | 21 | output "redis_ssm_arn" { 22 | value = module.redis-cluster.redis_ssm_name 23 | description = "A map of the names and ARNs created" 24 | } 25 | 26 | output "auth_token" { 27 | value = module.redis-cluster.auth_token 28 | sensitive = true 29 | } -------------------------------------------------------------------------------- /examples/redis-cluster/versions.tf: -------------------------------------------------------------------------------- 1 | # Terraform version 2 | terraform { 3 | required_version = ">= 1.6.2" 4 | 5 | required_providers { 6 | aws = { 7 | source = "hashicorp/aws" 8 | version = ">= 5.22.0" 9 | } 10 | } 11 | } 12 | -------------------------------------------------------------------------------- /examples/redis/example.tf: -------------------------------------------------------------------------------- 1 | ####---------------------------------------------------------------------------------- 2 | ## Provider block added, Use the Amazon Web Services (AWS) provider to interact with the many resources supported by AWS. 3 | ####---------------------------------------------------------------------------------- 4 | provider "aws" { 5 | region = local.region 6 | } 7 | locals { 8 | name = "redis" 9 | environment = "test" 10 | region = "eu-west-1" 11 | } 12 | ####---------------------------------------------------------------------------------- 13 | ## A VPC is a virtual network that closely resembles a traditional network that you'd operate in your own data center. 14 | ####---------------------------------------------------------------------------------- 15 | module "vpc" { 16 | source = "clouddrove/vpc/aws" 17 | version = "2.0.0" 18 | 19 | name = "${local.name}-vpc" 20 | environment = local.environment 21 | cidr_block = "10.0.0.0/16" 22 | } 23 | 24 | ####---------------------------------------------------------------------------------- 25 | ## A subnet is a range of IP addresses in your VPC. 26 | ####---------------------------------------------------------------------------------- 27 | module "subnets" { 28 | source = "clouddrove/subnet/aws" 29 | version = "2.0.1" 30 | 31 | name = "${local.name}-subnets" 32 | environment = local.environment 33 | availability_zones = ["eu-west-1a", "eu-west-1b", "eu-west-1c"] 34 | vpc_id = module.vpc.vpc_id 35 | type = "public" 36 | igw_id = module.vpc.igw_id 37 | cidr_block = module.vpc.vpc_cidr_block 38 | ipv6_cidr_block = module.vpc.ipv6_cidr_block 39 | } 40 | 41 | ####---------------------------------------------------------------------------------- 42 | ## Amazon ElastiCache [REDIS-CLUSTER] is a fully managed in-memory data store and cache service by Amazon Web Services. 43 | ## The service improves the performance of web applications by retrieving information from managed in-memory caches, 44 | ## instead of relying entirely on slower disk-based databases. 45 | ####---------------------------------------------------------------------------------- 46 | #tfsec:ignore:aws-cloudwatch-log-group-customer-key 47 | module "redis" { 48 | source = "./../../" 49 | 50 | 51 | name = local.name 52 | environment = local.environment 53 | ####---------------------------------------------------------------------------------- 54 | ## Below A security group controls the traffic that is allowed to reach and leave the resources that it is associated with. 55 | ####---------------------------------------------------------------------------------- 56 | vpc_id = module.vpc.vpc_id 57 | allowed_ip = [module.vpc.vpc_cidr_block] 58 | allowed_ports = [6379] 59 | 60 | cluster_replication_enabled = true 61 | 62 | replication_group = { 63 | engine = "redis" 64 | engine_version = "7.0" 65 | parameter_group_name = "default.redis7" 66 | port = 6379 67 | node_type = "cache.t2.micro" 68 | automatic_failover_enabled = false 69 | num_cache_clusters = 1 70 | } 71 | 72 | subnet_ids = module.subnets.public_subnet_id 73 | availability_zones = [""] 74 | retention_in_days = 0 75 | 76 | log_delivery_configuration = [ 77 | { 78 | destination_type = "cloudwatch-logs" 79 | log_format = "json" 80 | log_type = "slow-log" 81 | }, 82 | { 83 | destination_type = "cloudwatch-logs" 84 | log_format = "json" 85 | log_type = "engine-log" 86 | } 87 | ] 88 | extra_tags = { 89 | Application = "CloudDrove" 90 | } 91 | 92 | ####---------------------------------------------------------------------------------- 93 | ## will create ROUTE-53 for redis which will add the dns of the cluster. 94 | ####---------------------------------------------------------------------------------- 95 | route53_record_enabled = false 96 | ssm_parameter_endpoint_enabled = true 97 | route53 = { 98 | dns_record_name = "prod" 99 | route53_ttl = "300" 100 | route53_type = "CNAME" 101 | route53_zone_id = "Z017xxxxDLxxx0GH04" 102 | } 103 | } 104 | -------------------------------------------------------------------------------- /examples/redis/outputs.tf: -------------------------------------------------------------------------------- 1 | output "id" { 2 | value = module.redis[*].id 3 | description = "Redis cluster id." 4 | } 5 | 6 | output "tags" { 7 | value = module.redis.tags 8 | description = "A mapping of tags to assign to the resource." 9 | } 10 | 11 | output "redis_endpoint" { 12 | value = module.redis.redis_endpoint 13 | description = "Redis endpoint address." 14 | } 15 | 16 | output "sg_id" { 17 | value = module.redis[*].sg_id 18 | description = "of the security group id." 19 | } 20 | 21 | output "hostname" { 22 | value = module.redis[*].hostname 23 | description = "DNS hostname" 24 | } 25 | 26 | 27 | output "redis_ssm_arn" { 28 | value = module.redis.redis_ssm_name 29 | description = "A map of the names and ARNs created" 30 | } 31 | -------------------------------------------------------------------------------- /examples/redis/versions.tf: -------------------------------------------------------------------------------- 1 | # Terraform version 2 | terraform { 3 | required_version = ">= 1.6.2" 4 | 5 | required_providers { 6 | aws = { 7 | source = "hashicorp/aws" 8 | version = ">= 5.22.0" 9 | } 10 | } 11 | } 12 | -------------------------------------------------------------------------------- /main.tf: -------------------------------------------------------------------------------- 1 | ##---------------------------------------------------------------------------------- 2 | ## Labels module callled that will be used for naming and tags. 3 | ##---------------------------------------------------------------------------------- 4 | module "labels" { 5 | source = "clouddrove/labels/aws" 6 | version = "1.3.0" 7 | 8 | enabled = var.enable 9 | name = var.name 10 | repository = var.repository 11 | environment = var.environment 12 | managedby = var.managedby 13 | label_order = var.label_order 14 | extra_tags = var.extra_tags 15 | } 16 | 17 | ##---------------------------------------------------------------------------------- 18 | ## Below resources will create SECURITY-GROUP and its components. 19 | ##---------------------------------------------------------------------------------- 20 | resource "aws_security_group" "default" { 21 | count = var.enable && var.enable_security_group && length(var.sg_ids) < 1 ? 1 : 0 22 | 23 | name = format("%s-sg", module.labels.id) 24 | vpc_id = var.vpc_id 25 | description = var.sg_description 26 | tags = module.labels.tags 27 | lifecycle { 28 | create_before_destroy = true 29 | } 30 | } 31 | 32 | ##---------------------------------------------------------------------------------- 33 | ## Below resources will create SECURITY-GROUP-RULE and its components. 34 | ##---------------------------------------------------------------------------------- 35 | #tfsec:ignore:aws-ec2-no-public-egress-sgr 36 | resource "aws_security_group_rule" "egress" { 37 | count = (var.enable && var.enable_security_group == true && length(var.sg_ids) < 1 && var.is_external == false && var.egress_rule == true) ? 1 : 0 38 | 39 | description = var.sg_egress_description 40 | type = "egress" 41 | from_port = 0 42 | to_port = 65535 43 | protocol = "-1" 44 | cidr_blocks = ["0.0.0.0/0"] 45 | security_group_id = join("", aws_security_group.default[*].id) 46 | } 47 | #tfsec:ignore:aws-ec2-no-public-egress-sgr 48 | resource "aws_security_group_rule" "egress_ipv6" { 49 | count = (var.enable && var.enable_security_group == true && length(var.sg_ids) < 1 && var.is_external == false) && var.egress_rule == true ? 1 : 0 50 | 51 | description = var.sg_egress_ipv6_description 52 | type = "egress" 53 | from_port = 0 54 | to_port = 65535 55 | protocol = "-1" 56 | ipv6_cidr_blocks = ["::/0"] 57 | security_group_id = join("", aws_security_group.default[*].id) 58 | } 59 | resource "aws_security_group_rule" "ingress" { 60 | count = var.enable && length(var.allowed_ip) > 0 == true && length(var.sg_ids) < 1 ? length(compact(var.allowed_ports)) : 0 61 | 62 | description = var.sg_ingress_description 63 | type = "ingress" 64 | from_port = element(var.allowed_ports, count.index) 65 | to_port = element(var.allowed_ports, count.index) 66 | protocol = var.protocol 67 | cidr_blocks = var.allowed_ip 68 | security_group_id = join("", aws_security_group.default[*].id) 69 | } 70 | 71 | ##---------------------------------------------------------------------------------- 72 | ## Below resources will create KMS-KEY and its components. 73 | ##---------------------------------------------------------------------------------- 74 | resource "aws_kms_key" "default" { 75 | count = var.enable && var.kms_key_enabled && var.kms_key_id == "" ? 1 : 0 76 | 77 | description = var.kms_description 78 | key_usage = var.key_usage 79 | deletion_window_in_days = var.deletion_window_in_days 80 | is_enabled = var.is_enabled 81 | enable_key_rotation = var.enable_key_rotation 82 | customer_master_key_spec = var.customer_master_key_spec 83 | policy = data.aws_iam_policy_document.default.json 84 | multi_region = var.kms_multi_region 85 | tags = module.labels.tags 86 | } 87 | 88 | resource "aws_kms_alias" "default" { 89 | count = var.enable && var.kms_key_enabled && var.kms_key_id == "" ? 1 : 0 90 | 91 | name = coalesce(var.alias, format("alias/%v", module.labels.id)) 92 | target_key_id = var.kms_key_id == "" ? join("", aws_kms_key.default[*].id) : var.kms_key_id 93 | } 94 | 95 | ##---------------------------------------------------------------------------------- 96 | ## Data block called to get Permissions that will be used in creating policy. 97 | ##---------------------------------------------------------------------------------- 98 | data "aws_partition" "current" {} 99 | data "aws_caller_identity" "current" {} 100 | data "aws_iam_policy_document" "default" { 101 | version = "2012-10-17" 102 | statement { 103 | sid = "Enable IAM User Permissions" 104 | effect = "Allow" 105 | principals { 106 | type = "AWS" 107 | identifiers = [ 108 | format( 109 | "arn:%s:iam::%s:root", 110 | join("", data.aws_partition.current[*].partition), 111 | data.aws_caller_identity.current.account_id 112 | ) 113 | ] 114 | } 115 | actions = ["kms:*"] 116 | resources = ["*"] 117 | } 118 | } 119 | 120 | ##---------------------------------------------------------------------------------- 121 | ## Below resource will create will save logs cloudwatch_log_group resource for redis-cluster and memcached. 122 | ##---------------------------------------------------------------------------------- 123 | resource "aws_cloudwatch_log_group" "default" { 124 | count = var.enable && length(var.log_delivery_configuration) > 0 ? length(var.log_delivery_configuration) : 0 125 | name = format("%s-%s", module.labels.name, var.log_delivery_configuration[count.index].log_type) 126 | retention_in_days = var.retention_in_days 127 | tags = module.labels.tags 128 | } 129 | 130 | 131 | resource "aws_elasticache_subnet_group" "default" { 132 | count = var.enable ? 1 : 0 133 | name = format("%s-subnet-group", module.labels.id) 134 | subnet_ids = var.subnet_ids 135 | description = var.subnet_group_description 136 | 137 | tags = module.labels.tags 138 | } 139 | 140 | ##---------------------------------------------------------------------------------- 141 | ## Below resource will create random passoword for the auth_token 142 | ##---------------------------------------------------------------------------------- 143 | 144 | resource "random_password" "auth_token" { 145 | count = var.enable && var.auth_token_enable && var.auth_token == null ? 1 : 0 146 | length = var.length 147 | special = var.special 148 | } 149 | 150 | ##---------------------------------------------------------------------------------- 151 | ## Below resource will create replication-group resource for redis-cluster and memcached. 152 | ##---------------------------------------------------------------------------------- 153 | resource "aws_elasticache_replication_group" "cluster" { 154 | count = var.enable && var.cluster_replication_enabled ? 1 : 0 155 | 156 | engine = lookup(var.replication_group, "engine", "") 157 | replication_group_id = module.labels.id 158 | description = lookup(var.replication_group, "replication_group_description", "User-created description for the replication group.") 159 | engine_version = lookup(var.replication_group, "engine_version", "") 160 | port = lookup(var.replication_group, "port", "") 161 | parameter_group_name = lookup(var.replication_group, "parameter_group_name", "default.redis5.0") 162 | node_type = lookup(var.replication_group, "node_type", "cache.t2.small") 163 | automatic_failover_enabled = lookup(var.replication_group, "automatic_failover_enabled", true) 164 | subnet_group_name = join("", aws_elasticache_subnet_group.default[*].name) 165 | security_group_ids = length(var.sg_ids) < 1 ? aws_security_group.default[*].id : var.sg_ids 166 | security_group_names = var.security_group_names 167 | snapshot_arns = var.snapshot_arns 168 | snapshot_name = lookup(var.replication_group, "snapshot_name", "") 169 | notification_topic_arn = lookup(var.replication_group, "notification_topic_arn", "") 170 | snapshot_window = lookup(var.replication_group, "snapshot_window", null) 171 | final_snapshot_identifier = lookup(var.replication_group, "final_snapshot_identifier", null) 172 | snapshot_retention_limit = lookup(var.replication_group, "snapshot_retention_limit", "0") 173 | apply_immediately = lookup(var.replication_group, "apply_immediately", false) 174 | auto_minor_version_upgrade = lookup(var.replication_group, "auto_minor_version_upgrade", true) 175 | maintenance_window = lookup(var.replication_group, "maintenance_window", "sun:05:00-sun:06:00") 176 | at_rest_encryption_enabled = lookup(var.replication_group, "at_rest_encryption_enabled", true) 177 | transit_encryption_enabled = lookup(var.replication_group, "transit_encryption_enabled", true) 178 | multi_az_enabled = lookup(var.replication_group, "multi_az_enabled", false) 179 | network_type = var.network_type 180 | 181 | auth_token = var.auth_token_enable ? (var.auth_token == null ? random_password.auth_token[0].result : var.auth_token) : "" 182 | kms_key_id = var.kms_key_id == "" ? join("", aws_kms_key.default[*].arn) : var.kms_key_id 183 | tags = module.labels.tags 184 | num_cache_clusters = lookup(var.replication_group, "num_cache_clusters", 1) 185 | user_group_ids = var.user_group_ids 186 | 187 | dynamic "log_delivery_configuration" { 188 | for_each = var.log_delivery_configuration 189 | 190 | content { 191 | destination = lookup(log_delivery_configuration.value, "destination", aws_cloudwatch_log_group.default[index(var.log_delivery_configuration, log_delivery_configuration.value)].name) 192 | destination_type = lookup(log_delivery_configuration.value, "destination_type", null) 193 | log_format = lookup(log_delivery_configuration.value, "log_format", null) 194 | log_type = lookup(log_delivery_configuration.value, "log_type", null) 195 | } 196 | } 197 | } 198 | 199 | ##---------------------------------------------------------------------------------- 200 | ## Below resource will create cluster. 201 | ##---------------------------------------------------------------------------------- 202 | resource "aws_elasticache_cluster" "default" { 203 | count = var.enable && var.cluster_enabled ? 1 : 0 204 | engine = lookup(var.replication_group, "engine", "") 205 | cluster_id = module.labels.id 206 | engine_version = lookup(var.replication_group, "engine_version", "") 207 | port = lookup(var.replication_group, "port", "") 208 | num_cache_nodes = var.num_cache_nodes 209 | az_mode = var.az_mode 210 | parameter_group_name = lookup(var.replication_group, "parameter_group_name", "default.redis5.0") 211 | node_type = lookup(var.replication_group, "node_type", "cache.t2.small") 212 | subnet_group_name = join("", aws_elasticache_subnet_group.default[*].name) 213 | security_group_ids = length(var.sg_ids) < 1 ? aws_security_group.default[*].id : var.sg_ids 214 | snapshot_arns = var.snapshot_arns 215 | snapshot_name = lookup(var.replication_group, "snapshot_name", "") 216 | notification_topic_arn = lookup(var.replication_group, "notification_topic_arn", "") 217 | snapshot_window = lookup(var.replication_group, "snapshot_window", null) 218 | snapshot_retention_limit = lookup(var.replication_group, "snapshot_retention_limit", "0") 219 | apply_immediately = lookup(var.replication_group, "apply_immediately", false) 220 | preferred_availability_zones = slice(var.availability_zones, 0, var.num_cache_nodes) 221 | maintenance_window = lookup(var.replication_group, "maintenance_window", "sun:05:00-sun:06:00") 222 | network_type = var.network_type 223 | tags = module.labels.tags 224 | 225 | } 226 | 227 | ##---------------------------------------------------------------------------------- 228 | ## Below resource will create ROUTE-53 resource for redis and memcached. 229 | ##---------------------------------------------------------------------------------- 230 | resource "aws_route53_record" "elasticache" { 231 | count = var.enable && var.route53_record_enabled ? 1 : 0 232 | 233 | name = lookup(var.route53, "dns_record_name", "elasticache") 234 | type = lookup(var.route53, "route53_type", "") 235 | ttl = lookup(var.route53, "route53_ttl", null) 236 | zone_id = lookup(var.route53, "route53_zone_id", null) 237 | records = lookup(var.replication_group, "automatic_failover_enabled", true) ? [aws_elasticache_replication_group.cluster[0].configuration_endpoint_address] : [aws_elasticache_replication_group.cluster[0].primary_endpoint_address] 238 | } 239 | 240 | ##---------------------------------------------------------------------------------- 241 | ## Below resource will create ssm-parameter resource for redis and memcached with auth-token. 242 | ##---------------------------------------------------------------------------------- 243 | resource "aws_ssm_parameter" "secret" { 244 | count = var.enable && var.auth_token_enable ? 1 : 0 245 | 246 | name = format("/%s/%s/auth-token", var.environment, var.name) 247 | description = var.ssm_parameter_description 248 | type = var.ssm_parameter_type 249 | value = var.auth_token == null ? random_password.auth_token[0].result : var.auth_token 250 | key_id = var.kms_key_id == "" ? join("", aws_kms_key.default[*].arn) : var.kms_key_id 251 | } 252 | 253 | ##---------------------------------------------------------------------------------- 254 | ## Below resource will create ssm-parameter resource for redis with endpoint. 255 | ##---------------------------------------------------------------------------------- 256 | resource "aws_ssm_parameter" "secret-endpoint" { 257 | count = var.enable && var.ssm_parameter_endpoint_enabled ? 1 : 0 258 | 259 | name = format("/%s/%s/endpoint", var.environment, var.name) 260 | description = var.ssm_parameter_description 261 | type = var.ssm_parameter_type 262 | value = lookup(var.replication_group, "automatic_failover_enabled", true) ? [join("", aws_elasticache_replication_group.cluster[*].configuration_endpoint_address)][0] : [join("", aws_elasticache_replication_group.cluster[*].primary_endpoint_address)][0] 263 | key_id = var.kms_key_id == "" ? join("", aws_kms_key.default[*].arn) : var.kms_key_id 264 | } 265 | 266 | ##---------------------------------------------------------------------------------- 267 | ## Below resource will create ROUTE-53 resource for memcached. 268 | ##---------------------------------------------------------------------------------- 269 | resource "aws_route53_record" "memcached_route_53" { 270 | count = var.enable && var.memcached_route53_record_enabled ? 1 : 0 271 | 272 | name = lookup(var.route53, "dns_record_name", "") 273 | type = lookup(var.route53, "route53_type", "A") 274 | ttl = lookup(var.route53, "route53_ttl", 300) 275 | zone_id = lookup(var.route53, "route53_zone_id", null) 276 | records = aws_elasticache_cluster.default[*].configuration_endpoint 277 | } 278 | 279 | ##---------------------------------------------------------------------------------- 280 | ## Below resource will create ssm-parameter resource for memcached with endpoint. 281 | ##---------------------------------------------------------------------------------- 282 | resource "aws_ssm_parameter" "memcached_secret-endpoint" { 283 | count = var.enable && var.memcached_ssm_parameter_endpoint_enabled ? 1 : 0 284 | 285 | name = format("/%s/%s/memcached-endpoint", var.environment, var.name) 286 | description = var.ssm_parameter_description 287 | type = var.ssm_parameter_type 288 | value = join("", aws_elasticache_cluster.default[*].configuration_endpoint) 289 | key_id = var.kms_key_id == "" ? join("", aws_kms_key.default[*].arn) : var.kms_key_id 290 | } 291 | -------------------------------------------------------------------------------- /outputs.tf: -------------------------------------------------------------------------------- 1 | # Module : Redis 2 | # Description : Terraform module to create Elasticache Cluster and replica for Redis. 3 | output "id" { 4 | value = var.cluster_enabled ? "" : (var.cluster_replication_enabled ? join("", aws_elasticache_replication_group.cluster[*].id) : join("", aws_elasticache_replication_group.cluster[*].id)) 5 | description = "Redis cluster id." 6 | } 7 | 8 | output "port" { 9 | value = lookup(var.replication_group, "port", null) 10 | sensitive = true 11 | description = "Redis port." 12 | } 13 | 14 | output "tags" { 15 | value = module.labels.tags 16 | description = "A mapping of tags to assign to the resource." 17 | } 18 | 19 | output "redis_endpoint" { 20 | value = var.cluster_replication_enabled ? "" : (var.cluster_replication_enabled ? join("", aws_elasticache_replication_group.cluster[*].primary_endpoint_address) : join("", aws_elasticache_cluster.default[*].configuration_endpoint)) 21 | description = "Redis endpoint address." 22 | } 23 | 24 | output "redis_arn" { 25 | value = var.enable && length(aws_elasticache_replication_group.cluster) > 0 ? aws_elasticache_replication_group.cluster[0].arn : length(aws_elasticache_replication_group.cluster) > 0 ? aws_elasticache_replication_group.cluster[0].arn : null 26 | description = "Redis arn" 27 | } 28 | 29 | output "memcached_endpoint" { 30 | value = var.enable && var.cluster_enabled ? join("", aws_elasticache_cluster.default[*].configuration_endpoint) : null 31 | description = "Memcached endpoint address." 32 | } 33 | 34 | output "memcached_arn" { 35 | value = var.enable && length(aws_elasticache_cluster.default) > 0 ? aws_elasticache_cluster.default[0].arn : null 36 | description = "Memcached arn" 37 | } 38 | 39 | output "sg_id" { 40 | value = try(join("", aws_security_group.default[*].id), null) 41 | } 42 | 43 | output "hostname" { 44 | value = try(join("", aws_route53_record.elasticache[*].fqdn), null) 45 | description = "DNS hostname" 46 | } 47 | 48 | output "memcached_hostname" { 49 | value = try(join("", aws_route53_record.memcached_route_53[*].fqdn), null) 50 | description = "DNS hostname" 51 | } 52 | 53 | output "redis_ssm_name" { 54 | value = try(join("", aws_ssm_parameter.secret-endpoint[*].name), null) 55 | description = "A list of all of the parameter values" 56 | } 57 | 58 | output "Memcached_ssm_name" { 59 | value = try(join("", aws_ssm_parameter.memcached_secret-endpoint[*].name), null) 60 | description = "A list of all of the parameter values" 61 | } 62 | 63 | output "auth_token" { 64 | value = var.enable && var.auth_token_enable ? random_password.auth_token[0].result : null 65 | sensitive = true 66 | description = "Auth token generated value" 67 | } -------------------------------------------------------------------------------- /variables.tf: -------------------------------------------------------------------------------- 1 | #Module : LABEL 2 | #Description : Terraform label module variables. 3 | variable "name" { 4 | type = string 5 | default = "" 6 | description = "Name (e.g. `app` or `cluster`)." 7 | } 8 | 9 | variable "repository" { 10 | type = string 11 | default = "https://github.com/clouddrove/terraform-aws-elasticache" 12 | description = "Terraform current module repo" 13 | 14 | validation { 15 | condition = can(regex("^https://", var.repository)) 16 | error_message = "The module-repo value must be a valid Git repo link." 17 | } 18 | } 19 | 20 | variable "environment" { 21 | type = string 22 | default = "" 23 | description = "Environment (e.g. `prod`, `dev`, `staging`)." 24 | } 25 | 26 | variable "label_order" { 27 | type = list(any) 28 | default = ["environment", "name"] 29 | description = "Label order, e.g. `name`,`application`." 30 | } 31 | 32 | variable "extra_tags" { 33 | type = map(string) 34 | default = {} 35 | description = "Additional tags (e.g. map(`BusinessUnit`,`XYZ`)." 36 | } 37 | 38 | variable "managedby" { 39 | type = string 40 | default = "anmol@clouddrove.com" 41 | description = "ManagedBy, eg 'CloudDrove' or 'AnmolNagpal'." 42 | } 43 | 44 | variable "enable" { 45 | type = bool 46 | default = true 47 | description = "Enable or disable of elasticache" 48 | } 49 | 50 | variable "user_group_ids" { 51 | type = list(string) 52 | default = null 53 | description = "User Group ID to associate with the replication group." 54 | } 55 | variable "security_group_names" { 56 | type = list(string) 57 | default = null 58 | description = "A list of cache security group names to associate with this replication group." 59 | } 60 | 61 | variable "snapshot_arns" { 62 | type = list(string) 63 | default = null 64 | description = "A single-element string list containing an Amazon Resource Name (ARN) of a Redis RDB snapshot file stored in Amazon S3." 65 | } 66 | 67 | variable "replication_group" { 68 | type = map(any) 69 | default = {} 70 | } 71 | 72 | variable "subnet_ids" { 73 | type = list(any) 74 | default = [] 75 | description = "List of VPC Subnet IDs for the cache subnet group." 76 | sensitive = true 77 | } 78 | 79 | variable "subnet_group_description" { 80 | type = string 81 | default = "The Description of the ElastiCache Subnet Group." 82 | description = "Description for the cache subnet group. Defaults to `Managed by Terraform`." 83 | } 84 | 85 | variable "availability_zones" { 86 | type = list(string) 87 | description = "A list of EC2 availability zones in which the replication group's cache clusters will be created. The order of the availability zones in the list is not important." 88 | } 89 | 90 | variable "auth_token_enable" { 91 | type = bool 92 | default = true 93 | description = "Flag to specify whether to create auth token (password) protected cluster. Can be specified only if transit_encryption_enabled = true." 94 | } 95 | 96 | variable "auth_token" { 97 | type = string 98 | default = null 99 | description = "The password used to access a password protected server. Can be specified only if transit_encryption_enabled = true. Find auto generated auth_token in terraform.tfstate or in AWS SSM Parameter Store." 100 | } 101 | 102 | variable "cluster_replication_enabled" { 103 | type = bool 104 | default = false 105 | description = "(Redis only) Enabled or disabled replication_group for redis cluster." 106 | } 107 | 108 | # Module : Cluster 109 | # Description : Terraform cluster module variables. 110 | variable "cluster_enabled" { 111 | type = bool 112 | default = false 113 | description = "(Memcache only) Enabled or disabled cluster." 114 | } 115 | 116 | variable "num_cache_nodes" { 117 | type = number 118 | default = 1 119 | description = "(Required unless replication_group_id is provided) The initial number of cache nodes that the cache cluster will have. For Redis, this value must be 1. For Memcache, this value must be between 1 and 20. If this number is reduced on subsequent runs, the highest numbered nodes will be removed." 120 | } 121 | 122 | variable "az_mode" { 123 | type = string 124 | default = "single-az" 125 | description = "(Memcached only) Specifies whether the nodes in this Memcached node group are created in a single Availability Zone or created across multiple Availability Zones in the cluster's region. Valid values for this parameter are single-az or cross-az, default is single-az. If you want to choose cross-az, num_cache_nodes must be greater than 1." 126 | } 127 | 128 | variable "log_delivery_configuration" { 129 | type = list(map(any)) 130 | default = [] 131 | description = "The log_delivery_configuration block allows the streaming of Redis SLOWLOG or Redis Engine Log to CloudWatch Logs or Kinesis Data Firehose. Max of 2 blocks." 132 | } 133 | 134 | variable "retention_in_days" { 135 | type = number 136 | default = 0 137 | description = "Specifies the number of days you want to retain log events in the specified log group." 138 | } 139 | 140 | variable "kms_key_enabled" { 141 | type = bool 142 | default = true 143 | description = "Specifies whether the kms is enabled or disabled." 144 | } 145 | 146 | variable "kms_key_id" { 147 | type = string 148 | default = "" 149 | description = "The ARN of the key that you wish to use if encrypting at rest. If not supplied, uses service managed encryption. Can be specified only if at_rest_encryption_enabled = true." 150 | } 151 | 152 | variable "alias" { 153 | type = string 154 | default = "alias/redis" 155 | description = "The display name of the alias. The name must start with the word `alias` followed by a forward slash." 156 | } 157 | 158 | variable "kms_description" { 159 | type = string 160 | default = "Parameter Store KMS master key" 161 | description = "The description of the key as viewed in AWS console." 162 | } 163 | 164 | variable "key_usage" { 165 | type = string 166 | default = "ENCRYPT_DECRYPT" 167 | sensitive = true 168 | description = "Specifies the intended use of the key. Defaults to ENCRYPT_DECRYPT, and only symmetric encryption and decryption are supported." 169 | } 170 | 171 | variable "network_type" { 172 | type = string 173 | default = "ipv4" 174 | description = "value of the network type. Valid values are ipv4, ipv6 or dual_stack." 175 | } 176 | 177 | 178 | variable "deletion_window_in_days" { 179 | type = number 180 | default = 7 181 | description = "Duration in days after which the key is deleted after destruction of the resource." 182 | } 183 | 184 | variable "is_enabled" { 185 | type = bool 186 | default = true 187 | description = "Specifies whether the key is enabled." 188 | } 189 | 190 | variable "enable_key_rotation" { 191 | type = string 192 | default = true 193 | description = "Specifies whether key rotation is enabled." 194 | } 195 | 196 | variable "customer_master_key_spec" { 197 | type = string 198 | default = "SYMMETRIC_DEFAULT" 199 | description = "Specifies whether the key contains a symmetric key or an asymmetric key pair and the encryption algorithms or signing algorithms that the key supports. Valid values: SYMMETRIC_DEFAULT, RSA_2048, RSA_3072, RSA_4096, ECC_NIST_P256, ECC_NIST_P384, ECC_NIST_P521, or ECC_SECG_P256K1. Defaults to SYMMETRIC_DEFAULT." 200 | sensitive = true 201 | } 202 | 203 | variable "kms_multi_region" { 204 | type = bool 205 | default = false 206 | description = "Indicates whether the KMS key is a multi-Region (true) or regional (false) key." 207 | } 208 | variable "vpc_id" { 209 | type = string 210 | default = "" 211 | description = "The ID of the VPC that the instance security group belongs to." 212 | sensitive = true 213 | } 214 | 215 | variable "allowed_ip" { 216 | type = list(any) 217 | default = [] 218 | description = "List of allowed ip." 219 | } 220 | 221 | variable "allowed_ports" { 222 | type = list(any) 223 | default = [] 224 | description = "List of allowed ingress ports" 225 | } 226 | 227 | variable "protocol" { 228 | type = string 229 | default = "tcp" 230 | description = "The protocol. If not icmp, tcp, udp, or all use the." 231 | } 232 | 233 | variable "enable_security_group" { 234 | type = bool 235 | default = true 236 | description = "Enable default Security Group with only Egress traffic allowed." 237 | } 238 | 239 | variable "egress_rule" { 240 | type = bool 241 | default = true 242 | description = "Enable to create egress rule" 243 | } 244 | 245 | variable "is_external" { 246 | type = bool 247 | default = false 248 | description = "enable to udated existing security Group" 249 | } 250 | 251 | variable "sg_ids" { 252 | type = list(any) 253 | default = [] 254 | description = "of the security group id." 255 | } 256 | 257 | variable "sg_description" { 258 | type = string 259 | default = "Instance default security group (only egress access is allowed)." 260 | description = "The security group description." 261 | } 262 | variable "sg_egress_description" { 263 | type = string 264 | default = "Description of the rule." 265 | description = "Description of the egress and ingress rule" 266 | } 267 | 268 | variable "sg_egress_ipv6_description" { 269 | type = string 270 | default = "Description of the rule." 271 | description = "Description of the egress_ipv6 rule" 272 | } 273 | 274 | variable "sg_ingress_description" { 275 | type = string 276 | default = "Description of the ingress rule use elasticache." 277 | description = "Description of the ingress rule" 278 | } 279 | 280 | ##---------------------route53------------------------ 281 | variable "route53_record_enabled" { 282 | type = bool 283 | default = false 284 | description = "Whether to create Route53 record set." 285 | } 286 | 287 | variable "memcached_route53_record_enabled" { 288 | type = bool 289 | default = false 290 | description = "Whether to create Route53 record memcached set." 291 | } 292 | 293 | variable "route53" { 294 | type = map(any) 295 | default = {} 296 | description = "Route53 Configurations." 297 | } 298 | 299 | ###------------------------------- ssm_parameter---------------------------- 300 | 301 | variable "ssm_parameter_endpoint_enabled" { 302 | type = bool 303 | default = false 304 | description = "Name of the parameter." 305 | } 306 | 307 | variable "memcached_ssm_parameter_endpoint_enabled" { 308 | type = bool 309 | default = false 310 | description = "Name of the parameter." 311 | } 312 | 313 | variable "ssm_parameter_description" { 314 | type = string 315 | default = "Description of the parameter." 316 | description = "SSM Parameters can be imported using." 317 | } 318 | 319 | variable "ssm_parameter_type" { 320 | type = string 321 | default = "SecureString" 322 | description = "Type of the parameter." 323 | } 324 | 325 | ###------------------------------- random_password---------------------------- 326 | 327 | variable "length" { 328 | type = number 329 | default = 25 330 | } 331 | 332 | variable "special" { 333 | type = bool 334 | default = false 335 | 336 | } 337 | -------------------------------------------------------------------------------- /versions.tf: -------------------------------------------------------------------------------- 1 | # Terraform version 2 | terraform { 3 | required_version = ">= 1.6.5" 4 | 5 | required_providers { 6 | aws = { 7 | source = "hashicorp/aws" 8 | version = ">= 5.31.0" 9 | } 10 | random = { 11 | source = "hashicorp/random" 12 | version = ">= 3.6.0" 13 | } 14 | } 15 | } 16 | --------------------------------------------------------------------------------
"environment",
"name"
]