Hacker News new | ask | show | jobs
by jcoby 3597 days ago
> Have you considered starting your own stack from the ground up?

Yes. I'm actually in the middle of trying that now.

I want to set up a vpc, a few web servers (1-10) with an autoscaling policy behind the vpc along with a bastion server and a cron server, a code deploy setup to work with autoscaling, cloudwatch logging and monitoring, a load balancer, an elasticache instance, and an rds instance. I've been working on this off an on for months. If you or anyone else can point me in a direction to simplify this I'd be grateful.

The core of the problem I had with terraform (outside of the ECS issue) is that there is one AWS service that gets soft deleted. I can't remember what it is right now but it really threw tf for a loop. So I'd setup the stack, do some testing, decide to shut everything down for the day with a `terraform destroy` and the next day i couldn't resume because tf thinks the resource exists but aws doesn't think it does.

2 comments

What you are describing is pretty trivial with Terraform so shouldn't definitely take months. A week or two.

You can look at my github.com/RichardKnop/coreos-cluster as an example (that one sets up a CoreOS cluster but you can take just the VPC, RDS, security groups, subnets and NAT bastion from there. I also have couple more terraform repos on my GitHub that deploy AWS infrastructures like you described.

Also look at the GitHub of Government Digital Service (GDS), I think it's alphagov. They have a lot of nice terraform stuff there from their experimentation with different PaaS.

What part are you having trouble with? You can use the AWS provider for the VPC, security groups, EC2 instances for the bastion host, cron server and load balancer (or an ELB). Elasticache and RDS also require parameter groups and subnet groups. They don't support replication groups for Elasticache yet, but there's a PR for it.

I've also seen tfstate get weird after a slow Elasticache spin up or termination. If it takes over 10 minutes it times out. The main thing I don't like about Terraform is that they don't support conditionals, which can be annoying.

https://www.terraform.io/docs/providers/aws/