Skip to content

Commit

Permalink
Merge pull request #21465 from jhancock93/bugfix-appstream-image-arn
Browse files Browse the repository at this point in the history
Fix missing support for aws_appstream_fleet.image_arn
  • Loading branch information
ewbankkit authored Oct 25, 2021
2 parents d8924db + ade185e commit 6f82a3a
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 1 deletion.
3 changes: 3 additions & 0 deletions .changelog/21465.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
```release-note:bug-fix
resource/aws_appstream_fleet: Use `image_arn` when specified
```
4 changes: 4 additions & 0 deletions internal/service/appstream/fleet.go
Original file line number Diff line number Diff line change
Expand Up @@ -229,6 +229,10 @@ func resourceFleetCreate(ctx context.Context, d *schema.ResourceData, meta inter
input.ImageName = aws.String(v.(string))
}

if v, ok := d.GetOk("image_arn"); ok {
input.ImageArn = aws.String(v.(string))
}

if v, ok := d.GetOk("iam_role_arn"); ok {
input.IamRoleArn = aws.String(v.(string))
}
Expand Down
5 changes: 4 additions & 1 deletion internal/service/appstream/fleet_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -318,6 +318,9 @@ func testAccFleetCompleteConfig(name, description, fleetType, instanceType strin
return acctest.ConfigCompose(
acctest.ConfigAvailableAZsNoOptIn(),
fmt.Sprintf(`
data "aws_region" "current" {}
data "aws_partition" "current" {}
resource "aws_vpc" "test" {
cidr_block = "10.0.0.0/16"
}
Expand All @@ -331,7 +334,7 @@ resource "aws_subnet" "test" {
resource "aws_appstream_fleet" "test" {
name = %[1]q
image_name = "Amazon-AppStream2-Sample-Image-02-04-2019"
image_arn = "arn:${data.aws_partition.current.partition}:appstream:${data.aws_region.current.name}::image/Amazon-AppStream2-Sample-Image-02-04-2019"
compute_capacity {
desired_instances = 1
Expand Down

0 comments on commit 6f82a3a

Please sign in to comment.