"Error: domain \"development.client.company.at\" does not match." when trying to use CloudWatch RUM together with Amplify

0

I'm currently integrating AWS Amplify with AWS CloudWatch Real User Monitoring (RUM) to monitor user activity across different environments. My Amplify setup includes custom domains for each environment: client.company.at for production, staging.company.at for staging, and development.company.at for development. Everything works seamlessly within the Amplify environment.

To monitor user interactions, I've configured three application monitors in CloudWatch RUM, each corresponding to one of the environments mentioned above. Each monitor is set up with the respective custom domain.

However, when I attempt to send requests from my development environment (development.client.company.at), I encounter an error stating: "Error: domain "development.client.company.at" does not match." This is despite the fact that the domains in both Amplify and CloudWatch RUM are identical.

Strangely, I'm able to send requests successfully from my local environment (local.client.company.at) without any issues. This leads me to believe that there might be some missing permissions or misconfiguration in my AWS setup.

I've included a sample curl command below for reference:

curl 'https://dataplane.rum.eu-central-1.amazonaws.com/appmonitors/yyy' \
  -H 'Accept: */*' \
  -H 'Accept-Language: en-US,en;q=0.9' \
  -H 'Connection: keep-alive' \
  -H 'Origin: https://development.client.company.at' \
  -H 'Referer: https://development.client.company.at/' \
  -H 'Sec-Fetch-Dest: empty' \
  -H 'Sec-Fetch-Mode: cors' \
  -H 'Sec-Fetch-Site: cross-site' \
  -H 'User-Agent: Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/123.0.0.0 Safari/537.36' \
  -H 'authorization: AWS4-HMAC-SHA256 Credential=yyy/20240404/eu-central-1/rum/aws4_request, SignedHeaders=content-type;host;x-amz-content-sha256;x-amz-date;x-amz-security-token, Signature=yyy' \
  -H 'content-type: application/json' \
  -H 'sec-ch-ua: "Google Chrome";v="123", "Not:A-Brand";v="8", "Chromium";v="123"' \
  -H 'sec-ch-ua-mobile: ?0' \
  -H 'sec-ch-ua-platform: "Linux"' \
  -H 'x-amz-content-sha256: yyy' \
  -H 'x-amz-date: 20240404T120532Z' \
  -H 'x-amz-security-token: yyy' \
  --data-raw '{"BatchId":"yyy","AppMonitorDetails":{"id":"yyy","version":"1.0.0"},"UserDetails":{"userId":"yyy","sessionId":"yyy"},"RumEvents":[{"id":"yyy","timestamp":1712232332,"type":"com.amazon.rum.page_view_event","metadata":"{\"browserLanguage\":\"en-US\",\"browserName\":\"Chrome\",\"browserVersion\":\"123.0.0.0\",\"osName\":\"Linux\",\"osVersion\":\"x86_64\",\"deviceType\":\"desktop\",\"platformType\":\"web\",\"domain\":\"development.client.company.at\",\"title\":\"application\",\"pageId\":\"/yyy/yyy\",\"interaction\":7,\"parentPageId\":\"/yyy/yyy\",\"version\":\"1.0.0\",\"aws:client\":\"arw-module\",\"aws:clientVersion\":\"1.17.1\"}","details":"{\"version\":\"1.0.0\",\"pageId\":\"/yyy/yyy\",\"interaction\":7,\"pageInteractionId\":\"/yyy/yyy-7\",\"parentPageInteractionId\":\"/yyy/yyy-6\",\"timeOnParentPage\":29112,\"referrer\":\"\",\"referrerDomain\":\"\"}"}]}'

I'm unsure why requests from Amplify environments are failing while local requests are successful. Any insights or suggestions on resolving this issue would be greatly appreciated.

asked 25 days ago470 views
No Answers

You are not logged in. Log in to post an answer.

A good answer clearly answers the question and provides constructive feedback and encourages professional growth in the question asker.

Guidelines for Answering Questions