Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

d/aws_imagebuilder_image_recipe - add component parameter attribute #22856

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions .changelog/22856.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
```release-note:enhancement
data-source/aws_imagebuilder_image_recipe: Add `parameter` attribute to the `component` configuration block
```
16 changes: 16 additions & 0 deletions internal/service/imagebuilder/image_recipe_data_source.go
Original file line number Diff line number Diff line change
Expand Up @@ -86,6 +86,22 @@ func DataSourceImageRecipe() *schema.Resource {
Type: schema.TypeString,
Computed: true,
},
"parameter": {
Type: schema.TypeSet,
Computed: true,
Elem: &schema.Resource{
Schema: map[string]*schema.Schema{
"name": {
Type: schema.TypeString,
Computed: true,
},
"value": {
Type: schema.TypeString,
Computed: true,
},
},
},
},
},
},
},
Expand Down
14 changes: 14 additions & 0 deletions internal/service/imagebuilder/image_recipe_data_source_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,10 @@ func TestAccImageBuilderImageRecipeDataSource_arn(t *testing.T) {
resource.TestCheckResourceAttrPair(dataSourceName, "arn", resourceName, "arn"),
resource.TestCheckResourceAttrPair(dataSourceName, "block_device_mapping.#", resourceName, "block_device_mapping.#"),
resource.TestCheckResourceAttrPair(dataSourceName, "component.#", resourceName, "component.#"),
resource.TestCheckResourceAttrPair(dataSourceName, "component.0.component_arn", resourceName, "component.0.component_arn"),
resource.TestCheckResourceAttrPair(dataSourceName, "component.0.parameter.#", resourceName, "component.0.parameter.#"),
resource.TestCheckResourceAttrPair(dataSourceName, "component.0.parameter.0.name", resourceName, "component.0.parameter.0.name"),
resource.TestCheckResourceAttrPair(dataSourceName, "component.0.parameter.0.value", resourceName, "component.0.parameter.0.value"),
resource.TestCheckResourceAttrPair(dataSourceName, "date_created", resourceName, "date_created"),
resource.TestCheckResourceAttrPair(dataSourceName, "description", resourceName, "description"),
resource.TestCheckResourceAttrPair(dataSourceName, "name", resourceName, "name"),
Expand Down Expand Up @@ -62,6 +66,11 @@ resource "aws_imagebuilder_component" "test" {
onFailure = "Continue"
}]
}]
parameters = [{
Parameter1 = {
type = "string"
}
}]
schemaVersion = 1.0
})
name = %[1]q
Expand All @@ -72,6 +81,11 @@ resource "aws_imagebuilder_component" "test" {
resource "aws_imagebuilder_image_recipe" "test" {
component {
component_arn = aws_imagebuilder_component.test.arn

parameter {
name = "Parameter1"
value = "Value1"
}
}

name = %[1]q
Expand Down
3 changes: 3 additions & 0 deletions website/docs/d/imagebuilder_image_recipe.html.markdown
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,9 @@ In addition to all arguments above, the following attributes are exported:
* `virtual_name` - Virtual device name. For example, `ephemeral0`. Instance store volumes are numbered starting from 0.
* `component` - List of objects with components for the image recipe.
* `component_arn` - Amazon Resource Name (ARN) of the Image Builder Component.
* `parameter` - Set of parameters that are used to configure the component.
* `name` - Name of the component parameter.
* `value` - Value of the component parameter.
* `date_created` - Date the image recipe was created.
* `description` - Description of the image recipe.
* `name` - Name of the image recipe.
Expand Down