UNPKG

aws-cdk-lib

Version:

Version 2 of the AWS Cloud Development Kit library

2 lines (1 loc) 18.2 kB
"use strict";var _a,_b,_c;Object.defineProperty(exports,"__esModule",{value:!0}),exports.CfnTrustAnchor=exports.CfnProfile=exports.CfnCRL=void 0;const jsiiDeprecationWarnings=require("../../.warnings.jsii.js"),JSII_RTTI_SYMBOL_1=Symbol.for("jsii.rtti"),cdk=require("../../core"),cfn_parse=require("../../core/lib/helpers-internal");function CfnCRLPropsValidator(properties){if(!cdk.canInspect(properties))return cdk.VALIDATION_SUCCESS;const errors=new cdk.ValidationResults;return typeof properties!="object"&&errors.collect(new cdk.ValidationResult("Expected an object, but received: "+JSON.stringify(properties))),errors.collect(cdk.propertyValidator("crlData",cdk.requiredValidator)(properties.crlData)),errors.collect(cdk.propertyValidator("crlData",cdk.validateString)(properties.crlData)),errors.collect(cdk.propertyValidator("enabled",cdk.validateBoolean)(properties.enabled)),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("trustAnchorArn",cdk.validateString)(properties.trustAnchorArn)),errors.wrap('supplied properties not correct for "CfnCRLProps"')}function cfnCRLPropsToCloudFormation(properties){return cdk.canInspect(properties)?(CfnCRLPropsValidator(properties).assertSuccess(),{CrlData:cdk.stringToCloudFormation(properties.crlData),Name:cdk.stringToCloudFormation(properties.name),Enabled:cdk.booleanToCloudFormation(properties.enabled),Tags:cdk.listMapper(cdk.cfnTagToCloudFormation)(properties.tags),TrustAnchorArn:cdk.stringToCloudFormation(properties.trustAnchorArn)}):properties}function CfnCRLPropsFromCloudFormation(properties){if(properties=properties??{},typeof properties!="object")return new cfn_parse.FromCloudFormationResult(properties);const ret=new cfn_parse.FromCloudFormationPropertyObject;return ret.addPropertyResult("crlData","CrlData",cfn_parse.FromCloudFormation.getString(properties.CrlData)),ret.addPropertyResult("name","Name",cfn_parse.FromCloudFormation.getString(properties.Name)),ret.addPropertyResult("enabled","Enabled",properties.Enabled!=null?cfn_parse.FromCloudFormation.getBoolean(properties.Enabled):void 0),ret.addPropertyResult("tags","Tags",properties.Tags!=null?cfn_parse.FromCloudFormation.getArray(cfn_parse.FromCloudFormation.getCfnTag)(properties.Tags):void 0),ret.addPropertyResult("trustAnchorArn","TrustAnchorArn",properties.TrustAnchorArn!=null?cfn_parse.FromCloudFormation.getString(properties.TrustAnchorArn):void 0),ret.addUnrecognizedPropertiesAsExtra(properties),ret}class CfnCRL extends cdk.CfnResource{constructor(scope,id,props){super(scope,id,{type:CfnCRL.CFN_RESOURCE_TYPE_NAME,properties:props});try{jsiiDeprecationWarnings.aws_cdk_lib_aws_rolesanywhere_CfnCRLProps(props)}catch(error){throw process.env.JSII_DEBUG!=="1"&&error.name==="DeprecationError"&&Error.captureStackTrace(error,CfnCRL),error}cdk.requireProperty(props,"crlData",this),cdk.requireProperty(props,"name",this),this.attrCrlId=cdk.Token.asString(this.getAtt("CrlId",cdk.ResolutionTypeHint.STRING)),this.crlData=props.crlData,this.name=props.name,this.enabled=props.enabled,this.tags=new cdk.TagManager(cdk.TagType.STANDARD,"AWS::RolesAnywhere::CRL",props.tags,{tagPropertyName:"tags"}),this.trustAnchorArn=props.trustAnchorArn}static _fromCloudFormation(scope,id,resourceAttributes,options){resourceAttributes=resourceAttributes||{};const resourceProperties=options.parser.parseValue(resourceAttributes.Properties),propsResult=CfnCRLPropsFromCloudFormation(resourceProperties),ret=new CfnCRL(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}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",CfnCRL.CFN_RESOURCE_TYPE_NAME),inspector.addAttribute("aws:cdk:cloudformation:props",this.cfnProperties)}get cfnProperties(){return{crlData:this.crlData,name:this.name,enabled:this.enabled,tags:this.tags.renderTags(),trustAnchorArn:this.trustAnchorArn}}renderProperties(props){return cfnCRLPropsToCloudFormation(props)}}exports.CfnCRL=CfnCRL,_a=JSII_RTTI_SYMBOL_1,CfnCRL[_a]={fqn:"aws-cdk-lib.aws_rolesanywhere.CfnCRL",version:"2.70.0"},CfnCRL.CFN_RESOURCE_TYPE_NAME="AWS::RolesAnywhere::CRL";function CfnProfilePropsValidator(properties){if(!cdk.canInspect(properties))return cdk.VALIDATION_SUCCESS;const errors=new cdk.ValidationResults;return typeof properties!="object"&&errors.collect(new cdk.ValidationResult("Expected an object, but received: "+JSON.stringify(properties))),errors.collect(cdk.propertyValidator("durationSeconds",cdk.validateNumber)(properties.durationSeconds)),errors.collect(cdk.propertyValidator("enabled",cdk.validateBoolean)(properties.enabled)),errors.collect(cdk.propertyValidator("managedPolicyArns",cdk.listValidator(cdk.validateString))(properties.managedPolicyArns)),errors.collect(cdk.propertyValidator("name",cdk.requiredValidator)(properties.name)),errors.collect(cdk.propertyValidator("name",cdk.validateString)(properties.name)),errors.collect(cdk.propertyValidator("requireInstanceProperties",cdk.validateBoolean)(properties.requireInstanceProperties)),errors.collect(cdk.propertyValidator("roleArns",cdk.requiredValidator)(properties.roleArns)),errors.collect(cdk.propertyValidator("roleArns",cdk.listValidator(cdk.validateString))(properties.roleArns)),errors.collect(cdk.propertyValidator("sessionPolicy",cdk.validateString)(properties.sessionPolicy)),errors.collect(cdk.propertyValidator("tags",cdk.listValidator(cdk.validateCfnTag))(properties.tags)),errors.wrap('supplied properties not correct for "CfnProfileProps"')}function cfnProfilePropsToCloudFormation(properties){return cdk.canInspect(properties)?(CfnProfilePropsValidator(properties).assertSuccess(),{Name:cdk.stringToCloudFormation(properties.name),RoleArns:cdk.listMapper(cdk.stringToCloudFormation)(properties.roleArns),DurationSeconds:cdk.numberToCloudFormation(properties.durationSeconds),Enabled:cdk.booleanToCloudFormation(properties.enabled),ManagedPolicyArns:cdk.listMapper(cdk.stringToCloudFormation)(properties.managedPolicyArns),RequireInstanceProperties:cdk.booleanToCloudFormation(properties.requireInstanceProperties),SessionPolicy:cdk.stringToCloudFormation(properties.sessionPolicy),Tags:cdk.listMapper(cdk.cfnTagToCloudFormation)(properties.tags)}):properties}function CfnProfilePropsFromCloudFormation(properties){if(properties=properties??{},typeof properties!="object")return new cfn_parse.FromCloudFormationResult(properties);const ret=new cfn_parse.FromCloudFormationPropertyObject;return ret.addPropertyResult("name","Name",cfn_parse.FromCloudFormation.getString(properties.Name)),ret.addPropertyResult("roleArns","RoleArns",cfn_parse.FromCloudFormation.getStringArray(properties.RoleArns)),ret.addPropertyResult("durationSeconds","DurationSeconds",properties.DurationSeconds!=null?cfn_parse.FromCloudFormation.getNumber(properties.DurationSeconds):void 0),ret.addPropertyResult("enabled","Enabled",properties.Enabled!=null?cfn_parse.FromCloudFormation.getBoolean(properties.Enabled):void 0),ret.addPropertyResult("managedPolicyArns","ManagedPolicyArns",properties.ManagedPolicyArns!=null?cfn_parse.FromCloudFormation.getStringArray(properties.ManagedPolicyArns):void 0),ret.addPropertyResult("requireInstanceProperties","RequireInstanceProperties",properties.RequireInstanceProperties!=null?cfn_parse.FromCloudFormation.getBoolean(properties.RequireInstanceProperties):void 0),ret.addPropertyResult("sessionPolicy","SessionPolicy",properties.SessionPolicy!=null?cfn_parse.FromCloudFormation.getString(properties.SessionPolicy):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}class CfnProfile extends cdk.CfnResource{constructor(scope,id,props){super(scope,id,{type:CfnProfile.CFN_RESOURCE_TYPE_NAME,properties:props});try{jsiiDeprecationWarnings.aws_cdk_lib_aws_rolesanywhere_CfnProfileProps(props)}catch(error){throw process.env.JSII_DEBUG!=="1"&&error.name==="DeprecationError"&&Error.captureStackTrace(error,CfnProfile),error}cdk.requireProperty(props,"name",this),cdk.requireProperty(props,"roleArns",this),this.attrProfileArn=cdk.Token.asString(this.getAtt("ProfileArn",cdk.ResolutionTypeHint.STRING)),this.attrProfileId=cdk.Token.asString(this.getAtt("ProfileId",cdk.ResolutionTypeHint.STRING)),this.name=props.name,this.roleArns=props.roleArns,this.durationSeconds=props.durationSeconds,this.enabled=props.enabled,this.managedPolicyArns=props.managedPolicyArns,this.requireInstanceProperties=props.requireInstanceProperties,this.sessionPolicy=props.sessionPolicy,this.tags=new cdk.TagManager(cdk.TagType.STANDARD,"AWS::RolesAnywhere::Profile",props.tags,{tagPropertyName:"tags"})}static _fromCloudFormation(scope,id,resourceAttributes,options){resourceAttributes=resourceAttributes||{};const resourceProperties=options.parser.parseValue(resourceAttributes.Properties),propsResult=CfnProfilePropsFromCloudFormation(resourceProperties),ret=new CfnProfile(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}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",CfnProfile.CFN_RESOURCE_TYPE_NAME),inspector.addAttribute("aws:cdk:cloudformation:props",this.cfnProperties)}get cfnProperties(){return{name:this.name,roleArns:this.roleArns,durationSeconds:this.durationSeconds,enabled:this.enabled,managedPolicyArns:this.managedPolicyArns,requireInstanceProperties:this.requireInstanceProperties,sessionPolicy:this.sessionPolicy,tags:this.tags.renderTags()}}renderProperties(props){return cfnProfilePropsToCloudFormation(props)}}exports.CfnProfile=CfnProfile,_b=JSII_RTTI_SYMBOL_1,CfnProfile[_b]={fqn:"aws-cdk-lib.aws_rolesanywhere.CfnProfile",version:"2.70.0"},CfnProfile.CFN_RESOURCE_TYPE_NAME="AWS::RolesAnywhere::Profile";function CfnTrustAnchorPropsValidator(properties){if(!cdk.canInspect(properties))return cdk.VALIDATION_SUCCESS;const errors=new cdk.ValidationResults;return typeof properties!="object"&&errors.collect(new cdk.ValidationResult("Expected an object, but received: "+JSON.stringify(properties))),errors.collect(cdk.propertyValidator("enabled",cdk.validateBoolean)(properties.enabled)),errors.collect(cdk.propertyValidator("name",cdk.requiredValidator)(properties.name)),errors.collect(cdk.propertyValidator("name",cdk.validateString)(properties.name)),errors.collect(cdk.propertyValidator("source",cdk.requiredValidator)(properties.source)),errors.collect(cdk.propertyValidator("source",CfnTrustAnchor_SourcePropertyValidator)(properties.source)),errors.collect(cdk.propertyValidator("tags",cdk.listValidator(cdk.validateCfnTag))(properties.tags)),errors.wrap('supplied properties not correct for "CfnTrustAnchorProps"')}function cfnTrustAnchorPropsToCloudFormation(properties){return cdk.canInspect(properties)?(CfnTrustAnchorPropsValidator(properties).assertSuccess(),{Name:cdk.stringToCloudFormation(properties.name),Source:cfnTrustAnchorSourcePropertyToCloudFormation(properties.source),Enabled:cdk.booleanToCloudFormation(properties.enabled),Tags:cdk.listMapper(cdk.cfnTagToCloudFormation)(properties.tags)}):properties}function CfnTrustAnchorPropsFromCloudFormation(properties){if(properties=properties??{},typeof properties!="object")return new cfn_parse.FromCloudFormationResult(properties);const ret=new cfn_parse.FromCloudFormationPropertyObject;return ret.addPropertyResult("name","Name",cfn_parse.FromCloudFormation.getString(properties.Name)),ret.addPropertyResult("source","Source",CfnTrustAnchorSourcePropertyFromCloudFormation(properties.Source)),ret.addPropertyResult("enabled","Enabled",properties.Enabled!=null?cfn_parse.FromCloudFormation.getBoolean(properties.Enabled):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}class CfnTrustAnchor extends cdk.CfnResource{constructor(scope,id,props){super(scope,id,{type:CfnTrustAnchor.CFN_RESOURCE_TYPE_NAME,properties:props});try{jsiiDeprecationWarnings.aws_cdk_lib_aws_rolesanywhere_CfnTrustAnchorProps(props)}catch(error){throw process.env.JSII_DEBUG!=="1"&&error.name==="DeprecationError"&&Error.captureStackTrace(error,CfnTrustAnchor),error}cdk.requireProperty(props,"name",this),cdk.requireProperty(props,"source",this),this.attrTrustAnchorArn=cdk.Token.asString(this.getAtt("TrustAnchorArn",cdk.ResolutionTypeHint.STRING)),this.attrTrustAnchorId=cdk.Token.asString(this.getAtt("TrustAnchorId",cdk.ResolutionTypeHint.STRING)),this.name=props.name,this.source=props.source,this.enabled=props.enabled,this.tags=new cdk.TagManager(cdk.TagType.STANDARD,"AWS::RolesAnywhere::TrustAnchor",props.tags,{tagPropertyName:"tags"})}static _fromCloudFormation(scope,id,resourceAttributes,options){resourceAttributes=resourceAttributes||{};const resourceProperties=options.parser.parseValue(resourceAttributes.Properties),propsResult=CfnTrustAnchorPropsFromCloudFormation(resourceProperties),ret=new CfnTrustAnchor(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}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",CfnTrustAnchor.CFN_RESOURCE_TYPE_NAME),inspector.addAttribute("aws:cdk:cloudformation:props",this.cfnProperties)}get cfnProperties(){return{name:this.name,source:this.source,enabled:this.enabled,tags:this.tags.renderTags()}}renderProperties(props){return cfnTrustAnchorPropsToCloudFormation(props)}}exports.CfnTrustAnchor=CfnTrustAnchor,_c=JSII_RTTI_SYMBOL_1,CfnTrustAnchor[_c]={fqn:"aws-cdk-lib.aws_rolesanywhere.CfnTrustAnchor",version:"2.70.0"},CfnTrustAnchor.CFN_RESOURCE_TYPE_NAME="AWS::RolesAnywhere::TrustAnchor";function CfnTrustAnchor_SourcePropertyValidator(properties){if(!cdk.canInspect(properties))return cdk.VALIDATION_SUCCESS;const errors=new cdk.ValidationResults;return typeof properties!="object"&&errors.collect(new cdk.ValidationResult("Expected an object, but received: "+JSON.stringify(properties))),errors.collect(cdk.propertyValidator("sourceData",CfnTrustAnchor_SourceDataPropertyValidator)(properties.sourceData)),errors.collect(cdk.propertyValidator("sourceType",cdk.validateString)(properties.sourceType)),errors.wrap('supplied properties not correct for "SourceProperty"')}function cfnTrustAnchorSourcePropertyToCloudFormation(properties){return cdk.canInspect(properties)?(CfnTrustAnchor_SourcePropertyValidator(properties).assertSuccess(),{SourceData:cfnTrustAnchorSourceDataPropertyToCloudFormation(properties.sourceData),SourceType:cdk.stringToCloudFormation(properties.sourceType)}):properties}function CfnTrustAnchorSourcePropertyFromCloudFormation(properties){if(cdk.isResolvableObject(properties))return new cfn_parse.FromCloudFormationResult(properties);if(properties=properties??{},typeof properties!="object")return new cfn_parse.FromCloudFormationResult(properties);const ret=new cfn_parse.FromCloudFormationPropertyObject;return ret.addPropertyResult("sourceData","SourceData",properties.SourceData!=null?CfnTrustAnchorSourceDataPropertyFromCloudFormation(properties.SourceData):void 0),ret.addPropertyResult("sourceType","SourceType",properties.SourceType!=null?cfn_parse.FromCloudFormation.getString(properties.SourceType):void 0),ret.addUnrecognizedPropertiesAsExtra(properties),ret}function CfnTrustAnchor_SourceDataPropertyValidator(properties){if(!cdk.canInspect(properties))return cdk.VALIDATION_SUCCESS;const errors=new cdk.ValidationResults;return typeof properties!="object"&&errors.collect(new cdk.ValidationResult("Expected an object, but received: "+JSON.stringify(properties))),errors.collect(cdk.propertyValidator("acmPcaArn",cdk.validateString)(properties.acmPcaArn)),errors.collect(cdk.propertyValidator("x509CertificateData",cdk.validateString)(properties.x509CertificateData)),errors.wrap('supplied properties not correct for "SourceDataProperty"')}function cfnTrustAnchorSourceDataPropertyToCloudFormation(properties){return cdk.canInspect(properties)?(CfnTrustAnchor_SourceDataPropertyValidator(properties).assertSuccess(),{AcmPcaArn:cdk.stringToCloudFormation(properties.acmPcaArn),X509CertificateData:cdk.stringToCloudFormation(properties.x509CertificateData)}):properties}function CfnTrustAnchorSourceDataPropertyFromCloudFormation(properties){if(cdk.isResolvableObject(properties))return new cfn_parse.FromCloudFormationResult(properties);if(properties=properties??{},typeof properties!="object")return new cfn_parse.FromCloudFormationResult(properties);const ret=new cfn_parse.FromCloudFormationPropertyObject;return ret.addPropertyResult("acmPcaArn","AcmPcaArn",properties.AcmPcaArn!=null?cfn_parse.FromCloudFormation.getString(properties.AcmPcaArn):void 0),ret.addPropertyResult("x509CertificateData","X509CertificateData",properties.X509CertificateData!=null?cfn_parse.FromCloudFormation.getString(properties.X509CertificateData):void 0),ret.addUnrecognizedPropertiesAsExtra(properties),ret}