Access an amazonaws.com API from within localstack

25 Views Asked by At

I have a step function stack deployed within localstack.

One step is to call an external API which is hosted on XXXXXX.execute-api.eu-west-1.amazonaws.com

The problem is that it seems localstack overrides this domain to be localhost (127.0.0.x)

I tried this

zone_id=$(awslocal route53 create-hosted-zone \
    \--name amazonaws.com \
    \--caller-reference r1 | jq -r '.HostedZone.Id')

awslocal route53 change-resource-record-sets \
    \--hosted-zone-id $zone_id \
    \--change-batch 'Changes=\[{Action=CREATE,ResourceRecordSet={Name=XXXXXX.execute-api.eu-west-1.amazonaws.com,Type=A,ResourceRecords=\[{Value=XX.XX.XX.XX}\]}}\]'

I did this for all subdomains to no avail.

Which works well with other domains but not amazonaws.com

So my question is.. is there a way to override specific domains to allow it to point to other IPs?

Note: I cannot set the external domain name to anything else or change my hosts file locally (corporate machine restrictions)

0

There are 0 best solutions below