Skip to content

Trouble creating Q Business app via Python SDK

0

Hey all:

I am trying to create a simple Q app via the API from Python. When I run the below code, I get the following error:

An error occurred (AccessDeniedException) when calling the CreateApplication operation: Identity Type can not be null.

Here's the code:

import requests
import json
import boto3

# Initialize a Boto3 client for Amazon Q
aws_service = 'qbusiness'
client = boto3.client( aws_service )

# Parameters for the application creation
params = {
# "attachmentsConfiguration": {"attachmentsControlMode": "string"},
# "clientToken": "string",
# "description": "string",
"displayName": "pmo-q-bot-py-test",
# "encryptionConfiguration": {"kmsKeyId": "string"},
"roleArn": "arn:aws:iam::999999999999:role/aws-service-role/qbusiness.amazonaws.com/AWSServiceRoleForQBusiness",
# "identityCenterInstanceArn" : "",
# "tags": [
#     {"key": "string", "value": "string"}
# ]
}
# Create the application
try:
    response = client.create_application(**params)
    # Print the response
    print(response)
except Exception as e:
    print( e )

Nothing in the docs defers to an Identity Type being part of a Q business app. Might it be related to the user and role I'm using? (Authentication is via keys stored in the local config files).

Any thoughts?

Thanks, Steve

1 Answer
1
Accepted Answer

Hello.

Amazon Q Business uses IAM Identity Center to manage users.
Therefore, an error will occur if "identityCenterInstanceArn" is not set when creating an application.
https://docs.aws.amazon.com/amazonq/latest/qbusiness-ug/idp-sso.html

Starting April 30, 2024, all new applications will need to use IAM Identity Center directly to manage user access. No new applications can be created using the legacy identity management flow. All existing Amazon Q Business applications using legacy identity management will need to migrate to using IAM Identity Center for user management by July 29, 2024. We recommend you integrate any new application you're creating directly with IAM Identity Center.

EXPERT
answered a year ago
EXPERT
reviewed a year ago
EXPERT
reviewed a year ago
  • Thanks! Seems like I definitely need to start there.

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.