-
Notifications
You must be signed in to change notification settings - Fork 9.4k
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
Conversation
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. |
There was a problem hiding this 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.
aws/resource_aws_gamelift_fleet.go
Outdated
"fleet_type": { | ||
Type: schema.TypeString, | ||
Optional: true, | ||
ForceNew: true, | ||
}, |
There was a problem hiding this comment.
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),
},
aws/resource_aws_gamelift_fleet.go
Outdated
d.Set("instance_role_arn", fleet.InstanceRoleArn) | ||
d.Set("fleet_type", fleet.FleetType) |
There was a problem hiding this comment.
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" |
There was a problem hiding this comment.
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. 👍
There was a problem hiding this 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)
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! |
Thanks a lot to everyone who helped with this feature. |
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! |
Community Note
Fixes #3809
Changes proposed in this pull request:
Output from acceptance testing: