organization_admins
Creates, updates, deletes or gets an organization_admin
resource or lists organization_admins
in a region
Overview
Name | organization_admins |
Type | Resource |
Description | Resource schema for AWS::Detective::OrganizationAdmin |
Id | aws.detective.organization_admins |
Fields
Name | Datatype | Description |
---|---|---|
account_id | string | The account ID of the account that should be registered as your Organization's delegated administrator for Detective |
graph_arn | string | The Detective graph ARN |
region | string | AWS region. |
Methods
Name | Accessible by | Required Params |
---|---|---|
create_resource | INSERT | AccountId, region |
delete_resource | DELETE | data__Identifier, region |
list_resources | SELECT | region |
get_resource | SELECT | data__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
.
- Required Properties
- All Properties
- Manifest
/*+ create */
INSERT INTO aws.detective.organization_admins (
AccountId,
region
)
SELECT
'{{ AccountId }}',
'{{ region }}';
/*+ create */
INSERT INTO aws.detective.organization_admins (
AccountId,
region
)
SELECT
'{{ AccountId }}',
'{{ region }}';
version: 1
name: stack name
description: stack description
providers:
- aws
globals:
- name: region
value: '{{ vars.AWS_REGION }}'
resources:
- name: organization_admin
props:
- name: AccountId
value: '{{ AccountId }}'
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