-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmain.tf
More file actions
83 lines (76 loc) · 2.21 KB
/
Copy pathmain.tf
File metadata and controls
83 lines (76 loc) · 2.21 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
provider "aws" {
region = var.aws_region
default_tags {
tags = {
Environment = var.environment
Project = "FedRAMP-Containers"
ManagedBy = "OpenTofu"
}
}
}
# Initialize OpenTofu backend for state management
terraform {
required_providers {
aws = {
source = "hashicorp/aws"
version = "~> 5.0"
}
}
required_version = ">= 1.6.0"
}
# Remote state backend configuration (uncomment when ready to use)
# If using OpenTofu Cloud, adjust accordingly
/*
terraform {
backend "s3" {
bucket = var.state_bucket_name
key = "fedramp/terraform.tfstate"
region = var.aws_region
dynamodb_table = var.state_lock_table
encrypt = true
}
}
*/
# VPC Module
module "vpc" {
source = "./modules/fedramp/vpc"
vpc_cidr = var.vpc_cidr
environment = var.environment
availability_zones = var.availability_zones
# Remove EKS-specific configuration
}
# IAM Module
module "iam" {
source = "./modules/fedramp/iam"
environment = var.environment
}
# Security Module
module "security" {
source = "./modules/fedramp/security"
environment = var.environment
vpc_id = module.vpc.vpc_id
# Remove EKS-specific configuration
}
# ECS (Container Service) Module
module "ecs" {
source = "./modules/fedramp/ecs"
environment = var.environment
vpc_id = module.vpc.vpc_id
subnet_ids = module.vpc.private_subnet_ids
ecs_instance_role_name = module.iam.ecs_instance_role_name
cluster_name = var.ecs_cluster_name
instance_type = var.instance_type
instance_group_desired_size = var.instance_group_desired_size
instance_group_min_size = var.instance_group_min_size
instance_group_max_size = var.instance_group_max_size
ebs_kms_key_arn = module.security.ebs_kms_key_id
ecs_exec_kms_key_arn = module.security.secrets_kms_key_id
enable_ssh_access = false # FedRAMP recommends using SSM instead of SSH
}
# Monitoring & Logging Module
module "monitoring" {
source = "./modules/fedramp/monitoring"
environment = var.environment
vpc_id = module.vpc.vpc_id
ecs_cluster_id = module.ecs.cluster_id
}