Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
23 changes: 23 additions & 0 deletions infra/envs/dev/.terraform.lock.hcl

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

18 changes: 18 additions & 0 deletions infra/envs/dev/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,10 @@ terraform {
source = "hashicorp/google"
version = "~> 5.0"
}
aws = {
source = "hashicorp/aws"
version = "~> 5.0"
}
}
}

Expand All @@ -16,6 +20,10 @@ provider "google" {
region = var.region
}

provider "aws" {
region = var.aws_region
}

module "network" {
source = "../../modules/network"

Expand All @@ -35,3 +43,13 @@ module "heapdog_dev_instance" {
network_self_link = module.network.network_self_link
subnet_self_link = module.network.subnet_self_link
}

module "storage" {
source = "../../modules/storage"

bucket_name = var.bucket_name
tags = {
Environment = "dev"
Project = "heapdog"
}
}
10 changes: 9 additions & 1 deletion infra/envs/dev/outputs.tf
Original file line number Diff line number Diff line change
Expand Up @@ -14,4 +14,12 @@ output "dev_instance_internal_ip" {

output "network_name" {
value = module.network.network_name
}
}

output "storage_bucket_id" {
value = module.storage.bucket_id
}

output "storage_bucket_arn" {
value = module.storage.bucket_arn
}
13 changes: 12 additions & 1 deletion infra/envs/dev/variables.tf
Original file line number Diff line number Diff line change
Expand Up @@ -17,4 +17,15 @@ variable "zone" {
description = "GCP zone"
type = string
default = "northamerica-northeast1-a"
}
}

variable "aws_region" {
description = "AWS region"
type = string
default = "us-east-1"
}

variable "bucket_name" {
description = "Name of the S3 bucket"
type = string
}
22 changes: 22 additions & 0 deletions infra/envs/prod/.terraform.lock.hcl

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

12 changes: 11 additions & 1 deletion infra/envs/prod/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -34,4 +34,14 @@ module "heapdog_prod_instance" {
disk_size_gb = 30
network_self_link = module.network.network_self_link
subnet_self_link = module.network.subnet_self_link
}
}

module "storage" {
source = "../../modules/storage"

bucket_name = var.bucket_name
tags = {
Environment = "prod"
Project = "heapdog"
}
}
10 changes: 9 additions & 1 deletion infra/envs/prod/outputs.tf
Original file line number Diff line number Diff line change
Expand Up @@ -14,4 +14,12 @@ output "prod_instance_internal_ip" {

output "network_name" {
value = module.network.network_name
}
}

output "storage_bucket_id" {
value = module.storage.bucket_id
}

output "storage_bucket_arn" {
value = module.storage.bucket_arn
}
13 changes: 12 additions & 1 deletion infra/envs/prod/variables.tf
Original file line number Diff line number Diff line change
Expand Up @@ -17,4 +17,15 @@ variable "zone" {
description = "GCP zone"
type = string
default = "northamerica-northeast1-a"
}
}

variable "aws_region" {
description = "AWS region"
type = string
default = "us-east-1"
}

variable "bucket_name" {
description = "Name of the S3 bucket"
type = string
}
4 changes: 4 additions & 0 deletions infra/modules/compute/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -46,4 +46,8 @@ resource "google_compute_instance" "vm" {
metadata = {
enable-oslogin = "TRUE"
}

lifecycle {
ignore_changes = [boot_disk[0].initialize_params[0].image]
}
}
10 changes: 10 additions & 0 deletions infra/modules/storage/main.tf
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
# ============================================================================
# infra/modules/storage/main.tf
# ============================================================================

resource "aws_s3_bucket" "bucket" {
bucket = var.bucket_name

tags = var.tags
}

14 changes: 14 additions & 0 deletions infra/modules/storage/outputs.tf
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
# ============================================================================
# infra/modules/storage/outputs.tf
# ============================================================================

output "bucket_id" {
description = "The name of the bucket"
value = aws_s3_bucket.bucket.id
}

output "bucket_arn" {
description = "The ARN of the bucket"
value = aws_s3_bucket.bucket.arn
}

15 changes: 15 additions & 0 deletions infra/modules/storage/variables.tf
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
# ============================================================================
# infra/modules/storage/variables.tf
# ============================================================================

variable "bucket_name" {
description = "Name of the S3 bucket"
type = string
}

variable "tags" {
description = "Tags to apply to the bucket"
type = map(string)
default = {}
}