Added support for existing subnet group and security group#18
Added support for existing subnet group and security group#18easyawslearn wants to merge 1 commit into
Conversation
rbreslow
left a comment
There was a problem hiding this comment.
Hey @Patelvijaykumar, thanks for taking the time to work on this contribution!
Our approach with security groups across our modules has been to create the security group, but not supply it with any rules. We have an output for the security group ID, which can be used with the aws_security_group_rule resource like:
resource "aws_security_group_rule" "bastion_redis_egress" {
type = "egress"
from_port = 6379
to_port = 6379
protocol = "tcp"
security_group_id = "${module.vpc.bastion_security_group_id}"
source_security_group_id = "${module.cache.cache_security_group_id}"
}Here, cache is an instance of this module.
Support for subnet groups seems to be already wired up in this module. You can thread in an existing subnet group like this:
resource "aws_elasticache_subnet_group" "redis" {
...
}
module "cache" {
source = "github.com/azavea/terraform-aws-redis-elasticache"
...
subnet_group = "${aws_elasticache_subnet_group.redis.name}"
...
}|
@rbreslow Thanks for your review. changes taken for security group and subnet group is for referring to the existing resources. This should not impact to a resource which is getting created in the script. No issues if you have not planned to take such a strategy. Thanks, |
No description provided.