diff --git a/.changelog/23293.txt b/.changelog/23293.txt new file mode 100644 index 000000000000..f245cd45bd22 --- /dev/null +++ b/.changelog/23293.txt @@ -0,0 +1,3 @@ +```release-note:enhancement +resource/aws_imagebuilder_image_recipe: Add `systems_manager_agent.uninstall_after_build` argument +``` diff --git a/internal/service/imagebuilder/image_recipe_test.go b/internal/service/imagebuilder/image_recipe_test.go index 11e83aa178de..6e02fc040590 100644 --- a/internal/service/imagebuilder/image_recipe_test.go +++ b/internal/service/imagebuilder/image_recipe_test.go @@ -1231,12 +1231,12 @@ resource "aws_imagebuilder_image_recipe" "test" { component_arn = aws_imagebuilder_component.test.arn } - name = %[1]q - parent_image = "arn:${data.aws_partition.current.partition}:imagebuilder:${data.aws_region.current.name}:aws:image/amazon-linux-2-x86/x.x.x" - version = "1.0.0" + name = %[1]q + parent_image = "arn:${data.aws_partition.current.partition}:imagebuilder:${data.aws_region.current.name}:aws:image/amazon-linux-2-x86/x.x.x" + version = "1.0.0" systems_manager_agent { - uninstall_after_build = true + uninstall_after_build = true } } `, rName)) diff --git a/website/docs/r/imagebuilder_image_recipe.html.markdown b/website/docs/r/imagebuilder_image_recipe.html.markdown index 356ab04b25c2..c0440083597c 100644 --- a/website/docs/r/imagebuilder_image_recipe.html.markdown +++ b/website/docs/r/imagebuilder_image_recipe.html.markdown @@ -57,6 +57,7 @@ The following attributes are optional: * `block_device_mapping` - (Optional) Configuration block(s) with block device mappings for the image recipe. Detailed below. * `description` - (Optional) Description of the image recipe. +* `systems_manager_agent` - (Optional) Configuration block for the Systems Manager Agent installed by default by Image Builder. Detailed below. * `tags` - (Optional) Key-value map of resource tags for the image recipe. If configured with a provider [`default_tags` configuration block](/docs/providers/aws/index.html#default_tags-configuration-block) present, tags with matching keys will overwrite those defined at the provider-level. * `user_data_base64` (Optional) Base64 encoded user data. Use this to provide commands or a command script to run when you launch your build instance. * `working_directory` - (Optional) The working directory to be used during build and test workflows. @@ -96,6 +97,12 @@ The following arguments are required: * `name` - (Required) The name of the component parameter. * `value` - (Required) The value for the named component parameter. +### systems_manager_agent + +The following arguments are required: + +* `uninstall_after_build` - (Required) Whether to remove the Systems Manager Agent after the image has been built. Defaults to `false`. + ## Attributes Reference In addition to all arguments above, the following attributes are exported: