Serverless Framework Docs

#Spotinst Functions - IAM roles

Functions sometimes rely on outside services from Amazon such as S3, and accessing these resources often requires authorization using IAM. Spotinst Functions can be configured with the relevant permissions with the inclusion of IAM role information in the serverless.yml file. See Amazon's documentation for more information on IAM roles.

#Requirements

  • You will need to create an IAM role on your AWS account and attach policies with the relevant permissions.
  • A spotinst role will be generated and linked with your AWS role
  • Only one Spotinst role per function.
  • Multiple functions can be associated with the same Spotinst role.

#YML

functions:
  example:
    runtime: nodejs8.3
    handler: handler.main
    memory: 128
    timeout: 30
    access: private
    iamRoleConfig:
      roleId: ${role-id}

#Parameters

  • roleId: the role created on the console

    • ex : sfr-5ea76784

For more information on how to set up IAM roles, check out our documentation here

Have questions?

Head over to the forums to search for your questions and issues or post a new one.