OrganizationAdmin
The OrganizationAdmin resource lets you manage AWS Detective OrganizationAdmins and their configurations. This resource helps in managing the administrator account for AWS Detective.
Minimal Example
Section titled “Minimal Example”Create a basic OrganizationAdmin with required properties.
import AWS from "alchemy/aws/control";
const organizationAdmin = await AWS.Detective.OrganizationAdmin("myOrganizationAdmin", { AccountId: "123456789012", adopt: true // Adopt existing resource if it already exists});
Advanced Configuration
Section titled “Advanced Configuration”Here is an example of creating an OrganizationAdmin with minimal properties along with the adoption feature.
const advancedOrganizationAdmin = await AWS.Detective.OrganizationAdmin("advancedOrgAdmin", { AccountId: "987654321098", adopt: true // Adopt the existing resource});
Handling Existing Resources
Section titled “Handling Existing Resources”If you want to ensure that your OrganizationAdmin resource does not fail when the resource already exists, you can set the adopt
property to true.
const adoptedOrganizationAdmin = await AWS.Detective.OrganizationAdmin("existingOrgAdmin", { AccountId: "555555555555", adopt: true // This will allow the resource to be adopted instead of failing});
Resource Lifecycle Management
Section titled “Resource Lifecycle Management”You can also manage the lifecycle of the OrganizationAdmin resource by specifying properties that handle creation and updates.
const lifecycleManagedAdmin = await AWS.Detective.OrganizationAdmin("lifecycleOrgAdmin", { AccountId: "333333333333", adopt: false // Do not adopt existing resources});