UNPKG

aws-cdk-lib

Version:

Version 2 of the AWS Cloud Development Kit library

2 lines (1 loc) 5.18 kB
"use strict";var __decorate=exports&&exports.__decorate||function(decorators,target,key,desc){var c=arguments.length,r=c<3?target:desc===null?desc=Object.getOwnPropertyDescriptor(target,key):desc,d;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")r=Reflect.decorate(decorators,target,key,desc);else for(var i=decorators.length-1;i>=0;i--)(d=decorators[i])&&(r=(c<3?d(r):c>3?d(target,key,r):d(target,key))||r);return c>3&&r&&Object.defineProperty(target,key,r),r},_a,_b,_c;Object.defineProperty(exports,"__esModule",{value:!0}),exports.CloudFormationStackNotificationCheck=exports.CloudFormationStackDriftDetectionCheck=exports.AccessKeysRotated=void 0;var jsiiDeprecationWarnings=()=>{var tmp=require("../../.warnings.jsii.js");return jsiiDeprecationWarnings=()=>tmp,tmp};const JSII_RTTI_SYMBOL_1=Symbol.for("jsii.rtti");var rule_1=()=>{var tmp=require("./rule");return rule_1=()=>tmp,tmp},iam=()=>{var tmp=require("../../aws-iam");return iam=()=>tmp,tmp},core_1=()=>{var tmp=require("../../core");return core_1=()=>tmp,tmp},metadata_resource_1=()=>{var tmp=require("../../core/lib/metadata-resource");return metadata_resource_1=()=>tmp,tmp},prop_injectable_1=()=>{var tmp=require("../../core/lib/prop-injectable");return prop_injectable_1=()=>tmp,tmp};let AccessKeysRotated=class AccessKeysRotated2 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,AccessKeysRotated2),error}(0,metadata_resource_1().addConstructMetadata)(this,props)}};exports.AccessKeysRotated=AccessKeysRotated,_a=JSII_RTTI_SYMBOL_1,AccessKeysRotated[_a]={fqn:"aws-cdk-lib.aws_config.AccessKeysRotated",version:"2.211.0"},AccessKeysRotated.PROPERTY_INJECTION_ID="aws-cdk-lib.aws-config.AccessKeysRotated",exports.AccessKeysRotated=AccessKeysRotated=__decorate([prop_injectable_1().propertyInjectable],AccessKeysRotated);let CloudFormationStackDriftDetectionCheck=class CloudFormationStackDriftDetectionCheck2 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,CloudFormationStackDriftDetectionCheck2),error}(0,metadata_resource_1().addConstructMetadata)(this,props),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.211.0"},CloudFormationStackDriftDetectionCheck.PROPERTY_INJECTION_ID="aws-cdk-lib.aws-config.CloudFormationStackDriftDetectionCheck",exports.CloudFormationStackDriftDetectionCheck=CloudFormationStackDriftDetectionCheck=__decorate([prop_injectable_1().propertyInjectable],CloudFormationStackDriftDetectionCheck);let CloudFormationStackNotificationCheck=class CloudFormationStackNotificationCheck2 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,CloudFormationStackNotificationCheck2),error}if(props.topics&&props.topics.length>5)throw new(core_1()).ValidationError("At most 5 topics can be specified.",scope);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])}),(0,metadata_resource_1().addConstructMetadata)(this,props)}};exports.CloudFormationStackNotificationCheck=CloudFormationStackNotificationCheck,_c=JSII_RTTI_SYMBOL_1,CloudFormationStackNotificationCheck[_c]={fqn:"aws-cdk-lib.aws_config.CloudFormationStackNotificationCheck",version:"2.211.0"},CloudFormationStackNotificationCheck.PROPERTY_INJECTION_ID="aws-cdk-lib.aws-config.CloudFormationStackNotificationCheck",exports.CloudFormationStackNotificationCheck=CloudFormationStackNotificationCheck=__decorate([prop_injectable_1().propertyInjectable],CloudFormationStackNotificationCheck);