Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
T
terraform-aws-elasticache-redis
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Packages
Packages
Container Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Terraform Modules
terraform-aws-elasticache-redis
Commits
badb311c
Unverified
Commit
badb311c
authored
Oct 25, 2021
by
Nuru
Committed by
GitHub
Oct 25, 2021
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Bugfixes (#136)
* Fix #134 use only existing security groups * Fix #135, default zone ID
parent
42cf8d14
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
6 additions
and
5 deletions
+6
-5
main.tf
main.tf
+5
-4
security_group_inputs.tf
security_group_inputs.tf
+1
-1
No files found.
main.tf
View file @
badb311c
...
...
@@ -34,6 +34,8 @@ module "aws_security_group" {
source
=
"cloudposse/security-group/aws"
version
=
"0.4.2"
enabled
=
local
.
create_security_group
allow_all_egress
=
local
.
allow_all_egress
security_group_name
=
var
.
security_group_name
rules_map
=
local
.
sg_rules
...
...
@@ -61,7 +63,6 @@ module "aws_security_group" {
security_group_delete_timeout
=
var
.
security_group_delete_timeout
enabled
=
local
.
enabled
&&
local
.
create_security_group
context
=
module
.
this
.
context
}
...
...
@@ -114,10 +115,10 @@ resource "aws_elasticache_replication_group" "default" {
automatic_failover_enabled
=
var
.
automatic_failover_enabled
multi_az_enabled
=
var
.
multi_az_enabled
subnet_group_name
=
local
.
elasticache_subnet_group_name
# It would be nice to remove duplicate security group IDs, if there are any, using `compact`,
# It would be nice to remove
null or
duplicate security group IDs, if there are any, using `compact`,
# but that causes problems, and having duplicates does not seem to cause problems.
# See https://github.com/hashicorp/terraform/issues/29799
security_group_ids
=
concat
(
local
.
associated_security_group_ids
,
[
module
.
aws_security_group
.
id
]
)
security_group_ids
=
local
.
create_security_group
?
concat
(
local
.
associated_security_group_ids
,
[
module
.
aws_security_group
.
id
]
)
:
local
.
associated_security_group_ids
maintenance_window
=
var
.
maintenance_window
notification_topic_arn
=
var
.
notification_topic_arn
engine_version
=
var
.
engine_version
...
...
@@ -196,7 +197,7 @@ module "dns" {
enabled
=
module
.
this
.
enabled
&&
length
(
var
.
zone_id
)
>
0
?
true
:
false
dns_name
=
var
.
dns_subdomain
!
=
""
?
var
.
dns_subdomain
:
module
.
this
.
id
ttl
=
60
zone_id
=
try
(
var
.
zone_id
[
0
]
,
var
.
zone_id
)
zone_id
=
try
(
var
.
zone_id
[
0
]
,
tostring
(
var
.
zone_id
),
""
)
records
=
var
.
cluster_mode_enabled
?
[
join
(
""
,
aws_elasticache_replication_group
.
default
.*.
configuration_endpoint_address
)
]
:
[
join
(
""
,
aws_elasticache_replication_group
.
default
.*.
primary_endpoint_address
)
]
context
=
module
.
this
.
context
...
...
security_group_inputs.tf
View file @
badb311c
...
...
@@ -9,7 +9,7 @@ variable "create_security_group" {
}
locals
{
create_security_group
=
var
.
use_existing_security_groups
==
null
?
var
.
create_security_group
:
!
var
.
use_existing_security_groups
create_security_group
=
local
.
enabled
&&
(
var
.
use_existing_security_groups
==
null
?
var
.
create_security_group
:
!
var
.
use_existing_security_groups
)
}
variable
"associated_security_group_ids"
{
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment