Skip to content

Commit

Permalink
schemahelper: Allow list(any) to be passed into dynamic block for_each
Browse files Browse the repository at this point in the history
  • Loading branch information
radeksimko committed Sep 5, 2023
1 parent db27b63 commit 32d32ea
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
4 changes: 2 additions & 2 deletions decoder/body_extensions_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -1915,10 +1915,10 @@ resource "aws_elastic_beanstalk_environment" "example" {
{
Label: "for_each",
Description: lang.MarkupContent{
Value: "A meta-argument that accepts a map or a set of strings, and creates an instance for each item in that map or set.",
Value: "A meta-argument that accepts a list, map or a set of strings, and creates an instance for each item in that list, map or set.",
Kind: lang.MarkdownKind,
},
Detail: "required, map of any single type or set of string",
Detail: "required, map of any single type or list of any single type or set of string",
Kind: lang.AttributeCandidateKind,
TriggerSuggest: true,
TextEdit: lang.TextEdit{
Expand Down
3 changes: 2 additions & 1 deletion decoder/internal/schemahelper/dynamic_block.go
Original file line number Diff line number Diff line change
Expand Up @@ -41,10 +41,11 @@ func buildDynamicBlockSchema(inputSchema *schema.BodySchema) *schema.BlockSchema
"for_each": {
Constraint: schema.OneOf{
schema.AnyExpression{OfType: cty.Map(cty.DynamicPseudoType)},
schema.AnyExpression{OfType: cty.List(cty.DynamicPseudoType)},
schema.AnyExpression{OfType: cty.Set(cty.String)},
},
IsRequired: true,
Description: lang.Markdown("A meta-argument that accepts a map or a set of strings, and creates an instance for each item in that map or set."),
Description: lang.Markdown("A meta-argument that accepts a list, map or a set of strings, and creates an instance for each item in that list, map or set."),
},
"iterator": {
Constraint: schema.LiteralType{Type: cty.String},
Expand Down

0 comments on commit 32d32ea

Please sign in to comment.