-
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
Interface Definitions #36
Comments
The centralized place might already exist (but not easy to find): https://github.com/cfn-modules/docs/blob/master/CONTRIBUTING.md#interfaces
The
The reason why the NLB listener and target are combined is this: A NLB can only have a single target. While the ALB can have multiple targets (with path/domain rules). You can see the implemented interface of a module by looking at this comment at the top of a module.yml:
Not sure if that adds some new insights. I agree, the |
Thanks. I definitely did not find those docs. Maybe each file that has an interface should list that URL above/below (e.g. "Definitions: "). Easy to bulk replace the URL if you move the docs. I'm still extremely concerned about (edit: indicates names that more closely match the semantics of my next comment) I'll come back to non-interface issues like Private/Public below, but each For practical reasons, the VPC actually defines a Finally VPC itself has an |
P.S. I doubt the The same syntax could be used to precisely specify really complex collections. For example, |
P.P.S. Even if you 100% agree, I don't expect you to make these changes any time soon. I just wanted to highlight the issue (and try to help solve it) as soon as possible to avoid rework/bigger problems in the future. |
I'd like to suggest a centralized place for interface definitions and a more use-oriented scheme for
Outputs
naming. I assume you were trying to simplify/standardize the interfaces when creatingcfn-modules
, but I've already run into a case that worries me. I bring it up since interface design gets harder and harder to fix the longer you wait.Background: The next ECS Service I need to integrate requires an inbound TCP connection so I'm forced to implement an NLB stack in addition to our "existing" ALB stack.
Issue: This lead me to use/compare
alb-listener
andecs-nlb-listener-and-target
. While both expose an-Arn
output,alb-listener
the ARN is theListener
ecs-nlb-listener-and-target
the ARN is theTargetGroup
The ambiguity is especially pronounced since
ecs-nlb-listener-and-target
also has aListener
with anArn
that could be exposed. Technically, the interface for the two is different (i.e.ExposeArn
vsTarget
) so they're not "incompatible", but I don't think theExposeArn
interface is useful/scalable.Proposal: It seems to me that interfaces should not just indicate but enforce compatibility. E.G. a parameter named
TargetModule
should (in theory) accept any module that implements theTarget
interface. Like a puzzle piece, this relationship is enforced by ensuring that exports should only be compatible with each other (e.g.TargetArn
andTargetSg
).If a Resource can be used in multiple ways, it can be exposed at several endpoints. For example,
IngressSg
to indicate where to attach an Ingress rule for access to the service.EgressSg
as the group that gets authorized e.g. access to the RDS database.AlbListener
could expose the ALB's-LoadBalancerSg
atIngressSg
since this is the group that would be used to access the listenerAlbTarget
would expose the same-LoadBalancerSg
atEgressSg
since this group would be authorized to e.g. the ECS Service as the source of traffic.IngressSg
and the ECS SG atEgressSg
Obviously, it'd be easier to see/plan/enforce these relationships if they were listed e.g. here in the
docs
module.The text was updated successfully, but these errors were encountered: