@taimos/cdk-controltower
Version:
[](https://badge.fury.io/js/@taimos%2Fcdk-controltower)
71 lines (70 loc) • 1.97 kB
TypeScript
import { Environment } from 'aws-cdk-lib';
export interface AccountInfo {
readonly Id: string;
readonly Name: string;
readonly Email: string;
readonly Arn: string;
readonly JoinedMethod: string;
readonly JoinedTimestamp: string;
readonly Status: string;
}
export type AccountList<T extends string> = {
[name in T]: AccountInfo;
};
export type AccountConfig<T extends string, V> = {
[name in T]?: V;
};
export type GroupConfig<T extends string, V> = {
[name in T]?: V;
};
export interface GroupInfo {
readonly GroupId: string;
readonly DisplayName: string;
readonly ExternalIds?: {
Issuer: string;
Id: string;
}[];
readonly Description?: string;
}
export type GroupList<T extends string> = {
[name in T]: GroupInfo;
};
export interface SsoConfig<T extends string> {
readonly instanceArn: string;
readonly identityStoreId: string;
readonly groups: GroupList<T>;
}
/**
*
*/
export interface OrgPrincipalAware {
/**
* The organization principal account
*/
readonly orgPrincipalEnv: Environment;
}
/**
* Properties of a cdk-controltower stack stack
*
* @param T - the AccountName type of the generated account list
*/
export interface ControlTowerProps<T extends string> {
/**
* The list of AWS accounts. Can be generated by running `npx fetch-accounts`
*/
readonly accounts: AccountList<T>;
}
/**
* Properties of the SSO stack
*
* @param T - the AccountName type of the generated account list
* @param S - the GroupName type of the generated sso config
*/
export interface SsoProps<T extends string, S extends string> extends ControlTowerProps<T> {
/**
* The configuration of the AWS SSO org. Can be generated by running `npx fetch-sso-config`
*/
readonly ssoConfig: SsoConfig<S>;
}
export declare function generateAccountFile(): Promise<string>;
export declare function generateSsoConfigFile(): Promise<string>;