Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Native Terraform Integration #7959

Open
mcalhoun opened this issue Jul 18, 2020 · 2 comments
Open

Native Terraform Integration #7959

mcalhoun opened this issue Jul 18, 2020 · 2 comments

Comments

@mcalhoun
Copy link

mcalhoun commented Jul 18, 2020

Use case description

The definitive guide to using Terraform with the Serverless Framework describes the use cases for using Terraform to provision shared, non-app-specific infrastructure. In the guide, it is suggested that Terraform should store its outputs in AWS SSM Parameter Store, however, this requires tight coupling between Terraform modules and Serverless configurations and requires a different solution for each cloud provider.

Proposed solution

My proposal is to add native support to read Terraform outputs directly. In the example below, Serverless would resolve the db_url output from the Terraform module located at /infrastructure-live/prod/us-east-1/prod/data-stores/postgres

 functions:
      darksky:
        handler: handler.darksky
        environment: 
          DARKSKY_DB_URL: ${terraform:/infrastructure-live/prod/us-east-1/prod/data-stores/postgres~db_url}
        events:
          - http:
              path: /darksky/{latitude}/{longitude}
              method: get
@mcalhoun
Copy link
Author

Just to be clear, I am volunteering to implement this as well :)

@medikoo
Copy link
Contributor

medikoo commented Jul 20, 2020

@mcalhoun great thanks for proposal. I think it makes a big sense to create a plugin for that. Note that plugins can introduce custom variables scopes: https://www.serverless.com/framework/docs/providers/aws/guide/plugins#custom-variable-types

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants