This my Code:
`import boto3
from boto3.dynamodb.conditions import Key
TABLE_NAME = "RegData"
# Creating the DynamoDB Client
dynamodb_client = boto3.client('dynamodb', region_name="us-east-1")
# Creating the DynamoDB Table Resource
dynamodb = boto3.resource('dynamodb', region_name="us-east-1")
table = dynamodb.Table(TABLE_NAME)
response = dynamodb_client.get_item(
TableName=TABLE_NAME,
Key={
'BarCode': {'S': str(10)},
}
)
print(response['Item'])
`
The Error Massage:
NoCredentialsError Traceback (most recent call last)
<ipython-input-85-d5e8f6f0dacd> in <cell line: 1>()
1 response = dynamodb_client.get_item(
2 TableName=TABLE_NAME,
3 Key={
4 'artist': {'S': str(10)},
5 }
My Table:
I tried defining the response part in a function it run smoothly
however when I call the function the same error appear