Skip to content

Commit

Permalink
Update ECS configuration and provider settings
Browse files Browse the repository at this point in the history
  • Loading branch information
arnol377 committed Mar 28, 2025
1 parent 4103f97 commit c51aca0
Show file tree
Hide file tree
Showing 7 changed files with 84 additions and 25 deletions.
38 changes: 38 additions & 0 deletions .terraform_commits
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
[
{
"commit_hash": "4103f97c8464e786fafafcdab1f662391b5453f1",
"commit_message": "Refactor default.auto.tfvars and main.tf",
"author": "arnol377",
"timestamp": "2025-03-19T20:41:35.149386"
},
{
"commit_hash": "4103f97c8464e786fafafcdab1f662391b5453f1",
"commit_message": "Refactor default.auto.tfvars and main.tf",
"author": "arnol377",
"timestamp": "2025-03-20T17:24:21.832799"
},
{
"commit_hash": "4103f97c8464e786fafafcdab1f662391b5453f1",
"commit_message": "Refactor default.auto.tfvars and main.tf",
"author": "arnol377",
"timestamp": "2025-03-20T19:24:43.494765"
},
{
"commit_hash": "4103f97c8464e786fafafcdab1f662391b5453f1",
"commit_message": "Refactor default.auto.tfvars and main.tf",
"author": "arnol377",
"timestamp": "2025-03-27T14:27:43.832274"
},
{
"commit_hash": "4103f97c8464e786fafafcdab1f662391b5453f1",
"commit_message": "Refactor default.auto.tfvars and main.tf",
"author": "arnol377",
"timestamp": "2025-03-27T15:46:34.927126"
},
{
"commit_hash": "4103f97c8464e786fafafcdab1f662391b5453f1",
"commit_message": "Refactor default.auto.tfvars and main.tf",
"author": "arnol377",
"timestamp": "2025-03-27T16:21:05.154328"
}
]
1 change: 1 addition & 0 deletions .vscode-server-insiders
5 changes: 3 additions & 2 deletions default.auto.tfvars
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# The name of the ECS cluster
image_name = "github-runner"
image_version = "1.65.0"
image_version = "1.67.0"
server_url = "https://github.e.it.census.gov"
create_vpc_endpoint = false
create_ecs_cluster = true
Expand All @@ -21,8 +21,9 @@ security_groups = [
]

certs = {
bucket = "image-pipeline-assets"
bucket = "csvd-dev-ew-github-actions"
key = "katello-server-ca.pem"
}

aws_account = "csvd-dev-ew"
repo_org = "SCT-Engineering"
26 changes: 13 additions & 13 deletions main.tf
Original file line number Diff line number Diff line change
@@ -1,16 +1,16 @@
data "aws_ecs_cluster" "github-runner" {
count = var.create_ecs_cluster ? 0 : 1
cluster_name = "${var.ecs_cluster_name}-${data.aws_region.current.name}"
}

resource "aws_ecs_cluster" "github-runner" {
count = var.create_ecs_cluster ? 1 : 0
name = "${var.ecs_cluster_name}-${data.aws_region.current.name}"
}

locals {
ecs_cluster = var.create_ecs_cluster ? one(aws_ecs_cluster.github-runner).name : one(data.aws_ecs_cluster.github-runner).cluster_name
}
# data "aws_ecs_cluster" "github-runner" {
# count = var.create_ecs_cluster ? 0 : 1
# cluster_name = "${var.ecs_cluster_name}-${data.aws_region.current.name}"
# }

# resource "aws_ecs_cluster" "github-runner" {
# count = var.create_ecs_cluster ? 1 : 0
# name = "${var.ecs_cluster_name}-${data.aws_region.current.name}"
# }

# locals {
# ecs_cluster = var.create_ecs_cluster ? one(aws_ecs_cluster.github-runner).name : one(data.aws_ecs_cluster.github-runner).cluster_name
# }

data "aws_ip_ranges" "ip_ranges" {
regions = ["us-gov-west-1", "us-gov-east-1"]
Expand Down
20 changes: 20 additions & 0 deletions providers.tf
Original file line number Diff line number Diff line change
@@ -1,4 +1,24 @@
terraform {
required_providers {
aws = {
source = "hashicorp/aws"
version = "~> 5.70.0"
}
}
}

provider "github" {
owner = var.repo_org
base_url = var.base_url
}

provider "aws" {
default_tags {
tags = {
finops_project_name = "csvd_github_actions"
finops_project_number = "fs0000000078"
finops_project_role = "csvd_github_actions"
organization = "census:ocio:csvd"
}
}
}
11 changes: 9 additions & 2 deletions varfiles/csvd.tfvars
Original file line number Diff line number Diff line change
@@ -1,11 +1,18 @@
namespace = "csvd-ghe-runner"
repo_org = "CSVD"
desired_count = 1
desired_count = 3
aws_account = "cvsd-dev-ew"


certs = {
bucket = "github-actions-assets-us-gov-west-1-229685449397"
bucket = "csvd-dev-ew-github-actions"
key = "katello-server-ca.pem"
}

# vpc_id = "vpc-0db4980aedac7ece5"
# subnets = [
# "subnet-067d8fcf9da532c32"
# ]
# security_groups = [
# "sg-03cbf2a626ed55c7e"
# ]
8 changes: 0 additions & 8 deletions versions.tf

This file was deleted.

0 comments on commit c51aca0

Please sign in to comment.