aws-containers / retail-store-sample-app

Sample application for demonstrating container platforms and related technology
MIT No Attribution
266 stars 300 forks source link

US_WEST_2 hardcoded in cart service. Causes Control Planes EKS workshop (ACK) to error out. #634

Closed mattgillard closed 4 weeks ago

mattgillard commented 1 month ago

https://github.com/aws-containers/retail-store-sample-app/blob/1870a3929819ac37a3b047fe59afa67e1b4ca686/src/cart/src/main/java/com/amazon/sample/carts/configuration/DynamoDBConfiguration.java#L46

This part of the workshop fails when I ran in ap-southeast-2.

$ kubectl -n carts logs carts-855f5cc5f7-wcxbs
[...]
***************************
APPLICATION FAILED TO START
***************************

Description:

An error occurred when accessing Amazon DynamoDB: 

Credential should be scoped to a valid region.  (Service: DynamoDb, Status Code: 400, Request ID: xxx)

Action:

Check that the DynamoDB table has been created and your IAM credentials are configured with the appropriate access.

Confirmed hardcoding my region fixes the issue. I am not a java dev so not sure the correct way to fix it :) AWS_REGION is available obvs.

https://www.eksworkshop.com/docs/automation/controlplanes/ack/configure-application

niallthomson commented 1 month ago

Hey @mattgillard thanks for raising this.

It looks like the ACK lab is mistakenly setting the DynamoDB endpoint when it shouldn't. I'll get the lab fixed up.

niallthomson commented 4 weeks ago

This has been resolved in the workshop.