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, 2020 in AWS by akhtar
• 38,180 points
2,109 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, 2020 by MD
• 95,140 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,640 points
1,130 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,810 points
1,534 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
• 58,100 points
2,021 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
• 58,100 points
587 views
+13 votes
2 answers
0 votes
1 answer

AttributeError: 'ec2.ServiceResource' object has no attribute 'send_command'

Hi@Lakshminarayanan, The send_command attribute is not available in ...READ MORE

answered Oct 7, 2020 in AWS by MD
• 95,140 points
578 views
0 votes
1 answer