-
Notifications
You must be signed in to change notification settings - Fork 9.3k
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
Support all valid operating systems in aws_gamelift_build #17764
Support all valid operating systems in aws_gamelift_build #17764
Conversation
- Switched to use SDK provided values slice, as suggested in hashicorp#14601 - Direct effect is that it adds support for AMAZON_LINUX_2 as a valid operating system for builds
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.
Welcome @judgeaxl 👋
It looks like this is your first Pull Request submission to the Terraform AWS Provider! If you haven’t already done so please make sure you have checked out our CONTRIBUTING guide and FAQ to make sure your contribution is adhering to best practice and has all the necessary elements in place for a successful approval.
Also take a look at our FAQ which details how we prioritize Pull Requests for inclusion.
Thanks again, and welcome to the community! 😃
f06eb17
to
9574959
Compare
I couldn't come up with any meaningful tests to add to this, since there are no other parameters that are affected when you pick a different OS. I couldn't find any examples of tests of this type of validation in other providers either. |
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 this PR @judgeaxl , looks great 🚀
With regard to adding a test, i think for this type of enhancement we can generally get away with not testing each particular value, especially if there are quite a few. The tests for this resource are a bit different in the configuration that takes place outside of the explicit test steps but in any case we could technically still write a test like the following to substitute in values and ensure each update forces new resource and applies the change e.g.
func TestAccAWSGameliftBuild_OperatingSystem(t *testing.T) {
var build1, build2, build3 gamelift.Build
rString := acctest.RandString(8)
resourceName := "aws_gamelift_build.test"
buildName := fmt.Sprintf("%s_%s", testAccGameliftBuildPrefix, rString)
region := testAccGetRegion()
g, err := testAccAWSGameliftSampleGame(region)
if isResourceNotFoundError(err) {
t.Skip(err)
}
if err != nil {
t.Fatal(err)
}
loc := g.Location
bucketName := *loc.Bucket
roleArn := *loc.RoleArn
key := *loc.Key
resource.ParallelTest(t, resource.TestCase{
PreCheck: func() {
testAccPreCheck(t)
testAccPartitionHasServicePreCheck(gamelift.EndpointsID, t)
testAccPreCheckAWSGamelift(t)
},
Providers: testAccProviders,
CheckDestroy: testAccCheckAWSGameliftBuildDestroy,
Steps: []resource.TestStep{
{
Config: testAccAWSGameliftBuildConfig_operatingSystem(buildName, bucketName, key, roleArn, gamelift.OperatingSystemWindows2012),
Check: resource.ComposeTestCheckFunc(
testAccCheckAWSGameliftBuildExists(resourceName, &build1),
resource.TestCheckResourceAttr(resourceName, "operating_system", gamelift.OperatingSystemWindows2012),
),
},
{
Config: testAccAWSGameliftBuildConfig_operatingSystem(buildName, bucketName, key, roleArn, gamelift.OperatingSystemAmazonLinux),
Check: resource.ComposeTestCheckFunc(
testAccCheckAWSGameliftBuildExists(resourceName, &build2),
testAccCheckAWSGameliftBuildRecreated(&build2, &build3),
resource.TestCheckResourceAttr(resourceName, "operating_system", gamelift.OperatingSystemAmazonLinux),
),
},
{
Config: testAccAWSGameliftBuildConfig_operatingSystem(buildName, bucketName, key, roleArn, gamelift.OperatingSystemAmazonLinux2),
Check: resource.ComposeTestCheckFunc(
testAccCheckAWSGameliftBuildExists(resourceName, &build3),
testAccCheckAWSGameliftBuildRecreated(&build2, &build3),
resource.TestCheckResourceAttr(resourceName, "operating_system", gamelift.OperatingSystemAmazonLinux2),
),
},
},
})
}
This has been released in version 3.30.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! |
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
Closes #17763
Relates #14601