Skip to content

ralvescosta/cdktf-hello-world

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

22 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Terraform CDK for AWS ECS Fargate

Table of Contents

Introduction

Welcome to the Terraform CDK project for AWS ECS Fargate! This project leverages the power of Terraform and the ease of the CDK (Cloud Development Kit) to create and manage AWS infrastructure for running containerized applications using ECS Fargate. In this README, we'll provide an overview of Terraform and the CDK, explain the benefits of using them together, and describe how Terraform CDK works.

What is Terraform?

Terraform is an open-source infrastructure as code (IaC) tool that enables you to define and provision your infrastructure using a declarative configuration language. Terraform helps you manage your infrastructure efficiently by creating, updating, and destroying resources as needed, while also providing a clear and versioned representation of your infrastructure.

What is Terraform CDK?

The Terraform CDK (CDKTF) is a framework that allows you to define infrastructure using familiar programming languages like TypeScript, Python, and Go. This enables developers to harness the power of Terraform while leveraging the expressiveness and abstraction capabilities of their chosen programming language. CDKTF provides a higher-level way to define and manage infrastructure resources, making it easier to create and maintain complex infrastructure setups.

Benefits of Terraform CDK

  • Expressiveness: Write infrastructure code using programming languages you are familiar with, enabling you to use loops, conditionals, and other language features.

  • Abstraction: Create reusable constructs and abstractions to simplify your infrastructure definitions and reduce boilerplate code.

  • IDE Support: Leverage the capabilities of modern code editors and IDEs for autocompletion, error checking, and debugging.

  • Terraform Compatibility: CDKTF generates Terraform configuration, so you can seamlessly integrate with existing Terraform projects and modules.

How Terraform CDK Works

Terraform CDK operates in two main steps:

  1. Generate Terraform Configuration: Your CDK code is used to generate Terraform configuration files (.tf.json) that represent the desired infrastructure.

  2. Apply with Terraform: Terraform then takes these generated configuration files and applies them to create or modify AWS resources based on your specifications.

AWS ECS Fargate

AWS Elastic Container Service (ECS) Fargate is a compute engine for containers that allows you to run Docker containers without managing the underlying infrastructure. It's a serverless option for deploying and managing containerized applications, offering high scalability and ease of use.

Project Structure

Here's an overview of the project structure:

openapi

Getting Started

To use this project, you'll need the following prerequisites:

Follow these steps to get started:

  1. Clone the repository:

    git clone git@github.com:ralvescosta/cdktf-hello-world.git
    cd cdktf-hello-world
  2. Update the configure package with your terraform cloud configurations.

  3. Get the pre built AWS go files

cdktf get
  1. Run cdktf plan to check if everything is configured
cdktf plan
  1. With everything set up, just deploy
cdktf deploy

That's it! You've successfully deployed your AWS ECS Fargate infrastructure using Terraform CDK.

Contributing

We welcome contributions from the community! If you'd like to contribute to this project, please read our Contributing Guidelines to get started.

License

This project is licensed under the MIT License. See the LICENSE file for more details.

About

Simple project to learn about Terraform CDK

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published