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.
- IAM action
q:AssociateEnterpriseManagementResource
Request3 fields
resourceIdstringRequiredThe resource to associate. Must have an enforcing revision (published at least once). Length 1–64; pattern
^[a-z0-9]+$.scopeTypeEnterpriseManagementScopeTypeRequiredThe kind of scope to bind.
PROFILE.scopeIdstringRequiredThe identifier of the scope to bind. For
PROFILE, the Kiro profile ID. Length 1–128.
Response3 fields
resourceIdstringRequiredThe associated resource.
scopeTypeEnterpriseManagementScopeTypeRequiredThe scope kind.
scopeIdstringRequiredThe scope identifier.
Errors6
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.
- IAM action
q:CreateEnterpriseManagementResource
Request2 fields
namestringRequiredHuman-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
^[!-~]+$.
Response4 fields
resourceIdstringRequiredServer-assigned; use it in all later calls. Length 1–64; pattern
^[a-z0-9]+$.arnstringRequiredThe resource ARN. Length 1–256; pattern
^arn:[a-z0-9-]+:.+$.namestringRequiredThe display name as created.
createdAttimestampRequiredWhen the resource was created.
Errors5
AWS CLI
aws kiro-em create-enterprise-management-resource \ --name "Engineering policy"
Soft-deletes a resource by marking it deleted.
- IAM action
q:DeleteEnterpriseManagementResource
Request1 field
resourceIdstringRequiredThe resource to delete.
Response
No fields.
Errors5
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.
- IAM action
q:DeleteEnterpriseManagementResourceDraft
Request2 fields
resourceIdstringRequiredThe 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.
Response
No fields.
Errors6
AWS CLI
aws kiro-em delete-enterprise-management-resource-draft \ --resource-id abc123
Removes one file from a resource's working draft.
- IAM action
q:DeleteEnterpriseManagementResourceFile
Request5 fields
resourceIdstringRequiredThe resource whose draft holds the file.
typeEnterpriseManagementFileTypekgl,steering,skill, orpower. A file is named by type and path together.pathstringRequiredThe 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
^[!-~]+$.
Response1 field
eTagstringRequiredThe draft's new
eTag. Pass it asifMatchon the next write.
Errors6
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.
- IAM action
q:DisassociateEnterpriseManagementResource
Request3 fields
resourceIdstringRequiredThe resource to disassociate.
scopeTypeEnterpriseManagementScopeTypeRequiredPROFILE.scopeIdstringRequiredThe scope identifier. For
PROFILE, the Kiro profile ID. Length 1–128.
Response
No fields.
Errors5
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.
- IAM action
q:GetEnterpriseManagementResource
Request2 fields
resourceIdstringRequiredThe resource to read.
revisionstringA published revision number, or
DRAFTorENFORCING. Default enforcing. Length 1–16.
Response12 fields
resourceIdstringRequiredThe resource ID.
arnstringRequiredThe resource ARN.
namestringRequiredThe display name; the same whichever revision you read.
revisionintegerThe revision number. Absent when
DRAFT.stateEnterpriseManagementRevisionStateRequiredDRAFTorPUBLISHED.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.
fileCountintegerRequiredFiles the revision holds.
createdAttimestampRequiredWhen the revision was created.
createdBystringRequiredWho 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.
Errors5
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.
- IAM action
q:GetEnterpriseManagementResourceFile
Request4 fields
resourceIdstringRequiredThe resource to read.
typeEnterpriseManagementFileTypekgl,steering,skill, orpower.pathstringRequiredThe file path. Length 1–200.
revisionstringDRAFT,ENFORCING, or a revision number. Default enforcing.
Response1 field
contentstringRequiredThe file's text exactly as written, UTF-8.
Errors5
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.
- IAM action
q:ListEnterpriseManagementResourceFiles
Request4 fields
resourceIdstringRequiredThe resource to list.
revisionstringDRAFT,ENFORCING, or a revision number.maxResultsinteger1–100. Default 100.
nextTokenstringThe token from the previous page. Length 1–2048.
Response5 fields
resourceIdstringRequiredThe resource ID.
revisionintegerThe revision number. Absent for
DRAFT.filesEnterpriseManagementResourceFile[]RequiredIn the order written. 0–500 entries.
nextTokenstringPresent when more pages follow.
compositionmap of EnterpriseManagementFileType to EnterpriseManagementFileComposeBehaviorRequiredHow this revision's files compose with a developer's own, by type.
Errors5
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.
- IAM action
q:ListEnterpriseManagementResourceRevisions
Request3 fields
resourceIdstringRequiredThe resource to list.
maxResultsinteger1–100. Default 20.
nextTokenstringThe token from the previous page.
Response2 fields
revisionsEnterpriseManagementRevisionSummary[]RequiredNewest first. Empty when the resource was never published. 0–100 entries.
nextTokenstringPresent when more pages follow.
Errors5
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.
- IAM action
q:ListEnterpriseManagementResources
Request2 fields
maxResultsinteger1–100. Default 20.
nextTokenstringThe token from the previous page.
Response2 fields
resourcesEnterpriseManagementResourceSummary[]Required0–100 entries.
nextTokenstringAbsent only when the listing has ended. Keep following it even after a short or empty page.
Errors4
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.
- IAM action
q:PublishEnterpriseManagementResource
Request4 fields
resourceIdstringRequiredThe 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.
Response4 fields
revisionintegerRequiredThe revision the draft was sealed into, now enforcing.
parentintegerThe revision that was enforcing before. Absent on the first publish.
publishedAttimestampRequiredWhen the revision became enforcing.
warningsEnterpriseManagementDiagnostic[]WARNING-severity advisories. 0–100 entries.
Errors7
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.
- IAM action
q:PutEnterpriseManagementResourceFiles
Request5 fields
resourceIdstringRequiredThe 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.
Response5 fields
resourceIdstringRequiredThe resource ID.
fileCountintegerRequiredFiles the draft holds after this call.
filesEnterpriseManagementStoredFile[]RequiredIn the order sent.
eTagstringRequiredThe draft's new
eTag.compositionmap of EnterpriseManagementFileType to EnterpriseManagementFileComposeBehaviorRequiredThe compose behavior for every distributed type.
Errors7
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.
- IAM action
q:RestoreEnterpriseManagementResource
Request3 fields
resourceIdstringRequiredThe resource to restore.
targetRevisionintegerRequiredThe 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.
Response3 fields
revisionintegerRequiredThe new revision: one above the highest revision number used, never the target's own.
restoredFromintegerRequiredEquals
targetRevision.publishedAttimestampRequiredWhen the new revision became enforcing.
Errors6
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.
- IAM action
q:UpdateEnterpriseManagementResource
Request2 fields
resourceIdstringRequiredThe resource to update.
namestringThe new display name. Omitted leaves it unchanged. Length 1–256.
Response3 fields
resourceIdstringRequiredThe resource ID.
namestringRequiredThe display name after the update.
updatedAttimestampRequiredWhen the metadata changed.
Errors5
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.
- IAM action
q:ValidateEnterpriseManagementResource
Request2 fields
targetEnterpriseManagementValidateTargetRequiredbyResource(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.
Response2 fields
isValidbooleanRequiredtruewhen compilation produced noERRORfinding.diagnosticsEnterpriseManagementDiagnostic[]Errors first, up to 100. Empty when clean.
Errors5
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
Fields2 fields
scopeTypeEnterpriseManagementScopeTypeRequiredPROFILE.scopeIdstringRequiredThe Kiro profile ID. Length 1–128.
Fields7 fields
severityEnterpriseManagementDiagnosticSeverityRequiredERRORblocks publishing;WARNINGis advisory.codestringRequiredStable, machine-readable code, for example
YAML_PARSE_ERROR,UNKNOWN_SETTING,POLICY_BOUNDARY_VIOLATION. Treat the set as open. Length 1–128. See Common errors.messagestringRequiredHuman-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.
Fields3 fields
identityStoreIdstringRequiredThe IAM Identity Center identity store ID, for example
d-1234567890. Not the instance ID (ssoins-…). Pattern^d-[a-z0-9]{10}$.regionstringRequiredThe directory's home Region. Length 1–64.
profileArnstringRequiredThe 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/.+$.
Fields3 fields
pathstringRequiredThe file path. Length 1–200.
typeEnterpriseManagementFileTypeRequiredkgl,steering,skill, orpower.contentstringRequiredThe file text. Never empty. Length 1–524288.
Fields4 fields
pathstringRequiredThe file path.
typeEnterpriseManagementFileTypeRequiredThe file type.
sha256stringRequiredLowercase hex, 64 characters.
sizeByteslongRequired1–524288.
Fields7 fields
resourceIdstringRequiredThe resource ID.
arnstringRequiredThe resource ARN.
namestringRequiredThe 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.
Fields2 fields
messagestringRequiredFor example "3 errors prevented publishing".
diagnosticsEnterpriseManagementDiagnostic[]RequiredAt least one
ERROR. 0–100 entries.
Set exactly one of:
Fields3 fields
numberintegerA published revision number. Minimum 1.
draftunitThe open draft.
enforcingunitThe enforcing revision.
Enum: DRAFT, PUBLISHED.
Fields9 fields
revisionintegerRequiredRevision numbers start at 1, count up, and are never reused.
stateEnterpriseManagementRevisionStateRequiredAlways
PUBLISHEDin this listing.parentintegerThe revision this one superseded.
createdBystringRequiredThe identity that opened the draft. This shows a service role, not the caller.
createdAttimestampRequiredWhen 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.isEnforcingbooleanRequiredWhether this revision is live.
Enum: PROFILE.
Fields5 fields
pathstringRequiredThe path as sent.
typeEnterpriseManagementFileTypeRequiredThe file type.
sha256stringRequiredLowercase hex, 64 characters.
sizeByteslongRequired1–524288.
storageEnterpriseManagementFileStorageOutcomeRequiredSTOREDorDEDUPLICATED.
Set exactly one of:
Fields2 fields
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