serverless-plugin-terraform-remote-state

0.1.9-beta • Public • Published

Serverless Terraform Remote State Plugin

Inject terraform outputs into your Serverless config.

(Currently only compatible with Terraform 0.13.x)

Install:

yarn add -D serverless-plugin-terraform-remote-state

npm add --dev serverless-plugin-terraform-remote-state

Usage

service: my-service

provider:
  name: aws
  runtime: nodejs12.x
  apiGateway:
    restApiId: ${self:custom.terraformRemoteState.commonInfra.outputs.rest_api.id}
    restApiRootResourceId: ${self:custom.terraformRemoteState.commonInfra.outputs.rest_api.root_resource_id}

custom:
  terraformRemoteState:
    commonInfra:
      backend: s3
      config:
        bucket: my-state-bucket
        key: state/common/tf.state
        region: ap-southeast-2
    myService:
      backend: s3
      config:
        bucket: my-state-bucket
        key: state/my-service/tf.state
        region: ap-southeast-2

functions:
  snsListener:  
    handler: src/sns_listener.handler
    events:
      - sns:
          arn: ${self:custom.terraformRemoteState.myService.outputs.my_sns_topic.arn}

plugins:
    - serverless-plugin-terraform-remote-state

Versions

Current Tags

VersionDownloads (Last 7 Days)Tag
0.1.9-beta76latest

Version History

VersionDownloads (Last 7 Days)Published
0.1.9-beta76
0.1.8-beta0
0.1.7-beta0
0.1.6-beta0
0.1.5-beta0
0.1.4-beta0
0.1.3-beta0
0.1.2-beta0
0.1.1-beta0
0.1.0-beta0

Package Sidebar

Install

npm i serverless-plugin-terraform-remote-state

Weekly Downloads

76

Version

0.1.9-beta

License

MIT

Unpacked Size

18.2 kB

Total Files

17

Last publish

Collaborators

  • mtranter