-
Notifications
You must be signed in to change notification settings - Fork 40
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
Dedicated/Standardized Exports Unwrapper #38
Comments
Not sure if I get you right. Wouldn't the following work?
|
In theory yes, but that requires me to either (1) export all of the nested parameters in the wrapper or (2) continually modify the wrapper to expose values as-needed. I'd like to avoid polluting my exports in both cases and definitely don't want to be regularly updating the stack to facilitate the second. My applications are broken into a bunch of pieces. About half of the modules are separated for practical reasons (e.g. reuse) and will stay that way. The other half are separated for debugging reasons e.g. I don't want to redeploy DB/Redis every time I want to test/troubleshoot adjustments to service templates that require me to deploy and undeploy (e.g. due to eports). So I have e.g. a base template that creates and exports a VPC:
In most places where I'm using it, I've been passing this value to a nested stack so it doesn't matter that I can't double-import.
In theory, I can create a new module for everything so I can double-import again. In a lot of cases I do. In some cases I'm not really reusing the feature so it doesn't make as much sense. I can still create the wrapper but it ends up being pretty trivial:
I am trying to propose a way to unwrap module exports without the need for the nested module. The trivial wrapper is certainly a workaround. Maybe trivial wrappers are even the best practice. But I wanted to demonstrate a solution I had found that does not require extra wrappers. |
ok. So how would that "standardized outputs (or exports) YAML file in each package" look like? |
From my original post, you can use the following pattern to convert all of a module's exports into outputs...
For the actual VPC module (and similar), you may need a second parameter e.g.
You don't need to pollute any export spaces. The |
It occurs to me that this strategy could help fully modularize complex modules like VPC (and anything else affected by the discussion in #36). For example, I want/need the CIDR range for the two Public Subnets. Why? AWS Endpoint Services are attached to an NLB and consumer traffic looks like it's coming from the NLB's IP Address. Since the NLB IP addresses can't be obtained easily, I need to add the entire public (really DMZ in my world) range to my ALB Ingress to permit traffic. To do this today, I have to add the CIDR block output to both In the extreme version, it would be possible to instead:
In this approach, only the |
Assume I want to create a module like this:
BUT the
VpcModule
has been exported at${Environment}-VpcModule
. How do I get toVpcModule
fromEnvironment
?PeeringConnection
into a nested stack. I can use an import to populate theVpcModule
parameter and, within the stack, do the secondary import.This lets me do everything on the outer level:
I'd like to suggest including a standardized
outputs
(orexports
) YAML file in each package that wraps a module's stackname and provides all of its exports.The text was updated successfully, but these errors were encountered: