MyGit

dmamulashvili/terraform-aws-microservices

Fork: 2 Star: 0 (更新于 2024-11-21 15:04:39)

license: MIT

Language: HCL .

Terraform configuration sample to create AWS 3-Tier Infrastructure for deploying Microservices using ECS & RDS/Aurora PostgreSQL

GitHub网址

terraform-aws-microservices

Terraform configuration sample to create AWS 3-Tier Infrastructure for deploying Microservices using ECS & RDS/Aurora PostgreSQL

Install AWS CLI

Configure access_key & secret_key using aws profile

aws configure --profile myprofile

or use access_key & secret_key variables.

variables.tf

variable "region" {
  type = string
}

variable "app_name" {
  type = string
}

# Route 53 Hosted Zone
variable "domain_name" {
  type = string
}

# ALB https
variable "certificate_arn" {
  type = string
}

variable "env_name" {
  type = string
  validation {
    condition     = var.env_name == "dev" || var.env_name == "stage" || var.env_name == "prod"
    error_message = "The env_name value must be dev, stage or prod."
  }
}

variable "db_master_username" {
  type = string
}

#variable "access_key" {
#  type = string
#}
#
#variable "secret_key" {
#  type = string
#}

main.tf

provider "aws" {
  region     = var.region
#  access_key = var.access_key
#  secret_key = var.secret_key
  profile = ""
}

Terraform backend is disabled. view versions.tf

https://www.terraform.io/language/settings/backends/configuration

// Terraform Cloud
terraform {
  cloud {
    organization = ""

    workspaces {
      name = ""
    }
  }
  required_providers {
    aws = {
      source = "hashicorp/aws"
    }
  }
}

// AWS S3
terraform {
  backend "s3" {
    bucket  = ""
    key     = ""
    region  = ""
    profile = ""
#    access_key = ""
#    secret_key = ""
  }
  required_providers {
    aws = {
      source = "hashicorp/aws"
    }
  }
}

Initialize Terraform

cd src
terraform init

Plan & Apply

terraform plan
terraform apply

Destroy

terraform destroy

最近版本更新:(数据更新于 1970-01-01 00:00:00)

主题(topics):

3-tier-architecture, aws, ecs, rds, rds-aurora, terraform

dmamulashvili/terraform-aws-microservices同语言 HCL最近更新仓库

2024-10-03 21:55:26 terraform-aws-modules/terraform-aws-eks

2024-09-23 20:07:29 datalens-tech/datalens

2024-09-15 16:51:41 tungbq/devops-basics

2024-08-24 20:36:42 terraform-aws-modules/terraform-aws-rds-aurora

2024-03-04 21:50:51 canonical/packer-maas

2023-08-10 03:08:17 aws-ia/terraform-aws-eks-blueprints