By using AWS re:Post, you agree to the AWS re:Post Terms of Use

Lambda - Quicksight boto3 issue - 'QuickSight' object has no attribute 'update_spice_capacity_configuration'

0

Hi Folks, I have a lambda function which I need to modify to add this method 'update_spice_capacity_configuration' to udpate PurchaseMode = 'AUTO_PURCHASE' but I'm getting this error 'QuickSight' object has no attribute 'update_spice_capacity_configuration'

hasattr() output is 'false' suggesting me that this method may not be available. When I printed available methods, did not see this one either.('update_spice_capacity_configuration') I think this is due to boto3 version 1.34.42 Is there any workaround or a different API?

When I run it locally on boto3 version 1.34.96, it runs without errors.

Here is the python code as asked -

import boto3
qsclient = boto3.client('quicksight')
try:
    print(hasattr(qsclient,'update_spice_capacity_configuration'))
    print(boto3.__version__)
    response = qsclient.update_spice_capacity_configuration(
        AwsAccountId = os.environ['source_account'], #youraccount
        PurchaseMode = 'AUTO_PURCHASE'
    )
except ClientError as e:
        print(f"Unexpected error: {e}")

-- #error - AttributeError: 'QuickSight' object has no attribute 'update_spice_capacity_configuration'

  • Can you please post your code here - using the appropriate formatting - then we can help.

AWS
asked 6 months ago546 views
1 Answer
0

Since you did not include your code, I can give you some boiler plate for this:

import botocore
import boto3
import json


client = boto3.client('quicksight')

# Update Spice 

try:
    response = client.update_spice_capacity_configuration(
        AwsAccountId='123123123123',
        PurchaseMode='AUTO_PURCHASE'
    )
except botocore.exceptions.ClientError as error:
    print(json.dumps(error.response, indent=4))
    raise error

# Successful
print(json.dumps(response, indent=4))

This will either print out an error, if the call fails, or the full output of the response object.

I am using the following versions of boto3 and botocore:

  • boto3==1.34.126
  • botocore==1.34.126
AWS
EXPERT
answered 6 months ago

You are not logged in. Log in to post an answer.

A good answer clearly answers the question and provides constructive feedback and encourages professional growth in the question asker.

Guidelines for Answering Questions