import { ManagedPolicy, type ManagedPolicyProps, PolicyStatement } from "aws-cdk-lib/aws-iam"; import type { IConstruct } from "constructs"; import { COPY_STATE, type IBuilder, type Lifecycle } from "@composurecdk/core"; import { type StatementBuilder } from "./statement-builder.js"; /** * Configuration properties for the customer-managed IAM policy builder. * * Extends the CDK {@link ManagedPolicyProps} unchanged — the builder adds * an {@link IManagedPolicyBuilder.addStatements | addStatements} method that * accepts either {@link PolicyStatement} or {@link StatementBuilder}. */ export type ManagedPolicyBuilderProps = ManagedPolicyProps; /** * The build output of an {@link IManagedPolicyBuilder}. */ export interface ManagedPolicyBuilderResult { /** The customer-managed policy created by the builder. */ policy: ManagedPolicy; } /** * A fluent builder for configuring and creating an AWS IAM * customer-managed policy. * * @see https://docs.aws.amazon.com/cdk/api/v2/docs/aws-cdk-lib.aws_iam.ManagedPolicy.html * * @example * ```ts * const boundary = createManagedPolicyBuilder() * .managedPolicyName("ops-boundary") * .addStatements([ * createStatementBuilder() * .allow() * .actions(["s3:GetObject"]) * .resources(["arn:aws:s3:::my-bucket/*"]), * ]); * ``` */ export type IManagedPolicyBuilder = IBuilder; declare class ManagedPolicyBuilder implements Lifecycle { #private; props: Partial; /** * Append policy statements to the managed policy. * * Accepts either {@link PolicyStatement} or {@link StatementBuilder}. * Statement builders are resolved during {@link build} so wildcard-resource * validation runs at the composition boundary. */ addStatements(statements: (PolicyStatement | StatementBuilder)[]): this; /** @internal — see ADR-0005. */ [COPY_STATE](target: ManagedPolicyBuilder): void; build(scope: IConstruct, id: string): ManagedPolicyBuilderResult; } /** * Creates a new {@link IManagedPolicyBuilder} for configuring an AWS IAM * customer-managed policy. * * @returns A fluent builder for a customer-managed policy. */ export declare function createManagedPolicyBuilder(): IManagedPolicyBuilder; export {}; //# sourceMappingURL=managed-policy-builder.d.ts.map