hashicorp / terraform-provider-aws

The AWS Provider enables Terraform to manage AWS resources.
https://registry.terraform.io/providers/hashicorp/aws
Mozilla Public License 2.0
9.65k stars 9.03k forks source link

[Bug]: Adding a new feature to an existing feature group causes the feature group to be replaced #36784

Open twood10-chwy opened 3 months ago

twood10-chwy commented 3 months ago

Terraform Core Version

0.13.3

AWS Provider Version

4.67.0

Affected Resource(s)

Expected Behavior

When adding a new feature to the feature group, the existing feature group should be updated and all data retained.

Actual Behavior

Adding a new feature caused the feature group to be replaced, destroying all data along with it.

Relevant Error/Panic Output Snippet

module.aws_sagemaker_feature_group.demo_feature_group must be replaced ...
       + feature_definition { # forces replacement
            + feature_name = "MY_NEW_FEATURE"
            + feature_type = "String"
         }

Terraform Configuration Files

Initial definition

resource "aws_sagemaker_feature_group" "demo_feature_group" {
  feature_group_name             = "my-demo-feature-group-name"
  record_identifier_feature_name = "USER_ID"
  event_time_feature_name        = "AT"
  role_arn                       = aws_iam_role.feature_group_role.arn
  feature_definition {
    feature_name = "USER_ID"
    feature_type = "String"
  }
  feature_definition {
    feature_name = "AT"
    feature_type = "String"
  }
  feature_definition {
    feature_name = "FEATURE_A"
    feature_type = "String"
  }
  online_store_config {
    enable_online_store = true
  }
  offline_store_config {
    s3_storage_config {
      kms_key_id = var.kms_key_arn
      s3_uri     = "s3://${var.s3_bucket}/"
    }
    table_format = "Iceberg"
  }
}

Definition with new feature

resource "aws_sagemaker_feature_group" "demo_feature_group" {
  feature_group_name             = "my-demo-feature-group-name"
  record_identifier_feature_name = "USER_ID"
  event_time_feature_name        = "AT"
  role_arn                       = aws_iam_role.feature_group_role.arn
  feature_definition {
    feature_name = "USER_ID"
    feature_type = "String"
  }
  feature_definition {
    feature_name = "AT"
    feature_type = "String"
  }
  feature_definition {
    feature_name = "FEATURE_A"
    feature_type = "String"
  }
  feature_definition {
    feature_name = "FEATURE_B"
    feature_type = "String"
  }
  online_store_config {
    enable_online_store = true
  }
  offline_store_config {
    s3_storage_config {
      kms_key_id = var.kms_key_arn
      s3_uri     = "s3://${var.s3_bucket}/"
    }
    table_format = "Iceberg"
  }
}

Steps to Reproduce

  1. Create a feature group and deploy it
  2. Ingest data to the feature group and verify it exists
  3. Add a new feature to the feature group and deploy it
  4. Verify the previously added data no longer exists

Debug Output

No response

Panic Output

No response

Important Factoids

No response

References

No response

Would you like to implement a fix?

None

github-actions[bot] commented 3 months ago

Community Note

Voting for Prioritization

Volunteering to Work on This Issue

lsamaha1-chwy commented 3 months ago

any updates on timelines for a release which includes @nikhil-goenka's fix branch?