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

r/appstream_fleet: correctly create resource with stream_view argument #22395

Merged
merged 2 commits into from
Jan 4, 2022
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/22395.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
```release-note:bug
resource/aws_appstream_fleet: Correctly create resource with `stream_view` argument
```
4 changes: 4 additions & 0 deletions internal/service/appstream/fleet.go
Original file line number Diff line number Diff line change
Expand Up @@ -241,6 +241,10 @@ func resourceFleetCreate(ctx context.Context, d *schema.ResourceData, meta inter
input.MaxUserDurationInSeconds = aws.Int64(int64(v.(int)))
}

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

if v, ok := d.GetOk("vpc_config"); ok {
input.VpcConfig = expandVpcConfig(v.([]interface{}))
}
Expand Down
4 changes: 4 additions & 0 deletions internal/service/appstream/fleet_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,7 @@ func TestAccAppStreamFleet_basic(t *testing.T) {
resource.TestCheckResourceAttr(resourceName, "name", rName),
resource.TestCheckResourceAttr(resourceName, "instance_type", instanceType),
resource.TestCheckResourceAttr(resourceName, "state", appstream.FleetStateRunning),
resource.TestCheckResourceAttr(resourceName, "stream_view", appstream.StreamViewApp),
acctest.CheckResourceAttrRFC3339(resourceName, "created_time"),
),
},
Expand Down Expand Up @@ -117,6 +118,7 @@ func TestAccAppStreamFleet_completeWithStop(t *testing.T) {
resource.TestCheckResourceAttr(resourceName, "instance_type", instanceType),
resource.TestCheckResourceAttr(resourceName, "description", description),
acctest.CheckResourceAttrRFC3339(resourceName, "created_time"),
resource.TestCheckResourceAttr(resourceName, "stream_view", appstream.StreamViewDesktop),
),
},
{
Expand All @@ -128,6 +130,7 @@ func TestAccAppStreamFleet_completeWithStop(t *testing.T) {
resource.TestCheckResourceAttr(resourceName, "instance_type", instanceTypeUpdate),
resource.TestCheckResourceAttr(resourceName, "description", descriptionUpdated),
acctest.CheckResourceAttrRFC3339(resourceName, "created_time"),
resource.TestCheckResourceAttr(resourceName, "stream_view", appstream.StreamViewDesktop),
),
},
{
Expand Down Expand Up @@ -347,6 +350,7 @@ resource "aws_appstream_fleet" "test" {
fleet_type = %[3]q
instance_type = %[4]q
max_user_duration_in_seconds = 1000
stream_view = "DESKTOP"

vpc_config {
subnet_ids = aws_subnet.test.*.id
Expand Down
2 changes: 1 addition & 1 deletion website/docs/r/appstream_fleet.html.markdown
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ The following arguments are optional:
* `idle_disconnect_timeout_in_seconds` - (Optional) Amount of time that users can be idle (inactive) before they are disconnected from their streaming session and the `disconnect_timeout_in_seconds` time interval begins.
* `image_name` - (Optional) Name of the image used to create the fleet.
* `image_arn` - (Optional) ARN of the public, private, or shared image to use.
* `stream_view` - (Optional) AppStream 2.0 view that is displayed to your users when they stream from the fleet. When `APP` is specified, only the windows of applications opened by users display. When `DESKTOP` is specified, the standard desktop that is provided by the operating system displays.
* `stream_view` - (Optional) AppStream 2.0 view that is displayed to your users when they stream from the fleet. When `APP` is specified, only the windows of applications opened by users display. When `DESKTOP` is specified, the standard desktop that is provided by the operating system displays. If not specified, defaults to `APP`.
* `max_user_duration_in_seconds` - (Optional) Maximum amount of time that a streaming session can remain active, in seconds.
* `vpc_config` - (Optional) Configuration block for the VPC configuration for the image builder. See below.
* `tags` - (Optional) Map of tags to attach to AppStream instances.
Expand Down