Skip to content

Commit

Permalink
[IBCDPE-1004] Deploy airflow to dpe-prod
Browse files Browse the repository at this point in the history
* Deploy airflow to dpe-prod
  • Loading branch information
BryanFauble authored Aug 20, 2024
1 parent 4d8752f commit a836505
Show file tree
Hide file tree
Showing 6 changed files with 47 additions and 27 deletions.
8 changes: 8 additions & 0 deletions common-resources/aws-integrations/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -6,3 +6,11 @@ resource "spacelift_aws_integration" "org-sagebase-dnt-dev-aws-integration" {
duration_seconds = 3600
space_id = "root"
}

resource "spacelift_aws_integration" "org-sagebase-dpe-prod-aws-integration" {
name = "org-sagebase-dpe-prod-aws-integration"
role_arn = "arn:aws:iam::766808016710:role/spacelift-admin-role"
generate_credentials_in_worker = false
duration_seconds = 3600
space_id = "root"
}
4 changes: 4 additions & 0 deletions common-resources/aws-integrations/outputs.tf
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
output "org_sagebase_dnt_dev_aws_integration_id" {
value = spacelift_aws_integration.org-sagebase-dnt-dev-aws-integration.id
}

output "org_sagebase_dpe_prod_aws_integration_id" {
value = spacelift_aws_integration.org-sagebase-dpe-prod-aws-integration.id
}
4 changes: 4 additions & 0 deletions common-resources/outputs.tf
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
output "org_sagebase_dnt_dev_aws_integration_id" {
value = module.aws-integrations.org_sagebase_dnt_dev_aws_integration_id
}

output "org_sagebase_dpe_prod_aws_integration_id" {
value = module.aws-integrations.org_sagebase_dpe_prod_aws_integration_id
}
44 changes: 21 additions & 23 deletions deployments/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -42,33 +42,31 @@ module "dpe-sandbox-spacelift-development" {
azs = ["us-east-1a", "us-east-1b", "us-east-1c"]
}

# TODO: Fill this out with production specific values when we are ready

# module "dpe-sandbox-spacelift-development" {
# source = "./spacelift/dpe-k8s"
# parent_space_id = spacelift_space.development.id
# admin_stack_id = var.admin_stack_id
module "dpe-sandbox-spacelift-production" {
source = "./spacelift/dpe-k8s"
parent_space_id = spacelift_space.production.id
admin_stack_id = var.admin_stack_id

# aws_integration_id = var.org_sagebase_dnt_dev_aws_integration_id
# auto_deploy = true
# git_branch = var.git_branch
aws_integration_id = var.org_sagebase_dpe_prod_aws_integration_id
auto_deploy = false
git_branch = var.git_branch

# space_name = "dpe-sandbox"
space_name = "dpe-k8s"

# k8s_stack_name = "DPE DEV Kubernetes Infrastructure"
# k8s_stack_project_root = "deployments/stacks/dpe-k8s"
k8s_stack_name = "DPE Kubernetes Infrastructure"
k8s_stack_project_root = "deployments/stacks/dpe-k8s"

# k8s_stack_deployments_name = "DPE DEV Kubernetes Deployments"
# k8s_stack_deployments_project_root = "deployments/stacks/dpe-k8s-deployments"
k8s_stack_deployments_name = "DPE Kubernetes Deployments"
k8s_stack_deployments_project_root = "deployments/stacks/dpe-k8s-deployments"

# aws_account_id = "631692904429"
# region = "us-east-1"
aws_account_id = "766808016710"
region = "us-east-1"

# cluster_name = "dpe-k8-sandbox"
# vpc_name = "dpe-sandbox"
cluster_name = "dpe-k8"
vpc_name = "dpe-k8"

# vpc_cidr_block = "10.51.0.0/16"
# public_subnet_cidrs = ["10.51.1.0/24", "10.51.2.0/24", "10.51.3.0/24"]
# private_subnet_cidrs = ["10.51.4.0/24", "10.51.5.0/24", "10.51.6.0/24"]
# azs = ["us-east-1a", "us-east-1b", "us-east-1c"]
# }
vpc_cidr_block = "10.52.0.0/16"
public_subnet_cidrs = ["10.52.1.0/24", "10.52.2.0/24", "10.52.3.0/24"]
private_subnet_cidrs = ["10.52.4.0/24", "10.52.5.0/24", "10.52.6.0/24"]
azs = ["us-east-1a", "us-east-1b", "us-east-1c"]
}
5 changes: 5 additions & 0 deletions deployments/variables.tf
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,11 @@ variable "org_sagebase_dnt_dev_aws_integration_id" {
type = string
}

variable "org_sagebase_dpe_prod_aws_integration_id" {
description = "ID of the AWS integration for the org-sagebase-dpe-prod account"
type = string
}

variable "git_branch" {
description = "The branch to deploy"
type = string
Expand Down
9 changes: 5 additions & 4 deletions main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -60,8 +60,9 @@ module "deployments" {
module.common,
module.terraform-registry,
]
parent_space_id = spacelift_space.environment.id
admin_stack_id = spacelift_stack.root_administrative_stack.id
org_sagebase_dnt_dev_aws_integration_id = module.common.org_sagebase_dnt_dev_aws_integration_id
git_branch = local.git_branch
parent_space_id = spacelift_space.environment.id
admin_stack_id = spacelift_stack.root_administrative_stack.id
org_sagebase_dnt_dev_aws_integration_id = module.common.org_sagebase_dnt_dev_aws_integration_id
org_sagebase_dpe_prod_aws_integration_id = module.common.org_sagebase_dpe_prod_aws_integration_id
git_branch = local.git_branch
}

0 comments on commit a836505

Please sign in to comment.