Skip to content

update_resource

update_resource(
    role_arn: IAMRoleArn,
    resource_arn: ResourceArnString,
    *,
    config_overrides: Optional[LakeFormationClientConfig] = None,
    with_federation: Optional[NullableBoolean] = None,
    hybrid_access_enabled: Optional[NullableBoolean] = None,
    expected_resource_owner_account: Optional[AccountIdString] = None,
) -> UpdateResourceResponse

Updates the data access role used for vending access to the given (registered) resource in Lake Formation.

Parameters:

  • role_arn (IAMRoleArn) –

    The new role to use for the given resource registered in Lake Formation.

  • resource_arn (ResourceArnString) –

    The resource ARN.

  • with_federation (Optional[NullableBoolean], default: None ) –

    Whether or not the resource is a federated resource.

  • hybrid_access_enabled (Optional[NullableBoolean], default: None ) –

    Specifies whether the data access of tables pointing to the location can be managed by both Lake Formation permissions as well as Amazon S3 bucket policies.

  • expected_resource_owner_account (Optional[AccountIdString], default: None ) –

    The Amazon Web Services account that owns the Glue tables associated with specific Amazon S3 locations.

Raises:

Source code in docs_src/capo_lakeformation/_services/lake_formation.py
def update_resource(
    self,
    role_arn: "capo_lakeformation.types.iam_role_arn.IAMRoleArn",
    resource_arn: "capo_lakeformation.types.resource_arn_string.ResourceArnString",
    *,
    config_overrides: Optional[LakeFormationClientConfig] = None,
    with_federation: Optional[
        "capo_lakeformation.types.nullable_boolean.NullableBoolean"
    ] = None,
    hybrid_access_enabled: Optional[
        "capo_lakeformation.types.nullable_boolean.NullableBoolean"
    ] = None,
    expected_resource_owner_account: Optional[
        "capo_lakeformation.types.account_id_string.AccountIdString"
    ] = None,
) -> "capo_lakeformation.types.update_resource_response.UpdateResourceResponse":
    """<p>Updates the data access role used for vending access to the given (registered) resource in Lake Formation. </p>

    Args:
        role_arn: <p>The new role to use for the given resource registered in Lake Formation.</p>
        resource_arn: <p>The resource ARN.</p>
        with_federation: <p>Whether or not the resource is a federated resource.</p>
        hybrid_access_enabled: <p> Specifies whether the data access of tables pointing to the location can be managed by both Lake Formation permissions as well as Amazon S3 bucket policies. </p>
        expected_resource_owner_account: <p>The Amazon Web Services account that owns the Glue tables associated with specific Amazon S3 locations. </p>

    Raises:
        capo_lakeformation.errors.entity_not_found_exception.EntityNotFoundException: <p>A specified entity does not exist.</p>
        capo_lakeformation.errors.internal_service_exception.InternalServiceException: <p>An internal service error occurred.</p>
        capo_lakeformation.errors.invalid_input_exception.InvalidInputException: <p>The input provided was not valid.</p>
        capo_lakeformation.errors.operation_timeout_exception.OperationTimeoutException: <p>The operation timed out.</p>
        capo_lakeformation.errors.UnknownServiceError: The service returned an error code this client does not model.
    """

    def _handler(
        req: "OperationRequest[capo_lakeformation.types.update_resource_request.UpdateResourceRequest]",
    ) -> OperationResponse[
        "capo_lakeformation.types.update_resource_response.UpdateResourceResponse"
    ]:
        import capo_lakeformation._operations.aws_lake_formation.update_resource

        output, http_response = (
            capo_lakeformation._operations.aws_lake_formation.update_resource.update_resource(
                req.options, req.input
            )
        )
        return OperationResponse(output=output, response=http_response)

    interceptors_, options_ = self.operation_options(
        config_overrides, OperationLogging("UpdateResource")
    )
    input_: capo_lakeformation.types.update_resource_request.UpdateResourceRequest = {
        "role_arn": role_arn,
        "resource_arn": resource_arn,
    }
    if with_federation is not None:
        input_["with_federation"] = with_federation
    if hybrid_access_enabled is not None:
        input_["hybrid_access_enabled"] = hybrid_access_enabled
    if expected_resource_owner_account is not None:
        input_["expected_resource_owner_account"] = expected_resource_owner_account

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