UNPKG

aws-cdk-lib

Version:

Version 2 of the AWS Cloud Development Kit library

2 lines (1 loc) 6.12 kB
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.GatewayBase=exports.GatewayExceptionLevel=void 0;var jsiiDeprecationWarnings=()=>{var tmp=require("../../../.warnings.jsii.js");return jsiiDeprecationWarnings=()=>tmp,tmp};const JSII_RTTI_SYMBOL_1=Symbol.for("jsii.rtti");var perms_1=()=>{var tmp=require("./perms");return perms_1=()=>tmp,tmp},aws_cloudwatch_1=()=>{var tmp=require("../../../aws-cloudwatch");return aws_cloudwatch_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 GatewayExceptionLevel{static[JSII_RTTI_SYMBOL_1]={fqn:"aws-cdk-lib.aws_bedrockagentcore.GatewayExceptionLevel",version:"2.257.0"};static DEBUG=new GatewayExceptionLevel("DEBUG");static of(value){return new GatewayExceptionLevel(value)}value;constructor(value){this.value=value}toString(){return this.value}}exports.GatewayExceptionLevel=GatewayExceptionLevel;class GatewayBase extends core_1().Resource{static[JSII_RTTI_SYMBOL_1]={fqn:"aws-cdk-lib.aws_bedrockagentcore.GatewayBase",version:"2.257.0"};get gatewayRef(){return{gatewayIdentifier:this.gatewayId,gatewayArn:this.gatewayArn}}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,GatewayBase),error}}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.addToPrincipal({grantee,resourceArns:[this.gatewayRef.gatewayArn],actions})}grantRead(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.grantRead),error}const resourceSpecificGrant=this.grant(grantee,...perms_1().GATEWAY_GET_PERMS),allResourceGrant=iam().Grant.addToPrincipal({grantee,resourceArns:["*"],actions:[...perms_1().GATEWAY_LIST_PERMS]});return resourceSpecificGrant.combine(allResourceGrant)}grantManage(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.grantManage),error}return this.grant(grantee,...perms_1().GATEWAY_MANAGE_PERMS)}grantInvoke(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.grantInvoke),error}return this.grant(grantee,...perms_1().GATEWAY_INVOKE_PERMS)}metric(metricName,props){try{jsiiDeprecationWarnings().aws_cdk_lib_aws_cloudwatch_MetricOptions(props)}catch(error){throw process.env.JSII_DEBUG!=="1"&&error.name==="DeprecationError"&&Error.captureStackTrace(error,this.metric),error}const metricProps={namespace:"AWS/Bedrock-AgentCore",metricName,...props,dimensionsMap:{Resource:this.gatewayRef.gatewayArn,...props?.dimensionsMap}};return this.configureMetric(metricProps)}metricInvocations(props){try{jsiiDeprecationWarnings().aws_cdk_lib_aws_cloudwatch_MetricOptions(props)}catch(error){throw process.env.JSII_DEBUG!=="1"&&error.name==="DeprecationError"&&Error.captureStackTrace(error,this.metricInvocations),error}return this.metric("Invocations",{statistic:aws_cloudwatch_1().Stats.SUM,...props})}metricThrottles(props){try{jsiiDeprecationWarnings().aws_cdk_lib_aws_cloudwatch_MetricOptions(props)}catch(error){throw process.env.JSII_DEBUG!=="1"&&error.name==="DeprecationError"&&Error.captureStackTrace(error,this.metricThrottles),error}return this.metric("Throttles",{statistic:aws_cloudwatch_1().Stats.SUM,...props})}metricSystemErrors(props){try{jsiiDeprecationWarnings().aws_cdk_lib_aws_cloudwatch_MetricOptions(props)}catch(error){throw process.env.JSII_DEBUG!=="1"&&error.name==="DeprecationError"&&Error.captureStackTrace(error,this.metricSystemErrors),error}return this.metric("SystemErrors",{statistic:aws_cloudwatch_1().Stats.SUM,...props})}metricUserErrors(props){try{jsiiDeprecationWarnings().aws_cdk_lib_aws_cloudwatch_MetricOptions(props)}catch(error){throw process.env.JSII_DEBUG!=="1"&&error.name==="DeprecationError"&&Error.captureStackTrace(error,this.metricUserErrors),error}return this.metric("UserErrors",{statistic:aws_cloudwatch_1().Stats.SUM,...props})}metricLatency(props){try{jsiiDeprecationWarnings().aws_cdk_lib_aws_cloudwatch_MetricOptions(props)}catch(error){throw process.env.JSII_DEBUG!=="1"&&error.name==="DeprecationError"&&Error.captureStackTrace(error,this.metricLatency),error}return this.metric("Latency",{statistic:aws_cloudwatch_1().Stats.AVERAGE,...props})}metricDuration(props){try{jsiiDeprecationWarnings().aws_cdk_lib_aws_cloudwatch_MetricOptions(props)}catch(error){throw process.env.JSII_DEBUG!=="1"&&error.name==="DeprecationError"&&Error.captureStackTrace(error,this.metricDuration),error}return this.metric("Duration",{statistic:aws_cloudwatch_1().Stats.AVERAGE,...props})}metricTargetExecutionTime(props){try{jsiiDeprecationWarnings().aws_cdk_lib_aws_cloudwatch_MetricOptions(props)}catch(error){throw process.env.JSII_DEBUG!=="1"&&error.name==="DeprecationError"&&Error.captureStackTrace(error,this.metricTargetExecutionTime),error}return this.metric("TargetExecutionTime",{statistic:aws_cloudwatch_1().Stats.AVERAGE,...props})}metricTargetType(targetType,props){try{jsiiDeprecationWarnings().aws_cdk_lib_aws_cloudwatch_MetricOptions(props)}catch(error){throw process.env.JSII_DEBUG!=="1"&&error.name==="DeprecationError"&&Error.captureStackTrace(error,this.metricTargetType),error}return this.metric("TargetType",{dimensionsMap:{TargetType:targetType},statistic:aws_cloudwatch_1().Stats.SUM,...props})}configureMetric(props){return new(aws_cloudwatch_1()).Metric({...props,region:props?.region??this.stack.region,account:props?.account??this.stack.account})}}exports.GatewayBase=GatewayBase;