/** * The AWS carve-out resource table — the single source of truth for which AWS * Terraform types chant can carve, and how. * * Both the advisor (tier map / scoring) and `carve emit --state` derive from * this one list, so advise and emit cover exactly the same AWS types: advise * never ranks a resource emit cannot produce, and emit never claims a type * advise did not score. Adding a type here lights it up for both at once. * * Each entry maps the common, high-confidence Terraform attributes to their * CloudFormation property names (chant AWS constructors take CFN PascalCase * props). Attributes without a mapping here are preserved in a reference * comment on emit, never dropped — a curated seed, not a full TF↔CFN transform. */ /** A Terraform attribute → CloudFormation property mapping. */ type FieldSpec = string | { prop: string; transform: (v: unknown) => unknown; }; export interface AwsCarveType { /** Terraform resource type, e.g. `aws_s3_bucket`. */ tfType: string; /** Native-spec map tier: 1 clean 1:1, 2 some reshaping, 3 heavy composite. */ tier: 1 | 2 | 3; /** CloudFormation type, e.g. `AWS::S3::Bucket`. */ nativeType: string; /** chant AWS lexicon constructor, e.g. `Bucket` (verified against generated exports). */ ctor: string; /** The HCL attribute carrying the physical name (for the live-import hint / graph identity). */ identityAttr?: string; /** Terraform attribute → CFN property mappings. */ fields: Record; /** Map the Terraform `tags` map to CloudFormation `Tags` list. */ tags?: boolean; } export declare const AWS_LEXICON_IMPORT = "@intentius/chant-lexicon-aws"; export declare const AWS_CARVE_TYPES: AwsCarveType[]; export declare function awsCarveType(tfType: string): AwsCarveType | undefined; /** * How a folded sub-resource (see `FOLDS_INTO`) joins its parent's emitted * properties (#1637). Terraform splits configuration the CloudFormation shape * keeps inside the parent resource, so the fold is not just a carve-set * membership claim: the sub-resource's attributes have to land in the parent's * props, or the emitted resource silently loses what the Terraform declared. */ export interface AwsFoldMapper { /** Sub-resource attributes this mapper reads. Anything else stays unmapped. */ consumes: string[]; /** The parent CFN properties this sub-resource contributes. */ map: (attrs: Record) => Record; } export declare const AWS_FOLD_MAPPERS: Record; /** * Apply a folded sub-resource's state attributes to its parent's properties. * * Returns the props it contributes plus the attributes that stay genuinely * unmappable (which the emitted source preserves in its reference comment). A * mapper that produced nothing consumes nothing — the caller reports the whole * sub-resource rather than claiming a fold that did not happen. `null` means * this sub-resource type has no fold mapping at all. */ export declare function applyAwsFold(tfType: string, attrs: Record): { props: Record; unmapped: Record; } | null; /** A folded sub-resource's attributes minus what was consumed and its parent link. */ export declare function unmappedFoldAttrs(attrs: Record, consumed?: ReadonlySet): Record; /** * Apply an entry's field mappings to a resource's Terraform attributes, yielding * CloudFormation properties and the set of attribute keys that were consumed * (so the caller can report the rest as unmapped). */ export declare function applyAwsMapper(entry: AwsCarveType, attrs: Record): { props: Record; mappedKeys: string[]; }; export {}; //# sourceMappingURL=aws-resources.d.ts.map