Skip to content
This repository has been archived by the owner on Dec 20, 2023. It is now read-only.

Export stack outputs #89

Merged
merged 12 commits into from
Jul 22, 2019
Merged

Export stack outputs #89

merged 12 commits into from
Jul 22, 2019

Conversation

roni-frantchi
Copy link
Contributor

Why?

So that one may consume the VPC's outputs from another stack.
Needed for cases where there are multiple Serverless services rather than a single one that require the same VPC setup.

Breaking changes?

None. A configuration to exportOutputs was added, defaulting to false, preserving the current state of the plugin.

Usage?

See readme for more details.

Include Subnet Groups in outputs
@jplock
Copy link
Member

jplock commented Jul 21, 2019

Please rebase

src/index.js Outdated
@@ -105,6 +106,10 @@ class ServerlessVpcPlugin {
if ('createNatInstance' in vpcConfig && typeof vpcConfig.createNatInstance === 'boolean') {
({ createNatInstance } = vpcConfig);
}

if ('exportOutputs' in vpcConfig && typeof vpcConfig.createNatInstance === 'boolean') {
Copy link
Member

Choose a reason for hiding this comment

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

exportOutputs

Copy link
Contributor Author

@roni-frantchi roni-frantchi Jul 21, 2019

Choose a reason for hiding this comment

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

Thanks! Fixed in 6e4a867

@roni-frantchi
Copy link
Contributor Author

@jplock Rebased and fixed the issue you found.
Could you have another look please?

src/outputs.js Outdated
if (exportOutputs) {
Object.entries(outputs).forEach(([name, value]) => {
// eslint-disable-next-line no-param-reassign
value.Export = { Name: { '!Join': ['-', ["!Ref 'AWS::StackName'", name]] } };
Copy link
Member

Choose a reason for hiding this comment

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

Can you use ‘Fn::Join’ here instead of !Join? Same with removing !Ref. Otherwise looks good

@jplock
Copy link
Member

jplock commented Jul 21, 2019

Can the package-lock changes be removed from this PR?

@jplock jplock merged commit 71519a6 into smoketurner:master Jul 22, 2019
@roni-frantchi roni-frantchi mentioned this pull request Jul 22, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Development

Successfully merging this pull request may close these issues.

2 participants