Skip to content

set_visible_to_all_users async

set_visible_to_all_users(
    *,
    config_overrides: Optional[AsyncEMRClientConfig] = None,
    job_flow_ids: Optional[XmlStringList] = None,
    visible_to_all_users: Optional[Boolean] = None,
) -> None

The SetVisibleToAllUsers parameter is no longer supported. Your cluster may be visible to all users in your account. To restrict cluster access using an IAM policy, see Identity and Access Management for Amazon EMR.

Sets the Cluster\(VisibleToAllUsers</a> value for an Amazon EMR cluster. When <code>true</code>, IAM principals in the Amazon Web Services account can perform Amazon EMR cluster actions that their IAM policies allow. When <code>false</code>, only the IAM principal that created the cluster and the Amazon Web Services account root user can perform Amazon EMR actions on the cluster, regardless of IAM permissions policies attached to other IAM principals.</p> <p>This action works on running clusters. When you create a cluster, use the <a>RunJobFlowInput\)VisibleToAllUsers parameter.

For more information, see Understanding the Amazon EMR Cluster VisibleToAllUsers Setting in the Amazon EMR Management Guide.

Parameters:

  • job_flow_ids (Optional[XmlStringList], default: None ) –

    The unique identifier of the job flow (cluster).

  • visible_to_all_users (Optional[Boolean], default: None ) –

    A value of true indicates that an IAM principal in the Amazon Web Services account can perform Amazon EMR actions on the cluster that the IAM policies attached to the principal allow. A value of false indicates that only the IAM principal that created the cluster and the Amazon Web Services root user can perform Amazon EMR actions on the cluster.

Raises:

  • InternalServerError –

    Indicates that an error occurred while processing the request and that the request was not completed.

  • UnknownServiceError –

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

Source code in docs_src/capo_emr/_services/async_emr.py
async def set_visible_to_all_users(
    self,
    *,
    config_overrides: Optional[AsyncEMRClientConfig] = None,
    job_flow_ids: Optional["capo_emr.types.xml_string_list.XmlStringList"] = None,
    visible_to_all_users: Optional["capo_emr.types.boolean.Boolean"] = None,
) -> None:
    """<important> <p>The SetVisibleToAllUsers parameter is no longer supported. Your cluster may be visible to all users in your account. To restrict cluster access using an IAM policy, see <a href="https://docs.aws.amazon.com/emr/latest/ManagementGuide/emr-plan-access-IAM.html">Identity and Access Management for Amazon EMR</a>. </p> </important> <p>Sets the <a>Cluster$VisibleToAllUsers</a> value for an Amazon EMR cluster. When <code>true</code>, IAM principals in the Amazon Web Services account can perform Amazon EMR cluster actions that their IAM policies allow. When <code>false</code>, only the IAM principal that created the cluster and the Amazon Web Services account root user can perform Amazon EMR actions on the cluster, regardless of IAM permissions policies attached to other IAM principals.</p> <p>This action works on running clusters. When you create a cluster, use the <a>RunJobFlowInput$VisibleToAllUsers</a> parameter.</p> <p>For more information, see <a href="https://docs.aws.amazon.com/emr/latest/ManagementGuide/security_IAM_emr-with-IAM.html#security_set_visible_to_all_users">Understanding the Amazon EMR Cluster VisibleToAllUsers Setting</a> in the <i>Amazon EMR Management Guide</i>.</p>

    Args:
        job_flow_ids: <p>The unique identifier of the job flow (cluster).</p>
        visible_to_all_users: <p>A value of <code>true</code> indicates that an IAM principal in the Amazon Web Services account can perform Amazon EMR actions on the cluster that the IAM policies attached to the principal allow. A value of <code>false</code> indicates that only the IAM principal that created the cluster and the Amazon Web Services root user can perform Amazon EMR actions on the cluster.</p>

    Raises:
        capo_emr.errors.internal_server_error.InternalServerError: <p>Indicates that an error occurred while processing the request and that the request was not completed.</p>
        capo_emr.errors.UnknownServiceError: The service returned an error code this client does not model.
    """

    async def _handler(
        req: "AsyncOperationRequest[capo_emr.types.set_visible_to_all_users_input.SetVisibleToAllUsersInput]",
    ) -> AsyncOperationResponse[None]:
        import capo_emr._operations.elastic_map_reduce.set_visible_to_all_users

        (
            output,
            http_response,
        ) = await capo_emr._operations.elastic_map_reduce.set_visible_to_all_users.async_set_visible_to_all_users(
            req.options, req.input
        )
        return AsyncOperationResponse(output=output, response=http_response)

    interceptors_, options_ = self.operation_options(
        config_overrides, OperationLogging("SetVisibleToAllUsers")
    )
    input_: capo_emr.types.set_visible_to_all_users_input.SetVisibleToAllUsersInput = {}
    if job_flow_ids is not None:
        input_["job_flow_ids"] = job_flow_ids
    if visible_to_all_users is not None:
        input_["visible_to_all_users"] = visible_to_all_users

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