Skip to content

update_instance

update_instance(
    instance_arn: InstanceArn,
    *,
    config_overrides: Optional[SSOAdminClientConfig] = None,
    name: Optional[NameType] = None,
    encryption_configuration: Optional[EncryptionConfiguration] = None,
    permission_sets_enabled: Optional[bool] = None,
) -> UpdateInstanceResponse

Update the details for the instance of IAM Identity Center that is owned by the Amazon Web Services account.

In a single UpdateInstance request, you can perform only one of the following operations:

  • Update the encryption configuration of the instance by specifying EncryptionConfiguration.

  • Enable permission sets for the instance by specifying PermissionSetsEnabled.

A request that specifies both EncryptionConfiguration and PermissionSetsEnabled returns a ValidationException. To perform both operations, call UpdateInstance separately for each. The two calls can be made in parallel.

Parameters:

  • name (Optional[NameType], default: None ) –

    Updates the instance name.

  • instance_arn (InstanceArn) –

    The ARN of the instance of IAM Identity Center under which the operation will run. For more information about ARNs, see Amazon Resource Names (ARNs) and Amazon Web Services Service Namespaces in the Amazon Web Services General Reference.

  • encryption_configuration (Optional[EncryptionConfiguration], default: None ) –

    Specifies the encryption configuration for your IAM Identity Center instance. You can use this to configure customer managed KMS keys or Amazon Web Services owned KMS keys for encrypting your instance data.

  • permission_sets_enabled (Optional[bool], default: None ) –

    Enables permission sets for this Identity Center instance. The only accepted value is true . After permission sets are enabled, they cannot be disabled.

    You can't set EncryptionConfiguration and PermissionSetsEnabled in the same request. To configure both, make two separate UpdateInstance calls. These calls can be made in parallel.

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.

  • 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/sso_admin.py
def update_instance(
    self,
    instance_arn: "capo_sso_admin.types.instance_arn.InstanceArn",
    *,
    config_overrides: Optional[SSOAdminClientConfig] = None,
    name: Optional["capo_sso_admin.types.name_type.NameType"] = None,
    encryption_configuration: Optional[
        "capo_sso_admin.types.encryption_configuration.EncryptionConfiguration"
    ] = None,
    permission_sets_enabled: Optional[bool] = None,
) -> "capo_sso_admin.types.update_instance_response.UpdateInstanceResponse":
    """<p>Update the details for the instance of IAM Identity Center that is owned by the Amazon Web Services account.</p> <p>In a single <code>UpdateInstance</code> request, you can perform only one of the following operations:</p> <ul> <li> <p>Update the encryption configuration of the instance by specifying <code>EncryptionConfiguration</code>.</p> </li> <li> <p>Enable permission sets for the instance by specifying <code>PermissionSetsEnabled</code>.</p> </li> </ul> <p>A request that specifies both <code>EncryptionConfiguration</code> and <code>PermissionSetsEnabled</code> returns a <code>ValidationException</code>. To perform both operations, call <code>UpdateInstance</code> separately for each. The two calls can be made in parallel.</p>

    Args:
        name: <p>Updates the instance name.</p>
        instance_arn: <p>The ARN of the instance of IAM Identity Center under which the operation will run. 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>
        encryption_configuration: <p>Specifies the encryption configuration for your IAM Identity Center instance. You can use this to configure customer managed KMS keys or Amazon Web Services owned KMS keys for encrypting your instance data.</p>
        permission_sets_enabled: <p>Enables permission sets for this Identity Center instance. The only accepted value is <code>true </code>. After permission sets are enabled, they cannot be disabled.</p> <note> <p>You can't set <code>EncryptionConfiguration</code> and <code>PermissionSetsEnabled</code> in the same request. To configure both, make two separate <code>UpdateInstance</code> calls. These calls can be made in parallel.</p> </note>

    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.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.
    """

    def _handler(
        req: "OperationRequest[capo_sso_admin.types.update_instance_request.UpdateInstanceRequest]",
    ) -> OperationResponse[
        "capo_sso_admin.types.update_instance_response.UpdateInstanceResponse"
    ]:
        import capo_sso_admin._operations.swb_external_service.update_instance

        output, http_response = (
            capo_sso_admin._operations.swb_external_service.update_instance.update_instance(
                req.options, req.input
            )
        )
        return OperationResponse(output=output, response=http_response)

    interceptors_, options_ = self.operation_options(
        config_overrides, OperationLogging("UpdateInstance")
    )
    input_: capo_sso_admin.types.update_instance_request.UpdateInstanceRequest = {
        "instance_arn": instance_arn
    }
    if name is not None:
        input_["name"] = name
    if encryption_configuration is not None:
        input_["encryption_configuration"] = encryption_configuration
    if permission_sets_enabled is not None:
        input_["permission_sets_enabled"] = permission_sets_enabled

    response = execute_pipeline(
        OperationRequest(input=input_, options=options_),
        handler=_handler,
        interceptors=list(interceptors_),
    )
    response.response.close()
    return response.output