Skip to content

Commit

Permalink
Merge pull request #25372 from mherzig/b-fix_embed_host_domains_valid…
Browse files Browse the repository at this point in the history
…ation

bugfix: validate `embed_host_domains` correctly
  • Loading branch information
ewbankkit authored Jun 27, 2022
2 parents c9e05af + 943b6b8 commit 054afc0
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 1 deletion.
3 changes: 3 additions & 0 deletions .changelog/25372.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
```release-note:bug
resource/aws_appstream_stack: Fix crash when setting `embed_host_domains`
```
2 changes: 1 addition & 1 deletion internal/service/appstream/stack.go
Original file line number Diff line number Diff line change
Expand Up @@ -211,7 +211,7 @@ func resourceStackCreate(ctx context.Context, d *schema.ResourceData, meta inter
}

if v, ok := d.GetOk("embed_host_domains"); ok {
input.EmbedHostDomains = flex.ExpandStringList(v.([]interface{}))
input.EmbedHostDomains = flex.ExpandStringSet(v.(*schema.Set))
}

if v, ok := d.GetOk("feedback_url"); ok {
Expand Down
5 changes: 5 additions & 0 deletions internal/service/appstream/stack_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -95,6 +95,9 @@ func TestAccAppStreamStack_complete(t *testing.T) {
resource.TestCheckResourceAttr(resourceName, "name", rName),
acctest.CheckResourceAttrRFC3339(resourceName, "created_time"),
resource.TestCheckResourceAttr(resourceName, "description", descriptionUpdated),
resource.TestCheckResourceAttr(resourceName, "embed_host_domains.#", "2"),
resource.TestCheckTypeSetElemAttr(resourceName, "embed_host_domains.*", "example.com"),
resource.TestCheckTypeSetElemAttr(resourceName, "embed_host_domains.*", "subdomain.example.com"),
),
},
{
Expand Down Expand Up @@ -215,6 +218,8 @@ resource "aws_appstream_stack" "test" {
name = %[1]q
description = %[2]q
embed_host_domains = ["example.com", "subdomain.example.com"]
storage_connectors {
connector_type = "HOMEFOLDERS"
}
Expand Down

0 comments on commit 054afc0

Please sign in to comment.