sam-python-crud-sample
sam-python-crud-sample copied to clipboard
Table Parameter Overrides Not Used When Creating DynamoDB Table
Describe the bug A clear and concise description of what the bug is.
To Reproduce Steps to reproduce the behavior:
- sam build
- sam deploy --guided
- invoke URL from Curl or browser, value found on GET resource in API Gateway console
- when prompted for table name, use another value like FBActivities or CodeActivities, rather than default of Activities
You will see "internal server error", and CloudWatch
/aws/lambda/crud-sam-app-ListActivitiesFunction-kVMgyUAS17TY "Access denied exception when calling Scan operation." ListActivitiesFunctionRole. arn:aws:dynamodb:us-east-1:654654165497:table/FBActivities
Expected behavior Should show empty screen
Desktop (please complete the following information): Windows 11
Additional context I changed the last line below to make the fix
ActivitiesTable: Type: AWS::DynamoDB::Table Properties: AttributeDefinitions: - AttributeName: "id" AttributeType: "S" - AttributeName: "date" AttributeType: "S" KeySchema: - AttributeName: "id" KeyType: "HASH" - AttributeName: "date" KeyType: "RANGE" ProvisionedThroughput: ReadCapacityUnits: "1" WriteCapacityUnits: "1" TableName: !Ref Table