UNPKG

aws-cdk-lib

Version:

Version 2 of the AWS Cloud Development Kit library

2 lines (1 loc) 11.9 kB
"use strict";var _a,_b;Object.defineProperty(exports,"__esModule",{value:!0}),exports.CfnWorkspace=exports.CfnRuleGroupsNamespace=void 0;var jsiiDeprecationWarnings=()=>{var tmp=require("../../.warnings.jsii.js");return jsiiDeprecationWarnings=()=>tmp,tmp};const JSII_RTTI_SYMBOL_1=Symbol.for("jsii.rtti");var cdk=()=>{var tmp=require("../../core");return cdk=()=>tmp,tmp},cfn_parse=()=>{var tmp=require("../../core/lib/helpers-internal");return cfn_parse=()=>tmp,tmp};class CfnRuleGroupsNamespace extends cdk().CfnResource{static _fromCloudFormation(scope,id,resourceAttributes,options){resourceAttributes=resourceAttributes||{};const resourceProperties=options.parser.parseValue(resourceAttributes.Properties),propsResult=CfnRuleGroupsNamespacePropsFromCloudFormation(resourceProperties);if(cdk().isResolvableObject(propsResult.value))throw new Error("Unexpected IResolvable");const ret=new CfnRuleGroupsNamespace(scope,id,propsResult.value);for(const[propKey,propVal]of Object.entries(propsResult.extraProperties))ret.addPropertyOverride(propKey,propVal);return options.parser.handleAttributes(ret,resourceAttributes,id),ret}constructor(scope,id,props){super(scope,id,{type:CfnRuleGroupsNamespace.CFN_RESOURCE_TYPE_NAME,properties:props});try{jsiiDeprecationWarnings().aws_cdk_lib_aws_aps_CfnRuleGroupsNamespaceProps(props)}catch(error){throw process.env.JSII_DEBUG!=="1"&&error.name==="DeprecationError"&&Error.captureStackTrace(error,CfnRuleGroupsNamespace),error}cdk().requireProperty(props,"data",this),cdk().requireProperty(props,"name",this),cdk().requireProperty(props,"workspace",this),this.attrArn=cdk().Token.asString(this.getAtt("Arn",cdk().ResolutionTypeHint.STRING)),this.data=props.data,this.name=props.name,this.tags=new(cdk()).TagManager(cdk().TagType.STANDARD,"AWS::APS::RuleGroupsNamespace",props.tags,{tagPropertyName:"tags"}),this.tagsRaw=props.tags,this.workspace=props.workspace}get cfnProperties(){return{data:this.data,name:this.name,tags:this.tags.renderTags(),workspace:this.workspace}}inspect(inspector){try{jsiiDeprecationWarnings().aws_cdk_lib_TreeInspector(inspector)}catch(error){throw process.env.JSII_DEBUG!=="1"&&error.name==="DeprecationError"&&Error.captureStackTrace(error,this.inspect),error}inspector.addAttribute("aws:cdk:cloudformation:type",CfnRuleGroupsNamespace.CFN_RESOURCE_TYPE_NAME),inspector.addAttribute("aws:cdk:cloudformation:props",this.cfnProperties)}renderProperties(props){return convertCfnRuleGroupsNamespacePropsToCloudFormation(props)}}exports.CfnRuleGroupsNamespace=CfnRuleGroupsNamespace,_a=JSII_RTTI_SYMBOL_1,CfnRuleGroupsNamespace[_a]={fqn:"aws-cdk-lib.aws_aps.CfnRuleGroupsNamespace",version:"2.130.0"},CfnRuleGroupsNamespace.CFN_RESOURCE_TYPE_NAME="AWS::APS::RuleGroupsNamespace";function CfnRuleGroupsNamespacePropsValidator(properties){if(!cdk().canInspect(properties))return cdk().VALIDATION_SUCCESS;const errors=new(cdk()).ValidationResults;return properties&&typeof properties=="object"&&!Array.isArray(properties)||errors.collect(new(cdk()).ValidationResult("Expected an object, but received: "+JSON.stringify(properties))),errors.collect(cdk().propertyValidator("data",cdk().requiredValidator)(properties.data)),errors.collect(cdk().propertyValidator("data",cdk().validateString)(properties.data)),errors.collect(cdk().propertyValidator("name",cdk().requiredValidator)(properties.name)),errors.collect(cdk().propertyValidator("name",cdk().validateString)(properties.name)),errors.collect(cdk().propertyValidator("tags",cdk().listValidator(cdk().validateCfnTag))(properties.tags)),errors.collect(cdk().propertyValidator("workspace",cdk().requiredValidator)(properties.workspace)),errors.collect(cdk().propertyValidator("workspace",cdk().validateString)(properties.workspace)),errors.wrap('supplied properties not correct for "CfnRuleGroupsNamespaceProps"')}function convertCfnRuleGroupsNamespacePropsToCloudFormation(properties){return cdk().canInspect(properties)?(CfnRuleGroupsNamespacePropsValidator(properties).assertSuccess(),{Data:cdk().stringToCloudFormation(properties.data),Name:cdk().stringToCloudFormation(properties.name),Tags:cdk().listMapper(cdk().cfnTagToCloudFormation)(properties.tags),Workspace:cdk().stringToCloudFormation(properties.workspace)}):properties}function CfnRuleGroupsNamespacePropsFromCloudFormation(properties){if(cdk().isResolvableObject(properties))return new(cfn_parse()).FromCloudFormationResult(properties);if(properties=properties??{},!(properties&&typeof properties=="object"&&!Array.isArray(properties)))return new(cfn_parse()).FromCloudFormationResult(properties);const ret=new(cfn_parse()).FromCloudFormationPropertyObject;return ret.addPropertyResult("data","Data",properties.Data!=null?cfn_parse().FromCloudFormation.getString(properties.Data):void 0),ret.addPropertyResult("name","Name",properties.Name!=null?cfn_parse().FromCloudFormation.getString(properties.Name):void 0),ret.addPropertyResult("tags","Tags",properties.Tags!=null?cfn_parse().FromCloudFormation.getArray(cfn_parse().FromCloudFormation.getCfnTag)(properties.Tags):void 0),ret.addPropertyResult("workspace","Workspace",properties.Workspace!=null?cfn_parse().FromCloudFormation.getString(properties.Workspace):void 0),ret.addUnrecognizedPropertiesAsExtra(properties),ret}class CfnWorkspace extends cdk().CfnResource{static _fromCloudFormation(scope,id,resourceAttributes,options){resourceAttributes=resourceAttributes||{};const resourceProperties=options.parser.parseValue(resourceAttributes.Properties),propsResult=CfnWorkspacePropsFromCloudFormation(resourceProperties);if(cdk().isResolvableObject(propsResult.value))throw new Error("Unexpected IResolvable");const ret=new CfnWorkspace(scope,id,propsResult.value);for(const[propKey,propVal]of Object.entries(propsResult.extraProperties))ret.addPropertyOverride(propKey,propVal);return options.parser.handleAttributes(ret,resourceAttributes,id),ret}constructor(scope,id,props={}){super(scope,id,{type:CfnWorkspace.CFN_RESOURCE_TYPE_NAME,properties:props});try{jsiiDeprecationWarnings().aws_cdk_lib_aws_aps_CfnWorkspaceProps(props)}catch(error){throw process.env.JSII_DEBUG!=="1"&&error.name==="DeprecationError"&&Error.captureStackTrace(error,CfnWorkspace),error}this.attrArn=cdk().Token.asString(this.getAtt("Arn",cdk().ResolutionTypeHint.STRING)),this.attrPrometheusEndpoint=cdk().Token.asString(this.getAtt("PrometheusEndpoint",cdk().ResolutionTypeHint.STRING)),this.attrWorkspaceId=cdk().Token.asString(this.getAtt("WorkspaceId",cdk().ResolutionTypeHint.STRING)),this.alertManagerDefinition=props.alertManagerDefinition,this.alias=props.alias,this.kmsKeyArn=props.kmsKeyArn,this.loggingConfiguration=props.loggingConfiguration,this.tags=new(cdk()).TagManager(cdk().TagType.STANDARD,"AWS::APS::Workspace",props.tags,{tagPropertyName:"tags"}),this.tagsRaw=props.tags}get cfnProperties(){return{alertManagerDefinition:this.alertManagerDefinition,alias:this.alias,kmsKeyArn:this.kmsKeyArn,loggingConfiguration:this.loggingConfiguration,tags:this.tags.renderTags()}}inspect(inspector){try{jsiiDeprecationWarnings().aws_cdk_lib_TreeInspector(inspector)}catch(error){throw process.env.JSII_DEBUG!=="1"&&error.name==="DeprecationError"&&Error.captureStackTrace(error,this.inspect),error}inspector.addAttribute("aws:cdk:cloudformation:type",CfnWorkspace.CFN_RESOURCE_TYPE_NAME),inspector.addAttribute("aws:cdk:cloudformation:props",this.cfnProperties)}renderProperties(props){return convertCfnWorkspacePropsToCloudFormation(props)}}exports.CfnWorkspace=CfnWorkspace,_b=JSII_RTTI_SYMBOL_1,CfnWorkspace[_b]={fqn:"aws-cdk-lib.aws_aps.CfnWorkspace",version:"2.130.0"},CfnWorkspace.CFN_RESOURCE_TYPE_NAME="AWS::APS::Workspace";function CfnWorkspaceLoggingConfigurationPropertyValidator(properties){if(!cdk().canInspect(properties))return cdk().VALIDATION_SUCCESS;const errors=new(cdk()).ValidationResults;return properties&&typeof properties=="object"&&!Array.isArray(properties)||errors.collect(new(cdk()).ValidationResult("Expected an object, but received: "+JSON.stringify(properties))),errors.collect(cdk().propertyValidator("logGroupArn",cdk().validateString)(properties.logGroupArn)),errors.wrap('supplied properties not correct for "LoggingConfigurationProperty"')}function convertCfnWorkspaceLoggingConfigurationPropertyToCloudFormation(properties){return cdk().canInspect(properties)?(CfnWorkspaceLoggingConfigurationPropertyValidator(properties).assertSuccess(),{LogGroupArn:cdk().stringToCloudFormation(properties.logGroupArn)}):properties}function CfnWorkspaceLoggingConfigurationPropertyFromCloudFormation(properties){if(cdk().isResolvableObject(properties))return new(cfn_parse()).FromCloudFormationResult(properties);if(properties=properties??{},!(properties&&typeof properties=="object"&&!Array.isArray(properties)))return new(cfn_parse()).FromCloudFormationResult(properties);const ret=new(cfn_parse()).FromCloudFormationPropertyObject;return ret.addPropertyResult("logGroupArn","LogGroupArn",properties.LogGroupArn!=null?cfn_parse().FromCloudFormation.getString(properties.LogGroupArn):void 0),ret.addUnrecognizedPropertiesAsExtra(properties),ret}function CfnWorkspacePropsValidator(properties){if(!cdk().canInspect(properties))return cdk().VALIDATION_SUCCESS;const errors=new(cdk()).ValidationResults;return properties&&typeof properties=="object"&&!Array.isArray(properties)||errors.collect(new(cdk()).ValidationResult("Expected an object, but received: "+JSON.stringify(properties))),errors.collect(cdk().propertyValidator("alertManagerDefinition",cdk().validateString)(properties.alertManagerDefinition)),errors.collect(cdk().propertyValidator("alias",cdk().validateString)(properties.alias)),errors.collect(cdk().propertyValidator("kmsKeyArn",cdk().validateString)(properties.kmsKeyArn)),errors.collect(cdk().propertyValidator("loggingConfiguration",CfnWorkspaceLoggingConfigurationPropertyValidator)(properties.loggingConfiguration)),errors.collect(cdk().propertyValidator("tags",cdk().listValidator(cdk().validateCfnTag))(properties.tags)),errors.wrap('supplied properties not correct for "CfnWorkspaceProps"')}function convertCfnWorkspacePropsToCloudFormation(properties){return cdk().canInspect(properties)?(CfnWorkspacePropsValidator(properties).assertSuccess(),{AlertManagerDefinition:cdk().stringToCloudFormation(properties.alertManagerDefinition),Alias:cdk().stringToCloudFormation(properties.alias),KmsKeyArn:cdk().stringToCloudFormation(properties.kmsKeyArn),LoggingConfiguration:convertCfnWorkspaceLoggingConfigurationPropertyToCloudFormation(properties.loggingConfiguration),Tags:cdk().listMapper(cdk().cfnTagToCloudFormation)(properties.tags)}):properties}function CfnWorkspacePropsFromCloudFormation(properties){if(cdk().isResolvableObject(properties))return new(cfn_parse()).FromCloudFormationResult(properties);if(properties=properties??{},!(properties&&typeof properties=="object"&&!Array.isArray(properties)))return new(cfn_parse()).FromCloudFormationResult(properties);const ret=new(cfn_parse()).FromCloudFormationPropertyObject;return ret.addPropertyResult("alertManagerDefinition","AlertManagerDefinition",properties.AlertManagerDefinition!=null?cfn_parse().FromCloudFormation.getString(properties.AlertManagerDefinition):void 0),ret.addPropertyResult("alias","Alias",properties.Alias!=null?cfn_parse().FromCloudFormation.getString(properties.Alias):void 0),ret.addPropertyResult("kmsKeyArn","KmsKeyArn",properties.KmsKeyArn!=null?cfn_parse().FromCloudFormation.getString(properties.KmsKeyArn):void 0),ret.addPropertyResult("loggingConfiguration","LoggingConfiguration",properties.LoggingConfiguration!=null?CfnWorkspaceLoggingConfigurationPropertyFromCloudFormation(properties.LoggingConfiguration):void 0),ret.addPropertyResult("tags","Tags",properties.Tags!=null?cfn_parse().FromCloudFormation.getArray(cfn_parse().FromCloudFormation.getCfnTag)(properties.Tags):void 0),ret.addUnrecognizedPropertiesAsExtra(properties),ret}