Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Description
This PR enhances the export functionality in StackQL to allow for named exports when reusing an .iql file for multiple resources within a stack. #41
The changes enable exports to be defined as either a simple list of strings or as objects that map exported variables to renamed assigned variables.
I also add the logic of checking type consistency in expected_exports (
all items({items}) must be either dicts or non-dicts
)Fixes
base.py
file in cmd dir and theutils.py
file in lib dir.expected_exports
's type can be a list or an object(dict)(But don't the elements ofexpected_exports
should be same type, not allowing different type.)expected_exports
is an object(dict), the value ofexpected_exports
is a name of export.Checklist
Please make sure that the following criteria are met:
README.md
in the example project directory, which describes the stack and includes instructions to deploy or test.website/docs/template-library/..
which gets published to stackql-deploy.io (optional)Additional Notes
I tested it like below
1) make stackql manifest
2) set all exports as
named export
(unnamed export
is already supported, so I am not showing that case.)fyi) not allowing below manifest
becuase exports' types are different each other.
3) build resources
$ stackql-deploy build . dev -e AWS_REGION=ap-northeast-2
4) I also tested
test
command5) also tested
teardown
commandteardown
, if you usednamed export
like above, not aunnamed export
, you should set props like below.$ stackql-deploy teardown . dev -e AWS_REGION=ap-northeast-2