When enabling SSL in NLB listener interface INetworkListenerCertificateProps is required:
add_listener(id, *, port, certificates=None, default_target_groups=None, protocol=None, ssl_policy=None)
Add a listener to this load balancer.
Parameters
id (str) –
props –
port (Union[int, float]) – The port on which the listener listens for requests.
certificates (Optional[List[INetworkListenerCertificateProps]]) – Certificate list of ACM cert ARNs. Default: - No certificates.
default_target_groups (Optional[List[INetworkTargetGroup]]) – Default target groups to load balance to. Default: - None.
protocol (Optional[Protocol]) – Protocol for listener, expects TCP or TLS. Default: - TLS if certificates are provided. TCP otherwise.
ssl_policy (Optional[SslPolicy]) – SSL Policy. Default: - Current predefined security policy.
However there is nothing that creates that interface.
listener = some_nlb.add_listener(
'SslListener',
port=443,
certificates=[certmanager_ssl],
default_target_groups=[target_group],
protocol = elbv2.Protocol.TLS,
)
Error: Resolution error: Resolution error: Trying to resolve() a Construct at ../Properties/certificates/0/node
This is :bug: Bug Report
I have the same problem. Is there any workaround until the bug gets fixed?
Something like the following should tide you over:
@jsii.implements(elbv2.INetworkListenerCertificateProps)
class Certificate:
def __init__(self, arn):
self.arn = arn
@property
def certificate_arn(self):
return self.arn
Most helpful comment
I have the same problem. Is there any workaround until the bug gets fixed?