import { List , Value } from "./dataTypes" ; export interface CreationPolicy { AutoScalingCreationPolicy ? : { MinSuccessfulInstancesPercent ? : Value < number > ; } ; ResourceSignal ? : { Count ? : Value < number > ; Timeout ? : Value < string > ; } ; } export enum DeletionPolicy { Delete = 'Delete' , Retain = 'Retain' , Snapshot = 'Snapshot' } export interface UpdatePolicy { AutoScalingReplacingUpdate ? : { WillReplace ? : Value < boolean > ; } ; AutoScalingRollingUpdate ? : { MaxBatchSize ? : Value < number > ; MinInstancesInService ? : Value < number > ; MinSuccessfulInstancesPercent ? : Value < number > ; PauseTime ? : Value < string > ; SuspendProcesses ? : List < string > ; WaitOnResourceSignals ? : Value < boolean > ; } ; AutoScalingScheduledAction ? : { IgnoreUnmodifiedGroupSizeProperties ? : Value < boolean > ; } ; } export default interface Resource { Type : string ; DependsOn ? : Value < string > | List < string > ; Properties ? : { [ key ] : any ; } ; Metadata ? : { [ key ] : any ; } ; CreationPolicy ? : CreationPolicy ; DeletionPolicy ? : DeletionPolicy ; UpdatePolicy ? : UpdatePolicy ; Condition ? : Value < string > ; } export abstract class ResourceBase < TProperties extends object = { [ key ] : any ; } > implements Resource { Type : string ; DependsOn ? : Value < string > | List < string > ; Properties : TProperties ; Metadata ? : { [ key ] : any ; } ; CreationPolicy ? : CreationPolicy ; DeletionPolicy ? : DeletionPolicy ; UpdatePolicy ? : UpdatePolicy ; Condition ? : Value < string > ; protected constructor ( type , properties ) { this . Type = type ; this . Properties = properties ; } dependsOn ( dependencies ) { this . DependsOn = dependencies ; return this ; } metadata ( metadata ) { this . Metadata = metadata ; return this ; } creationPolicy ( policy ) { this . CreationPolicy = policy ; return this ; } deletionPolicy ( policy ) { this . DeletionPolicy = policy ; return this ; } updatePolicy ( policy ) { this . UpdatePolicy = policy ; return this ; } condition ( condition ) { this . Condition = condition ; return this ; } } export class ResourceTag { constructor ( public Key , public Value ) { } }