Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fixes terraform apply error #954

Merged
merged 2 commits into from
Nov 13, 2024
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
12 changes: 6 additions & 6 deletions Core/Testing/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ variable "viz_initialize_pipeline_arn" {
type = string
}

variable "step_function_arn" {
variable "lambda_role" {
type = string
}

Expand Down Expand Up @@ -39,6 +39,7 @@ resource "aws_cloudwatch_event_target" "trigger_pipeline_test_run" {
rule = aws_cloudwatch_event_rule.detect_test_files.name
target_id = "initialize_pipeline"
arn = var.viz_initialize_pipeline_arn
role_arn = var.lambda_role
input_transformer {
input_paths = {
"s3_bucket": "$.detail.bucket.name",
Expand All @@ -63,12 +64,11 @@ data "aws_s3_objects" "test_nwm_outputs" {
bucket = var.test_data_bucket
prefix = "test_nwm_outputs/"
max_keys = 2000
depends_on = [var.step_function_arn]
}

resource "aws_s3_object_copy" "test" {
count = length(data.aws_s3_objects.test_nwm_outputs.keys)
bucket = var.test_data_bucket
source = join("/", [var.test_data_bucket, element(data.aws_s3_objects.test_nwm_outputs.keys, count.index)])
key = replace(element(data.aws_s3_objects.test_nwm_outputs.keys, count.index), "test_nwm_outputs", formatdate("'common/data/model/com/nwm/prod/nwm.'YYYYDDMM", timestamp()))
count = length(data.aws_s3_objects.test_nwm_outputs.keys)
bucket = var.test_data_bucket
source = join("/", [var.test_data_bucket, element(data.aws_s3_objects.test_nwm_outputs.keys, count.index)])
key = replace(element(data.aws_s3_objects.test_nwm_outputs.keys, count.index), "test_nwm_outputs", formatdate("'common/data/model/com/nwm/prod/nwm.'YYYYMMDD", timestamp()))
}
7 changes: 6 additions & 1 deletion Core/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -710,9 +710,14 @@ module "sync-wrds-location-db" {
module "testing" {
count = local.env.environment == "ti" ? 1 : 0
source = "./Testing"
depends_on = [
module.s3.buckets,
module.step-functions.viz_pipeline_step_function,
module.viz-lambda-functions
]

environment = local.env.environment
test_data_bucket = module.s3.buckets["deployment"].bucket
viz_initialize_pipeline_arn = module.viz-lambda-functions.initialize_pipeline.arn
step_function_arn = module.step-functions.viz_pipeline_step_function.arn
lambda_role = module.iam-roles.role_viz_pipeline.arn
}
Loading