From 705a8982d9299e722dfc81944a7e3b9f35dbd3be Mon Sep 17 00:00:00 2001 From: Kamil Turek Date: Wed, 16 Feb 2022 22:49:31 +0100 Subject: [PATCH 1/3] Update plan time validations --- internal/service/imagebuilder/image_recipe.go | 22 +++++++++---------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/internal/service/imagebuilder/image_recipe.go b/internal/service/imagebuilder/image_recipe.go index 2744329c931..b62a4f018bb 100644 --- a/internal/service/imagebuilder/image_recipe.go +++ b/internal/service/imagebuilder/image_recipe.go @@ -82,12 +82,13 @@ func ResourceImageRecipe() *schema.Resource { Type: schema.TypeString, Optional: true, ForceNew: true, - ValidateFunc: verify.ValidARN, + ValidateFunc: validation.StringLenBetween(1, 1024), }, "snapshot_id": { - Type: schema.TypeString, - Optional: true, - ForceNew: true, + Type: schema.TypeString, + Optional: true, + ForceNew: true, + ValidateFunc: validation.StringLenBetween(1, 1024), }, "volume_size": { Type: schema.TypeInt, @@ -96,11 +97,10 @@ func ResourceImageRecipe() *schema.Resource { ValidateFunc: validation.IntBetween(1, 16000), }, "volume_type": { - Type: schema.TypeString, - Optional: true, - ForceNew: true, - // https://github.com/hashicorp/terraform-provider-aws/issues/17274. - ValidateFunc: validation.StringInSlice(append(imagebuilder.EbsVolumeType_Values(), EBSVolumeTypeGP3), false), + Type: schema.TypeString, + Optional: true, + ForceNew: true, + ValidateFunc: validation.StringInSlice(imagebuilder.EbsVolumeType_Values(), false), }, }, }, @@ -167,7 +167,7 @@ func ResourceImageRecipe() *schema.Resource { Type: schema.TypeString, Required: true, ForceNew: true, - ValidateFunc: validation.StringLenBetween(1, 126), + ValidateFunc: validation.StringLenBetween(1, 128), }, "owner": { Type: schema.TypeString, @@ -177,7 +177,7 @@ func ResourceImageRecipe() *schema.Resource { Type: schema.TypeString, Required: true, ForceNew: true, - ValidateFunc: validation.StringLenBetween(1, 126), + ValidateFunc: validation.StringLenBetween(1, 1024), }, "platform": { Type: schema.TypeString, From 734daade60c64be68ce6e0fdf4d5c4213ac4ed54 Mon Sep 17 00:00:00 2001 From: Kamil Turek Date: Wed, 16 Feb 2022 22:54:10 +0100 Subject: [PATCH 2/3] Add changelog --- .changelog/23235.txt | 3 +++ 1 file changed, 3 insertions(+) create mode 100644 .changelog/23235.txt diff --git a/.changelog/23235.txt b/.changelog/23235.txt new file mode 100644 index 00000000000..0157d7ce5a6 --- /dev/null +++ b/.changelog/23235.txt @@ -0,0 +1,3 @@ +```release-note:enhancement +resource/aws_imagebuilder_image_recipe: Update plan time validation of `kms_key_id`, `snapshot_id`, `volume_type`, `name`, `parent_image`. +``` From a4539d170819fee4c484622ba1d602e627a1e9b0 Mon Sep 17 00:00:00 2001 From: Kamil Turek Date: Wed, 16 Feb 2022 23:00:18 +0100 Subject: [PATCH 3/3] Update changelog --- .changelog/23235.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.changelog/23235.txt b/.changelog/23235.txt index 0157d7ce5a6..a089a11879e 100644 --- a/.changelog/23235.txt +++ b/.changelog/23235.txt @@ -1,3 +1,3 @@ ```release-note:enhancement -resource/aws_imagebuilder_image_recipe: Update plan time validation of `kms_key_id`, `snapshot_id`, `volume_type`, `name`, `parent_image`. +resource/aws_imagebuilder_image_recipe: Update plan time validation of `block_device_mapping.ebs.kms_key_id`, `block_device_mapping.ebs.snapshot_id`, `block_device_mapping.ebs.volume_type`, `name`, `parent_image`. ```