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

feat(Variables): Add support for Terraform state file parsing #8755

Merged
merged 1 commit into from Jan 15, 2021

Conversation

bdwyertech
Copy link
Contributor

@bdwyertech bdwyertech commented Jan 13, 2021

Terraform state file is JSON. This would add support for cross-referencing Terraform outputs in serverless configuration.

custom:
  AlbListener:
    dev: ${file(./terraform.tfstate.d/${opt:region, 'us-east-1'}/terraform.tfstate):outputs.alblistener.value}

@codecov
Copy link

codecov bot commented Jan 13, 2021

Codecov Report

Merging #8755 (ccf2d85) into master (30015ea) will increase coverage by 0.07%.
The diff coverage is 100.00%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master    #8755      +/-   ##
==========================================
+ Coverage   87.51%   87.59%   +0.07%     
==========================================
  Files         259      259              
  Lines        9628     9640      +12     
==========================================
+ Hits         8426     8444      +18     
+ Misses       1202     1196       -6     
Impacted Files Coverage Δ
lib/utils/fs/parse.js 100.00% <100.00%> (ø)
lib/configSchema.js 100.00% <0.00%> (ø)
lib/plugins/aws/remove/lib/stack.js 100.00% <0.00%> (ø)
lib/classes/Variables.js 99.73% <0.00%> (+<0.01%) ⬆️
lib/plugins/aws/provider.js 93.09% <0.00%> (+0.02%) ⬆️
lib/plugins/aws/lib/updateStack.js 98.52% <0.00%> (+0.04%) ⬆️
lib/plugins/aws/deploy/lib/createStack.js 97.67% <0.00%> (+0.05%) ⬆️
lib/classes/Service.js 85.60% <0.00%> (+0.11%) ⬆️
...b/plugins/aws/package/compile/events/cloudFront.js 98.90% <0.00%> (+3.29%) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 30015ea...ccf2d85. Read the comment docs.

Copy link
Contributor

@pgrzesik pgrzesik left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hello @bdwyertech, thanks for submitting your PR. Would you be willing to add a test case that covers this specific use case?

@bdwyertech
Copy link
Contributor Author

bdwyertech commented Jan 14, 2021 via email

@bdwyertech bdwyertech force-pushed the tfstate branch 2 times, most recently from ad084a0 to 7d6a3ae Compare January 14, 2021 15:48
Signed-off-by: Brian Dwyer <Brian.Dwyer@broadridge.com>
@bdwyertech
Copy link
Contributor Author

Tests added @pgrzesik

Copy link
Contributor

@pgrzesik pgrzesik left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you @bdwyertech, well done 👍

@pgrzesik pgrzesik changed the title Add support for Terraform state file parsing & interpolation feat(Variables): Add support for Terraform state file parsing Jan 15, 2021
@pgrzesik pgrzesik merged commit 461a396 into serverless:master Jan 15, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants