@fntio/infra-client
Version:
Self-hosted AWS access portal: credential vending, target-account trust, and grant-driven private networking as CDK stacks and constructs.
57 lines (56 loc) • 3.29 kB
TypeScript
import * as cdk from "aws-cdk-lib";
import { Construct } from "constructs";
import * as dynamodb from "aws-cdk-lib/aws-dynamodb";
import * as s3 from "aws-cdk-lib/aws-s3";
/** Cognito → SES email delivery. */
export interface EmailConfig {
readonly hostedZoneId: string;
readonly zoneName: string;
/** Sender address — must be an address under zoneName (the SES identity
* that authorizes sending is the domain itself). */
readonly fromAddress: string;
/** Display name shown next to fromAddress in mail clients. */
readonly fromName?: string;
/** DMARC aggregate-report recipient (`rua`); omitted = no reports requested. */
readonly dmarcReportEmail?: string;
}
export interface DataStackProps extends cdk.StackProps {
/** Harden the tables (RETAIN + point-in-time recovery). Defaults to false
* (sandbox behavior). See AppTable. */
readonly prod?: boolean;
/** The SES identity lives HERE, not CredsStack: verification is async, so a
* failed CredsStack deploy must not roll the identity back (never converges). */
readonly email?: EmailConfig;
}
/** The DynamoDB tables — separate from CredsStack so durable data outlives
* compute redeploys. */
export declare class DataStack extends cdk.Stack {
readonly accountsTable: dynamodb.Table;
readonly rolesTable: dynamodb.Table;
readonly requestsTable: dynamodb.Table;
readonly auditTable: dynamodb.Table;
readonly groupsTable: dynamodb.Table;
readonly resourcesTable: dynamodb.Table;
/** Access model v2: grants stored exactly as granted — principal → target,
* plus member#/pref# rows; `byTarget` = who holds X. */
readonly accessTable: dynamodb.Table;
readonly revocationsTable: dynamodb.Table;
/** clientId → name + rotation state; grants live in Access under `user#<clientId>`. */
readonly serviceUsersTable: dynamodb.Table;
/** Personal access tokens: tokenId → owner, scopes, expiry and the SHA-256 of the secret (never the secret).
* Always present, like the plugin catalog, so switching the feature never adds or removes an export. */
readonly tokensTable: dynamodb.Table;
/** Plugin catalog (Epic 5): deployment-written records, keyed by pluginId. Always present so enabling or
* disabling the feature never adds or removes a cross-stack export; unused until `plugins.enabled`. */
readonly pluginCatalogTable: dynamodb.Table;
/** Plugin UIs under immutable `<id>/<version>-<hash>/` prefixes: uploaded by CredsStack's registrations
* (so a record can depend on its upload), served by WebStack's /plugin-assets/* behavior, never touched
* by the site deploy's prune. */
readonly pluginAssetsBucket: s3.Bucket;
/** Server-access logs of every hub bucket and the standard logs of both CloudFront distributions
* (Security Hub S3.9, CloudFront.5). ACL-based ownership: that is what CloudFront's standard logging
* and S3 log delivery write with, and it keeps the other stacks free of a cross-stack bucket-policy
* reference back into this one. The one bucket that logs nowhere — AWS says to suppress S3.9 on it. */
readonly accessLogsBucket: s3.Bucket;
constructor(scope: Construct, id: string, props?: DataStackProps);
}