Package Exports
- @mongey/serverless-plugin-terraform-remote-state
This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (@mongey/serverless-plugin-terraform-remote-state) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.
Readme
Serverless Terraform Remote State Plugin
Inject Terraform outputs into your Serverless config.
(Currently only compatible with Terraform 0.13+)
Install:
yarn add -D @mongey/serverless-plugin-terraform-remote-state
npm add --dev @mongey/serverless-plugin-terraform-remote-state
Usage
service: my-service
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
provider:
name: aws
runtime: nodejs12.x
apiGateway:
restApiId: ${terraformRemoteState:commonInfra.outputs.rest_api.id}
restApiRootResourceId: ${terraformRemoteState:commonInfra.outputs.rest_api.root_resource_id}
functions:
snsListener:
handler: src/sns_listener.handler
events:
- sns:
arn: ${terraformRemoteState:myService.outputs.my_sns_topic.arn}