#terraform-aws-modules - April 2020

curious deviant
curious deviantover 6 years ago
Hello, requesting some thoughts/opinions. So I am looking at building reusable tf modules for my teams. We are divided in our opinion on whether we should use a mono-repo and have sub-directories for each aws resource or one github repo per resource. On my previous projects, I have done the later. Each component has it's own lifecycle (tagging etc. ) that way and also only the required modules get downloaded and not the entire mono-repo during terraform get. What do you guys think ?
Shawn Petersen
Shawn Petersenover 6 years ago
i agree with separate repos from an access perspective, especially with different teams. You might not want some teams accessing/building vpc or iam resources, while letting them build out ec2 or s3 etc...
Taco
Tacoover 6 years ago
Hello - I am using the terraform-aws-alb module and am trying to figure out how to attach targets to the created load balancer. I have instances that are running due to the autoscale_groupmodule, but I’m uncertain how to attach them. I’ve looked at the regular Terraform aws_lb_target_group_attachment resource, but haven’t worked out how to deal with the fact that I have two instances but target_id on aws_lb_target_group_attachment appears to only take one id. Any guidance would be much appreciated.
David
Davidover 6 years ago(edited)
Are you using the https://github.com/terraform-aws-modules/terraform-aws-autoscaling module? I don't see any module named autoscale_group on the main module registry.

If so, you just put the alb target group arns from the load balancer module into the autoscaling module, with something like target_group_arns = module.alb.target_group_arns

Regardless of module, target_group_arns is a field on the aws_autoscaling_group terraform resource
Taco
Tacoover 6 years ago
Thanks, and sorry for the typo. Your info helped.
Taco
Tacoover 6 years ago
A follow up to yesterday’s question. I am using the CloudPosse ALB module (https://github.com/cloudposse/terraform-aws-alb) in conjunction with the CloudPosse ASG module (https://github.com/cloudposse/terraform-aws-ec2-autoscale-group). I linked them via target_group_arns as suggested yesterday. I instructed the ASG to used a standard, Linux AMI as its image, and I also tell the ASG to install httpd, etc. via userdata. However, I keep getting a 504 Gateway Time-out error. During troubleshooting, I noticed that the registered targets in my target group are failing their health check with 504 errors. When I look at the actual EC2 instances, they are using the default VPC security group which has no ingress or egress rules. So I found my 504 problem, but I’m not certain why my targets don’t have the proper security groups. The module is generating the expected security group to let in [0.0.0.0/0] over port 80, but that security group is not assigned to the targets in my target group. I see that the security groups are assigned to the ENIs, but that’s it. Any help/advice is most appreciated.
Taco
Tacoover 6 years ago
May have figured this out. I needed to get the security group from the ALB module and feed it into the ASG module.
Bircan Bilici
Bircan Biliciover 6 years ago
Hi Guys,
I’ve added some additional parameters into terraform-aws-codebuild
https://github.com/cloudposse/terraform-aws-codebuild/pull/53
Can some one review pls.
Thnks
Alex Siegman
Alex Siegmanover 6 years ago
Just a quick one to add a missing output: https://github.com/cloudposse/terraform-aws-rds/pull/59
joshmyers
joshmyersover 6 years ago
Hey @Maxim Mironenko (Cloud Posse) - any movement on https://github.com/cloudposse/terraform-aws-tfstate-backend/pull/43 ?
Partha
Parthaover 6 years ago(edited)
Hi All,
Can some suggest module for ElastiCache (REDIS)
drexler
drexlerover 6 years ago(edited)
Hi im trying to create a multiple subnets with terraform-aws-multi-az-subnets . However, since count is not allowed within modules, is there a way to use a single module and have some kind of iteration over the cidr lists to generate the subnets?
cabrinha
cabrinhaover 6 years ago
Hello there, I'd like to disable the creation of the s3 endpoint when using the EMR module: https://github.com/cloudposse/terraform-aws-emr-cluster/pull/14 -- I've already got an S3 endpoint managed somewhere else.
Erik Osterman (Cloud Posse)
Erik Osterman (Cloud Posse)over 6 years ago
@Maxim Mironenko (Cloud Posse) ☝️
Erik Osterman (Cloud Posse)
Erik Osterman (Cloud Posse)over 6 years ago
(Also we have #pr-reviews channel)
cabrinha
cabrinhaover 6 years ago(edited)
The bot and these commands are really nice!
sheldonh
sheldonhover 6 years ago
Anyone have a module I can plugin to get RDS event logging for cloudwatch events pushed to cloudwatch logs+pager duty or similar destination. I saw an older cloudposse one, some promise. Anything else?
navdeep
navdeepover 6 years ago
@Andriy Knysh (Cloud Posse) i have been using cloudposse for long time , hey just need a direction for how to include a provision for reading a another account bucket
i have been using private subnet for emr clusters
joshmyers
joshmyersover 6 years ago
Hey folks - Opened a smol PR - https://github.com/cloudposse/terraform-aws-route53-alias/pull/21 was hoping for maybe a quick turnaround? 😄 cc @Erik Osterman (Cloud Posse) / @Maxim Mironenko (Cloud Posse)
Erik Osterman (Cloud Posse)
Erik Osterman (Cloud Posse)over 6 years ago
@Andriy Knysh (Cloud Posse) can you review this ☝️
Andriy Knysh (Cloud Posse)
Andriy Knysh (Cloud Posse)over 6 years ago
yes
erik
erikover 6 years ago
set the channel topic: :terraform: Terraform Modules
joshmyers
joshmyersover 6 years ago
Thank you!
Andriy Knysh (Cloud Posse)
Andriy Knysh (Cloud Posse)over 6 years ago