UNPKG

aws-cdk-lib

Version:

Version 2 of the AWS Cloud Development Kit library

2 lines (1 loc) 3.15 kB
"use strict";var _a,_b,_c;Object.defineProperty(exports,"__esModule",{value:!0}),exports.CloudFormationStackNotificationCheck=exports.CloudFormationStackDriftDetectionCheck=exports.AccessKeysRotated=void 0;const jsiiDeprecationWarnings=require("../../.warnings.jsii.js"),JSII_RTTI_SYMBOL_1=Symbol.for("jsii.rtti"),iam=require("../../aws-iam"),core_1=require("../../core"),rule_1=require("./rule");class AccessKeysRotated extends rule_1.ManagedRule{constructor(scope,id,props={}){super(scope,id,{...props,identifier:rule_1.ManagedRuleIdentifiers.ACCESS_KEYS_ROTATED,inputParameters:{...props.maxAge?{maxAccessKeyAge:props.maxAge.toDays()}:{}}});try{jsiiDeprecationWarnings.aws_cdk_lib_aws_config_AccessKeysRotatedProps(props)}catch(error){throw process.env.JSII_DEBUG!=="1"&&error.name==="DeprecationError"&&Error.captureStackTrace(error,AccessKeysRotated),error}}}exports.AccessKeysRotated=AccessKeysRotated,_a=JSII_RTTI_SYMBOL_1,AccessKeysRotated[_a]={fqn:"aws-cdk-lib.aws_config.AccessKeysRotated",version:"2.70.0"};class CloudFormationStackDriftDetectionCheck extends rule_1.ManagedRule{constructor(scope,id,props={}){super(scope,id,{...props,identifier:rule_1.ManagedRuleIdentifiers.CLOUDFORMATION_STACK_DRIFT_DETECTION_CHECK,inputParameters:{cloudformationRoleArn:core_1.Lazy.string({produce:()=>this.role.roleArn})}});try{jsiiDeprecationWarnings.aws_cdk_lib_aws_config_CloudFormationStackDriftDetectionCheckProps(props)}catch(error){throw process.env.JSII_DEBUG!=="1"&&error.name==="DeprecationError"&&Error.captureStackTrace(error,CloudFormationStackDriftDetectionCheck),error}this.ruleScope=rule_1.RuleScope.fromResource(rule_1.ResourceType.CLOUDFORMATION_STACK,props.ownStackOnly?core_1.Stack.of(this).stackId:void 0),this.role=props.role||new iam.Role(this,"Role",{assumedBy:new iam.ServicePrincipal("config.amazonaws.com"),managedPolicies:[iam.ManagedPolicy.fromAwsManagedPolicyName("ReadOnlyAccess")]})}}exports.CloudFormationStackDriftDetectionCheck=CloudFormationStackDriftDetectionCheck,_b=JSII_RTTI_SYMBOL_1,CloudFormationStackDriftDetectionCheck[_b]={fqn:"aws-cdk-lib.aws_config.CloudFormationStackDriftDetectionCheck",version:"2.70.0"};class CloudFormationStackNotificationCheck extends rule_1.ManagedRule{constructor(scope,id,props={}){try{jsiiDeprecationWarnings.aws_cdk_lib_aws_config_CloudFormationStackNotificationCheckProps(props)}catch(error){throw process.env.JSII_DEBUG!=="1"&&error.name==="DeprecationError"&&Error.captureStackTrace(error,CloudFormationStackNotificationCheck),error}if(props.topics&&props.topics.length>5)throw new Error("At most 5 topics can be specified.");super(scope,id,{...props,identifier:rule_1.ManagedRuleIdentifiers.CLOUDFORMATION_STACK_NOTIFICATION_CHECK,inputParameters:props.topics&&props.topics.reduce((params,topic,idx)=>({...params,[`snsTopic${idx+1}`]:topic.topicArn}),{}),ruleScope:rule_1.RuleScope.fromResources([rule_1.ResourceType.CLOUDFORMATION_STACK])})}}exports.CloudFormationStackNotificationCheck=CloudFormationStackNotificationCheck,_c=JSII_RTTI_SYMBOL_1,CloudFormationStackNotificationCheck[_c]={fqn:"aws-cdk-lib.aws_config.CloudFormationStackNotificationCheck",version:"2.70.0"};