UNPKG

@fntio/infra-client

Version:

Self-hosted AWS access portal: credential vending, target-account trust, and grant-driven private networking as CDK stacks and constructs.

28 lines (27 loc) • 1.46 kB
import { Construct } from "constructs"; import * as ec2 from "aws-cdk-lib/aws-ec2"; import * as iam from "aws-cdk-lib/aws-iam"; import { AppFunction } from "./app-function"; export interface SgManagerProps { /** The hub's SET-ONCE product prefix (hub.resourcePrefix) — the well-known * function name and the managed-rule marker derive from it. */ readonly resourcePrefix: string; /** Mutating IAM is pinned to this VPC (`ec2:Vpc` condition) — so resources * in a PEERED VPC can't use SG automation. */ readonly vpc: ec2.IVpc; /** The connector's SG in this account — the only source the manager ever * writes into ingress rules (env, never caller input). */ readonly connectorSecurityGroup: ec2.ISecurityGroup; /** The hub's reconciler role (`hub.aclReconcilerPrincipal()`). Omit when * the reconciler is same-account — identity policy alone suffices. */ readonly trustedInvoker?: iam.IPrincipal; /** The connector VPC's name (config `connectorVpcs[].name`) — suffixes the * function name so an account's second VPC gets its own manager. */ readonly name?: string; } /** Lives in the target account so the reconciler never holds EC2 permissions * anywhere — it may only ask this fn, which only opens this VPC's groups. */ export declare class SgManager extends Construct { readonly fn: AppFunction; constructor(scope: Construct, id: string, props: SgManagerProps); }