GoDeploy
is a CLI tool written in Go that aims to simplify the process of deploying serverless functions to multiple
FaaS providers, i.e., AWS Lambda and Google Cloud Functions.
aws-credentials.yaml:
role: "<FUNCTION_USER_GROUP>"
aws_access_key_id: "<ACCESS_KEY_ID>"
aws_secret_access_key: "<SECRET_ACCESS_KEY>"
aws_session_token: "<SESSION_TOKEN>"
Info: When using this library in combination with the AWSAcademy course, role will most likely be LabRole.
gcp-credentials.yaml:
{
"type": "service_account",
"project_id": "<PROJECT_ID>",
"private_key_id": "<PRIVATE_KEY_ID>",
"private_key": "-----BEGIN PRIVATE KEY-----<PRIVATE_KEY>-----END PRIVATE KEY-----\n"
}
For more information how to retrieve the information needed for this file, see: Google Cloud
- Install Go, for more information, see https://go.dev/doc/install
- Clone the repository to a local folder
- run
go install
inside the root directory of the project - Find the
godeploy
executable inside the/go/bin
directory - Run the deployment with the following command
godeploy deploy
(If your deployment file's name differs from deployment.yaml specify the file with the-f
parameter)
The structure of the archive (.zip) for the project using GoDeploy should look something like this.
.
├── aws-credentials.yaml
├── gcp-credentials.yaml
├── code
│ ├── ...
You furthermore need a deployment file, like deployment.yaml
, that describes where the functions should be deployed.
See here.