Skip to content

Commit

Permalink
Merge pull request #23235 from kamilturek/aws-imagebuilder-image-reci…
Browse files Browse the repository at this point in the history
…pe-update-validations

r/aws_imagebuilder_image_recipe - update plan time validations
  • Loading branch information
ewbankkit committed Feb 17, 2022
2 parents f2e6cf1 + a4539d1 commit 2a8a08f
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 11 deletions.
3 changes: 3 additions & 0 deletions .changelog/23235.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
```release-note:enhancement
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`.
```
22 changes: 11 additions & 11 deletions internal/service/imagebuilder/image_recipe.go
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand All @@ -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),
},
},
},
Expand Down Expand Up @@ -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,
Expand All @@ -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,
Expand Down

0 comments on commit 2a8a08f

Please sign in to comment.