IN THIS ARTICLE
Updating Projects and Cloud Gems to Version 1.0.0 of the Cloud Gem Framework
Updating Projects and Cloud Gems to Version 1.0.0 of the Cloud Gem Framework
A cloud gem is a gem that depends on the Cloud Gem Framework. Starting in Lumberyard 1.10 (and Cloud Gem Framework 1.0.0), gem versioning support makes the work of updating Lumberyard cloud gem projects much easier. However, manual steps are required to update projects and gems that were created before Cloud Gem Framework version 1.0.0.
Updating Existing Cloud Gem Projects
To update an existing cloud gem project, you must update the project’s gems.json
file and runtime configuration.
To update an existing Lumberyard project
In the project’s
dev\<project-name>\gems.json
file, find the entry forCloudGemFramework
. Change theVersion
value to1.0.0
and thePath
value toGems/CloudGemFramework/v1
, as in the following example.{ "Path": "Gems/CloudGemFramework/v1", "Uuid": "6fc787a982184217a5a553ca24676cfa", "Version": "1.0.0", "_comment": "CloudGemFramework" },
In a command prompt window, run the following command to update the project’s runtime configuration.
dev\Tools\LmbrSetup\Win\lmbr.exe projects populate-appdescriptors -projects <project-name>
For more information about
populate-appdescriptors
, see Projects Commands in the documentation for Managing Game Projects with Lmbr.exe.
Update the Project’s AWS Directory
To update the project’s AWS directory, you must delete the project, deployment access, and deployment template files. But before you delete the template files, you must save any roles or resources that you added.
To update the AWS directory
Delete the
<project>\AWS\project-code
directory. If you have made changes to this code, you must update theCloudGemFramework\vN\lambda-code
directory content to preserve the changes that you made.If you added roles or other resources to the
<project>\AWS\project-template.json
file, create a<project>\AWS\project-template-extensions.json
file and copy those resource definitions into theproject-template-extensions.json
file.Delete the
<project>\AWS\project-template.json
file.If you added roles or other resources to the
<project>\AWS\deployment-access-template.json
file, create a<project>\AWS\deployment-access-template-extensions.json
file and copy those resource definitions into thedeployment-access-template-extensions.json
file.Delete the
<project>\AWS\deployment-access-template.json
file.If you added resources to the
<project>\AWS\deployment-template.json
file, create a<project>\AWS\deployment-template-extensions.json
file and copy those resource definitions into thedeployment-template-extensions.json
file.Delete the
<project>\AWS\deployment-template.json
file.
Update the Project’s Resource Group Directories
When no Lambda resources exist for a resource group, you can simply remove the resource group’s Lambda code directories.
To remove Lambda code directories from a project resource group
For each
<project>\AWS\resource-group\<resource-group-name>
directory, check whether itsresource-template.json
file defines AWS Lambda function resources.If the
resource-template.json
file does not define any Lambda resources, delete the following directories:<project>\AWS\resource-group\<resource-group-name>\lambda-function-code
<project>\AWS\resource-group\<resource-group-name>\<lambda-name>-lambda-code
If the
resource-template.json
file defines AWS Lambda function resources, perform the steps described in Updating Lambda Code.
Updating Existing Cloud Gems
To update an existing cloud gem, you must update the gem’s gem.json
file and either remove its Lambda code directories or update its Lambda code.
To update an existing cloud gem
In the
<gem>\gem.json
file, find the entry forCloudGemFramework
. ChangeVersionConstraints
to the following value."VersionConstraints": [ "~>1.0" ],
If the
<gem>\AWS\resource-template.json
file does not exist or does not define any AWS Lambda function resources, delete the<gem>\AWS\lambda-function-code
directory and any<gem>\AWS\<lambda-name>-lambda-code
directories. Otherwise, perform the steps in Updating Lambda Code.
Updating Lambda Code
Updating Lambda code involves reorganizing your existing Lambda code directories and creating .import
files as needed. For information on the reasons for this directory restructuring, see
Cloud Gem Framework and Resource Manager Versioning.
To update your Lambda code
For each of the following Lambda code directories, perform the steps that follow.
<project>\AWS\resource-group\<resource-group-name>\lambda-function-code
<project>\AWS\resource-group\<resource-group-name>\<lambda-name>-lambda-code
<gem>\AWS\lambda-function-code
<gem>\AWS\<lambda-name>-lambda-code
If the code directory contains the
service.py
anderrors.py
files that support service API dispatching, delete them and add an.import
file with the following content to the directory:CloudGemFramework.LambdaService
If the code directory contains a
CloudCanvas
subdirectory, delete the subdirectory. If you did not have to create an.import
file in step 2, add an.import
file that has the following content:CloudGemFramework.LambdaSettings
If you already created an
.import
file in step 2, addCloudGemFramework.LambdaSettings
to the.import
file, as in the following example:CloudGemFramework.LambdaService CloudGemFramework.LambdaSettings
Move the contents of the code directory (along with the new
.import
file, if any) into a<parent-dir>\lambda-code\<lambda-name>
directory. Note the following:- If you had code for multiple Lambda functions in the single
lambda-function-code
directory, decide which modules to put into the subdirectory of thelambda-code
directory, and place them there. - If you have code that is used by multiple Lambda functions, put that code in a
<parent-dir>\common-code\<import-name>
directory. To include the code with the rest of the Lambda code when it is uploaded, use an.import
file.
- If you had code for multiple Lambda functions in the single
For more information about these changes, see Cloud Gem Framework and Resource Manager Versioning.