import type { Context } from "../../context.ts"; /** * Properties for creating or updating a Cloud Control resource */ export interface CloudControlResourceProps { /** * The type name of the resource (e.g. AWS::S3::Bucket) */ typeName: string; /** * The desired state of the resource */ desiredState: Record; /** * If true, adopt existing resource instead of failing when resource already exists */ adopt?: boolean; /** * Optional AWS region * @default AWS_REGION environment variable */ region?: string; /** * AWS access key ID (overrides environment variable) */ accessKeyId?: string; /** * AWS secret access key (overrides environment variable) */ secretAccessKey?: string; /** * AWS session token for temporary credentials */ sessionToken?: string; } /** * Output returned after Cloud Control resource creation/update */ export interface CloudControlResource extends CloudControlResourceProps { /** * The identifier of the resource */ id: string; /** * Time at which the resource was created */ createdAt: number; } /** * Creates a memoized Resource handler for a CloudFormation resource type * * @param typeName CloudFormation resource type (e.g., "AWS::S3::Bucket") * @returns A memoized Resource handler for the specified type */ export declare function createResourceType(typeName: string): any; /** * AWS Cloud Control Resource (Generic Handler) * * This exported resource provides a generic way to manage any AWS resource * supported by the Cloud Control API by explicitly passing the `typeName`. * It is intended for direct use when the specific resource type might not be * known at compile time or when not using the typed Proxy interface. * * For the strongly-typed Proxy interface (e.g., `AWS.S3.Bucket(...)`), Alchemy * uses internal handlers generated by the `createResourceType` factory function. * * Creates and manages AWS resources using the Cloud Control API. * * @example * // Create an S3 bucket * const bucket = await CloudControlResource("my-bucket", { * typeName: "AWS::S3::Bucket", * desiredState: { * BucketName: "my-unique-bucket-name", * VersioningConfiguration: { * Status: "Enabled" * } * } * }); * * @example * // Create a DynamoDB table * const table = await CloudControlResource("users-table", { * typeName: "AWS::DynamoDB::Table", * desiredState: { * TableName: "users", * AttributeDefinitions: [ * { * AttributeName: "id", * AttributeType: "S" * } * ], * KeySchema: [ * { * AttributeName: "id", * KeyType: "HASH" * } * ], * ProvisionedThroughput: { * ReadCapacityUnits: 5, * WriteCapacityUnits: 5 * } * } * }); */ export declare const CloudControlResource: (((this: any, id: string, props?: {}) => never) & (new (_: never) => never)) | typeof CloudControlLifecycle; declare function CloudControlLifecycle(this: Context, id: string, props: CloudControlResourceProps): Promise<{ id: string; createdAt: number; /** * The type name of the resource (e.g. AWS::S3::Bucket) */ typeName: string; /** * The desired state of the resource */ desiredState: Record; /** * If true, adopt existing resource instead of failing when resource already exists */ adopt?: boolean; /** * Optional AWS region * @default AWS_REGION environment variable */ region?: string; /** * AWS access key ID (overrides environment variable) */ accessKeyId?: string; /** * AWS secret access key (overrides environment variable) */ secretAccessKey?: string; /** * AWS session token for temporary credentials */ sessionToken?: string; }>; export {}; //# sourceMappingURL=resource.d.ts.map