"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.InspectorScanActionBase=void 0;var jsiiDeprecationWarnings=()=>{var tmp=require("../../../.warnings.jsii.js");return jsiiDeprecationWarnings=()=>tmp,tmp};const JSII_RTTI_SYMBOL_1=Symbol.for("jsii.rtti");var codepipeline=()=>{var tmp=require("../../../aws-codepipeline");return codepipeline=()=>tmp,tmp},iam=()=>{var tmp=require("../../../aws-iam");return iam=()=>tmp,tmp},cdk=()=>{var tmp=require("../../../core");return cdk=()=>tmp,tmp},action_1=()=>{var tmp=require("../action");return action_1=()=>tmp,tmp};class InspectorScanActionBase extends action_1().Action{static[JSII_RTTI_SYMBOL_1]={fqn:"aws-cdk-lib.aws_codepipeline_actions.InspectorScanActionBase",version:"2.256.1"};props;constructor(props){super({...props,category:codepipeline().ActionCategory.INVOKE,provider:"InspectorScan",artifactBounds:{minInputs:0,maxInputs:1,minOutputs:1,maxOutputs:1},outputs:[props.output]});try{jsiiDeprecationWarnings().aws_cdk_lib_aws_codepipeline_actions_InspectorScanActionBaseProps(props)}catch(error){throw process.env.JSII_DEBUG!=="1"&&error.name==="DeprecationError"&&Error.captureStackTrace(error,InspectorScanActionBase),error}this.props=props}get variables(){return{highestScannedSeverity:this.variableExpression("HighestScannedSeverity")}}bound(scope,stage,options){try{jsiiDeprecationWarnings().aws_cdk_lib_aws_codepipeline_IStage(stage),jsiiDeprecationWarnings().aws_cdk_lib_aws_codepipeline_ActionBindOptions(options)}catch(error){throw process.env.JSII_DEBUG!=="1"&&error.name==="DeprecationError"&&Error.captureStackTrace(error,this.bound),error}options.role.addToPrincipalPolicy(new(iam()).PolicyStatement({resources:["*"],actions:["inspector-scan:ScanSbom"]}));const logGroupArn=cdk().Stack.of(scope).formatArn({service:"logs",resource:"log-group",resourceName:`/aws/codepipeline/${stage.pipeline.pipelineName}`,arnFormat:cdk().ArnFormat.COLON_RESOURCE_NAME}),logGroupArnWithWildcard=`${logGroupArn}:*`;return options.role.addToPrincipalPolicy(new(iam()).PolicyStatement({resources:[logGroupArn,logGroupArnWithWildcard],actions:["logs:CreateLogGroup","logs:CreateLogStream","logs:PutLogEvents"]})),(this.actionProperties.outputs??[]).length>0&&options.bucket.grantWrite(options.role),{configuration:{...this.renderActionConfiguration(),CriticalThreshold:this.props.criticalThreshold,HighThreshold:this.props.highThreshold,MediumThreshold:this.props.mediumThreshold,LowThreshold:this.props.lowThreshold}}}}exports.InspectorScanActionBase=InspectorScanActionBase;
