import { CapabilityProps, Capability } from "./capability"; import { ClusterInfo } from "../spi"; import { CfnCapability } from "aws-cdk-lib/aws-eks"; import * as iam from "aws-cdk-lib/aws-iam"; /** * Scopes an IAMRoleSelector to specific Kubernetes resource types. */ export interface AckResourceTypeSelector { group: string; version: string; kind: string; } /** * Properties for ACK capability. */ export interface AckCapabilityProps extends Omit { /** IAM Role Selectors for granular permission control */ roleSelectors?: AckRoleSelectorBuilder[]; } /** * Builder for constructing ACK IAMRoleSelector resources. * Accepts either an existing role ARN or a policy to create a new role. * * @example * ```typescript * // Let the capability create the role with a managed policy * new AckRoleSelectorBuilder("s3-prod") * .withManagedPolicy("AmazonS3FullAccess") * .namespaces("production") * .build() * * // Use an existing role ARN * new AckRoleSelectorBuilder("rds-prod") * .withRoleArn("arn:aws:iam::123:role/MyExistingRole") * .namespaces("rds-resources") * .build() * * // Use a custom inline policy * new AckRoleSelectorBuilder("s3-readonly") * .withPolicyDocument(new iam.PolicyDocument({ * statements: [new iam.PolicyStatement({ * actions: ["s3:Get*", "s3:List*"], * resources: ["*"], * })], * })) * .namespaces("s3-readonly") * .build() * ``` */ export declare class AckRoleSelectorBuilder { readonly name: string; roleArn?: string; managedPolicyName?: string; policyDocument?: iam.PolicyDocument; namespaceNames?: string[]; namespaceLabelSelector?: Record; resourceTypeSelector?: AckResourceTypeSelector[]; constructor(name: string); /** Use an existing IAM role ARN */ withRoleArn(roleArn: string): this; /** Create a role with an AWS managed policy */ withManagedPolicy(policyName: string): this; /** Create a role with a custom inline policy */ withPolicyDocument(doc: iam.PolicyDocument): this; /** Scope to specific namespace names */ namespaces(...namespaces: string[]): this; /** Scope to namespaces matching labels */ namespaceLabels(labels: Record): this; /** Scope to specific resource types */ resourceTypes(...types: AckResourceTypeSelector[]): this; } /** * AWS Controllers for Kubernetes (ACK) capability for EKS clusters. * Requires either direct IAM permissions or roleSelectors to be provided. */ export declare class AckCapability extends Capability { readonly options: AckCapabilityProps; readonly DEFAULT_POLICY_NAME: undefined; static readonly defaultProps: Partial; constructor(options: AckCapabilityProps); create(clusterInfo: ClusterInfo): CfnCapability; private buildSelector; private createSelectorRole; }