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

EventBridge Scheduler with error for Sagemaker Pipeline Parameters #146

Open
1 task done
Miguel-Barros96 opened this issue Dec 13, 2024 · 0 comments
Open
1 task done

Comments

@Miguel-Barros96
Copy link

Description

The Terraform module contains a bug when attempting to apply a event bridge schedule with a SageMaker pipeline with parameters as target.

Issues

1. Dynamic Block Lookup Issue

The lookup inside the dynamic block is not using the .value attribute Line to fix
Fix: Update the lookup to:

lookup(sagemaker_pipeline_parameters.value, "pipeline_parameter", null)

2. Limited Parameters in Dynamic Block

With the current for_each implementation in the dynamic block, it's only possible to pass one parameter.

Fix: Update the for_each to:

for_each = lookup(sagemaker_pipeline_parameters.value, "pipeline_parameter", null) != null ? sagemaker_pipeline_parameters.value.pipeline_parameter : []

Note: The value sagemaker_pipeline_parameters.value.pipeline_parameter should not be enclosed in brackets to allow multiple parameters.

  • ✋ I have searched the open/closed issues and my issue is not listed.

Versions

  • Module version [Required]: 3.13.0

  • Terraform version:
    1.9.6

  • Provider version(s):
    AWS Provider Version: 5.79.0

Reproduction Code [Required]

schedules = [
  {
    name = "test"
    schedule_expression = "rate(1 day)"
    arn = "arn:aws:sagemaker:{AWS_REGION}:{AWS_ACCOUNT_ID}:pipeline/{PIPELINE_NAME}"
    role_arn = "arn:aws:iam::{AWS_ACCOUNT_ID}:role/{AWS_ROLE_NAME}"
    
    sagemaker_pipeline_parameters = {
       pipeline_parameter = [{
              name  = "parameter-1"
              value = "value-1"
            },
            {
              name  = "parameter-2"
              value = "value-1"
            }]
        }
  }
]

Steps to reproduce the behavior:
Just create a simple schedule for the module like the above and the result plan should show the sagemaker_pipeline_parameters block empty

No

Yes

Expected behavior

Both parameters should be added

Actual behavior

Empty block for sagemaker_pipeline_parameters

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant