Skip to content

Commit

Permalink
Refactor .gitignore and add downloads/*.rpm
Browse files Browse the repository at this point in the history
  • Loading branch information
arnol377 committed Feb 4, 2025
1 parent 8397944 commit d135923
Show file tree
Hide file tree
Showing 7 changed files with 136 additions and 2 deletions.
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -38,3 +38,5 @@ terraform.rc
ghe-runner
**/terraform.tfstate
**/terraform.tfvars

downloads/*.rpm
57 changes: 57 additions & 0 deletions .terraform.lock.hcl

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

39 changes: 39 additions & 0 deletions downloads.tf
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
locals {
# Define a set of Morpheus binaries to be downloaded
morpheus_binaries = [
{
name = "morpheus-appliance-fips-7.0.10-1.el8.x86_64.rpm"
url = "https://downloads.morpheusdata.com/files/morpheus-appliance-fips-7.0.10-1.el8.x86_64.rpm"
path_prefix = "morpheus"
output_path = "${path.root}/downloads"
},
{
name = "morpheus-appliance-7.0.10-1.el8.x86_64.rpm"
url = "https://downloads.morpheusdata.com/files/morpheus-appliance-7.0.10-1.el8.x86_64.rpm"
path_prefix = "morpheus"
output_path = "${path.root}/downloads"
}
]

# Create a set of download configurations for each binary
downloads = concat(
local.morpheus_binaries
)
}

module downloader {
# Iterate over each download configuration
for_each = tomap({ for download in local.downloads : download.name => download })
source = "HappyPathway/downloader/url"
url = each.value.url
output_path = "${each.value.output_path}/${each.key}"
}


resource "aws_s3_bucket_object" "morpheus_rpms" {
for_each = tomap({ for download in local.downloads : download.name => download })
bucket = aws_s3_bucket.assets_bucket.bucket
key = "${each.value.path_prefix}/${each.key}"
source = "${each.value.output_path}/${each.key}"
depends_on = [module.downloader]
}
11 changes: 11 additions & 0 deletions imports.tf
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
# module.morpheus.module.build_user[0].aws_secretsmanager_secret.credentials
import {
to = module.morpheus.module.build_user[0].aws_secretsmanager_secret.credentials
id = "arn:aws-us-gov:secretsmanager:us-gov-west-1:229685449397:secret:/image-pipeline/morpheus-app/build_user_credentials-BF4y0w"
}

# module.morpheus.aws_secretsmanager_secret.ssh_key
import {
to = module.morpheus.aws_secretsmanager_secret.ssh_key
id = "arn:aws-us-gov:secretsmanager:us-gov-west-1:229685449397:secret:/image-pipeline/morpheus-app/ssh-private-key-FCQtUR"
}
5 changes: 4 additions & 1 deletion linux-images.code-workspace
Original file line number Diff line number Diff line change
Expand Up @@ -8,13 +8,16 @@
},
{
"path": ".",
"name": "aws-image-pipeline"
"name": "aws-image-pipeline"
},
{
"path": "../terraform-aws-image-pipeline"
},
{
"path": "../image-pipeline-goss-testing"
},
{
"path": "../terraform-url-downloader"
}
],
"settings": {
Expand Down
21 changes: 20 additions & 1 deletion locals.tf
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,28 @@ data "aws_security_group" "it_linux_base" {
}

locals {
domains_list = [
".census.gov",
"169.254.169.254",
"148.129.*",
"10.*",
"172.18.*",
"172.22.*",
"172.23.*",
"172.24.*",
"172.25.*",
".eks.amazonaws.com",
".s3.amazonaws.com",
".amazonaws.com",
".gcr.io",
".pkg.dev",
"${local._vpc_config.region}.compute.internal",
".${local._vpc_config.region}.compute.internal",
"downloads.morpheusdata.com"
]
proxy_env_vars = {
HTTP_PROXY = "http://proxy.tco.census.gov:3128"
NO_PROXY = ".census.gov,169.254.169.254,148.129.*,10.*,172.18.*,172.22.*,172.23.*,172.24.*,172.25.*,.eks.amazonaws.com,.s3.amazonaws.com,.amazonaws.com,.gcr.io,.pkg.dev,${local._vpc_config.region}.compute.internal,.${local._vpc_config.region}.compute.internal"
NO_PROXY = join(",", local.domains_list)
HTTPS_PROXY = "http://proxy.tco.census.gov:3128"
}
source_repo = "linux-image-pipeline"
Expand Down
3 changes: 3 additions & 0 deletions morpheus.tf
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,9 @@ module "morpheus" {
source_ami = var.use_rhel9_ami ? one(data.aws_ssm_parameter.rhel9_ami).value : local.morpheus_ami
instance_type = "m5.xlarge" # x86_64 compatible instance type
}
extra_parameters = {
morpheus_version = "7.0.10-1"
}
image_volume_mapping = [
{
device_name = "/dev/sda1"
Expand Down

0 comments on commit d135923

Please sign in to comment.