Skip to content

create_consent_portal async

create_consent_portal(
    execution_role_arn: ExecutionRoleArnType,
    idp_config: ConsentPortalIdpConfig,
    name: ConsentPortalNameType,
    sources: ConsentPortalSources,
    *,
    config_overrides: Optional[AsyncBedrockAgentCoreControlClientConfig] = None,
    description: Optional[ConsentPortalDescriptionType] = None,
    tags: Optional[TagsMap] = None,
) -> CreateConsentPortalResponse

Creates a new consent portal.

Parameters:

  • execution_role_arn (ExecutionRoleArnType) –

    The Amazon Resource Name (ARN) of the IAM role that the consent portal assumes to access the resources defined in its sources.

  • idp_config (ConsentPortalIdpConfig) –

    The identity provider configuration that the consent portal uses to authenticate end users.

  • name (ConsentPortalNameType) –

    The name of the consent portal. The name must be unique within your account.

  • sources (ConsentPortalSources) –

    The resources served by the consent portal. Currently, we only support type agentcore-gateway.

  • description (Optional[ConsentPortalDescriptionType], default: None ) –

    The description of the consent portal.

  • tags (Optional[TagsMap], default: None ) –

    A map of tag keys and values to assign to the consent portal. Tags enable you to categorize your resources in different ways, for example, by purpose, owner, or environment.

Raises:

Source code in docs_src/capo_bedrock_agentcore_control/_services/async_bedrock_agent_core_control.py
async def create_consent_portal(
    self,
    execution_role_arn: "capo_bedrock_agentcore_control.types.execution_role_arn_type.ExecutionRoleArnType",
    idp_config: "capo_bedrock_agentcore_control.types.consent_portal_idp_config.ConsentPortalIdpConfig",
    name: "capo_bedrock_agentcore_control.types.consent_portal_name_type.ConsentPortalNameType",
    sources: "capo_bedrock_agentcore_control.types.consent_portal_sources.ConsentPortalSources",
    *,
    config_overrides: Optional[AsyncBedrockAgentCoreControlClientConfig] = None,
    description: Optional[
        "capo_bedrock_agentcore_control.types.consent_portal_description_type.ConsentPortalDescriptionType"
    ] = None,
    tags: Optional["capo_bedrock_agentcore_control.types.tags_map.TagsMap"] = None,
) -> "capo_bedrock_agentcore_control.types.create_consent_portal_response.CreateConsentPortalResponse":
    """<p>Creates a new consent portal.</p>

    Args:
        execution_role_arn: <p>The Amazon Resource Name (ARN) of the IAM role that the consent portal assumes to access the resources defined in its sources.</p>
        idp_config: <p>The identity provider configuration that the consent portal uses to authenticate end users.</p>
        name: <p>The name of the consent portal. The name must be unique within your account.</p>
        sources: <p>The resources served by the consent portal. Currently, we only support type <code>agentcore-gateway</code>.</p>
        description: <p>The description of the consent portal.</p>
        tags: <p>A map of tag keys and values to assign to the consent portal. Tags enable you to categorize your resources in different ways, for example, by purpose, owner, or environment.</p>

    Raises:
        capo_bedrock_agentcore_control.errors.access_denied_exception.AccessDeniedException: <p>This exception is thrown when a request is denied per access permissions</p>
        capo_bedrock_agentcore_control.errors.conflict_exception.ConflictException: <p>This exception is thrown when there is a conflict performing an operation</p>
        capo_bedrock_agentcore_control.errors.internal_server_exception.InternalServerException: <p>This exception is thrown if there was an unexpected error during processing of request</p>
        capo_bedrock_agentcore_control.errors.resource_not_found_exception.ResourceNotFoundException: <p>This exception is thrown when a resource referenced by the operation does not exist</p>
        capo_bedrock_agentcore_control.errors.service_quota_exceeded_exception.ServiceQuotaExceededException: <p>This exception is thrown when a request is made beyond the service quota</p>
        capo_bedrock_agentcore_control.errors.throttling_exception.ThrottlingException: <p>This exception is thrown when the number of requests exceeds the limit</p>
        capo_bedrock_agentcore_control.errors.unauthorized_exception.UnauthorizedException: <p>This exception is thrown when the JWT bearer token is invalid or not found for OAuth bearer token based access</p>
        capo_bedrock_agentcore_control.errors.validation_exception.ValidationException: <p>The input fails to satisfy the constraints specified by the service.</p>
        capo_bedrock_agentcore_control.errors.UnknownServiceError: The service returned an error code this client does not model.
    """

    async def _handler(
        req: "AsyncOperationRequest[capo_bedrock_agentcore_control.types.create_consent_portal_request.CreateConsentPortalRequest]",
    ) -> AsyncOperationResponse[
        "capo_bedrock_agentcore_control.types.create_consent_portal_response.CreateConsentPortalResponse"
    ]:
        import capo_bedrock_agentcore_control._operations.amazon_bedrock_agent_core_control.create_consent_portal

        (
            output,
            http_response,
        ) = await capo_bedrock_agentcore_control._operations.amazon_bedrock_agent_core_control.create_consent_portal.async_create_consent_portal(
            req.options, req.input
        )
        return AsyncOperationResponse(output=output, response=http_response)

    interceptors_, options_ = self.operation_options(
        config_overrides, OperationLogging("CreateConsentPortal")
    )
    input_: capo_bedrock_agentcore_control.types.create_consent_portal_request.CreateConsentPortalRequest = {
        "execution_role_arn": execution_role_arn,
        "idp_config": idp_config,
        "name": name,
        "sources": sources,
    }
    if description is not None:
        input_["description"] = description
    if tags is not None:
        input_["tags"] = tags

    response = await aexecute_pipeline(
        AsyncOperationRequest(input=input_, options=options_),
        handler=_handler,
        interceptors=list(interceptors_),
    )
    await response.response.aclose()
    return response.output