Skip to content

Commit

Permalink
Merge branch 'f-add-additional-property-to-imagebuilder' of ssh://git…
Browse files Browse the repository at this point in the history
…hub.com/schabert/terraform-provider-aws into schabert-f-add-additional-property-to-imagebuilder
  • Loading branch information
bflad committed Jan 4, 2021
2 parents 1a65888 + 1dbf3b9 commit 0f51b3e
Show file tree
Hide file tree
Showing 4 changed files with 17 additions and 0 deletions.
5 changes: 5 additions & 0 deletions aws/data_source_aws_imagebuilder_image_recipe.go
Original file line number Diff line number Diff line change
Expand Up @@ -116,6 +116,10 @@ func dataSourceAwsImageBuilderImageRecipe() *schema.Resource {
Type: schema.TypeString,
Computed: true,
},
"working_directory": {
Type: schema.TypeString,
Computed: true,
},
},
}
}
Expand Down Expand Up @@ -154,6 +158,7 @@ func dataSourceAwsImageBuilderImageRecipeRead(d *schema.ResourceData, meta inter
d.Set("platform", imageRecipe.Platform)
d.Set("tags", keyvaluetags.ImagebuilderKeyValueTags(imageRecipe.Tags).IgnoreAws().IgnoreConfig(ignoreTagsConfig).Map())
d.Set("version", imageRecipe.Version)
d.Set("working_directory", imageRecipe.WorkingDirectory)

return nil
}
1 change: 1 addition & 0 deletions aws/data_source_aws_imagebuilder_image_recipe_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,7 @@ resource "aws_imagebuilder_component" "test" {
}]
schemaVersion = 1.0
})
working_directory = "/tmp"
name = %[1]q
platform = "Linux"
version = "1.0.0"
Expand Down
10 changes: 10 additions & 0 deletions aws/resource_aws_imagebuilder_image_recipe.go
Original file line number Diff line number Diff line change
Expand Up @@ -170,6 +170,12 @@ func resourceAwsImageBuilderImageRecipe() *schema.Resource {
ForceNew: true,
ValidateFunc: validation.StringLenBetween(1, 128),
},
"working_directory": {
Type: schema.TypeString,
Optional: true,
ForceNew: true,
ValidateFunc: validation.StringLenBetween(1, 1024),
},
},
}
}
Expand Down Expand Up @@ -208,6 +214,9 @@ func resourceAwsImageBuilderImageRecipeCreate(d *schema.ResourceData, meta inter
if v, ok := d.GetOk("version"); ok {
input.SemanticVersion = aws.String(v.(string))
}
if v, ok := d.GetOk("working_directory"); ok {
input.WorkingDirectory = aws.String(v.(string))
}

output, err := conn.CreateImageRecipe(input)

Expand Down Expand Up @@ -261,6 +270,7 @@ func resourceAwsImageBuilderImageRecipeRead(d *schema.ResourceData, meta interfa
d.Set("platform", imageRecipe.Platform)
d.Set("tags", keyvaluetags.ImagebuilderKeyValueTags(imageRecipe.Tags).IgnoreAws().IgnoreConfig(ignoreTagsConfig).Map())
d.Set("version", imageRecipe.Version)
d.Set("working_directory", imageRecipe.WorkingDirectory)

return nil
}
Expand Down
1 change: 1 addition & 0 deletions website/docs/r/imagebuilder_image_recipe.html.markdown
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,7 @@ The following attributes are optional:
* `block_device_mapping` - (Optional) Configuration block(s) with block device mappings for the the image recipe. Detailed below.
* `description` - (Optional) Description of the image recipe.
* `tags` - (Optional) Key-value map of resource tags for the image recipe.
* `working_directory` - (Optional) The working directory to be used during build and test workflows.

### block_device_mapping

Expand Down

0 comments on commit 0f51b3e

Please sign in to comment.