Skip to content
This repository was archived by the owner on Oct 8, 2022. It is now read-only.

Added support for existing subnet group and security group #18

Open
wants to merge 1 commit into
base: develop
Choose a base branch
from

Conversation

easyawslearn
Copy link

No description provided.

@rbreslow rbreslow self-requested a review January 30, 2019 18:47
Copy link

@rbreslow rbreslow left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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}"
  ...
}

@easyawslearn
Copy link
Author

@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,
Vijay

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants