"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
const stack_1 = require("./stack");
/**
 * Represents a CloudFormation condition, for resources which must be conditionally created and
 * the determination must be made at deploy time.
 */
class Condition extends stack_1.Referenceable {
    /**
     * Build a new condition. The condition must be constructed with a condition token,
     * that the condition is based on.
     */
    constructor(parent, name, props) {
        super(parent, name);
        this.expression = props && props.expression;
    }
    toCloudFormation() {
        return {
            Conditions: {
                [this.logicalId]: this.expression
            }
        };
    }
}
exports.Condition = Condition;
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiY29uZGl0aW9uLmpzIiwic291cmNlUm9vdCI6IiIsInNvdXJjZXMiOlsiY29uZGl0aW9uLnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiI7O0FBRUEsbUNBQXdDO0FBTXhDOzs7R0FHRztBQUNILE1BQWEsU0FBVSxTQUFRLHFCQUFhO0lBTXhDOzs7T0FHRztJQUNILFlBQVksTUFBaUIsRUFBRSxJQUFZLEVBQUUsS0FBc0I7UUFDL0QsS0FBSyxDQUFDLE1BQU0sRUFBRSxJQUFJLENBQUMsQ0FBQztRQUNwQixJQUFJLENBQUMsVUFBVSxHQUFHLEtBQUssSUFBSSxLQUFLLENBQUMsVUFBVSxDQUFDO0lBQ2hELENBQUM7SUFFTSxnQkFBZ0I7UUFDbkIsT0FBTztZQUNILFVBQVUsRUFBRTtnQkFDUixDQUFDLElBQUksQ0FBQyxTQUFTLENBQUMsRUFBRSxJQUFJLENBQUMsVUFBVTthQUNwQztTQUNKLENBQUM7SUFDTixDQUFDO0NBQ0o7QUF0QkQsOEJBc0JDIn0=