Skip to content

feat(gamelift): support Build serverSdkVersion, updated OperatingSystem values#27857

Merged
mergify[bot] merged 5 commits intoaws:mainfrom
lpizzinidev:gh-27655
Nov 9, 2023
Merged

feat(gamelift): support Build serverSdkVersion, updated OperatingSystem values#27857
mergify[bot] merged 5 commits intoaws:mainfrom
lpizzinidev:gh-27655

Conversation

@lpizzinidev
Copy link
Copy Markdown
Contributor

Some adjustments to Build properties:

Closes #27655.


By submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license

@github-actions github-actions bot added distinguished-contributor [Pilot] contributed 50+ PRs to the CDK effort/small Small work item – less than a day of effort feature-request A feature should be added or improved. p2 labels Nov 6, 2023
@aws-cdk-automation aws-cdk-automation requested a review from a team November 6, 2023 16:30
Copy link
Copy Markdown
Contributor

@scanlonp scanlonp left a comment

Choose a reason for hiding this comment

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

Looks great! A minor nit on the error message, and then it should be good to go. Edited the error message.

One concern. Should serverSdkVersion be a public attribute on the Build and Import classes? It looks like the rest of the parameters are.

@mergify mergify bot dismissed scanlonp’s stale review November 6, 2023 16:47

Pull request has been modified.

@aws-cdk-automation aws-cdk-automation added the pr/needs-community-review This PR needs a review from a Trusted Community Member or Core Team Member. label Nov 6, 2023
Copy link
Copy Markdown
Contributor

@go-to-k go-to-k left a comment

Choose a reason for hiding this comment

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

Looks good to me. I had to comment on a couple of points.

}

private validateServerSdkVersion(serverSdkVersion?: string) {
if (!serverSdkVersion) return;
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

It will be passed if a string is empty, so I would prefer an undefined check. And I think it should take the case that the param is Token by CfnParameter, etc., what do you think?

Suggested change
if (!serverSdkVersion) return;
if (serverSdkVersion === undefined || Token.isUnresolved(serverSdkVersion)) return;

throw new Error(`serverSdkVersion must be in the 0.0.0 format, got ${serverSdkVersion}.`);
}
if (serverSdkVersion.length > 128) {
throw new Error(`serverSdkVersion length must be smaller than or equal to 128, got ${serverSdkVersion}.`);
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

I think it would be better to output the length of a character in the error message. I have seen other cases like this.

https://github.com/aws/aws-cdk/blob/main/packages/aws-cdk-lib/aws-stepfunctions-tasks/lib/sagemaker/create-training-job.ts#L341
https://github.com/aws/aws-cdk/blob/main/packages/aws-cdk-lib/aws-events-targets/lib/batch.ts#L118
https://github.com/aws/aws-cdk/blob/main/packages/%40aws-cdk/aws-glue-alpha/lib/database.ts#L136

Suggested change
throw new Error(`serverSdkVersion length must be smaller than or equal to 128, got ${serverSdkVersion}.`);
throw new Error(`serverSdkVersion length must be smaller than or equal to 128, got ${serverSdkVersion.length}.`);

@go-to-k
Copy link
Copy Markdown
Contributor

go-to-k commented Nov 7, 2023

Oh, sorry, @scanlonp already reviewed.

@lpizzinidev
Copy link
Copy Markdown
Contributor Author

@go-to-k
Nice catches! I missed both of them 😄

@scanlonp
Some of the props are exposed, but others are not.
Unless there is a specific need to provide a reference to serverSdkVersion outside of the class I would keep it private.

Copy link
Copy Markdown
Contributor

@go-to-k go-to-k left a comment

Choose a reason for hiding this comment

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

@lpizzinidev Thanks! I approved.

@aws-cdk-automation aws-cdk-automation added pr/needs-maintainer-review This PR needs a review from a Core Team Member and removed pr/needs-community-review This PR needs a review from a Trusted Community Member or Core Team Member. labels Nov 7, 2023
@mergify
Copy link
Copy Markdown
Contributor

mergify bot commented Nov 8, 2023

Thank you for contributing! Your pull request will be updated from main and then merged automatically (do not update manually, and be sure to allow changes to be pushed to your fork).

@aws-cdk-automation aws-cdk-automation removed the pr/needs-maintainer-review This PR needs a review from a Core Team Member label Nov 8, 2023
@mergify
Copy link
Copy Markdown
Contributor

mergify bot commented Nov 8, 2023

Thank you for contributing! Your pull request will be updated from main and then merged automatically (do not update manually, and be sure to allow changes to be pushed to your fork).

@aws-cdk-automation
Copy link
Copy Markdown
Collaborator

AWS CodeBuild CI Report

  • CodeBuild project: AutoBuildv2Project1C6BFA3F-wQm2hXv2jqQv
  • Commit ID: 15de967
  • Result: SUCCEEDED
  • Build Logs (available for 30 days)

Powered by github-codebuild-logs, available on the AWS Serverless Application Repository

@mergify mergify bot merged commit f1bb801 into aws:main Nov 9, 2023
@mergify
Copy link
Copy Markdown
Contributor

mergify bot commented Nov 9, 2023

Thank you for contributing! Your pull request will be updated from main and then merged automatically (do not update manually, and be sure to allow changes to be pushed to your fork).

mikewrighton pushed a commit that referenced this pull request Nov 13, 2023
…em values (#27857)

Some adjustments to `Build` properties:
* Adds support for [`serverSdkVersion`](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-gamelift-build.html#cfn-gamelift-build-serversdkversion) attribute
* Updates list of available [`operatingSystem`](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-gamelift-build.html#cfn-gamelift-build-operatingsystem) and deprecates Windows Server 2012

Closes #27655.

----

*By submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license*
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

distinguished-contributor [Pilot] contributed 50+ PRs to the CDK effort/small Small work item – less than a day of effort feature-request A feature should be added or improved. p2

Projects

None yet

Development

Successfully merging this pull request may close these issues.

(@aws-cdk/aws-gamelift-alpha): Missing properties to support GameLift Server SDK 5+

4 participants