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

[Bug]: aws_sagemaker_pipeline fails to update pipeline when using definition saved in S3 #38259

Open
adamantike opened this issue Jul 5, 2024 · 1 comment
Labels
bug Addresses a defect in current functionality. service/sagemaker Issues and PRs that pertain to the sagemaker service.

Comments

@adamantike
Copy link

Terraform Core Version

1.4.7

AWS Provider Version

5.57.0

Affected Resource(s)

  • aws_sagemaker_pipeline

Expected Behavior

  1. SageMaker pipeline correctly updates to the new pipeline definition located in a different S3 file.
  2. pipeline_definition is not listed as a change in the diff, does not display that it will be changed to -> null

Actual Behavior

  1. The diff includes pipeline_definition changing from the current JSON definition to null.
  2. Apply fails, as it runs the validations for pipeline_definition (which is not being provided, as it's mutually exclusive with the pipeline_definition_s3_location attribute), indicating that its minimum length must be 1.

Relevant Error/Panic Output Snippet

# aws_sagemaker_pipeline.this will be updated in-place
  ~ resource "aws_sagemaker_pipeline" "this" {
        id                    = "mypipeline"
      - pipeline_definition   = jsonencode(
            {
              # all current JSON retrieved from the previous S3 file
            }
        ) -> null
      ~ pipeline_definition_s3_location {
          ~ object_key = "pipelines/0.0.1/mypipeline.json" -> "pipelines/0.0.2/mypipeline.json"
            # (1 unchanged attribute hidden)
        }
    }
Plan: 1 to add, 0 to change, 0 to destroy.
aws_sagemaker_pipeline.this: Modifying... [id=mypipeline]
╷
│ Error: updating SageMaker Pipeline (mypipeline): InvalidParameter: 1 validation error(s) found.
│ - minimum field size of 1, UpdatePipelineInput.PipelineDefinition.
│ 
│ 
│   with aws_sagemaker_pipeline.this,
│   on main.tf line 8, in resource "aws_sagemaker_pipeline" "this":
│    8: resource "aws_sagemaker_pipeline" "this" {
│ 
╵

Terraform Configuration Files

terraform {
  required_providers {
    aws = {
      source  = "hashicorp/aws"
      version = "~> 5.0"
    }
  }
}

provider "aws" {
  region = "us-east-1"
}

resource "aws_sagemaker_pipeline" "this" {
  pipeline_name         = "test"
  pipeline_display_name = "test"
  role_arn              = "<iam_role_arn>"

  pipeline_definition_s3_location {
    bucket     = "<s3_bucket_name>"
    object_key = "v1.json"
  }
}

Steps to Reproduce

  1. Upload two SageMaker pipeline JSON definitions to S3. Both can have the same content. (e.g. v1.json and v2.json)
  2. Run apply using v1.json to create the SageMaker pipeline.
  3. Change aws_sagemaker_pipeline.pipeline_definition_s3_location to point to v2.json.
  4. Try to apply, to update the pipeline to the new definition.

Debug Output

No response

Panic Output

No response

Important Factoids

No response

References

No response

Would you like to implement a fix?

None

@adamantike adamantike added the bug Addresses a defect in current functionality. label Jul 5, 2024
Copy link

github-actions bot commented Jul 5, 2024

Community Note

Voting for Prioritization

  • Please vote on this issue by adding a 👍 reaction to the original post to help the community and maintainers prioritize this request.
  • Please see our prioritization guide for information on how we prioritize.
  • Please do not leave "+1" or other comments that do not add relevant new information or questions, they generate extra noise for issue followers and do not help prioritize the request.

Volunteering to Work on This Issue

  • If you are interested in working on this issue, please leave a comment.
  • If this would be your first contribution, please review the contribution guide.

@github-actions github-actions bot added the service/sagemaker Issues and PRs that pertain to the sagemaker service. label Jul 5, 2024
@terraform-aws-provider terraform-aws-provider bot added the needs-triage Waiting for first response or review from a maintainer. label Jul 5, 2024
@justinretzolk justinretzolk removed the needs-triage Waiting for first response or review from a maintainer. label Jul 10, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Addresses a defect in current functionality. service/sagemaker Issues and PRs that pertain to the sagemaker service.
Projects
None yet
Development

No branches or pull requests

2 participants