The Enterprise Management APIs create, edit, publish, and assign Kiro policies. The console uses the same APIs. This page is for administrators and platform engineers who automate policy changes with the AWS CLI or an SDK. Kiro Enterprise Management is in preview for new Kiro profiles created in US East (N. Virginia) (us-east-1). It is on for all newly created profiles there; existing profiles are not affected by this change. To take a policy from nothing to live with the AWS CLI, start at Common tasks. To learn the policy format the files carry, see the KGL reference.
| Item | Value |
|---|---|
| Endpoint | https://management.us-east-1.kiro.dev |
| Protocol | awsJson1_0: POST / with the JSON body |
| Target header | X-Amz-Target: KiroControlPlaneQDeveloperService.<Operation> |
| Content type | application/x-amz-json-1.0 |
| Signing | SigV4, service name q, region us-east-1 |
| IAM action | q:<Operation>, for example q:PublishEnterpriseManagementResource |
| API version | 2025-01-12 |
| AWS CLI | aws kiro-em <command> |
The kiro-em commands need the Enterprise Management service model for the AWS CLI. Every command on this page runs in us-east-1; the examples pass --region us-east-1 on the first command and omit it afterwards. The examples use the placeholders abc123 for a resource ID, <profile-id> for a Kiro profile ID, and d-1234567890 for an IAM Identity Center identity store ID.
These seven commands take a policy from nothing to live on a Kiro profile, then remove it. Each command links to its operation for the full list of fields and errors.
Step 1: Create the resource. The response holds the resourceId; use it in every later call. See CreateEnterpriseManagementResource.
aws kiro-em create-enterprise-management-resource \ --region us-east-1 \ --name "Engineering policy"
Step 2: Write the policy into the draft. Describe the policy file in a JSON list such as files.json: path, type set to kgl, and content holding the KGL text with newlines escaped. The example below shows one rule to keep it short. It allows only model_use; API keys and Kiro Crew messaging and network access stay denied, and the built-in tools and Kiro Crew scheduled jobs keep Kiro's own default. Before Step 4, replace content with a complete policy: the defaults from Get started or a policy from KGL examples. The call opens a draft if none is open. See PutEnterpriseManagementResourceFiles.
[ { "path": "policy.yaml", "type": "kgl", "content": "rules:\n - id: model-use-allow\n capability: model_use\n effect: allow\n" } ]
aws kiro-em put-enterprise-management-resource-files \ --resource-id abc123 \ --files file://files.json
Step 3: Check the draft. isValid is true when there is no error, and diagnostics lists errors first. Nothing is published. See ValidateEnterpriseManagementResource.
aws kiro-em validate-enterprise-management-resource \ --target byResource=abc123
Step 4: Publish. The draft becomes a numbered revision and goes live. Send --idc-config whenever any rule is conditioned on a group or user; omit it otherwise. See PublishEnterpriseManagementResource.
aws kiro-em publish-enterprise-management-resource \ --resource-id abc123 \ --idc-config identityStoreId=d-1234567890,region=us-east-1,profileArn=arn:aws:codewhisperer:us-east-1:123456789012:profile/<profile-id>
Step 5: Assign the policy to the profile. The resource must have been published at least once. Rules and settings reach every user of the profile within about five minutes; files arrive when their next session starts. See AssociateEnterpriseManagementResource.
aws kiro-em associate-enterprise-management-resource \ --resource-id abc123 \ --scope-type PROFILE \ --scope-id <profile-id>
Step 6: Confirm. The list shows each resource, the scopes it governs, and its live revision. See ListEnterpriseManagementResources.
aws kiro-em list-enterprise-management-resources
Step 7: Remove the assignment when you are done. The policy stays in the account. This command is the path for it. See DisassociateEnterpriseManagementResource.
aws kiro-em disassociate-enterprise-management-resource \ --resource-id abc123 \ --scope-type PROFILE \ --scope-id <profile-id>
To change a live policy, repeat steps 2 to 4. The assignment stays. Changed rules and settings reach developers within about five minutes; changed files arrive at their next session.
| Operation | AWS CLI command | Purpose |
|---|---|---|
| AssociateEnterpriseManagementResource | associate-enterprise-management-resource | Associates a resource with a scope so it governs everyone under that scope. |
| CreateEnterpriseManagementResource | create-enterprise-management-resource | Creates a new Enterprise Management resource and opens an empty draft. |
| DeleteEnterpriseManagementResource | delete-enterprise-management-resource | Soft-deletes a resource by marking it deleted. |
| DeleteEnterpriseManagementResourceDraft | delete-enterprise-management-resource-draft | Discards the open draft without publishing it, leaving the enforcing revision unchanged. |
| DeleteEnterpriseManagementResourceFile | delete-enterprise-management-resource-file | Removes one file from a resource's working draft. |
| DisassociateEnterpriseManagementResource | disassociate-enterprise-management-resource | Removes an association so the resource no longer governs that scope. |
| GetEnterpriseManagementResource | get-enterprise-management-resource | Retrieves one revision of a resource for display or editing. |
| GetEnterpriseManagementResourceFile | get-enterprise-management-resource-file | Returns one file's bytes from one revision of a resource. |
| ListEnterpriseManagementResourceFiles | list-enterprise-management-resource-files | Lists the files one revision of a resource holds, without their content. |
| ListEnterpriseManagementResourceRevisions | list-enterprise-management-resource-revisions | Lists a resource's revision history for the audit and restore views. |
| ListEnterpriseManagementResources | list-enterprise-management-resources | Lists the caller tenant's resources and, for each, the scopes it governs and its live revision. |
| PublishEnterpriseManagementResource | publish-enterprise-management-resource | Publishes the open draft: validates it, compiles it, seals it into an immutable revision, and makes that revision enforcing (live), in one synchronous call. |
| PutEnterpriseManagementResourceFiles | put-enterprise-management-resource-files | Writes one or more files into a resource's working draft, opening a draft if none is open. |
| RestoreEnterpriseManagementResource | restore-enterprise-management-resource | Restores a resource to a previously published revision. |
| UpdateEnterpriseManagementResource | update-enterprise-management-resource | Updates a resource's metadata, such as its display name. |
| ValidateEnterpriseManagementResource | validate-enterprise-management-resource | Validates and compiles a document set as a dry run, returning diagnostics without publishing or changing any state. |
Every operation can return AccessDeniedException (403), InternalServerException (500), ThrottlingException (429), and ValidationException (400). Operations on an existing resource also return ResourceNotFoundException (404). The service returns every client error as HTTP 400; see Errors.
Associates a resource with a scope so it governs everyone under that scope.
- Action IAM
q:AssociateEnterpriseManagementResource
Requête3 champs
resourceIdstringObligatoireThe resource to associate. Must have an enforcing revision (published at least once). Length 1–64; pattern
^[a-z0-9]+$.scopeTypeEnterpriseManagementScopeTypeObligatoireThe kind of scope to bind.
PROFILE.scopeIdstringObligatoireThe identifier of the scope to bind. For
PROFILE, the Kiro profile ID. Length 1–128.
Réponse3 champs
resourceIdstringObligatoireThe associated resource.
scopeTypeEnterpriseManagementScopeTypeObligatoireThe scope kind.
scopeIdstringObligatoireThe scope identifier.
Erreurs6
The service accepts a profile ID that does not exist without an error. Copy the profile ID from the Kiro console, then check that the Profile Controls page names the profile. If a profile is still bound to a deleted resource, associating another fails with ConflictException ("already associated with resource …"); disassociate the deleted resource by its ID first.
AWS CLI
aws kiro-em associate-enterprise-management-resource \ --region us-east-1 \ --resource-id abc123 \ --scope-type PROFILE \ --scope-id <profile-id>
Creates a new Enterprise Management resource and opens an empty draft.
- Action IAM
q:CreateEnterpriseManagementResource
Requête2 champs
namestringObligatoireHuman-readable display name. A label, not an identifier; not unique. Length 1–256.
clientTokenstringUnique caller token for idempotency; a retry with the same token returns the original result. The AWS CLI sets it if omitted. Length 1–128; pattern
^[!-~]+$.
Réponse4 champs
resourceIdstringObligatoireServer-assigned; use it in all later calls. Length 1–64; pattern
^[a-z0-9]+$.arnstringObligatoireThe resource ARN. Length 1–256; pattern
^arn:[a-z0-9-]+:.+$.namestringObligatoireThe display name as created.
createdAttimestampObligatoireWhen the resource was created.
Erreurs5
AWS CLI
aws kiro-em create-enterprise-management-resource \ --name "Engineering policy"
Soft-deletes a resource by marking it deleted.
- Action IAM
q:DeleteEnterpriseManagementResource
Requête1 champ
resourceIdstringObligatoireThe resource to delete.
Réponse
Aucun champ.
Erreurs5
Disassociate the resource from every scope before you delete it. If you delete a resource while it is associated, the profile stays bound to it and associating another resource fails.
AWS CLI
aws kiro-em delete-enterprise-management-resource \ --resource-id abc123
Discards the open draft without publishing it, leaving the enforcing revision unchanged.
- Action IAM
q:DeleteEnterpriseManagementResourceDraft
Requête2 champs
resourceIdstringObligatoireThe resource whose draft to discard.
ifMatchstringThe draft's
eTagfrom the last read or write. When supplied, the discard is rejected withConflictExceptionif the draft changed since, so one administrator cannot throw away another's work. Length 1–256.
Réponse
Aucun champ.
Erreurs6
AWS CLI
aws kiro-em delete-enterprise-management-resource-draft \ --resource-id abc123
Removes one file from a resource's working draft.
- Action IAM
q:DeleteEnterpriseManagementResourceFile
Requête5 champs
resourceIdstringObligatoireThe resource whose draft holds the file.
typeEnterpriseManagementFileTypekgl,steering,skill, orpower. A file is named by type and path together.pathstringObligatoireThe file path, matched case-folded and Unicode normalized. Length 1–200.
ifMatchstringThe draft's
eTag; the delete is rejected withConflictExceptionif the draft changed since.clientTokenstringIdempotency token. Length 1–128; pattern
^[!-~]+$.
Réponse1 champ
eTagstringObligatoireThe draft's new
eTag. Pass it asifMatchon the next write.
Erreurs6
AWS CLI
aws kiro-em delete-enterprise-management-resource-file \ --resource-id abc123 \ --type steering \ --path coding-standard.md
Removes an association so the resource no longer governs that scope.
- Action IAM
q:DisassociateEnterpriseManagementResource
Requête3 champs
resourceIdstringObligatoireThe resource to disassociate.
scopeTypeEnterpriseManagementScopeTypeObligatoirePROFILE.scopeIdstringObligatoireThe scope identifier. For
PROFILE, the Kiro profile ID. Length 1–128.
Réponse
Aucun champ.
Erreurs5
This operation removes an assignment. It also unbinds a profile from a resource that was deleted while associated.
AWS CLI
aws kiro-em disassociate-enterprise-management-resource \ --resource-id abc123 \ --scope-type PROFILE \ --scope-id <profile-id>
Retrieves one revision of a resource for display or editing.
- Action IAM
q:GetEnterpriseManagementResource
Requête2 champs
resourceIdstringObligatoireThe resource to read.
revisionstringA published revision number, or
DRAFTorENFORCING. Default enforcing. Length 1–16.
Réponse12 champs
resourceIdstringObligatoireThe resource ID.
arnstringObligatoireThe resource ARN.
namestringObligatoireThe display name; the same whichever revision you read.
revisionintegerThe revision number. Absent when
DRAFT.stateEnterpriseManagementRevisionStateObligatoireDRAFTorPUBLISHED.parentintegerFor a draft, the revision it was opened from, which must still be enforcing when the draft is published. For a published revision, the one it superseded.
fileCountintegerObligatoireFiles the revision holds.
createdAttimestampObligatoireWhen the revision was created.
createdBystringObligatoireWho created it. This shows a service role, not the caller.
updatedAttimestampLast write to the draft. Absent for a published or untouched draft.
updatedBystringWho last wrote to the draft. This shows a service role, not the caller.
eTagstringThe draft's concurrency token. Send it as
ifMatchon write, delete, and publish. Length 1–256.
Erreurs5
AWS CLI
aws kiro-em get-enterprise-management-resource \ --resource-id abc123 \ --revision DRAFT
Returns one file's bytes from one revision of a resource.
- Action IAM
q:GetEnterpriseManagementResourceFile
Requête4 champs
resourceIdstringObligatoireThe resource to read.
typeEnterpriseManagementFileTypekgl,steering,skill, orpower.pathstringObligatoireThe file path. Length 1–200.
revisionstringDRAFT,ENFORCING, or a revision number. Default enforcing.
Réponse1 champ
contentstringObligatoireThe file's text exactly as written, UTF-8.
Erreurs5
AWS CLI
aws kiro-em get-enterprise-management-resource-file \ --resource-id abc123 \ --type kgl \ --path policy.yaml
Lists the files one revision of a resource holds, without their content.
- Action IAM
q:ListEnterpriseManagementResourceFiles
Requête4 champs
resourceIdstringObligatoireThe resource to list.
revisionstringDRAFT,ENFORCING, or a revision number.maxResultsinteger1–100. Default 100.
nextTokenstringThe token from the previous page. Length 1–2048.
Réponse5 champs
resourceIdstringObligatoireThe resource ID.
revisionintegerThe revision number. Absent for
DRAFT.filesEnterpriseManagementResourceFile[]ObligatoireIn the order written. 0–500 entries.
nextTokenstringPresent when more pages follow.
compositionmap of EnterpriseManagementFileType to EnterpriseManagementFileComposeBehaviorObligatoireHow this revision's files compose with a developer's own, by type.
Erreurs5
AWS CLI
aws kiro-em list-enterprise-management-resource-files \ --resource-id abc123 \ --revision ENFORCING
Lists a resource's revision history for the audit and restore views.
- Action IAM
q:ListEnterpriseManagementResourceRevisions
Requête3 champs
resourceIdstringObligatoireThe resource to list.
maxResultsinteger1–100. Default 20.
nextTokenstringThe token from the previous page.
Réponse2 champs
revisionsEnterpriseManagementRevisionSummary[]ObligatoireNewest first. Empty when the resource was never published. 0–100 entries.
nextTokenstringPresent when more pages follow.
Erreurs5
AWS CLI
aws kiro-em list-enterprise-management-resource-revisions \ --resource-id abc123
Lists the caller tenant's resources and, for each, the scopes it governs and its live revision.
- Action IAM
q:ListEnterpriseManagementResources
Requête2 champs
maxResultsinteger1–100. Default 20.
nextTokenstringThe token from the previous page.
Réponse2 champs
resourcesEnterpriseManagementResourceSummary[]Obligatoire0–100 entries.
nextTokenstringAbsent only when the listing has ended. Keep following it even after a short or empty page.
Erreurs4
AWS CLI
aws kiro-em list-enterprise-management-resources
Publishes the open draft: validates it, compiles it, seals it into an immutable revision, and makes that revision enforcing (live), in one synchronous call.
- Action IAM
q:PublishEnterpriseManagementResource
Requête4 champs
resourceIdstringObligatoireThe resource whose draft to publish.
ifMatchstringThe draft's
eTag. The publish is rejected withConflictExceptionif the draft changed since, so a caller cannot publish a draft it has not seen.idcConfigEnterpriseManagementIdcConfigThe IAM Identity Center instance to resolve the draft's group and user IDs against. Send it whenever any rule is conditioned on a group or user.
clientTokenstringIdempotency token.
Réponse4 champs
revisionintegerObligatoireThe revision the draft was sealed into, now enforcing.
parentintegerThe revision that was enforcing before. Absent on the first publish.
publishedAttimestampObligatoireWhen the revision became enforcing.
warningsEnterpriseManagementDiagnostic[]WARNING-severity advisories. 0–100 entries.
Erreurs7
AWS CLI
aws kiro-em publish-enterprise-management-resource \ --resource-id abc123 \ --idc-config identityStoreId=d-1234567890,region=us-east-1,profileArn=arn:aws:codewhisperer:us-east-1:123456789012:profile/<profile-id>
Writes one or more files into a resource's working draft, opening a draft if none is open.
- Action IAM
q:PutEnterpriseManagementResourceFiles
Requête5 champs
resourceIdstringObligatoireThe resource whose draft to write.
filesEnterpriseManagementInlineFile[]Each file is written, or replaced if one with the same type and path exists. At most 500 entries and at most 5 MiB of content in total.
compositionmap of EnterpriseManagementFileType to EnterpriseManagementFileComposeBehaviorReplaces the whole map when supplied. Omit it to leave the map as it was.
ifMatchstringThe draft's
eTag; the write is rejected withConflictExceptionif the draft changed since.clientTokenstringIdempotency token.
Réponse5 champs
resourceIdstringObligatoireThe resource ID.
fileCountintegerObligatoireFiles the draft holds after this call.
filesEnterpriseManagementStoredFile[]ObligatoireIn the order sent.
eTagstringObligatoireThe draft's new
eTag.compositionmap of EnterpriseManagementFileType to EnterpriseManagementFileComposeBehaviorObligatoireThe compose behavior for every distributed type.
Erreurs7
AWS CLI
aws kiro-em put-enterprise-management-resource-files \ --resource-id abc123 \ --files file://files.json
Restores a resource to a previously published revision.
- Action IAM
q:RestoreEnterpriseManagementResource
Requête3 champs
resourceIdstringObligatoireThe resource to restore.
targetRevisionintegerObligatoireThe published revision to restore. Its content is copied into a new revision, which becomes enforcing; the target is left as it was. Minimum 1.
clientTokenstringIdempotency token.
Réponse3 champs
revisionintegerObligatoireThe new revision: one above the highest revision number used, never the target's own.
restoredFromintegerObligatoireEquals
targetRevision.publishedAttimestampObligatoireWhen the new revision became enforcing.
Erreurs6
AWS CLI
aws kiro-em restore-enterprise-management-resource \ --resource-id abc123 \ --target-revision 2
Updates a resource's metadata, such as its display name.
- Action IAM
q:UpdateEnterpriseManagementResource
Requête2 champs
resourceIdstringObligatoireThe resource to update.
namestringThe new display name. Omitted leaves it unchanged. Length 1–256.
Réponse3 champs
resourceIdstringObligatoireThe resource ID.
namestringObligatoireThe display name after the update.
updatedAttimestampObligatoireWhen the metadata changed.
Erreurs5
AWS CLI
aws kiro-em update-enterprise-management-resource \ --resource-id abc123 \ --name "Engineering policy v2"
Validates and compiles a document set as a dry run, returning diagnostics without publishing or changing any state.
- Action IAM
q:ValidateEnterpriseManagementResource
Requête2 champs
targetEnterpriseManagementValidateTargetObligatoirebyResource(an existing resource's open draft) orfiles(an inline set). Exactly one.idcConfigEnterpriseManagementIdcConfigSend it whenever the target conditions a rule on a group or user.
Réponse2 champs
isValidbooleanObligatoiretruewhen compilation produced noERRORfinding.diagnosticsEnterpriseManagementDiagnostic[]Errors first, up to 100. Empty when clean.
Erreurs5
A request with an empty target returns HTTP 500. Send either byResource or files.
AWS CLI
aws kiro-em validate-enterprise-management-resource \ --target byResource=abc123
Champs2 champs
scopeTypeEnterpriseManagementScopeTypeObligatoirePROFILE.scopeIdstringObligatoireThe Kiro profile ID. Length 1–128.
Champs7 champs
severityEnterpriseManagementDiagnosticSeverityObligatoireERRORblocks publishing;WARNINGis advisory.codestringObligatoireStable, machine-readable code, for example
YAML_PARSE_ERROR,UNKNOWN_SETTING,POLICY_BOUNDARY_VIOLATION. Treat the set as open. Length 1–128. See Common errors.messagestringObligatoireHuman-readable explanation.
pathstringThe file the finding refers to. Length 1–200.
elementstringThe setting key or rule name.
lineinteger1-based line.
columninteger1-based column.
Enum: ERROR, WARNING.
Enum: append, replace, locked.
Enum: STORED, DEDUPLICATED.
Enum: kgl, steering, skill, power.
Champs3 champs
identityStoreIdstringObligatoireThe IAM Identity Center identity store ID, for example
d-1234567890. Not the instance ID (ssoins-…). Pattern^d-[a-z0-9]{10}$.regionstringObligatoireThe directory's home Region. Length 1–64.
profileArnstringObligatoireThe Kiro (Amazon Q Developer) profile ARN the directory read runs under. Pattern
^arn:(aws\|aws-cn\|aws-us-gov):codewhisperer:[a-z0-9\-]+:[0-9]{12}:profile/.+$.
Champs3 champs
pathstringObligatoireThe file path. Length 1–200.
typeEnterpriseManagementFileTypeObligatoirekgl,steering,skill, orpower.contentstringObligatoireThe file text. Never empty. Length 1–524288.
Champs4 champs
pathstringObligatoireThe file path.
typeEnterpriseManagementFileTypeObligatoireThe file type.
sha256stringObligatoireLowercase hex, 64 characters.
sizeByteslongObligatoire1–524288.
Champs7 champs
resourceIdstringObligatoireThe resource ID.
arnstringObligatoireThe resource ARN.
namestringObligatoireThe display name.
latestRevisionintegerThe newest published revision. Absent when never published.
enforcingRevisionintegerThe oldest revision any scope in this Region is still serving. Absent when the resource is associated with no scope here.
associatedScopesEnterpriseManagementAssociatedScope[]0–100 entries.
updatedAttimestampThe last rename or publish.
Returned by PublishEnterpriseManagementResource and PutEnterpriseManagementResourceFiles when the documents fail validation or compilation. It carries every blocking finding as one list. ValidateEnterpriseManagementResource reports the same findings without failing. HTTP 400.
Champs2 champs
messagestringObligatoireFor example "3 errors prevented publishing".
diagnosticsEnterpriseManagementDiagnostic[]ObligatoireAt least one
ERROR. 0–100 entries.
Set exactly one of:
Champs3 champs
numberintegerA published revision number. Minimum 1.
draftunitThe open draft.
enforcingunitThe enforcing revision.
Enum: DRAFT, PUBLISHED.
Champs9 champs
revisionintegerObligatoireRevision numbers start at 1, count up, and are never reused.
stateEnterpriseManagementRevisionStateObligatoireAlways
PUBLISHEDin this listing.parentintegerThe revision this one superseded.
createdBystringObligatoireThe identity that opened the draft. This shows a service role, not the caller.
createdAttimestampObligatoireWhen the draft was opened.
publishedAttimestampWhen the revision was published.
publishedBystringWho published it. This shows a service role, not the caller.
restoredFromintegerPresent only on a revision made by
RestoreEnterpriseManagementResource.isEnforcingbooleanObligatoireWhether this revision is live.
Enum: PROFILE.
Champs5 champs
pathstringObligatoireThe path as sent.
typeEnterpriseManagementFileTypeObligatoireThe file type.
sha256stringObligatoireLowercase hex, 64 characters.
sizeByteslongObligatoire1–524288.
storageEnterpriseManagementFileStorageOutcomeObligatoireSTOREDorDEDUPLICATED.
Set exactly one of:
Champs2 champs
byResourcestringValidate an existing resource's open draft, reading exactly the files a publish would. No open draft returns
ResourceNotFoundException. Length 1–64.filesEnterpriseManagementInlineFile[]Validate the files as sent. Nothing is stored. 0–500 entries.
| Exception | HTTP status | Fields |
|---|---|---|
AccessDeniedException | 403 | message, reason |
ConflictException | 409 | message, reason |
EnterpriseManagementResourceValidationException | 400 | message, diagnostics |
InternalServerException | 500 | message |
ResourceNotFoundException | 404 | message |
ThrottlingException | 429 | message |
ValidationException | 400 | message, reason, missingPermissions (a list of action and resource) |
The service returns every client error as HTTP 400, including not-found, access-denied, and conflict conditions, and the message holds internal text such as "(Service: KiroEnterpriseManagement, Status Code: 404, …)". Match on the exception name, such as ResourceNotFoundException, rather than the status code. The AWS CLI and the SDKs show the right exception.
Enterprise Management API reference