aws-cdk-lib
Version:
Version 2 of the AWS Cloud Development Kit library
2 lines (1 loc) • 3.49 kB
JavaScript
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.QueueEncryption=exports.QueueBase=void 0;var jsiiDeprecationWarnings=()=>{var tmp=require("../../.warnings.jsii.js");return jsiiDeprecationWarnings=()=>tmp,tmp};const JSII_RTTI_SYMBOL_1=Symbol.for("jsii.rtti");var policy_1=()=>{var tmp=require("./policy");return policy_1=()=>tmp,tmp},sqs_grants_generated_1=()=>{var tmp=require("./sqs-grants.generated");return sqs_grants_generated_1=()=>tmp,tmp},iam=()=>{var tmp=require("../../aws-iam");return iam=()=>tmp,tmp},core_1=()=>{var tmp=require("../../core");return core_1=()=>tmp,tmp};class QueueBase extends core_1().Resource{static[JSII_RTTI_SYMBOL_1]={fqn:"aws-cdk-lib.aws_sqs.QueueBase",version:"2.233.0"};grants=sqs_grants_generated_1().QueueGrants.fromQueue(this);policy;constructor(scope,id,props={}){super(scope,id,props);try{jsiiDeprecationWarnings().aws_cdk_lib_ResourceProps(props)}catch(error){throw process.env.JSII_DEBUG!=="1"&&error.name==="DeprecationError"&&Error.captureStackTrace(error,QueueBase),error}this.node.addValidation({validate:()=>this.policy?.document.validateForResourcePolicy()??[]})}grantOnKey(grantee,...actions){try{jsiiDeprecationWarnings().aws_cdk_lib_aws_iam_IGrantable(grantee)}catch(error){throw process.env.JSII_DEBUG!=="1"&&error.name==="DeprecationError"&&Error.captureStackTrace(error,this.grantOnKey),error}return{grant:this.encryptionMasterKey?this.encryptionMasterKey.grant(grantee,...actions):void 0}}get queueRef(){return{queueUrl:this.queueUrl,queueArn:this.queueArn}}addToResourcePolicy(statement){try{jsiiDeprecationWarnings().aws_cdk_lib_aws_iam_PolicyStatement(statement)}catch(error){throw process.env.JSII_DEBUG!=="1"&&error.name==="DeprecationError"&&Error.captureStackTrace(error,this.addToResourcePolicy),error}return!this.policy&&this.autoCreatePolicy&&(this.policy=new(policy_1()).QueuePolicy(this,"Policy",{queues:[this]})),this.policy?(this.policy.document.addStatements(statement),{statementAdded:!0,policyDependable:this.policy}):{statementAdded:!1}}grantConsumeMessages(grantee){try{jsiiDeprecationWarnings().aws_cdk_lib_aws_iam_IGrantable(grantee)}catch(error){throw process.env.JSII_DEBUG!=="1"&&error.name==="DeprecationError"&&Error.captureStackTrace(error,this.grantConsumeMessages),error}return this.grants.consumeMessages(grantee)}grantSendMessages(grantee){try{jsiiDeprecationWarnings().aws_cdk_lib_aws_iam_IGrantable(grantee)}catch(error){throw process.env.JSII_DEBUG!=="1"&&error.name==="DeprecationError"&&Error.captureStackTrace(error,this.grantSendMessages),error}return this.grants.sendMessages(grantee)}grantPurge(grantee){try{jsiiDeprecationWarnings().aws_cdk_lib_aws_iam_IGrantable(grantee)}catch(error){throw process.env.JSII_DEBUG!=="1"&&error.name==="DeprecationError"&&Error.captureStackTrace(error,this.grantPurge),error}return this.grants.purge(grantee)}grant(grantee,...actions){try{jsiiDeprecationWarnings().aws_cdk_lib_aws_iam_IGrantable(grantee)}catch(error){throw process.env.JSII_DEBUG!=="1"&&error.name==="DeprecationError"&&Error.captureStackTrace(error,this.grant),error}return iam().Grant.addToPrincipalOrResource({grantee,actions,resourceArns:[this.queueArn],resource:this})}}exports.QueueBase=QueueBase;var QueueEncryption;(function(QueueEncryption2){QueueEncryption2.UNENCRYPTED="NONE",QueueEncryption2.KMS_MANAGED="KMS_MANAGED",QueueEncryption2.KMS="KMS",QueueEncryption2.SQS_MANAGED="SQS_MANAGED"})(QueueEncryption||(exports.QueueEncryption=QueueEncryption={}));