AWS Serverless Application Model (AWS SAM) with Attini

The AWS Serverless Application Model (AWS SAM) is an open-source framework that you can use to build serverless applications on AWS.

If an Attini deployment plan contains an AttiniSam step, Attini will build and package the SAM App automatically.

What does AttiniSam do?

The following steps are done automatically when the AttiniSam step is used.

  1. After Attini prePackage, the Attini CLI will look for a build directory within your SAM project. If the directory does not exist, Attini will run sam build.

  2. Attini will then zip the whole SAM Project, including the build directory. This means that the file names within your SAM App do not need to be compatible with S3 naming guidelines and the files will not be excluded by Attini ignore.

  3. The Attini Framework will convert the AttiniSam step into an AttiniCfn step.

  4. The Attini deployment plan will automatically create an AttiniRunnerJob step with our default Runner. This step will download your SAM project, extract it and run sam package with the following configuration.

    sam package -t ${SAM_PROJECT_PATH}/.aws-sam/build/template.yaml \
                    --s3-bucket "${ATTINI_ARTIFACT_STORE}" \
                    --s3-prefix "${ATTINI_ENVIRONMENT_NAME}/${ATTINI_DISTRIBUTION_NAME}/${ATTINI_DISTRIBUTION_ID}/.sam-source/${SAM_PROJECT_PATH}"
    

    For more information about the variables referenced, see Runner environment variables.

    Note

    The files put on S3 by the AttiniSam package will be included by the Attini artifact life cycle policy.