Skip to main content

organization_admins

Creates, updates, deletes or gets an organization_admin resource or lists organization_admins in a region

Overview

Nameorganization_admins
TypeResource
DescriptionResource schema for AWS::Detective::OrganizationAdmin
Idaws.detective.organization_admins

Fields

NameDatatypeDescription
account_idstringThe account ID of the account that should be registered as your Organization's delegated administrator for Detective
graph_arnstringThe Detective graph ARN
regionstringAWS region.

Methods

NameAccessible byRequired Params
create_resourceINSERTAccountId, region
delete_resourceDELETEdata__Identifier, region
list_resourcesSELECTregion
get_resourceSELECTdata__Identifier, region

SELECT examples

Gets all organization_admins in a region.

SELECT
region,
account_id,
graph_arn
FROM aws.detective.organization_admins
WHERE region = 'us-east-1';

Gets all properties from an individual organization_admin.

SELECT
region,
account_id,
graph_arn
FROM aws.detective.organization_admins
WHERE region = 'us-east-1' AND data__Identifier = '<AccountId>';

INSERT example

Use the following StackQL query and manifest file to create a new organization_admin resource, using stack-deploy.

/*+ create */
INSERT INTO aws.detective.organization_admins (
AccountId,
region
)
SELECT
'{{ AccountId }}',
'{{ region }}';

DELETE example

/*+ delete */
DELETE FROM aws.detective.organization_admins
WHERE data__Identifier = '<AccountId>'
AND region = 'us-east-1';

Permissions

To operate on the organization_admins resource, the following permissions are required:

Create

detective:EnableOrganizationAdminAccount,
detective:ListOrganizationAdminAccount,
iam:CreateServiceLinkedRole,
organizations:RegisterDelegatedAdministrator,
organizations:DescribeOrganization,
organizations:EnableAWSServiceAccess,
organizations:ListAccounts

Read

detective:ListOrganizationAdminAccount,
organizations:DescribeOrganization

Delete

detective:DisableOrganizationAdminAccount,
detective:ListOrganizationAdminAccount,
organizations:DescribeOrganization

List

detective:ListOrganizationAdminAccount,
organizations:DescribeOrganization