@aws-cdk/aws-sqs
Version:
The CDK Construct Library for AWS::SQS
59 lines • 5.09 kB
JavaScript
var _a;
Object.defineProperty(exports, "__esModule", { value: true });
exports.QueuePolicy = void 0;
const jsiiDeprecationWarnings = require("../.warnings.jsii.js");
const JSII_RTTI_SYMBOL_1 = Symbol.for("jsii.rtti");
const aws_iam_1 = require("@aws-cdk/aws-iam");
const core_1 = require("@aws-cdk/core");
const sqs_generated_1 = require("./sqs.generated");
/**
* The policy for an SQS Queue
*
* Policies define the operations that are allowed on this resource.
*
* You almost never need to define this construct directly.
*
* All AWS resources that support resource policies have a method called
* `addToResourcePolicy()`, which will automatically create a new resource
* policy if one doesn't exist yet, otherwise it will add to the existing
* policy.
*
* Prefer to use `addToResourcePolicy()` instead.
*/
class QueuePolicy extends core_1.Resource {
constructor(scope, id, props) {
super(scope, id);
/**
* The IAM policy document for this policy.
*/
this.document = new aws_iam_1.PolicyDocument();
try {
jsiiDeprecationWarnings._aws_cdk_aws_sqs_QueuePolicyProps(props);
}
catch (error) {
if (process.env.JSII_DEBUG !== "1" && error.name === "DeprecationError") {
Error.captureStackTrace(error, QueuePolicy);
}
throw error;
}
new sqs_generated_1.CfnQueuePolicy(this, 'Resource', {
policyDocument: this.document,
queues: props.queues.map(q => q.queueUrl),
});
}
/**
* Not currently supported by AWS CloudFormation.
*
* This attribute temporarily existed in CloudFormation, and then was removed again.
*
* @attribute
*/
get queuePolicyId() {
throw new Error('QueuePolicy.queuePolicyId has been removed from CloudFormation');
}
}
exports.QueuePolicy = QueuePolicy;
_a = JSII_RTTI_SYMBOL_1;
QueuePolicy[_a] = { fqn: "@aws-cdk/aws-sqs.QueuePolicy", version: "1.204.0" };
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoicG9saWN5LmpzIiwic291cmNlUm9vdCI6IiIsInNvdXJjZXMiOlsicG9saWN5LnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiI7Ozs7OztBQUFBLDhDQU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