Deploy Serverless Applications to AWS Lambda Using AWS SAM

Calibo Accelerate enables you to deploy and manage serverless applications on AWS Lambda using the AWS Serverless Application Model (SAM). This integration allows you to configure, build, deploy, test, and monitor Lambda functions directly from the Calibo Accelerate interface—without switching to the AWS Console.

Using AWS SAM, Calibo Accelerate abstracts the complexity of CloudFormation-based Lambda deployments while still giving you fine-grained control over deployment parameters, IAM roles, artifacts, and runtime configuration.

Note:

Currently, this support is available with GitHub Actions–based CI/CD pipelines. Support for AWS Lambda deployments using AWS SAM with Jenkins as a CI/CD tool will be added in a subsequent release.

Prerequisites

Before you begin, ensure the following prerequisites are met:

1. AWS Account Configuration

  • An AWS account is configured in Calibo Accelerate with required IAM permissions for:

    • AWS Lambda

    • AWS CloudFormation

    • Amazon S3 (for SAM artifact storage)

    • Amazon ECR (if using image-based Lambda packaging)

    1.1 Required IAM Permissions in CloudFormation Template

    Ensure that the CloudFormation template used to configure your AWS account includes the necessary IAM permissions for Lambda serverless deployments through Calibo Accelerate.

    The IAM role created by the template (CloudFormation Assume Role) includes permissions similar to the following:

    Copy
    {
      "Version": "2012-10-17",
      "Statement": [
        {
          "Sid": "CFNReadOnly",
          "Effect": "Allow",
          "Action": [
            "cloudformation:DescribeStacks",
            "cloudformation:ListStackResources"
          ],
          "Resource": "*"
        },
        {
          "Sid": "LambdaGetAndInvoke",
          "Effect": "Allow",
          "Action": [
            "lambda:GetFunction",
            "lambda:ListAliases",
            "lambda:ListVersionsByFunction",
            "lambda:InvokeFunction"
          ],
          "Resource": "*"
        },
        {
          "Sid": "ReadCloudWatchLogsForLambda",
          "Effect": "Allow",
          "Action": [
            "logs:DescribeLogGroups",
            "logs:DescribeLogStreams",
            "logs:GetLogEvents",
            "logs:FilterLogEvents"
          ],
          "Resource": "*"
        },
        {
          "Sid": "ReadCloudWatchMetrics",
          "Effect": "Allow",
          "Action": [
            "cloudwatch:GetMetricData",
            "cloudwatch:GetMetricStatistics",
            "cloudwatch:ListMetrics"
          ],
          "Resource": "*"
        },
        {
          "Sid": "ListS3BucketsAndIAMRoles",
          "Effect": "Allow",
          "Action": [
            "s3:ListAllMyBuckets",
            "s3:GetBucketLocation",
            "iam:ListRoles"
          ],
          "Resource": "*"
        }
      ]
    }

    This role must trust the CloudFormation service (cloudformation.amazonaws.com) in its trust policy. In addition, the role used by the deployment workflow (for example, the SAM Execution Role assumed by GitHub Actions) must have iam:PassRole permission on the CloudFormation Assume Role to allow CloudFormation to assume it during stack operations.

    1.2 OIDC-Based Deployment Role for GitHub Actions (Mandatory)

    To use GitHub Actions to execute your SAM deployments, your AWS account must trust GitHub via OIDC federation. Ensure the following:

    • An IAM OIDC Identity Provider is created:

      • An IAM role is created for SAM deployment (for example, calibo-sam-deploy-role) that:

        • Can be assumed via sts:AssumeRoleWithWebIdentity

        • Is restricted to your GitHub organization / repository

        • Has permissions for:

          • S3 artifact upload

          • CloudFormation change set creation and execution

          • iam:PassRole (if a separate Lambda execution role is used)

      • The Role ARN of this deployment role is configured in Calibo Accelerate under the AWS SAM settings in a deployment stage of a feature.

      Without this OIDC-based deployment role, GitHub Actions cannot deploy SAM stacks into your AWS account.

    2. Source Code Repository
    A GitHub repository must exist containing:

    • Application source code

    • AWS SAM template file (for example, template.yaml)

    3. CI/CD Tool Configuration
    The connection details of your GitHub Actions account must be configured in Calibo Accelerate.

    4. Container Image Scanning Tool Configuration
    (Optional) The connection details of your Snyk account must be configured if you are using image-based Lambda packaging, and container image vulnerability scanning is required.

Deploying an AWS Lambda (Serverless) Application Using AWS SAM in Calibo Accelerate

After completing the prerequisites, follow these steps to build, configure, and deploy your AWS Lambda function using AWS SAM through Calibo Accelerate.