forked from localstack/localstack
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathplugins.py
More file actions
26 lines (19 loc) · 899 Bytes
/
plugins.py
File metadata and controls
26 lines (19 loc) · 899 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
import logging
from localstack import config
from localstack.runtime import hooks
LOG = logging.getLogger(__name__)
@hooks.configure_localstack_container()
def configure_edge_port(container):
ports = [config.EDGE_PORT, config.EDGE_PORT_HTTP]
LOG.debug("configuring container with edge ports: %s", ports)
for port in ports:
if port:
container.ports.add(port)
# Register the ArnPartitionRewriteListener only if the feature flag is enabled
@hooks.on_infra_start(should_load=lambda: config.ARN_PARTITION_REWRITING)
def register_partition_adjusting_proxy_listener():
LOG.info(
"Registering ArnPartitionRewriteListener to dynamically replace partitions in requests and responses."
)
from localstack.services.generic_proxy import ArnPartitionRewriteListener, ProxyListener
ProxyListener.DEFAULT_LISTENERS.append(ArnPartitionRewriteListener())