aws-cdk-lib
Version:
Version 2 of the AWS Cloud Development Kit library
2 lines (1 loc) • 19.6 kB
JavaScript
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.CfnWorkflow=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/lib");return cdk=()=>tmp,tmp},cfn_parse=()=>{var tmp=require("../../core/lib/helpers-internal");return cfn_parse=()=>tmp,tmp},cdk_errors=()=>{var tmp=require("../../core/lib/errors");return cdk_errors=()=>tmp,tmp};class CfnWorkflow extends cdk().CfnResource{static[JSII_RTTI_SYMBOL_1]={fqn:"aws-cdk-lib.aws_mwaaserverless.CfnWorkflow",version:"2.252.0"};static CFN_RESOURCE_TYPE_NAME="AWS::MWAAServerless::Workflow";static _fromCloudFormation(scope,id,resourceAttributes,options){resourceAttributes=resourceAttributes||{};const resourceProperties=options.parser.parseValue(resourceAttributes.Properties),propsResult=CfnWorkflowPropsFromCloudFormation(resourceProperties);if(cdk().isResolvableObject(propsResult.value))throw new(cdk_errors()).ValidationError(cfn_parse().lit`UnexpectedIResolvable`,"Unexpected IResolvable",scope);const ret=new CfnWorkflow(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}static isCfnWorkflow(x){return cdk().CfnResource.isCfnResource(x)&&x.cfnResourceType===CfnWorkflow.CFN_RESOURCE_TYPE_NAME}static arnForWorkflow(resource){try{jsiiDeprecationWarnings().aws_cdk_lib_interfaces_aws_mwaaserverless_IWorkflowRef(resource)}catch(error){throw process.env.JSII_DEBUG!=="1"&&error.name==="DeprecationError"&&Error.captureStackTrace(error,this.arnForWorkflow),error}return resource.workflowRef.workflowArn}cdkTagManager;_definitionS3Location;_description;_encryptionConfiguration;_loggingConfiguration;_name;_networkConfiguration;_roleArn;_tags;_triggerMode;cfnPropertyNames={tags:"Tags",definitionS3Location:"DefinitionS3Location",description:"Description",encryptionConfiguration:"EncryptionConfiguration",loggingConfiguration:"LoggingConfiguration",name:"Name",networkConfiguration:"NetworkConfiguration",roleArn:"RoleArn",triggerMode:"TriggerMode"};constructor(scope,id,props){super(scope,id,{type:CfnWorkflow.CFN_RESOURCE_TYPE_NAME,properties:props});try{jsiiDeprecationWarnings().aws_cdk_lib_aws_mwaaserverless_CfnWorkflowProps(props)}catch(error){throw process.env.JSII_DEBUG!=="1"&&error.name==="DeprecationError"&&Error.captureStackTrace(error,CfnWorkflow),error}cdk().requireProperty(props,"definitionS3Location",this),cdk().requireProperty(props,"roleArn",this),this.cdkTagManager=new(cdk()).TagManager(cdk().TagType.MAP,"AWS::MWAAServerless::Workflow",void 0,{tagPropertyName:"tags"}),this._definitionS3Location=props.definitionS3Location,this._description=props.description,this._encryptionConfiguration=props.encryptionConfiguration,this._loggingConfiguration=props.loggingConfiguration,this._name=props.name,this._networkConfiguration=props.networkConfiguration,this._roleArn=props.roleArn,this._tags=props.tags,this._triggerMode=props.triggerMode}get workflowRef(){return{workflowArn:this.ref}}get definitionS3Location(){return this._definitionS3Location}set definitionS3Location(value){cdk().traceProperty(this.node,"DefinitionS3Location"),this._definitionS3Location=value}get description(){return this._description}set description(value){cdk().traceProperty(this.node,"Description"),this._description=value}get encryptionConfiguration(){return this._encryptionConfiguration}set encryptionConfiguration(value){cdk().traceProperty(this.node,"EncryptionConfiguration"),this._encryptionConfiguration=value}get loggingConfiguration(){return this._loggingConfiguration}set loggingConfiguration(value){cdk().traceProperty(this.node,"LoggingConfiguration"),this._loggingConfiguration=value}get name(){return this._name}set name(value){cdk().traceProperty(this.node,"Name"),this._name=value}get networkConfiguration(){return this._networkConfiguration}set networkConfiguration(value){cdk().traceProperty(this.node,"NetworkConfiguration"),this._networkConfiguration=value}get roleArn(){return this._roleArn}set roleArn(value){cdk().traceProperty(this.node,"RoleArn"),this._roleArn=value}get tags(){return this._tags}set tags(value){cdk().traceProperty(this.node,"Tags"),this._tags=value}get triggerMode(){return this._triggerMode}set triggerMode(value){cdk().traceProperty(this.node,"TriggerMode"),this._triggerMode=value}get attrCreatedAt(){return cdk().Token.asString(this.getAtt("CreatedAt",cdk().ResolutionTypeHint.STRING))}get attrModifiedAt(){return cdk().Token.asString(this.getAtt("ModifiedAt",cdk().ResolutionTypeHint.STRING))}get attrScheduleConfiguration(){return this.getAtt("ScheduleConfiguration")}get attrWorkflowArn(){return cdk().Token.asString(this.getAtt("WorkflowArn",cdk().ResolutionTypeHint.STRING))}get attrWorkflowStatus(){return cdk().Token.asString(this.getAtt("WorkflowStatus",cdk().ResolutionTypeHint.STRING))}get attrWorkflowVersion(){return cdk().Token.asString(this.getAtt("WorkflowVersion",cdk().ResolutionTypeHint.STRING))}get cfnProperties(){return{tags:this.cdkTagManager.renderTags(this._tags),definitionS3Location:this._definitionS3Location,description:this._description,encryptionConfiguration:this._encryptionConfiguration,loggingConfiguration:this._loggingConfiguration,name:this._name,networkConfiguration:this._networkConfiguration,roleArn:this._roleArn,triggerMode:this._triggerMode}}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",CfnWorkflow.CFN_RESOURCE_TYPE_NAME),inspector.addAttribute("aws:cdk:cloudformation:logicalId",this._synthesizeLogicalId()),inspector.addAttribute("aws:cdk:cloudformation:props",this.cfnProperties)}renderProperties(props){return convertCfnWorkflowPropsToCloudFormation(props)}}exports.CfnWorkflow=CfnWorkflow;function CfnWorkflowS3LocationPropertyValidator(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("bucket",cdk().requiredValidator)(properties.bucket)),errors.collect(cdk().propertyValidator("bucket",cdk().validateString)(properties.bucket)),errors.collect(cdk().propertyValidator("objectKey",cdk().requiredValidator)(properties.objectKey)),errors.collect(cdk().propertyValidator("objectKey",cdk().validateString)(properties.objectKey)),errors.collect(cdk().propertyValidator("versionId",cdk().validateString)(properties.versionId)),errors.wrap('supplied properties not correct for "S3LocationProperty"')}function convertCfnWorkflowS3LocationPropertyToCloudFormation(properties){return cdk().canInspect(properties)?(CfnWorkflowS3LocationPropertyValidator(properties).assertSuccess(),{Bucket:cdk().stringToCloudFormation(properties.bucket),ObjectKey:cdk().stringToCloudFormation(properties.objectKey),VersionId:cdk().stringToCloudFormation(properties.versionId)}):properties}function CfnWorkflowS3LocationPropertyFromCloudFormation(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("bucket","Bucket",properties.Bucket!=null?cfn_parse().FromCloudFormation.getString(properties.Bucket):void 0),ret.addPropertyResult("objectKey","ObjectKey",properties.ObjectKey!=null?cfn_parse().FromCloudFormation.getString(properties.ObjectKey):void 0),ret.addPropertyResult("versionId","VersionId",properties.VersionId!=null?cfn_parse().FromCloudFormation.getString(properties.VersionId):void 0),ret.addUnrecognizedPropertiesAsExtra(properties),ret}function CfnWorkflowEncryptionConfigurationPropertyValidator(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("kmsKeyId",cdk().validateString)(properties.kmsKeyId)),errors.collect(cdk().propertyValidator("type",cdk().requiredValidator)(properties.type)),errors.collect(cdk().propertyValidator("type",cdk().validateString)(properties.type)),errors.wrap('supplied properties not correct for "EncryptionConfigurationProperty"')}function convertCfnWorkflowEncryptionConfigurationPropertyToCloudFormation(properties){return cdk().canInspect(properties)?(CfnWorkflowEncryptionConfigurationPropertyValidator(properties).assertSuccess(),{KmsKeyId:cdk().stringToCloudFormation(properties.kmsKeyId),Type:cdk().stringToCloudFormation(properties.type)}):properties}function CfnWorkflowEncryptionConfigurationPropertyFromCloudFormation(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("kmsKeyId","KmsKeyId",properties.KmsKeyId!=null?cfn_parse().FromCloudFormation.getString(properties.KmsKeyId):void 0),ret.addPropertyResult("type","Type",properties.Type!=null?cfn_parse().FromCloudFormation.getString(properties.Type):void 0),ret.addUnrecognizedPropertiesAsExtra(properties),ret}function CfnWorkflowLoggingConfigurationPropertyValidator(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("logGroupName",cdk().requiredValidator)(properties.logGroupName)),errors.collect(cdk().propertyValidator("logGroupName",cdk().validateString)(properties.logGroupName)),errors.wrap('supplied properties not correct for "LoggingConfigurationProperty"')}function convertCfnWorkflowLoggingConfigurationPropertyToCloudFormation(properties){return cdk().canInspect(properties)?(CfnWorkflowLoggingConfigurationPropertyValidator(properties).assertSuccess(),{LogGroupName:cdk().stringToCloudFormation(properties.logGroupName)}):properties}function CfnWorkflowLoggingConfigurationPropertyFromCloudFormation(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("logGroupName","LogGroupName",properties.LogGroupName!=null?cfn_parse().FromCloudFormation.getString(properties.LogGroupName):void 0),ret.addUnrecognizedPropertiesAsExtra(properties),ret}function CfnWorkflowNetworkConfigurationPropertyValidator(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("securityGroupIds",cdk().listValidator(cdk().validateString))(properties.securityGroupIds)),errors.collect(cdk().propertyValidator("subnetIds",cdk().listValidator(cdk().validateString))(properties.subnetIds)),errors.wrap('supplied properties not correct for "NetworkConfigurationProperty"')}function convertCfnWorkflowNetworkConfigurationPropertyToCloudFormation(properties){return cdk().canInspect(properties)?(CfnWorkflowNetworkConfigurationPropertyValidator(properties).assertSuccess(),{SecurityGroupIds:cdk().listMapper(cdk().stringToCloudFormation)(properties.securityGroupIds),SubnetIds:cdk().listMapper(cdk().stringToCloudFormation)(properties.subnetIds)}):properties}function CfnWorkflowNetworkConfigurationPropertyFromCloudFormation(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("securityGroupIds","SecurityGroupIds",properties.SecurityGroupIds!=null?cfn_parse().FromCloudFormation.getArray(cfn_parse().FromCloudFormation.getString)(properties.SecurityGroupIds):void 0),ret.addPropertyResult("subnetIds","SubnetIds",properties.SubnetIds!=null?cfn_parse().FromCloudFormation.getArray(cfn_parse().FromCloudFormation.getString)(properties.SubnetIds):void 0),ret.addUnrecognizedPropertiesAsExtra(properties),ret}function CfnWorkflowScheduleConfigurationPropertyValidator(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("cronExpression",cdk().validateString)(properties.cronExpression)),errors.wrap('supplied properties not correct for "ScheduleConfigurationProperty"')}function convertCfnWorkflowScheduleConfigurationPropertyToCloudFormation(properties){return cdk().canInspect(properties)?(CfnWorkflowScheduleConfigurationPropertyValidator(properties).assertSuccess(),{CronExpression:cdk().stringToCloudFormation(properties.cronExpression)}):properties}function CfnWorkflowScheduleConfigurationPropertyFromCloudFormation(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("cronExpression","CronExpression",properties.CronExpression!=null?cfn_parse().FromCloudFormation.getString(properties.CronExpression):void 0),ret.addUnrecognizedPropertiesAsExtra(properties),ret}function CfnWorkflowPropsValidator(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("definitionS3Location",cdk().requiredValidator)(properties.definitionS3Location)),errors.collect(cdk().propertyValidator("definitionS3Location",CfnWorkflowS3LocationPropertyValidator)(properties.definitionS3Location)),errors.collect(cdk().propertyValidator("description",cdk().validateString)(properties.description)),errors.collect(cdk().propertyValidator("encryptionConfiguration",CfnWorkflowEncryptionConfigurationPropertyValidator)(properties.encryptionConfiguration)),errors.collect(cdk().propertyValidator("loggingConfiguration",CfnWorkflowLoggingConfigurationPropertyValidator)(properties.loggingConfiguration)),errors.collect(cdk().propertyValidator("name",cdk().validateString)(properties.name)),errors.collect(cdk().propertyValidator("networkConfiguration",CfnWorkflowNetworkConfigurationPropertyValidator)(properties.networkConfiguration)),errors.collect(cdk().propertyValidator("roleArn",cdk().requiredValidator)(properties.roleArn)),errors.collect(cdk().propertyValidator("roleArn",cdk().validateString)(properties.roleArn)),errors.collect(cdk().propertyValidator("tags",cdk().hashValidator(cdk().validateString))(properties.tags)),errors.collect(cdk().propertyValidator("triggerMode",cdk().validateString)(properties.triggerMode)),errors.wrap('supplied properties not correct for "CfnWorkflowProps"')}function convertCfnWorkflowPropsToCloudFormation(properties){return cdk().canInspect(properties)?(CfnWorkflowPropsValidator(properties).assertSuccess(),{DefinitionS3Location:convertCfnWorkflowS3LocationPropertyToCloudFormation(properties.definitionS3Location),Description:cdk().stringToCloudFormation(properties.description),EncryptionConfiguration:convertCfnWorkflowEncryptionConfigurationPropertyToCloudFormation(properties.encryptionConfiguration),LoggingConfiguration:convertCfnWorkflowLoggingConfigurationPropertyToCloudFormation(properties.loggingConfiguration),Name:cdk().stringToCloudFormation(properties.name),NetworkConfiguration:convertCfnWorkflowNetworkConfigurationPropertyToCloudFormation(properties.networkConfiguration),RoleArn:cdk().stringToCloudFormation(properties.roleArn),Tags:cdk().hashMapper(cdk().stringToCloudFormation)(properties.tags),TriggerMode:cdk().stringToCloudFormation(properties.triggerMode)}):properties}function CfnWorkflowPropsFromCloudFormation(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("definitionS3Location","DefinitionS3Location",properties.DefinitionS3Location!=null?CfnWorkflowS3LocationPropertyFromCloudFormation(properties.DefinitionS3Location):void 0),ret.addPropertyResult("description","Description",properties.Description!=null?cfn_parse().FromCloudFormation.getString(properties.Description):void 0),ret.addPropertyResult("encryptionConfiguration","EncryptionConfiguration",properties.EncryptionConfiguration!=null?CfnWorkflowEncryptionConfigurationPropertyFromCloudFormation(properties.EncryptionConfiguration):void 0),ret.addPropertyResult("loggingConfiguration","LoggingConfiguration",properties.LoggingConfiguration!=null?CfnWorkflowLoggingConfigurationPropertyFromCloudFormation(properties.LoggingConfiguration):void 0),ret.addPropertyResult("name","Name",properties.Name!=null?cfn_parse().FromCloudFormation.getString(properties.Name):void 0),ret.addPropertyResult("networkConfiguration","NetworkConfiguration",properties.NetworkConfiguration!=null?CfnWorkflowNetworkConfigurationPropertyFromCloudFormation(properties.NetworkConfiguration):void 0),ret.addPropertyResult("roleArn","RoleArn",properties.RoleArn!=null?cfn_parse().FromCloudFormation.getString(properties.RoleArn):void 0),ret.addPropertyResult("tags","Tags",properties.Tags!=null?cfn_parse().FromCloudFormation.getMap(cfn_parse().FromCloudFormation.getString)(properties.Tags):void 0),ret.addPropertyResult("triggerMode","TriggerMode",properties.TriggerMode!=null?cfn_parse().FromCloudFormation.getString(properties.TriggerMode):void 0),ret.addUnrecognizedPropertiesAsExtra(properties),ret}