This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
### --- ec2/providers.tf --- | |
resource "aws_instance" "app_server" { | |
ami = var.ami | |
instance_type = var.instance_type | |
tags = { | |
Name = var.tag_name | |
} | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
### --- ec2/providers.tf --- | |
terraform { | |
required_providers { | |
aws = { | |
source = "hashicorp/aws" | |
version = "~> 3.27" | |
} | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Local .terraform directories | |
**/.terraform/* | |
**/.terraform.* | |
# .tfstate files | |
*.tfstate | |
*.tfstate.* | |
# Crash log files | |
crash.log |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
resource "aws_ecs_cluster" "cluster" { | |
name = "week20_ecs_cluster" | |
capacity_providers = ["FARGATE_SPOT", "FARGATE"] | |
default_capacity_provider_strategy { | |
capacity_provider = "FARGATE_SPOT" | |
} | |
setting { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
resource "aws_subnet" "private_subnet_1" { | |
vpc_id = aws_vpc.ecs_vpc.id | |
cidr_block = "10.0.2.0/24" | |
availability_zone = "us-east-1a" | |
tags = { | |
Name = "private_subnet_1" | |
} | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
resource "aws_vpc" "ecs_vpc" { | |
cidr_block = var.vpc_cidr | |
tags = { | |
Name = "vpc_ecs_week20project" | |
} | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
resource "aws_vpc" "ecs_vpc" { | |
cidr_block = var.vpc_cidr | |
tags = { | |
Name = "vpc_ecs_week20project" | |
} | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
variable "region" { | |
description = "The region where environment is going to be deployed" | |
type = string | |
default = "us-east-1" | |
} | |
variable "aws_access_key" { | |
type = string | |
sensitive = true | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
terraform { | |
required_providers { | |
docker = { | |
source = "kreuzwerker/docker" | |
version = "2.15.0" | |
} | |
aws = { | |
source = "hashicorp/aws" | |
version = "~> 3.0" | |
} |
NewerOlder