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

Add fleet_type option for Gamelift fleets. #3809 #8234

Merged
merged 4 commits into from
Jan 29, 2020

Conversation

kosmodromov
Copy link
Contributor

Community Note

  • Please vote on this pull request by adding a 👍 reaction to the original pull request comment to help the community and maintainers prioritize this request
  • Please do not leave "+1" comments, they generate extra noise for pull request followers and do not help prioritize the request

Fixes #3809

Changes proposed in this pull request:

  • Add fleet_type option for Gamelift fleets

Output from acceptance testing:

$ make testacc TEST=./aws/ TESTARGS='-run=TestAccAWSGameliftFleet_allFields'
==> Checking that code complies with gofmt requirements...
TF_ACC=1 go test ./aws/ -v -parallel 20 -run=TestAccAWSGameliftFleet_allFields -timeout 120m
=== RUN   TestAccAWSGameliftFleet_allFields
=== PAUSE TestAccAWSGameliftFleet_allFields
=== CONT  TestAccAWSGameliftFleet_allFields
--- PASS: TestAccAWSGameliftFleet_allFields (1292.04s)
PASS
ok  	github.com/terraform-providers/terraform-provider-aws/aws	1292.101s

@ghost ghost added size/XS Managed by automation to categorize the size of a PR. documentation Introduces or discusses updates to documentation. service/gamelift Issues and PRs that pertain to the gamelift service. tests PRs: expanded test coverage. Issues: expanded coverage, enhancements to test infrastructure. labels Apr 6, 2019
@aeschright aeschright requested a review from a team June 26, 2019 16:49
@Teviwe
Copy link

Teviwe commented Jan 23, 2020

We really need to define Gamelift fleet_type due to financial ideas and really don't want to make our own fork of aws module. Please decide to test and merge it.
@aeschright may be you can help us with this feature.

Copy link
Contributor

@bflad bflad left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hi @kosmodromov 👋 Thank you for submitting this. Please see the below feedback items and reach out if you have any questions or do not have time to implement them.

Comment on lines 43 to 47
"fleet_type": {
Type: schema.TypeString,
Optional: true,
ForceNew: true,
},
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Since the GameLift API Reference lists the default as ON_DEMAND, we should also add that to the resource schema, to prevent a difference for all operators when they upgrade the Terraform AWS Provider. We can also support plan-time validation of this attribute. 👍

			"fleet_type": {
				Type:     schema.TypeString,
				Optional: true,
				ForceNew: true,
				Default:  gamelift.FleetTypeOnDemand,
				ValidateFunc: validation.StringInSlice([]string{
					gamelift.FleetTypeOnDemand,
					gamelift.FleetTypeSpot,
				}, false),
			},

d.Set("instance_role_arn", fleet.InstanceRoleArn)
d.Set("fleet_type", fleet.FleetType)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Duplicate d.Set() call for this attribute (also the cause of the CI failure)

@@ -556,6 +558,7 @@ resource "aws_gamelift_fleet" "test" {
name = "%s"
description = "%s"
instance_role_arn = "${aws_iam_role.test.arn}"
fleet_type = "ON_DEMAND"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We should ensure existing configurations do not show a difference by removing these additions to the test configurations. The resource.TestCheckResourceAttr() additions above are okay. 👍

@bflad bflad added enhancement Requests to existing resources that expand the functionality or scope. waiting-response Maintainers are waiting on response from community or contributor. labels Jan 23, 2020
@bflad bflad self-assigned this Jan 29, 2020
@bflad bflad added this to the v2.47.0 milestone Jan 29, 2020
Copy link
Contributor

@bflad bflad left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you for those updates, @kosmodromov, looks good. 🚀

Output from acceptance testing:

--- PASS: TestAccAWSGameliftFleet_basic (1528.31s)
--- PASS: TestAccAWSGameliftFleet_allFields (1702.55s)

@bflad bflad merged commit d26fb33 into hashicorp:master Jan 29, 2020
bflad added a commit that referenced this pull request Jan 29, 2020
@ghost
Copy link

ghost commented Jan 30, 2020

This has been released in version 2.47.0 of the Terraform AWS provider. Please see the Terraform documentation on provider versioning or reach out if you need any assistance upgrading.

For further feature requests or bug reports with this functionality, please create a new GitHub issue following the template for triage. Thanks!

@ghost ghost removed the waiting-response Maintainers are waiting on response from community or contributor. label Jan 30, 2020
@kosmodromov kosmodromov deleted the gamelift_fleet_type branch January 30, 2020 22:26
@Teviwe
Copy link

Teviwe commented Jan 31, 2020

Thanks a lot to everyone who helped with this feature.

@ghost
Copy link

ghost commented Mar 27, 2020

I'm going to lock this issue because it has been closed for 30 days ⏳. This helps our maintainers find and focus on the active issues.

If you feel this issue should be reopened, we encourage creating a new issue linking back to this one for added context. Thanks!

@ghost ghost locked and limited conversation to collaborators Mar 27, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
documentation Introduces or discusses updates to documentation. enhancement Requests to existing resources that expand the functionality or scope. service/gamelift Issues and PRs that pertain to the gamelift service. size/XS Managed by automation to categorize the size of a PR. tests PRs: expanded test coverage. Issues: expanded coverage, enhancements to test infrastructure.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

AWS GameLift FleetType field not supported
3 participants