Giter Site home page Giter Site logo

Comments (10)

LucianU avatar LucianU commented on May 24, 2024 1

@RaduCStefanescu, I can make a Terraform setup that automates all this. Terraform can also handle creating ECR, ECS and EC2. This is an example of the final result, without the Haskell and Nix part:
https://www.williamyaoh.com/posts/2019-04-09-deploying-haskell-with-ecs-and-nix.html

from seismic-risc.

RaduCStefanescu avatar RaduCStefanescu commented on May 24, 2024 1

@LucianU

  • Based on our recent discussions regarding DevOps I would like to use Docker Hub as a repository for our images
  • The EC2 instances should be t2.micro

from seismic-risc.

RaduCStefanescu avatar RaduCStefanescu commented on May 24, 2024

Hi @LucianU
Pretty awesome you want to contribute to this issue.
Well, my thoughts were about using Ansible for this task? What do you think?

from seismic-risc.

LucianU avatar LucianU commented on May 24, 2024

If all the other infrastructure provisioning code is in Ansible, then I understand why you would want to keep it that way.

My reasons for preferring Terraform now over Ansible are as follows:

Ansible doesn't keep a state of the infrastructure while Terraform does.
What do I mean by this? Let's say you have an Ansible task that creates 1 server. If you run the task twice, you get two servers, unless you assign a label to that server and check that it exists before you run the task.

Terraform keeps a snapshot of your entire infrastructure in a file which you can share with others. If you add a server resource to your Terraform files, it will make sure that exists. If it exists, it won't do anything. Every time you run terraform apply, it will show you the changes it will make.

There is another consequence to Ansible's lack of state. If you delete a task, Ansible doesn't know to clean up the resource defined by that task. So you're left with junk around, unless you remember to delete it manually.

With Terraform, if you delete a resource from the config file, Terraform will delete it from the infrastructure.

Again, if all infrastructure code is in Ansible, I can understand why you don't want to add a second tool and I can do this in Ansible. But if there isn't much Ansible code, I recommend using Terraform.

References:
https://blog.gruntwork.io/why-we-use-terraform-and-not-chef-puppet-ansible-saltstack-or-cloudformation-7989dad2865c
https://blog.gruntwork.io/an-introduction-to-terraform-f17df9c6d180

from seismic-risc.

LucianU avatar LucianU commented on May 24, 2024

Considering the conversation we had on Slack, I'll go ahead and start working on a setup that uses Terraform to provision the needed AWS resources.

@RaduCStefanescu, will you assign the task to me?

from seismic-risc.

RaduCStefanescu avatar RaduCStefanescu commented on May 24, 2024

Assigned @LucianU
Thank you!

from seismic-risc.

RaduCStefanescu avatar RaduCStefanescu commented on May 24, 2024

In progress @LucianU

from seismic-risc.

LucianU avatar LucianU commented on May 24, 2024

@RaduCStefanescu, I have a few questions:

  • do we already have an ECR or should Terraform create one?
  • what type of EC2 instance should we create?

from seismic-risc.

LucianU avatar LucianU commented on May 24, 2024

@RaduCStefanescu, can I get access to an AWS account where I can test the Terraform setup?

from seismic-risc.

RaduCStefanescu avatar RaduCStefanescu commented on May 24, 2024

@LucianU I will come back with the details in Slack

from seismic-risc.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.