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.

33 lines (32 loc) • 1.57 kB
import { Construct } from "constructs"; import * as iam from "aws-cdk-lib/aws-iam"; import { TargetRoleSpec } from "./web-identity"; export interface TargetAccountTrustProps { /** The OIDC issuer URL served by the hub. */ readonly issuerUrl: string; /** The roles to create here, each assumable via web identity. */ readonly roles: readonly TargetRoleSpec[]; /** Create the provider as a plain `AWS::IAM::OIDCProvider` instead of CDK's custom resource (a Lambda asset * that needs the bootstrap bucket). For the portable template only: switching a DEPLOYED stack would try to * create a second provider for the same issuer and fail. */ readonly nativeProvider?: boolean; } export interface TargetAccountTrust { readonly provider: iam.IOpenIdConnectProvider; readonly providerArn: string; readonly roles: iam.Role[]; } /** With `nativeProvider`: the L1 has no construct-level interface, only its ARN. */ export interface NativeTargetAccountTrust { readonly provider?: undefined; readonly providerArn: string; readonly roles: iam.Role[]; } /** OIDC provider + one fixed-name role per spec, written into the CALLER's * scope (not a nested construct) so adopting it never replaces deployed resources. */ export declare function addTargetAccountTrust(scope: Construct, props: TargetAccountTrustProps & { nativeProvider: true; }): NativeTargetAccountTrust; export declare function addTargetAccountTrust(scope: Construct, props: TargetAccountTrustProps & { nativeProvider?: false; }): TargetAccountTrust;