Skip to content

Commit ea0a06d

Browse files
committed
fix extraction of EventBridge API destination name using new ARN format
1 parent 1c4e172 commit ea0a06d

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

localstack/utils/aws/aws_stack.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -698,8 +698,10 @@ def send_event_to_target(arn, event, target_attributes=None, asynchronous=True):
698698

699699
elif ":events:" in arn:
700700
events_client = connect_to_service("events", region_name=region)
701-
target_name = arn.split(":")[-1].split("/")[-1]
702-
if ":destination/" in arn:
701+
arn_suffix_parts = arn.split(":")[-1].split("/")
702+
target_name = arn_suffix_parts[-1]
703+
if ":destination/" in arn or ":api-destination/" in arn:
704+
target_name = arn_suffix_parts[1] # extract name from ...:api-destination/<name>/<uuid>
703705
destination = events_client.describe_api_destination(Name=target_name)
704706
method = destination.get("HttpMethod", "GET")
705707
endpoint = destination.get("InvocationEndpoint")

0 commit comments

Comments
 (0)