We are experimenting with Jetbrains Space as our code repo and CI/CD. We are trying to find a way to setup the .space.kts
file to deploy to AWS Lambda.
We want the develop
branch to publish to the Lambda $Latest
and when we merge to the main
branch from the develop
branch we want it to publish a new Lambda version and link that version to the alias pro
.
I've looked around but haven't found anything that would suggest there is a pre-built solution for controlling AWS Lambda so my current thinking is something like this:
job("Publish to Lambda Latest") {
startOn {
gitPush {
branchFilter {
+"refs/heads/develop"
}
}
}
container(displayName = "AWS Lambda CLI", image = "amazon/aws-cli") {
// Space Packages repository
env["REPOSITORY_URL"] = "https://..."
shellScript {
content = """
echo Deploying to Lambda Latest...
...
"""
}
}
}
I'm not convinced that using a shell script is a very robust way to do this as I will need to pass variables from one command to another. Is there a better way to do this?