

本文為英文版的機器翻譯版本，如內容有任何歧義或不一致之處，概以英文版為準。

# 更新 LF-Tag 表達式
<a name="TBAC-updating-expressions"></a>

只有資料湖管理員、LF-Tag 表達式建立者，以及對 LF-Tag 表達式具有 `Alter`或 `Super`許可的主體，才能更新 LF-Tag 表達式。除了`Alter`許可之外，您也需要新表達式內文上所有基礎索引鍵值的 `lakeformation:UpdateLFTagExpression` IAM 許可和`Grant with LF-Tag`許可，才能更新表達式。

您可以透過更新表達式上授予的描述、表達式內文和許可來更新 LF-Tag 表達式。您無法變更 LF-Tag 表達式的名稱。若要變更名稱，請刪除 LF-Tag 表達式，並使用必要的參數新增。

您可以使用 AWS Lake Formation 主控台、 API 或 AWS Command Line Interface () 來更新 LF-Tag 表達式AWS CLI。

------
#### [ Console ]

**更新 LF-Tag 表達式**

1. 開啟 Lake Formation 主控台，網址為 [https://console.aws.amazon.com/lakeformation/](https://console.aws.amazon.com/lakeformation/)。

   以資料湖管理員、LF 標籤建立者或具有 LF 標籤`Alter`許可的主體身分登入。

1. 在導覽窗格中的許可下，選擇 **LF 標籤和許可**。

1. 選擇 **LF-Tag 表達**式索引標籤。

1. 在 **LF-Tag 表達**式區段中，選取 LF-Tag 表達式，然後選擇**編輯**。

1. 在**編輯 LF-Tag 表達**式對話方塊中，更新描述，並透過新增或移除索引鍵和值來更新表達式內文。

   若要新增多個值，請在**值**欄位中，從下拉式清單中選擇值。

1. 選擇**儲存**。

------
#### [ AWS CLI ]

 Lake Formation 中的 update-lf-tag-expression 命令可讓您更新現有的 LF-Tag 表達式。

```
aws lakeformation update-lf-tag-expression \
-- name expression_name\
-- description new_description \
-- catalog-id catalog_id \
-- expression '{"Expression": [{"TagKey": "tag_key", "TagValues": ["tag_value1", "tag_value2", ...]}]}'
```

以下是所提供命令中的參數所代表的意義：
+ name – 您要更新的現有具名標籤表達式的名稱。
+ description – 表達式的新描述。

  catalog-id – 具名標籤表達式所在的 Data Catalog ID。
+ expression – 您要更新表達式的新標籤表達式字串。

------