Skip to content

create_permission_set async

create_permission_set(
    name: PermissionSetName,
    instance_arn: InstanceArn,
    *,
    config_overrides: Optional[AsyncSSOAdminClientConfig] = None,
    description: Optional[PermissionSetDescription] = None,
    session_duration: Optional[Duration] = None,
    relay_state: Optional[RelayState] = None,
    tags: Optional[TagList] = None,
) -> CreatePermissionSetResponse

Creates a permission set within a specified IAM Identity Center instance.

To grant users and groups access to Amazon Web Services account resources, use CreateAccountAssignment .

Parameters:

Raises:

  • AccessDeniedException –

    You do not have sufficient access to perform this action.

  • ConflictException –

    Occurs when a conflict with a previous successful write is detected. This generally occurs when the previous write did not have time to propagate to the host serving the current request. A retry (with appropriate backoff logic) is the recommended response to this exception.

  • InternalServerException –

    The request processing has failed because of an unknown error, exception, or failure with an internal server.

  • ResourceNotFoundException –

    Indicates that a requested resource is not found.

  • ServiceQuotaExceededException –

    Indicates that the principal has crossed the permitted number of resources that can be created.

  • ThrottlingException –

    Indicates that the principal has crossed the throttling limits of the API operations.

  • ValidationException –

    The request failed because it contains a syntax error.

  • UnknownServiceError –

    The service returned an error code this client does not model.

Source code in docs_src/capo_sso_admin/_services/async_sso_admin.py
async def create_permission_set(
    self,
    name: "capo_sso_admin.types.permission_set_name.PermissionSetName",
    instance_arn: "capo_sso_admin.types.instance_arn.InstanceArn",
    *,
    config_overrides: Optional[AsyncSSOAdminClientConfig] = None,
    description: Optional[
        "capo_sso_admin.types.permission_set_description.PermissionSetDescription"
    ] = None,
    session_duration: Optional["capo_sso_admin.types.duration.Duration"] = None,
    relay_state: Optional["capo_sso_admin.types.relay_state.RelayState"] = None,
    tags: Optional["capo_sso_admin.types.tag_list.TagList"] = None,
) -> "capo_sso_admin.types.create_permission_set_response.CreatePermissionSetResponse":
    """<p>Creates a permission set within a specified IAM Identity Center instance.</p> <note> <p>To grant users and groups access to Amazon Web Services account resources, use <code> <a>CreateAccountAssignment</a> </code>.</p> </note>

    Args:
        name: <p>The name of the <a>PermissionSet</a>.</p>
        description: <p>The description of the <a>PermissionSet</a>.</p>
        instance_arn: <p>The ARN of the IAM Identity Center instance under which the operation will be executed. For more information about ARNs, see <a href="/general/latest/gr/aws-arns-and-namespaces.html">Amazon Resource Names (ARNs) and Amazon Web Services Service Namespaces</a> in the <i>Amazon Web Services General Reference</i>.</p>
        session_duration: <p>The length of time that the application user sessions are valid in the ISO-8601 standard.</p>
        relay_state: <p>Used to redirect users within the application during the federation authentication process.</p>
        tags: <p>The tags to attach to the new <a>PermissionSet</a>.</p>

    Raises:
        capo_sso_admin.errors.access_denied_exception.AccessDeniedException: <p>You do not have sufficient access to perform this action.</p>
        capo_sso_admin.errors.conflict_exception.ConflictException: <p>Occurs when a conflict with a previous successful write is detected. This generally occurs when the previous write did not have time to propagate to the host serving the current request. A retry (with appropriate backoff logic) is the recommended response to this exception.</p>
        capo_sso_admin.errors.internal_server_exception.InternalServerException: <p>The request processing has failed because of an unknown error, exception, or failure with an internal server.</p>
        capo_sso_admin.errors.resource_not_found_exception.ResourceNotFoundException: <p>Indicates that a requested resource is not found.</p>
        capo_sso_admin.errors.service_quota_exceeded_exception.ServiceQuotaExceededException: <p>Indicates that the principal has crossed the permitted number of resources that can be created.</p>
        capo_sso_admin.errors.throttling_exception.ThrottlingException: <p>Indicates that the principal has crossed the throttling limits of the API operations.</p>
        capo_sso_admin.errors.validation_exception.ValidationException: <p>The request failed because it contains a syntax error.</p>
        capo_sso_admin.errors.UnknownServiceError: The service returned an error code this client does not model.
    """

    async def _handler(
        req: "AsyncOperationRequest[capo_sso_admin.types.create_permission_set_request.CreatePermissionSetRequest]",
    ) -> AsyncOperationResponse[
        "capo_sso_admin.types.create_permission_set_response.CreatePermissionSetResponse"
    ]:
        import capo_sso_admin._operations.swb_external_service.create_permission_set

        (
            output,
            http_response,
        ) = await capo_sso_admin._operations.swb_external_service.create_permission_set.async_create_permission_set(
            req.options, req.input
        )
        return AsyncOperationResponse(output=output, response=http_response)

    interceptors_, options_ = self.operation_options(
        config_overrides, OperationLogging("CreatePermissionSet")
    )
    input_: capo_sso_admin.types.create_permission_set_request.CreatePermissionSetRequest = {
        "name": name,
        "instance_arn": instance_arn,
    }
    if description is not None:
        input_["description"] = description
    if session_duration is not None:
        input_["session_duration"] = session_duration
    if relay_state is not None:
        input_["relay_state"] = relay_state
    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