"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
const cdk_1 = require("@aws-cdk/cdk");
const sqs_generated_1 = require("./sqs.generated");
/**
 * Applies a policy to SQS queues.
 */
class QueuePolicy extends cdk_1.Construct {
    constructor(parent, name, props) {
        super(parent, name);
        /**
         * The IAM policy document for this policy.
         */
        this.document = new cdk_1.PolicyDocument();
        new sqs_generated_1.cloudformation.QueuePolicyResource(this, 'Resource', {
            policyDocument: this.document,
            queues: props.queues.map(q => q.queueUrl)
        });
    }
}
exports.QueuePolicy = QueuePolicy;
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoicG9saWN5LmpzIiwic291cmNlUm9vdCI6IiIsInNvdXJjZXMiOlsicG9saWN5LnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiI7O0FBQUEsc0NBQXlEO0FBRXpELG1EQUFpRDtBQVNqRDs7R0FFRztBQUNILE1BQWEsV0FBWSxTQUFRLGVBQVM7SUFNdEMsWUFBWSxNQUFpQixFQUFFLElBQVksRUFBRSxLQUF1QjtRQUNoRSxLQUFLLENBQUMsTUFBTSxFQUFFLElBQUksQ0FBQyxDQUFDO1FBTnhCOztXQUVHO1FBQ2EsYUFBUSxHQUFHLElBQUksb0JBQWMsRUFBRSxDQUFDO1FBSzVDLElBQUksOEJBQWMsQ0FBQyxtQkFBbUIsQ0FBQyxJQUFJLEVBQUUsVUFBVSxFQUFFO1lBQ3JELGNBQWMsRUFBRSxJQUFJLENBQUMsUUFBUTtZQUM3QixNQUFNLEVBQUUsS0FBSyxDQUFDLE1BQU0sQ0FBQyxHQUFHLENBQUMsQ0FBQyxDQUFDLEVBQUUsQ0FBQyxDQUFDLENBQUMsUUFBUSxDQUFDO1NBQzVDLENBQUMsQ0FBQztJQUNQLENBQUM7Q0FDSjtBQWRELGtDQWNDIn0=