- Navigation GuideYou are on a Command (operation) page with structural examples. Use the navigation breadcrumb if you would like to return to the Client landing page.
UpdateRuleCommand
Updates a rule. In Amazon DataZone, a rule is a formal agreement that enforces specific requirements across user workflows (e.g., publishing assets to the catalog, requesting subscriptions, creating projects) within the Amazon DataZone data portal. These rules help maintain consistency, ensure compliance, and uphold governance standards in data management processes. For instance, a metadata enforcement rule can specify the required information for creating a subscription request or publishing a data asset to the catalog, ensuring alignment with organizational standards.
Example Syntax
Use a bare-bones client and the command you need to make an API call.
import { DataZoneClient, UpdateRuleCommand } from "@aws-sdk/client-datazone"; // ES Modules import
// const { DataZoneClient, UpdateRuleCommand } = require("@aws-sdk/client-datazone"); // CommonJS import
const client = new DataZoneClient(config);
const input = { // UpdateRuleInput
domainIdentifier: "STRING_VALUE", // required
identifier: "STRING_VALUE", // required
name: "STRING_VALUE",
description: "STRING_VALUE",
scope: { // RuleScope
assetType: { // AssetTypesForRule
selectionMode: "ALL" || "SPECIFIC", // required
specificAssetTypes: [ // RuleAssetTypeList
"STRING_VALUE",
],
},
dataProduct: true || false,
project: { // ProjectsForRule
selectionMode: "ALL" || "SPECIFIC", // required
specificProjects: [ // RuleProjectIdentifierList
"STRING_VALUE",
],
},
},
detail: { // RuleDetail Union: only one key present
metadataFormEnforcementDetail: { // MetadataFormEnforcementDetail
requiredMetadataForms: [ // RequiredMetadataFormList
{ // MetadataFormReference
typeIdentifier: "STRING_VALUE", // required
typeRevision: "STRING_VALUE", // required
},
],
},
},
includeChildDomainUnits: true || false,
};
const command = new UpdateRuleCommand(input);
const response = await client.send(command);
// { // UpdateRuleOutput
// identifier: "STRING_VALUE", // required
// revision: "STRING_VALUE", // required
// name: "STRING_VALUE", // required
// ruleType: "METADATA_FORM_ENFORCEMENT", // required
// target: { // RuleTarget Union: only one key present
// domainUnitTarget: { // DomainUnitTarget
// domainUnitId: "STRING_VALUE", // required
// includeChildDomainUnits: true || false,
// },
// },
// action: "CREATE_LISTING_CHANGE_SET" || "CREATE_SUBSCRIPTION_REQUEST", // required
// scope: { // RuleScope
// assetType: { // AssetTypesForRule
// selectionMode: "ALL" || "SPECIFIC", // required
// specificAssetTypes: [ // RuleAssetTypeList
// "STRING_VALUE",
// ],
// },
// dataProduct: true || false,
// project: { // ProjectsForRule
// selectionMode: "ALL" || "SPECIFIC", // required
// specificProjects: [ // RuleProjectIdentifierList
// "STRING_VALUE",
// ],
// },
// },
// detail: { // RuleDetail Union: only one key present
// metadataFormEnforcementDetail: { // MetadataFormEnforcementDetail
// requiredMetadataForms: [ // RequiredMetadataFormList
// { // MetadataFormReference
// typeIdentifier: "STRING_VALUE", // required
// typeRevision: "STRING_VALUE", // required
// },
// ],
// },
// },
// description: "STRING_VALUE",
// createdAt: new Date("TIMESTAMP"), // required
// updatedAt: new Date("TIMESTAMP"), // required
// createdBy: "STRING_VALUE", // required
// lastUpdatedBy: "STRING_VALUE", // required
// };
UpdateRuleCommand Input
Parameter | Type | Description |
---|
Parameter | Type | Description |
---|---|---|
domainIdentifier Required | string | undefined | The ID of the domain in which a rule is to be updated. |
identifier Required | string | undefined | The ID of the rule that is to be updated |
description | string | undefined | The description of the rule. |
detail | RuleDetail | undefined | The detail of the rule. |
includeChildDomainUnits | boolean | undefined | Specifies whether to update this rule in the child domain units. |
name | string | undefined | The name of the rule. |
scope | RuleScope | undefined | The scrope of the rule. |
UpdateRuleCommand Output
Parameter | Type | Description |
---|
Parameter | Type | Description |
---|---|---|
$metadata Required | ResponseMetadata | Metadata pertaining to this request. |
action Required | RuleAction | undefined | The action of the rule. |
createdAt Required | Date | undefined | The timestamp at which the rule was created. |
createdBy Required | string | undefined | The user who created the rule. |
detail Required | RuleDetail | undefined | The detail of the rule. |
identifier Required | string | undefined | The ID of the rule. |
lastUpdatedBy Required | string | undefined | The timestamp at which the rule was last updated. |
name Required | string | undefined | The name of the rule. |
revision Required | string | undefined | The revision of the rule. |
ruleType Required | RuleType | undefined | The type of the rule. |
scope Required | RuleScope | undefined | The scope of the rule. |
target Required | RuleTarget | undefined | The target of the rule. |
updatedAt Required | Date | undefined | The timestamp at which the rule was last updated. |
description | string | undefined | The description of the rule. |
Throws
Name | Fault | Details |
---|
Name | Fault | Details |
---|---|---|
AccessDeniedException | client | You do not have sufficient access to perform this action. |
ConflictException | client | There is a conflict while performing this action. |
InternalServerException | server | The request has failed because of an unknown error, exception or failure. |
ResourceNotFoundException | client | The specified resource cannot be found. |
ServiceQuotaExceededException | client | The request has exceeded the specified service quota. |
ThrottlingException | client | The request was denied due to request throttling. |
ValidationException | client | The input fails to satisfy the constraints specified by the Amazon Web Services service. |
UnauthorizedException | client | You do not have permission to perform this action. |
DataZoneServiceException | Base exception class for all service exceptions from DataZone service. |