@@ -3,6 +3,7 @@ package elbv2
3
3
import (
4
4
"context"
5
5
"reflect"
6
+ "strings"
6
7
"time"
7
8
8
9
awssdk "github.com/aws/aws-sdk-go-v2/aws"
@@ -101,7 +102,8 @@ func (m *defaultListenerManager) Create(ctx context.Context, resLS *elbv2model.L
101
102
}); err != nil {
102
103
return elbv2model.ListenerStatus {}, errors .Wrap (err , "failed to update extra certificates on listener" )
103
104
}
104
- if areListenerAttributesSupported (resLS .Spec .Protocol ) {
105
+ listenerARN := awssdk .ToString (sdkLS .Listener .ListenerArn )
106
+ if ! isIsolatedRegion (getRegionFromARN (listenerARN )) && areListenerAttributesSupported (resLS .Spec .Protocol ) {
105
107
if err := m .attributesReconciler .Reconcile (ctx , resLS , sdkLS ); err != nil {
106
108
return elbv2model.ListenerStatus {}, err
107
109
}
@@ -121,7 +123,8 @@ func (m *defaultListenerManager) Update(ctx context.Context, resLS *elbv2model.L
121
123
if err := m .updateSDKListenerWithExtraCertificates (ctx , resLS , sdkLS , false ); err != nil {
122
124
return elbv2model.ListenerStatus {}, err
123
125
}
124
- if areListenerAttributesSupported (resLS .Spec .Protocol ) {
126
+ listenerARN := awssdk .ToString (sdkLS .Listener .ListenerArn )
127
+ if ! isIsolatedRegion (getRegionFromARN (listenerARN )) && areListenerAttributesSupported (resLS .Spec .Protocol ) {
125
128
if err := m .attributesReconciler .Reconcile (ctx , resLS , sdkLS ); err != nil {
126
129
return elbv2model.ListenerStatus {}, err
127
130
}
@@ -379,3 +382,17 @@ func areListenerAttributesSupported(protocol elbv2model.Protocol) bool {
379
382
supported , exists := PROTOCOLS_SUPPORTING_LISTENER_ATTRIBUTES [protocol ]
380
383
return exists && supported
381
384
}
385
+
386
+ func getRegionFromARN (arn string ) string {
387
+ if strings .HasPrefix (arn , "arn:" ) {
388
+ arnElements := strings .Split (arn , ":" )
389
+ if len (arnElements ) > 3 {
390
+ return arnElements [3 ]
391
+ }
392
+ }
393
+ return ""
394
+ }
395
+
396
+ func isIsolatedRegion (region string ) bool {
397
+ return strings .Contains (strings .ToLower (region ), "-iso-" )
398
+ }
0 commit comments