dynamodb.ServiceResource' object has no attribute 'exceptions'.

0 votes

Hi Guys,

I have dynamodb = boto3.resource('dynamodb'). But when attempting to except 

dynamodb.exceptions.ConditionalCheckFailedException, I get this below error.

AttributeError: 'dynamodb.ServiceResource' object has no attribute 'exceptions'.
Jul 13 in AWS by akhtar
• 17,690 points
70 views

1 answer to this question.

0 votes

Hi@akhtar,

You'll need to use boto3.client('dynamodb') to be able to access exceptions, it doesn't work with resources. You can use the below line in your code.

dynamodb = boto3.resource('dynamodb')

It will help you.

answered Jul 13 by MD
• 40,740 points

Related Questions In AWS

0 votes
1 answer

Updating an attribute in AWS DynamoDB

Unfortunately, it can't be achieved in a ...READ MORE

answered Nov 2, 2018 in AWS by Archana
• 5,600 points
797 views
0 votes
1 answer
0 votes
1 answer

Import my AWS credentials using python script

Using AWS Cli  Configure your IAM user then ...READ MORE

answered Nov 16, 2018 in AWS by Jino
• 5,660 points
1,103 views
0 votes
1 answer

AWS S3 uploading hidden files by default

versioning is enabled in your bucket. docs.aws.amazon.com/AmazonS3/latest/user-guide/….... the ...READ MORE

answered Oct 4, 2018 in AWS by Priyaj
• 57,550 points
997 views
0 votes
1 answer

Pass account id of an AWS sub account using a variable as an argument in CloudWatch Alarm Actions with python (boto3)?

Python String and Integer concatenation >>> print("arn:aws:swf:us-east-2:{0}:action/actions/AWS_EC2.InstanceId.Stop/1.0".format(acccnum)) arn:aws:swf:us-east-2:12312312312312:action/actions/AWS_EC2.InstanceId.Stop/1.0 >>> print("arn:aws:swf:us-east-2:" ...READ MORE

answered Oct 5, 2018 in AWS by Priyaj
• 57,550 points
387 views
+13 votes
2 answers
0 votes
1 answer
0 votes
1 answer

'No module named 'requests'' on the AWS Python Lambda function?

Hi@akhtar, According to my knowledge requests is not ...READ MORE

answered Apr 15 in AWS by MD
• 40,740 points
1,410 views