From 609d58e50be895007ab71c60536242de4b051718 Mon Sep 17 00:00:00 2001 From: tabito Date: Tue, 7 Oct 2025 22:40:25 +0900 Subject: [PATCH 1/6] Accept `notebook-al2023-v1` as a valid platform_identifier --- internal/service/sagemaker/notebook_instance.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/internal/service/sagemaker/notebook_instance.go b/internal/service/sagemaker/notebook_instance.go index 0bb3527eb2c9..54d8dc43a63d 100644 --- a/internal/service/sagemaker/notebook_instance.go +++ b/internal/service/sagemaker/notebook_instance.go @@ -115,7 +115,7 @@ func resourceNotebookInstance() *schema.Resource { Optional: true, Computed: true, ForceNew: true, - ValidateFunc: validation.StringMatch(regexache.MustCompile(`^(notebook-al1-v1|notebook-al2-v1|notebook-al2-v2|notebook-al2-v3)$`), ""), + ValidateFunc: validation.StringMatch(regexache.MustCompile(`^(notebook-al1-v1|notebook-al2-v1|notebook-al2-v2|notebook-al2-v3|notebook-al2023-v1)$`), ""), }, names.AttrRoleARN: { Type: schema.TypeString, From 2eb6dc0dd7235a3ccc07b486b2249b072fcce514 Mon Sep 17 00:00:00 2001 From: tabito Date: Tue, 7 Oct 2025 22:41:03 +0900 Subject: [PATCH 2/6] Add a check to the acceptance test for `notebook-al2023-v1` platform_identifier --- internal/service/sagemaker/notebook_instance_test.go | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/internal/service/sagemaker/notebook_instance_test.go b/internal/service/sagemaker/notebook_instance_test.go index 606efd497d47..b53f33eeec02 100644 --- a/internal/service/sagemaker/notebook_instance_test.go +++ b/internal/service/sagemaker/notebook_instance_test.go @@ -434,6 +434,13 @@ func TestAccSageMakerNotebookInstance_Platform_identifier(t *testing.T) { resource.TestCheckResourceAttr(resourceName, "platform_identifier", "notebook-al2-v3"), ), }, + { + Config: testAccNotebookInstanceConfig_platformIdentifier(rName, "notebook-al2023-v1"), + Check: resource.ComposeTestCheckFunc( + testAccCheckNotebookInstanceExists(ctx, resourceName, ¬ebook), + resource.TestCheckResourceAttr(resourceName, "platform_identifier", "notebook-al2023-v1"), + ), + }, }, }) } From ca1889d543881b3ae4d7e9fdba42d8093b699f27 Mon Sep 17 00:00:00 2001 From: tabito Date: Tue, 7 Oct 2025 22:41:41 +0900 Subject: [PATCH 3/6] Update the documentation to add `notebook-al2023-v1` and mark some deprecated --- website/docs/r/sagemaker_notebook_instance.html.markdown | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/website/docs/r/sagemaker_notebook_instance.html.markdown b/website/docs/r/sagemaker_notebook_instance.html.markdown index 5ddc9fde8207..d4b3f98fcf79 100644 --- a/website/docs/r/sagemaker_notebook_instance.html.markdown +++ b/website/docs/r/sagemaker_notebook_instance.html.markdown @@ -57,7 +57,7 @@ This resource supports the following arguments: * `name` - (Required) The name of the notebook instance (must be unique). * `role_arn` - (Required) The ARN of the IAM role to be used by the notebook instance which allows SageMaker AI to call other services on your behalf. * `instance_type` - (Required) The name of ML compute instance type. -* `platform_identifier` - (Optional) The platform identifier of the notebook instance runtime environment. This value can be either `notebook-al1-v1`, `notebook-al2-v1`, `notebook-al2-v2`, or `notebook-al2-v3`, depending on which version of Amazon Linux you require. +* `platform_identifier` - (Optional) The platform identifier of the notebook instance runtime environment. This value can be either `notebook-al1-v1`(deprecated), `notebook-al2-v1`(deprecated), `notebook-al2-v2`(deprecated), `notebook-al2-v3`, or `notebook-al2023-v1`. depending on which version of Amazon Linux you require. * `volume_size` - (Optional) The size, in GB, of the ML storage volume to attach to the notebook instance. The default value is 5 GB. * `subnet_id` - (Optional) The VPC subnet ID. * `security_groups` - (Optional) The associated security groups. From 17fb7ba7e5add41950ab5b346d6d9642c29da160 Mon Sep 17 00:00:00 2001 From: tabito Date: Tue, 7 Oct 2025 22:55:59 +0900 Subject: [PATCH 4/6] docs: Add default value for platform_identifier --- website/docs/r/sagemaker_notebook_instance.html.markdown | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/website/docs/r/sagemaker_notebook_instance.html.markdown b/website/docs/r/sagemaker_notebook_instance.html.markdown index d4b3f98fcf79..35d10fc5070a 100644 --- a/website/docs/r/sagemaker_notebook_instance.html.markdown +++ b/website/docs/r/sagemaker_notebook_instance.html.markdown @@ -57,7 +57,7 @@ This resource supports the following arguments: * `name` - (Required) The name of the notebook instance (must be unique). * `role_arn` - (Required) The ARN of the IAM role to be used by the notebook instance which allows SageMaker AI to call other services on your behalf. * `instance_type` - (Required) The name of ML compute instance type. -* `platform_identifier` - (Optional) The platform identifier of the notebook instance runtime environment. This value can be either `notebook-al1-v1`(deprecated), `notebook-al2-v1`(deprecated), `notebook-al2-v2`(deprecated), `notebook-al2-v3`, or `notebook-al2023-v1`. depending on which version of Amazon Linux you require. +* `platform_identifier` - (Optional) The platform identifier of the notebook instance runtime environment. This value can be either `notebook-al1-v1`(deprecated), `notebook-al2-v1`(deprecated), `notebook-al2-v2`(deprecated), `notebook-al2-v3`, or `notebook-al2023-v1`, depending on which version of Amazon Linux you require. Defaults to `notebook-al2-v3`. * `volume_size` - (Optional) The size, in GB, of the ML storage volume to attach to the notebook instance. The default value is 5 GB. * `subnet_id` - (Optional) The VPC subnet ID. * `security_groups` - (Optional) The associated security groups. From f70320b1a34d51ead54632769d74e56bddff8e54 Mon Sep 17 00:00:00 2001 From: tabito Date: Tue, 7 Oct 2025 23:13:57 +0900 Subject: [PATCH 5/6] acctest: Update deprecated platform_identifier --- .../sagemaker/notebook_instance_test.go | 20 +++---------------- 1 file changed, 3 insertions(+), 17 deletions(-) diff --git a/internal/service/sagemaker/notebook_instance_test.go b/internal/service/sagemaker/notebook_instance_test.go index b53f33eeec02..5418913848e2 100644 --- a/internal/service/sagemaker/notebook_instance_test.go +++ b/internal/service/sagemaker/notebook_instance_test.go @@ -50,7 +50,7 @@ func TestAccSageMakerNotebookInstance_basic(t *testing.T) { resource.TestCheckResourceAttr(resourceName, "instance_metadata_service_configuration.0.minimum_instance_metadata_service_version", "2"), resource.TestCheckResourceAttr(resourceName, names.AttrInstanceType, "ml.t2.medium"), resource.TestCheckResourceAttr(resourceName, names.AttrName, rName), - resource.TestCheckResourceAttr(resourceName, "platform_identifier", "notebook-al2-v2"), + resource.TestCheckResourceAttr(resourceName, "platform_identifier", "notebook-al2-v3"), resource.TestCheckResourceAttrPair(resourceName, names.AttrRoleARN, "aws_iam_role.test", names.AttrARN), resource.TestCheckResourceAttr(resourceName, "root_access", "Enabled"), resource.TestCheckResourceAttr(resourceName, "security_groups.#", "0"), @@ -409,10 +409,10 @@ func TestAccSageMakerNotebookInstance_Platform_identifier(t *testing.T) { CheckDestroy: testAccCheckNotebookInstanceDestroy(ctx), Steps: []resource.TestStep{ { - Config: testAccNotebookInstanceConfig_platformIdentifier(rName, "notebook-al2-v1"), + Config: testAccNotebookInstanceConfig_platformIdentifier(rName, "notebook-al2-v3"), Check: resource.ComposeTestCheckFunc( testAccCheckNotebookInstanceExists(ctx, resourceName, ¬ebook), - resource.TestCheckResourceAttr(resourceName, "platform_identifier", "notebook-al2-v1"), + resource.TestCheckResourceAttr(resourceName, "platform_identifier", "notebook-al2-v3"), ), }, { @@ -420,20 +420,6 @@ func TestAccSageMakerNotebookInstance_Platform_identifier(t *testing.T) { ImportState: true, ImportStateVerify: true, }, - { - Config: testAccNotebookInstanceConfig_platformIdentifier(rName, "notebook-al2-v2"), - Check: resource.ComposeTestCheckFunc( - testAccCheckNotebookInstanceExists(ctx, resourceName, ¬ebook), - resource.TestCheckResourceAttr(resourceName, "platform_identifier", "notebook-al2-v2"), - ), - }, - { - Config: testAccNotebookInstanceConfig_platformIdentifier(rName, "notebook-al2-v3"), - Check: resource.ComposeTestCheckFunc( - testAccCheckNotebookInstanceExists(ctx, resourceName, ¬ebook), - resource.TestCheckResourceAttr(resourceName, "platform_identifier", "notebook-al2-v3"), - ), - }, { Config: testAccNotebookInstanceConfig_platformIdentifier(rName, "notebook-al2023-v1"), Check: resource.ComposeTestCheckFunc( From 429d06eb40df1e666e5cf774689f9a58eb0b177a Mon Sep 17 00:00:00 2001 From: tabito Date: Tue, 7 Oct 2025 23:28:51 +0900 Subject: [PATCH 6/6] add changelog --- .changelog/44570.txt | 3 +++ 1 file changed, 3 insertions(+) create mode 100644 .changelog/44570.txt diff --git a/.changelog/44570.txt b/.changelog/44570.txt new file mode 100644 index 000000000000..b9f331ff9d73 --- /dev/null +++ b/.changelog/44570.txt @@ -0,0 +1,3 @@ +```release-note:enhancement +resource/aws_sagemaker_notebook_instance: Add `notebook-al2023-v1` to valid `platform_identifier` values +```