Credentials

The plugin needs permission to create and manage cloud resources on your behalf. Credentials can be supplied via environment variables, a config file, or inline in config.json. Environment variables are recommended for CI/CD pipelines; inline config is convenient for local development.

Never commit credentials to source control. Use environment variables or a secrets manager in CI/CD pipelines.

AWS Credentials

The plugin uses the standard AWS credential chain. Any of the following methods work.

Method 1 — Environment Variables (recommended for CI/CD)

export AWS_ACCESS_KEY_ID=AKIAIOSFODNN7EXAMPLE

export AWS_SECRET_ACCESS_KEY=wJalrXUtnFEMI/K7MDENG/bPxRfiCYEXAMPLEKEY

export AWS_DEFAULT_REGION=eu-west-2

Method 2 — AWS Credentials File

Configure a named profile in ~/.aws/credentials:

[myapp-deploy]

aws_access_key_id = AKIAIOSFODNN7EXAMPLE

aws_secret_access_key = wJalrXUtnFEMI/K7MDENG/bPxRfiCYEXAMPLEKEY

region = eu-west-2

Then reference the profile in your config:

{

  "credentials": {

    "method": "profile",

    "profile": "myapp-deploy"

  }

}

Method 3 — Inline in config.json

{

  "credentials": {

    "method": "static",

    "accessKeyId": "${AWS_ACCESS_KEY_ID}",

    "secretAccessKey": "${AWS_SECRET_ACCESS_KEY}",

    "region": "eu-west-2"

  }

}

Use variable substitution (${...}) so the actual values come from environment variables, not the file.

Method 4 — IAM Role (EC2 / ECS / Lambda)

When running on an AWS compute resource with an attached IAM role, no credential configuration is needed. The plugin picks up the instance metadata credentials automatically.

Minimum IAM Permissions

The IAM user or role must have permission to create and manage the resources for each component type you use. The table below lists the minimum AWS managed policies or equivalent custom permissions.

Component
Required permissions (actions)
function
lambda:CreateFunction, lambda:UpdateFunctionConfiguration, lambda:UpdateFunctionCode, lambda:GetFunction, lambda:GetFunctionConfiguration, lambda:TagResource, iam:CreateRole, iam:GetRole, iam:TagRole, iam:PutRolePolicy, iam:PassRole, sts:GetCallerIdentity, logs:CreateLogGroup, and (only when a function declares a schedule) events:PutRule, events:PutTargets, events:DeleteRule, events:RemoveTargets, events:ListTargetsByRule, lambda:AddPermission
api-gateway
apigateway:*, acm:RequestCertificate, acm:DescribeCertificate, route53:ChangeResourceRecordSets
website
s3:*, cloudfront:*, acm:RequestCertificate, route53:ChangeResourceRecordSets, and secretsmanager:GetSecretValue (only when an accessGate is enabled)
database
dynamodb:CreateTable, dynamodb:DescribeTable, dynamodb:TagResource, and (only when a table declares a ttlAttribute) dynamodb:DescribeTimeToLive, dynamodb:UpdateTimeToLive
storage
s3:*
authentication
cognito-idp:*, and lambda:AddPermission (only when Cognito Lambda triggers are declared, to let the pool invoke the trigger functions)
email
ses:*
sms
sns:*
event-bus
events:*, lambda:AddPermission

Function-to-function links. When a function declares a FUNCTION_TO_FUNCTION link, the plugin injects the target function's ARN as a FUNCTION_<NAME> environment variable. Resolving that ARN requires lambda:GetFunctionConfiguration (and lambda:GetFunction) so the variable is populated even when the target function was unchanged and therefore skipped in the current deploy. Creating a function with its execution role also requires iam:PassRole. If you scope your policy narrower than lambda:*, make sure these read actions are included or the linked ARN will be silently omitted.

Website access gate. When a website component enables an accessGate (edge HTTP Basic auth), the deploy identity additionally needs secretsmanager:GetSecretValue to read the credentials secret at deploy time, and the CloudFront function actions cloudfront:CreateFunction, cloudfront:UpdateFunction, cloudfront:PublishFunction, cloudfront:DescribeFunction, and cloudfront:DeleteFunction (all covered by cloudfront:*). If you scope secretsmanager:GetSecretValue by resource, include the ARN of the secret named in accessGate.credentialsSecret.

Website edge functions. When a website declares an edgeFunctions viewer-request entry, the deploy identity needs the CloudFront function actions cloudfront:CreateFunction, cloudfront:UpdateFunction, cloudfront:PublishFunction, cloudfront:DescribeFunction, and cloudfront:DeleteFunction — all already covered by cloudfront:*. Edge functions read their source from the project at deploy time and need no Secrets Manager access (unlike the access gate).

CI/CD Example (GitHub Actions)

- name: Deploy

  env:

    AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }}

    AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }}

    AWS_DEFAULT_REGION: eu-west-2

  run: mvn serverless:deploy

Credentials Object Reference

The optional credentials block at the root of config.json supports these fields:

Field
Type
Required
Description
method
string

required

One of: env (default), profile (AWS), static (AWS), service-principal (Azure), service-account-key (GCP).
region
string

optional

AWS only. Overrides the region for credential resolution. Normally set per-region in the regions array.
profile
string

optional

AWS only. Named profile from ~/.aws/credentials.
accessKeyId
string

optional

AWS static credentials. Use variable substitution.
secretAccessKey
string

optional

AWS static credentials. Use variable substitution.
clientId
string

optional

Azure service principal client ID.
clientSecret
string

optional

Azure service principal client secret. Use variable substitution.
tenantId
string

optional

Azure tenant ID.
subscriptionId
string

optional

Azure subscription ID.
keyFile
string

optional

GCP path to service account JSON key file. Use variable substitution.
projectId
string

optional

GCP project ID. Can also be set via GCLOUD_PROJECT environment variable.

If the credentials block is omitted entirely, the plugin falls back to the provider's default credential chain — environment variables, then credential files, then instance metadata. This is the recommended approach for most CI/CD setups.