UNPKG

@aws-cdk/aws-ssm

Version:

The CDK Construct Library for AWS::SSM

1,001 lines (1,000 loc) 478 kB
"use strict"; // Copyright 2012-2020 Amazon.com, Inc. or its affiliates. All Rights Reserved. // Generated from the AWS CloudFormation Resource Specification // See: docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/cfn-resource-specification.html // @cfn2ts:meta@ {"generated":"2020-10-29T17:11:08.632Z","fingerprint":"OYPsZIZrWO9e/Lt4X26//g9BWFrMB7Z4Q6NuE1Dbhlc="} Object.defineProperty(exports, "__esModule", { value: true }); exports.CfnResourceDataSync = exports.CfnPatchBaseline = exports.CfnParameter = exports.CfnMaintenanceWindowTask = exports.CfnMaintenanceWindowTarget = exports.CfnMaintenanceWindow = exports.CfnDocument = exports.CfnAssociation = void 0; /* eslint-disable max-len */ // This is generated code - line lengths are difficult to control const cdk = require("@aws-cdk/core"); const cfn_parse = require("@aws-cdk/core/lib/cfn-parse"); /** * Determine whether the given properties match those of a `CfnAssociationProps` * * @param properties - the TypeScript properties of a `CfnAssociationProps` * * @returns the result of the validation. */ function CfnAssociationPropsValidator(properties) { if (!cdk.canInspect(properties)) { return cdk.VALIDATION_SUCCESS; } const errors = new cdk.ValidationResults(); errors.collect(cdk.propertyValidator('applyOnlyAtCronInterval', cdk.validateBoolean)(properties.applyOnlyAtCronInterval)); errors.collect(cdk.propertyValidator('associationName', cdk.validateString)(properties.associationName)); errors.collect(cdk.propertyValidator('automationTargetParameterName', cdk.validateString)(properties.automationTargetParameterName)); errors.collect(cdk.propertyValidator('complianceSeverity', cdk.validateString)(properties.complianceSeverity)); errors.collect(cdk.propertyValidator('documentVersion', cdk.validateString)(properties.documentVersion)); errors.collect(cdk.propertyValidator('instanceId', cdk.validateString)(properties.instanceId)); errors.collect(cdk.propertyValidator('maxConcurrency', cdk.validateString)(properties.maxConcurrency)); errors.collect(cdk.propertyValidator('maxErrors', cdk.validateString)(properties.maxErrors)); errors.collect(cdk.propertyValidator('name', cdk.requiredValidator)(properties.name)); errors.collect(cdk.propertyValidator('name', cdk.validateString)(properties.name)); errors.collect(cdk.propertyValidator('outputLocation', CfnAssociation_InstanceAssociationOutputLocationPropertyValidator)(properties.outputLocation)); errors.collect(cdk.propertyValidator('parameters', cdk.hashValidator(cdk.listValidator(cdk.validateString)))(properties.parameters)); errors.collect(cdk.propertyValidator('scheduleExpression', cdk.validateString)(properties.scheduleExpression)); errors.collect(cdk.propertyValidator('syncCompliance', cdk.validateString)(properties.syncCompliance)); errors.collect(cdk.propertyValidator('targets', cdk.listValidator(CfnAssociation_TargetPropertyValidator))(properties.targets)); errors.collect(cdk.propertyValidator('waitForSuccessTimeoutSeconds', cdk.validateNumber)(properties.waitForSuccessTimeoutSeconds)); return errors.wrap('supplied properties not correct for "CfnAssociationProps"'); } /** * Renders the AWS CloudFormation properties of an `AWS::SSM::Association` resource * * @param properties - the TypeScript properties of a `CfnAssociationProps` * * @returns the AWS CloudFormation properties of an `AWS::SSM::Association` resource. */ // @ts-ignore TS6133 function cfnAssociationPropsToCloudFormation(properties) { if (!cdk.canInspect(properties)) { return properties; } CfnAssociationPropsValidator(properties).assertSuccess(); return { Name: cdk.stringToCloudFormation(properties.name), ApplyOnlyAtCronInterval: cdk.booleanToCloudFormation(properties.applyOnlyAtCronInterval), AssociationName: cdk.stringToCloudFormation(properties.associationName), AutomationTargetParameterName: cdk.stringToCloudFormation(properties.automationTargetParameterName), ComplianceSeverity: cdk.stringToCloudFormation(properties.complianceSeverity), DocumentVersion: cdk.stringToCloudFormation(properties.documentVersion), InstanceId: cdk.stringToCloudFormation(properties.instanceId), MaxConcurrency: cdk.stringToCloudFormation(properties.maxConcurrency), MaxErrors: cdk.stringToCloudFormation(properties.maxErrors), OutputLocation: cfnAssociationInstanceAssociationOutputLocationPropertyToCloudFormation(properties.outputLocation), Parameters: cdk.hashMapper(cdk.listMapper(cdk.stringToCloudFormation))(properties.parameters), ScheduleExpression: cdk.stringToCloudFormation(properties.scheduleExpression), SyncCompliance: cdk.stringToCloudFormation(properties.syncCompliance), Targets: cdk.listMapper(cfnAssociationTargetPropertyToCloudFormation)(properties.targets), WaitForSuccessTimeoutSeconds: cdk.numberToCloudFormation(properties.waitForSuccessTimeoutSeconds), }; } // @ts-ignore TS6133 function CfnAssociationPropsFromCloudFormation(properties) { properties = properties || {}; return { name: cfn_parse.FromCloudFormation.getString(properties.Name), applyOnlyAtCronInterval: properties.ApplyOnlyAtCronInterval != null ? cfn_parse.FromCloudFormation.getBoolean(properties.ApplyOnlyAtCronInterval) : undefined, associationName: properties.AssociationName != null ? cfn_parse.FromCloudFormation.getString(properties.AssociationName) : undefined, automationTargetParameterName: properties.AutomationTargetParameterName != null ? cfn_parse.FromCloudFormation.getString(properties.AutomationTargetParameterName) : undefined, complianceSeverity: properties.ComplianceSeverity != null ? cfn_parse.FromCloudFormation.getString(properties.ComplianceSeverity) : undefined, documentVersion: properties.DocumentVersion != null ? cfn_parse.FromCloudFormation.getString(properties.DocumentVersion) : undefined, instanceId: properties.InstanceId != null ? cfn_parse.FromCloudFormation.getString(properties.InstanceId) : undefined, maxConcurrency: properties.MaxConcurrency != null ? cfn_parse.FromCloudFormation.getString(properties.MaxConcurrency) : undefined, maxErrors: properties.MaxErrors != null ? cfn_parse.FromCloudFormation.getString(properties.MaxErrors) : undefined, outputLocation: properties.OutputLocation != null ? CfnAssociationInstanceAssociationOutputLocationPropertyFromCloudFormation(properties.OutputLocation) : undefined, parameters: properties.Parameters != null ? cfn_parse.FromCloudFormation.getMap(cfn_parse.FromCloudFormation.getArray(cfn_parse.FromCloudFormation.getString))(properties.Parameters) : undefined, scheduleExpression: properties.ScheduleExpression != null ? cfn_parse.FromCloudFormation.getString(properties.ScheduleExpression) : undefined, syncCompliance: properties.SyncCompliance != null ? cfn_parse.FromCloudFormation.getString(properties.SyncCompliance) : undefined, targets: properties.Targets != null ? cfn_parse.FromCloudFormation.getArray(CfnAssociationTargetPropertyFromCloudFormation)(properties.Targets) : undefined, waitForSuccessTimeoutSeconds: properties.WaitForSuccessTimeoutSeconds != null ? cfn_parse.FromCloudFormation.getNumber(properties.WaitForSuccessTimeoutSeconds) : undefined, }; } /** * A CloudFormation `AWS::SSM::Association`. * * @see http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-ssm-association.html * @external * @cloudformationResource AWS::SSM::Association */ class CfnAssociation extends cdk.CfnResource { /** * Create a new `AWS::SSM::Association`. * * @param scope - scope in which this resource is defined. * @param id - scoped id of the resource. * @param props - resource properties. * @external */ constructor(scope, id, props) { super(scope, id, { type: CfnAssociation.CFN_RESOURCE_TYPE_NAME, properties: props }); cdk.requireProperty(props, 'name', this); this.attrAssociationId = cdk.Token.asString(this.getAtt('AssociationId')); this.name = props.name; this.applyOnlyAtCronInterval = props.applyOnlyAtCronInterval; this.associationName = props.associationName; this.automationTargetParameterName = props.automationTargetParameterName; this.complianceSeverity = props.complianceSeverity; this.documentVersion = props.documentVersion; this.instanceId = props.instanceId; this.maxConcurrency = props.maxConcurrency; this.maxErrors = props.maxErrors; this.outputLocation = props.outputLocation; this.parameters = props.parameters; this.scheduleExpression = props.scheduleExpression; this.syncCompliance = props.syncCompliance; this.targets = props.targets; this.waitForSuccessTimeoutSeconds = props.waitForSuccessTimeoutSeconds; } /** * A factory method that creates a new instance of this class from an object * containing the CloudFormation properties of this resource. * Used in the @aws-cdk/cloudformation-include module. * * @internal */ static _fromCloudFormation(scope, id, resourceAttributes, options) { resourceAttributes = resourceAttributes || {}; const resourceProperties = options.parser.parseValue(resourceAttributes.Properties); const props = CfnAssociationPropsFromCloudFormation(resourceProperties); const ret = new CfnAssociation(scope, id, props); options.parser.handleAttributes(ret, resourceAttributes, id); return ret; } /** * (experimental) Examines the CloudFormation resource and discloses attributes. * * @param inspector - tree inspector to collect and process attributes. * @experimental */ inspect(inspector) { inspector.addAttribute("aws:cdk:cloudformation:type", CfnAssociation.CFN_RESOURCE_TYPE_NAME); inspector.addAttribute("aws:cdk:cloudformation:props", this.cfnProperties); } /** * @external */ get cfnProperties() { return { name: this.name, applyOnlyAtCronInterval: this.applyOnlyAtCronInterval, associationName: this.associationName, automationTargetParameterName: this.automationTargetParameterName, complianceSeverity: this.complianceSeverity, documentVersion: this.documentVersion, instanceId: this.instanceId, maxConcurrency: this.maxConcurrency, maxErrors: this.maxErrors, outputLocation: this.outputLocation, parameters: this.parameters, scheduleExpression: this.scheduleExpression, syncCompliance: this.syncCompliance, targets: this.targets, waitForSuccessTimeoutSeconds: this.waitForSuccessTimeoutSeconds, }; } /** * @external */ renderProperties(props) { return cfnAssociationPropsToCloudFormation(props); } } exports.CfnAssociation = CfnAssociation; /** * The CloudFormation resource type name for this resource class. * * @external */ CfnAssociation.CFN_RESOURCE_TYPE_NAME = "AWS::SSM::Association"; /** * Determine whether the given properties match those of a `InstanceAssociationOutputLocationProperty` * * @param properties - the TypeScript properties of a `InstanceAssociationOutputLocationProperty` * * @returns the result of the validation. */ function CfnAssociation_InstanceAssociationOutputLocationPropertyValidator(properties) { if (!cdk.canInspect(properties)) { return cdk.VALIDATION_SUCCESS; } const errors = new cdk.ValidationResults(); errors.collect(cdk.propertyValidator('s3Location', CfnAssociation_S3OutputLocationPropertyValidator)(properties.s3Location)); return errors.wrap('supplied properties not correct for "InstanceAssociationOutputLocationProperty"'); } /** * Renders the AWS CloudFormation properties of an `AWS::SSM::Association.InstanceAssociationOutputLocation` resource * * @param properties - the TypeScript properties of a `InstanceAssociationOutputLocationProperty` * * @returns the AWS CloudFormation properties of an `AWS::SSM::Association.InstanceAssociationOutputLocation` resource. */ // @ts-ignore TS6133 function cfnAssociationInstanceAssociationOutputLocationPropertyToCloudFormation(properties) { if (!cdk.canInspect(properties)) { return properties; } CfnAssociation_InstanceAssociationOutputLocationPropertyValidator(properties).assertSuccess(); return { S3Location: cfnAssociationS3OutputLocationPropertyToCloudFormation(properties.s3Location), }; } // @ts-ignore TS6133 function CfnAssociationInstanceAssociationOutputLocationPropertyFromCloudFormation(properties) { if (cdk.isResolvableObject(properties)) { return properties; } properties = properties || {}; return { s3Location: properties.S3Location != null ? CfnAssociationS3OutputLocationPropertyFromCloudFormation(properties.S3Location) : undefined, }; } /** * Determine whether the given properties match those of a `ParameterValuesProperty` * * @param properties - the TypeScript properties of a `ParameterValuesProperty` * * @returns the result of the validation. */ function CfnAssociation_ParameterValuesPropertyValidator(properties) { if (!cdk.canInspect(properties)) { return cdk.VALIDATION_SUCCESS; } const errors = new cdk.ValidationResults(); errors.collect(cdk.propertyValidator('parameterValues', cdk.listValidator(cdk.validateString))(properties.parameterValues)); return errors.wrap('supplied properties not correct for "ParameterValuesProperty"'); } /** * Renders the AWS CloudFormation properties of an `AWS::SSM::Association.ParameterValues` resource * * @param properties - the TypeScript properties of a `ParameterValuesProperty` * * @returns the AWS CloudFormation properties of an `AWS::SSM::Association.ParameterValues` resource. */ // @ts-ignore TS6133 function cfnAssociationParameterValuesPropertyToCloudFormation(properties) { if (!cdk.canInspect(properties)) { return properties; } CfnAssociation_ParameterValuesPropertyValidator(properties).assertSuccess(); return { ParameterValues: cdk.listMapper(cdk.stringToCloudFormation)(properties.parameterValues), }; } // @ts-ignore TS6133 function CfnAssociationParameterValuesPropertyFromCloudFormation(properties) { if (cdk.isResolvableObject(properties)) { return properties; } properties = properties || {}; return { parameterValues: properties.ParameterValues != null ? cfn_parse.FromCloudFormation.getStringArray(properties.ParameterValues) : undefined, }; } /** * Determine whether the given properties match those of a `S3OutputLocationProperty` * * @param properties - the TypeScript properties of a `S3OutputLocationProperty` * * @returns the result of the validation. */ function CfnAssociation_S3OutputLocationPropertyValidator(properties) { if (!cdk.canInspect(properties)) { return cdk.VALIDATION_SUCCESS; } const errors = new cdk.ValidationResults(); errors.collect(cdk.propertyValidator('outputS3BucketName', cdk.validateString)(properties.outputS3BucketName)); errors.collect(cdk.propertyValidator('outputS3KeyPrefix', cdk.validateString)(properties.outputS3KeyPrefix)); errors.collect(cdk.propertyValidator('outputS3Region', cdk.validateString)(properties.outputS3Region)); return errors.wrap('supplied properties not correct for "S3OutputLocationProperty"'); } /** * Renders the AWS CloudFormation properties of an `AWS::SSM::Association.S3OutputLocation` resource * * @param properties - the TypeScript properties of a `S3OutputLocationProperty` * * @returns the AWS CloudFormation properties of an `AWS::SSM::Association.S3OutputLocation` resource. */ // @ts-ignore TS6133 function cfnAssociationS3OutputLocationPropertyToCloudFormation(properties) { if (!cdk.canInspect(properties)) { return properties; } CfnAssociation_S3OutputLocationPropertyValidator(properties).assertSuccess(); return { OutputS3BucketName: cdk.stringToCloudFormation(properties.outputS3BucketName), OutputS3KeyPrefix: cdk.stringToCloudFormation(properties.outputS3KeyPrefix), OutputS3Region: cdk.stringToCloudFormation(properties.outputS3Region), }; } // @ts-ignore TS6133 function CfnAssociationS3OutputLocationPropertyFromCloudFormation(properties) { if (cdk.isResolvableObject(properties)) { return properties; } properties = properties || {}; return { outputS3BucketName: properties.OutputS3BucketName != null ? cfn_parse.FromCloudFormation.getString(properties.OutputS3BucketName) : undefined, outputS3KeyPrefix: properties.OutputS3KeyPrefix != null ? cfn_parse.FromCloudFormation.getString(properties.OutputS3KeyPrefix) : undefined, outputS3Region: properties.OutputS3Region != null ? cfn_parse.FromCloudFormation.getString(properties.OutputS3Region) : undefined, }; } /** * Determine whether the given properties match those of a `TargetProperty` * * @param properties - the TypeScript properties of a `TargetProperty` * * @returns the result of the validation. */ function CfnAssociation_TargetPropertyValidator(properties) { if (!cdk.canInspect(properties)) { return cdk.VALIDATION_SUCCESS; } const errors = new cdk.ValidationResults(); errors.collect(cdk.propertyValidator('key', cdk.requiredValidator)(properties.key)); errors.collect(cdk.propertyValidator('key', cdk.validateString)(properties.key)); errors.collect(cdk.propertyValidator('values', cdk.requiredValidator)(properties.values)); errors.collect(cdk.propertyValidator('values', cdk.listValidator(cdk.validateString))(properties.values)); return errors.wrap('supplied properties not correct for "TargetProperty"'); } /** * Renders the AWS CloudFormation properties of an `AWS::SSM::Association.Target` resource * * @param properties - the TypeScript properties of a `TargetProperty` * * @returns the AWS CloudFormation properties of an `AWS::SSM::Association.Target` resource. */ // @ts-ignore TS6133 function cfnAssociationTargetPropertyToCloudFormation(properties) { if (!cdk.canInspect(properties)) { return properties; } CfnAssociation_TargetPropertyValidator(properties).assertSuccess(); return { Key: cdk.stringToCloudFormation(properties.key), Values: cdk.listMapper(cdk.stringToCloudFormation)(properties.values), }; } // @ts-ignore TS6133 function CfnAssociationTargetPropertyFromCloudFormation(properties) { if (cdk.isResolvableObject(properties)) { return properties; } properties = properties || {}; return { key: cfn_parse.FromCloudFormation.getString(properties.Key), values: cfn_parse.FromCloudFormation.getStringArray(properties.Values), }; } /** * Determine whether the given properties match those of a `CfnDocumentProps` * * @param properties - the TypeScript properties of a `CfnDocumentProps` * * @returns the result of the validation. */ function CfnDocumentPropsValidator(properties) { if (!cdk.canInspect(properties)) { return cdk.VALIDATION_SUCCESS; } const errors = new cdk.ValidationResults(); errors.collect(cdk.propertyValidator('content', cdk.requiredValidator)(properties.content)); errors.collect(cdk.propertyValidator('content', cdk.validateObject)(properties.content)); errors.collect(cdk.propertyValidator('documentType', cdk.validateString)(properties.documentType)); errors.collect(cdk.propertyValidator('name', cdk.validateString)(properties.name)); errors.collect(cdk.propertyValidator('tags', cdk.listValidator(cdk.validateCfnTag))(properties.tags)); return errors.wrap('supplied properties not correct for "CfnDocumentProps"'); } /** * Renders the AWS CloudFormation properties of an `AWS::SSM::Document` resource * * @param properties - the TypeScript properties of a `CfnDocumentProps` * * @returns the AWS CloudFormation properties of an `AWS::SSM::Document` resource. */ // @ts-ignore TS6133 function cfnDocumentPropsToCloudFormation(properties) { if (!cdk.canInspect(properties)) { return properties; } CfnDocumentPropsValidator(properties).assertSuccess(); return { Content: cdk.objectToCloudFormation(properties.content), DocumentType: cdk.stringToCloudFormation(properties.documentType), Name: cdk.stringToCloudFormation(properties.name), Tags: cdk.listMapper(cdk.cfnTagToCloudFormation)(properties.tags), }; } // @ts-ignore TS6133 function CfnDocumentPropsFromCloudFormation(properties) { properties = properties || {}; return { content: cfn_parse.FromCloudFormation.getAny(properties.Content), documentType: properties.DocumentType != null ? cfn_parse.FromCloudFormation.getString(properties.DocumentType) : undefined, name: properties.Name != null ? cfn_parse.FromCloudFormation.getString(properties.Name) : undefined, tags: properties.Tags != null ? cfn_parse.FromCloudFormation.getArray(cfn_parse.FromCloudFormation.getCfnTag)(properties.Tags) : undefined, }; } /** * A CloudFormation `AWS::SSM::Document`. * * @see http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-ssm-document.html * @external * @cloudformationResource AWS::SSM::Document */ class CfnDocument extends cdk.CfnResource { /** * Create a new `AWS::SSM::Document`. * * @param scope - scope in which this resource is defined. * @param id - scoped id of the resource. * @param props - resource properties. * @external */ constructor(scope, id, props) { super(scope, id, { type: CfnDocument.CFN_RESOURCE_TYPE_NAME, properties: props }); cdk.requireProperty(props, 'content', this); this.content = props.content; this.documentType = props.documentType; this.name = props.name; this.tags = new cdk.TagManager(cdk.TagType.STANDARD, "AWS::SSM::Document", props.tags, { tagPropertyName: 'tags' }); } /** * A factory method that creates a new instance of this class from an object * containing the CloudFormation properties of this resource. * Used in the @aws-cdk/cloudformation-include module. * * @internal */ static _fromCloudFormation(scope, id, resourceAttributes, options) { resourceAttributes = resourceAttributes || {}; const resourceProperties = options.parser.parseValue(resourceAttributes.Properties); const props = CfnDocumentPropsFromCloudFormation(resourceProperties); const ret = new CfnDocument(scope, id, props); options.parser.handleAttributes(ret, resourceAttributes, id); return ret; } /** * (experimental) Examines the CloudFormation resource and discloses attributes. * * @param inspector - tree inspector to collect and process attributes. * @experimental */ inspect(inspector) { inspector.addAttribute("aws:cdk:cloudformation:type", CfnDocument.CFN_RESOURCE_TYPE_NAME); inspector.addAttribute("aws:cdk:cloudformation:props", this.cfnProperties); } /** * @external */ get cfnProperties() { return { content: this.content, documentType: this.documentType, name: this.name, tags: this.tags.renderTags(), }; } /** * @external */ renderProperties(props) { return cfnDocumentPropsToCloudFormation(props); } } exports.CfnDocument = CfnDocument; /** * The CloudFormation resource type name for this resource class. * * @external */ CfnDocument.CFN_RESOURCE_TYPE_NAME = "AWS::SSM::Document"; /** * Determine whether the given properties match those of a `CfnMaintenanceWindowProps` * * @param properties - the TypeScript properties of a `CfnMaintenanceWindowProps` * * @returns the result of the validation. */ function CfnMaintenanceWindowPropsValidator(properties) { if (!cdk.canInspect(properties)) { return cdk.VALIDATION_SUCCESS; } const errors = new cdk.ValidationResults(); errors.collect(cdk.propertyValidator('allowUnassociatedTargets', cdk.requiredValidator)(properties.allowUnassociatedTargets)); errors.collect(cdk.propertyValidator('allowUnassociatedTargets', cdk.validateBoolean)(properties.allowUnassociatedTargets)); errors.collect(cdk.propertyValidator('cutoff', cdk.requiredValidator)(properties.cutoff)); errors.collect(cdk.propertyValidator('cutoff', cdk.validateNumber)(properties.cutoff)); errors.collect(cdk.propertyValidator('description', cdk.validateString)(properties.description)); errors.collect(cdk.propertyValidator('duration', cdk.requiredValidator)(properties.duration)); errors.collect(cdk.propertyValidator('duration', cdk.validateNumber)(properties.duration)); errors.collect(cdk.propertyValidator('endDate', cdk.validateString)(properties.endDate)); errors.collect(cdk.propertyValidator('name', cdk.requiredValidator)(properties.name)); errors.collect(cdk.propertyValidator('name', cdk.validateString)(properties.name)); errors.collect(cdk.propertyValidator('schedule', cdk.requiredValidator)(properties.schedule)); errors.collect(cdk.propertyValidator('schedule', cdk.validateString)(properties.schedule)); errors.collect(cdk.propertyValidator('scheduleOffset', cdk.validateNumber)(properties.scheduleOffset)); errors.collect(cdk.propertyValidator('scheduleTimezone', cdk.validateString)(properties.scheduleTimezone)); errors.collect(cdk.propertyValidator('startDate', cdk.validateString)(properties.startDate)); errors.collect(cdk.propertyValidator('tags', cdk.listValidator(cdk.validateCfnTag))(properties.tags)); return errors.wrap('supplied properties not correct for "CfnMaintenanceWindowProps"'); } /** * Renders the AWS CloudFormation properties of an `AWS::SSM::MaintenanceWindow` resource * * @param properties - the TypeScript properties of a `CfnMaintenanceWindowProps` * * @returns the AWS CloudFormation properties of an `AWS::SSM::MaintenanceWindow` resource. */ // @ts-ignore TS6133 function cfnMaintenanceWindowPropsToCloudFormation(properties) { if (!cdk.canInspect(properties)) { return properties; } CfnMaintenanceWindowPropsValidator(properties).assertSuccess(); return { AllowUnassociatedTargets: cdk.booleanToCloudFormation(properties.allowUnassociatedTargets), Cutoff: cdk.numberToCloudFormation(properties.cutoff), Duration: cdk.numberToCloudFormation(properties.duration), Name: cdk.stringToCloudFormation(properties.name), Schedule: cdk.stringToCloudFormation(properties.schedule), Description: cdk.stringToCloudFormation(properties.description), EndDate: cdk.stringToCloudFormation(properties.endDate), ScheduleOffset: cdk.numberToCloudFormation(properties.scheduleOffset), ScheduleTimezone: cdk.stringToCloudFormation(properties.scheduleTimezone), StartDate: cdk.stringToCloudFormation(properties.startDate), Tags: cdk.listMapper(cdk.cfnTagToCloudFormation)(properties.tags), }; } // @ts-ignore TS6133 function CfnMaintenanceWindowPropsFromCloudFormation(properties) { properties = properties || {}; return { allowUnassociatedTargets: cfn_parse.FromCloudFormation.getBoolean(properties.AllowUnassociatedTargets), cutoff: cfn_parse.FromCloudFormation.getNumber(properties.Cutoff), duration: cfn_parse.FromCloudFormation.getNumber(properties.Duration), name: cfn_parse.FromCloudFormation.getString(properties.Name), schedule: cfn_parse.FromCloudFormation.getString(properties.Schedule), description: properties.Description != null ? cfn_parse.FromCloudFormation.getString(properties.Description) : undefined, endDate: properties.EndDate != null ? cfn_parse.FromCloudFormation.getString(properties.EndDate) : undefined, scheduleOffset: properties.ScheduleOffset != null ? cfn_parse.FromCloudFormation.getNumber(properties.ScheduleOffset) : undefined, scheduleTimezone: properties.ScheduleTimezone != null ? cfn_parse.FromCloudFormation.getString(properties.ScheduleTimezone) : undefined, startDate: properties.StartDate != null ? cfn_parse.FromCloudFormation.getString(properties.StartDate) : undefined, tags: properties.Tags != null ? cfn_parse.FromCloudFormation.getArray(cfn_parse.FromCloudFormation.getCfnTag)(properties.Tags) : undefined, }; } /** * A CloudFormation `AWS::SSM::MaintenanceWindow`. * * @see http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-ssm-maintenancewindow.html * @external * @cloudformationResource AWS::SSM::MaintenanceWindow */ class CfnMaintenanceWindow extends cdk.CfnResource { /** * Create a new `AWS::SSM::MaintenanceWindow`. * * @param scope - scope in which this resource is defined. * @param id - scoped id of the resource. * @param props - resource properties. * @external */ constructor(scope, id, props) { super(scope, id, { type: CfnMaintenanceWindow.CFN_RESOURCE_TYPE_NAME, properties: props }); cdk.requireProperty(props, 'allowUnassociatedTargets', this); cdk.requireProperty(props, 'cutoff', this); cdk.requireProperty(props, 'duration', this); cdk.requireProperty(props, 'name', this); cdk.requireProperty(props, 'schedule', this); this.allowUnassociatedTargets = props.allowUnassociatedTargets; this.cutoff = props.cutoff; this.duration = props.duration; this.name = props.name; this.schedule = props.schedule; this.description = props.description; this.endDate = props.endDate; this.scheduleOffset = props.scheduleOffset; this.scheduleTimezone = props.scheduleTimezone; this.startDate = props.startDate; this.tags = new cdk.TagManager(cdk.TagType.STANDARD, "AWS::SSM::MaintenanceWindow", props.tags, { tagPropertyName: 'tags' }); } /** * A factory method that creates a new instance of this class from an object * containing the CloudFormation properties of this resource. * Used in the @aws-cdk/cloudformation-include module. * * @internal */ static _fromCloudFormation(scope, id, resourceAttributes, options) { resourceAttributes = resourceAttributes || {}; const resourceProperties = options.parser.parseValue(resourceAttributes.Properties); const props = CfnMaintenanceWindowPropsFromCloudFormation(resourceProperties); const ret = new CfnMaintenanceWindow(scope, id, props); options.parser.handleAttributes(ret, resourceAttributes, id); return ret; } /** * (experimental) Examines the CloudFormation resource and discloses attributes. * * @param inspector - tree inspector to collect and process attributes. * @experimental */ inspect(inspector) { inspector.addAttribute("aws:cdk:cloudformation:type", CfnMaintenanceWindow.CFN_RESOURCE_TYPE_NAME); inspector.addAttribute("aws:cdk:cloudformation:props", this.cfnProperties); } /** * @external */ get cfnProperties() { return { allowUnassociatedTargets: this.allowUnassociatedTargets, cutoff: this.cutoff, duration: this.duration, name: this.name, schedule: this.schedule, description: this.description, endDate: this.endDate, scheduleOffset: this.scheduleOffset, scheduleTimezone: this.scheduleTimezone, startDate: this.startDate, tags: this.tags.renderTags(), }; } /** * @external */ renderProperties(props) { return cfnMaintenanceWindowPropsToCloudFormation(props); } } exports.CfnMaintenanceWindow = CfnMaintenanceWindow; /** * The CloudFormation resource type name for this resource class. * * @external */ CfnMaintenanceWindow.CFN_RESOURCE_TYPE_NAME = "AWS::SSM::MaintenanceWindow"; /** * Determine whether the given properties match those of a `CfnMaintenanceWindowTargetProps` * * @param properties - the TypeScript properties of a `CfnMaintenanceWindowTargetProps` * * @returns the result of the validation. */ function CfnMaintenanceWindowTargetPropsValidator(properties) { if (!cdk.canInspect(properties)) { return cdk.VALIDATION_SUCCESS; } const errors = new cdk.ValidationResults(); errors.collect(cdk.propertyValidator('description', cdk.validateString)(properties.description)); errors.collect(cdk.propertyValidator('name', cdk.validateString)(properties.name)); errors.collect(cdk.propertyValidator('ownerInformation', cdk.validateString)(properties.ownerInformation)); errors.collect(cdk.propertyValidator('resourceType', cdk.requiredValidator)(properties.resourceType)); errors.collect(cdk.propertyValidator('resourceType', cdk.validateString)(properties.resourceType)); errors.collect(cdk.propertyValidator('targets', cdk.requiredValidator)(properties.targets)); errors.collect(cdk.propertyValidator('targets', cdk.listValidator(CfnMaintenanceWindowTarget_TargetsPropertyValidator))(properties.targets)); errors.collect(cdk.propertyValidator('windowId', cdk.requiredValidator)(properties.windowId)); errors.collect(cdk.propertyValidator('windowId', cdk.validateString)(properties.windowId)); return errors.wrap('supplied properties not correct for "CfnMaintenanceWindowTargetProps"'); } /** * Renders the AWS CloudFormation properties of an `AWS::SSM::MaintenanceWindowTarget` resource * * @param properties - the TypeScript properties of a `CfnMaintenanceWindowTargetProps` * * @returns the AWS CloudFormation properties of an `AWS::SSM::MaintenanceWindowTarget` resource. */ // @ts-ignore TS6133 function cfnMaintenanceWindowTargetPropsToCloudFormation(properties) { if (!cdk.canInspect(properties)) { return properties; } CfnMaintenanceWindowTargetPropsValidator(properties).assertSuccess(); return { ResourceType: cdk.stringToCloudFormation(properties.resourceType), Targets: cdk.listMapper(cfnMaintenanceWindowTargetTargetsPropertyToCloudFormation)(properties.targets), WindowId: cdk.stringToCloudFormation(properties.windowId), Description: cdk.stringToCloudFormation(properties.description), Name: cdk.stringToCloudFormation(properties.name), OwnerInformation: cdk.stringToCloudFormation(properties.ownerInformation), }; } // @ts-ignore TS6133 function CfnMaintenanceWindowTargetPropsFromCloudFormation(properties) { properties = properties || {}; return { resourceType: cfn_parse.FromCloudFormation.getString(properties.ResourceType), targets: cfn_parse.FromCloudFormation.getArray(CfnMaintenanceWindowTargetTargetsPropertyFromCloudFormation)(properties.Targets), windowId: cfn_parse.FromCloudFormation.getString(properties.WindowId), description: properties.Description != null ? cfn_parse.FromCloudFormation.getString(properties.Description) : undefined, name: properties.Name != null ? cfn_parse.FromCloudFormation.getString(properties.Name) : undefined, ownerInformation: properties.OwnerInformation != null ? cfn_parse.FromCloudFormation.getString(properties.OwnerInformation) : undefined, }; } /** * A CloudFormation `AWS::SSM::MaintenanceWindowTarget`. * * @see http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-ssm-maintenancewindowtarget.html * @external * @cloudformationResource AWS::SSM::MaintenanceWindowTarget */ class CfnMaintenanceWindowTarget extends cdk.CfnResource { /** * Create a new `AWS::SSM::MaintenanceWindowTarget`. * * @param scope - scope in which this resource is defined. * @param id - scoped id of the resource. * @param props - resource properties. * @external */ constructor(scope, id, props) { super(scope, id, { type: CfnMaintenanceWindowTarget.CFN_RESOURCE_TYPE_NAME, properties: props }); cdk.requireProperty(props, 'resourceType', this); cdk.requireProperty(props, 'targets', this); cdk.requireProperty(props, 'windowId', this); this.resourceType = props.resourceType; this.targets = props.targets; this.windowId = props.windowId; this.description = props.description; this.name = props.name; this.ownerInformation = props.ownerInformation; } /** * A factory method that creates a new instance of this class from an object * containing the CloudFormation properties of this resource. * Used in the @aws-cdk/cloudformation-include module. * * @internal */ static _fromCloudFormation(scope, id, resourceAttributes, options) { resourceAttributes = resourceAttributes || {}; const resourceProperties = options.parser.parseValue(resourceAttributes.Properties); const props = CfnMaintenanceWindowTargetPropsFromCloudFormation(resourceProperties); const ret = new CfnMaintenanceWindowTarget(scope, id, props); options.parser.handleAttributes(ret, resourceAttributes, id); return ret; } /** * (experimental) Examines the CloudFormation resource and discloses attributes. * * @param inspector - tree inspector to collect and process attributes. * @experimental */ inspect(inspector) { inspector.addAttribute("aws:cdk:cloudformation:type", CfnMaintenanceWindowTarget.CFN_RESOURCE_TYPE_NAME); inspector.addAttribute("aws:cdk:cloudformation:props", this.cfnProperties); } /** * @external */ get cfnProperties() { return { resourceType: this.resourceType, targets: this.targets, windowId: this.windowId, description: this.description, name: this.name, ownerInformation: this.ownerInformation, }; } /** * @external */ renderProperties(props) { return cfnMaintenanceWindowTargetPropsToCloudFormation(props); } } exports.CfnMaintenanceWindowTarget = CfnMaintenanceWindowTarget; /** * The CloudFormation resource type name for this resource class. * * @external */ CfnMaintenanceWindowTarget.CFN_RESOURCE_TYPE_NAME = "AWS::SSM::MaintenanceWindowTarget"; /** * Determine whether the given properties match those of a `TargetsProperty` * * @param properties - the TypeScript properties of a `TargetsProperty` * * @returns the result of the validation. */ function CfnMaintenanceWindowTarget_TargetsPropertyValidator(properties) { if (!cdk.canInspect(properties)) { return cdk.VALIDATION_SUCCESS; } const errors = new cdk.ValidationResults(); errors.collect(cdk.propertyValidator('key', cdk.requiredValidator)(properties.key)); errors.collect(cdk.propertyValidator('key', cdk.validateString)(properties.key)); errors.collect(cdk.propertyValidator('values', cdk.listValidator(cdk.validateString))(properties.values)); return errors.wrap('supplied properties not correct for "TargetsProperty"'); } /** * Renders the AWS CloudFormation properties of an `AWS::SSM::MaintenanceWindowTarget.Targets` resource * * @param properties - the TypeScript properties of a `TargetsProperty` * * @returns the AWS CloudFormation properties of an `AWS::SSM::MaintenanceWindowTarget.Targets` resource. */ // @ts-ignore TS6133 function cfnMaintenanceWindowTargetTargetsPropertyToCloudFormation(properties) { if (!cdk.canInspect(properties)) { return properties; } CfnMaintenanceWindowTarget_TargetsPropertyValidator(properties).assertSuccess(); return { Key: cdk.stringToCloudFormation(properties.key), Values: cdk.listMapper(cdk.stringToCloudFormation)(properties.values), }; } // @ts-ignore TS6133 function CfnMaintenanceWindowTargetTargetsPropertyFromCloudFormation(properties) { if (cdk.isResolvableObject(properties)) { return properties; } properties = properties || {}; return { key: cfn_parse.FromCloudFormation.getString(properties.Key), values: properties.Values != null ? cfn_parse.FromCloudFormation.getStringArray(properties.Values) : undefined, }; } /** * Determine whether the given properties match those of a `CfnMaintenanceWindowTaskProps` * * @param properties - the TypeScript properties of a `CfnMaintenanceWindowTaskProps` * * @returns the result of the validation. */ function CfnMaintenanceWindowTaskPropsValidator(properties) { if (!cdk.canInspect(properties)) { return cdk.VALIDATION_SUCCESS; } const errors = new cdk.ValidationResults(); errors.collect(cdk.propertyValidator('description', cdk.validateString)(properties.description)); errors.collect(cdk.propertyValidator('loggingInfo', CfnMaintenanceWindowTask_LoggingInfoPropertyValidator)(properties.loggingInfo)); errors.collect(cdk.propertyValidator('maxConcurrency', cdk.requiredValidator)(properties.maxConcurrency)); errors.collect(cdk.propertyValidator('maxConcurrency', cdk.validateString)(properties.maxConcurrency)); errors.collect(cdk.propertyValidator('maxErrors', cdk.requiredValidator)(properties.maxErrors)); errors.collect(cdk.propertyValidator('maxErrors', cdk.validateString)(properties.maxErrors)); errors.collect(cdk.propertyValidator('name', cdk.validateString)(properties.name)); errors.collect(cdk.propertyValidator('priority', cdk.requiredValidator)(properties.priority)); errors.collect(cdk.propertyValidator('priority', cdk.validateNumber)(properties.priority)); errors.collect(cdk.propertyValidator('serviceRoleArn', cdk.validateString)(properties.serviceRoleArn)); errors.collect(cdk.propertyValidator('targets', cdk.requiredValidator)(properties.targets)); errors.collect(cdk.propertyValidator('targets', cdk.listValidator(CfnMaintenanceWindowTask_TargetPropertyValidator))(properties.targets)); errors.collect(cdk.propertyValidator('taskArn', cdk.requiredValidator)(properties.taskArn)); errors.collect(cdk.propertyValidator('taskArn', cdk.validateString)(properties.taskArn)); errors.collect(cdk.propertyValidator('taskInvocationParameters', CfnMaintenanceWindowTask_TaskInvocationParametersPropertyValidator)(properties.taskInvocationParameters)); errors.collect(cdk.propertyValidator('taskParameters', cdk.validateObject)(properties.taskParameters)); errors.collect(cdk.propertyValidator('taskType', cdk.requiredValidator)(properties.taskType)); errors.collect(cdk.propertyValidator('taskType', cdk.validateString)(properties.taskType)); errors.collect(cdk.propertyValidator('windowId', cdk.requiredValidator)(properties.windowId)); errors.collect(cdk.propertyValidator('windowId', cdk.validateString)(properties.windowId)); return errors.wrap('supplied properties not correct for "CfnMaintenanceWindowTaskProps"'); } /** * Renders the AWS CloudFormation properties of an `AWS::SSM::MaintenanceWindowTask` resource * * @param properties - the TypeScript properties of a `CfnMaintenanceWindowTaskProps` * * @returns the AWS CloudFormation properties of an `AWS::SSM::MaintenanceWindowTask` resource. */ // @ts-ignore TS6133 function cfnMaintenanceWindowTaskPropsToCloudFormation(properties) { if (!cdk.canInspect(properties)) { return properties; } CfnMaintenanceWindowTaskPropsValidator(properties).assertSuccess(); return { MaxConcurrency: cdk.stringToCloudFormation(properties.maxConcurrency), MaxErrors: cdk.stringToCloudFormation(properties.maxErrors), Priority: cdk.numberToCloudFormation(properties.priority), Targets: cdk.listMapper(cfnMaintenanceWindowTaskTargetPropertyToCloudFormation)(properties.targets), TaskArn: cdk.stringToCloudFormation(properties.taskArn), TaskType: cdk.stringToCloudFormation(properties.taskType), WindowId: cdk.stringToCloudFormation(properties.windowId), Description: cdk.stringToCloudFormation(properties.description), LoggingInfo: cfnMaintenanceWindowTaskLoggingInfoPropertyToCloudFormation(properties.loggingInfo), Name: cdk.stringToCloudFormation(properties.name), ServiceRoleArn: cdk.stringToCloudFormation(properties.serviceRoleArn), TaskInvocationParameters: cfnMaintenanceWindowTaskTaskInvocationParametersPropertyToCloudFormation(properties.taskInvocationParameters), TaskParameters: cdk.objectToCloudFormation(properties.taskParameters), }; } // @ts-ignore TS6133 function CfnMaintenanceWindowTaskPropsFromCloudFormation(properties) { properties = properties || {}; return { maxConcurrency: cfn_parse.FromCloudFormation.getString(properties.MaxConcurrency), maxErrors: cfn_parse.FromCloudFormation.getString(properties.MaxErrors), priority: cfn_parse.FromCloudFormation.getNumber(properties.Priority), targets: cfn_parse.FromCloudFormation.getArray(CfnMaintenanceWindowTaskTargetPropertyFromCloudFormation)(properties.Targets), taskArn: cfn_parse.FromCloudFormation.getString(properties.TaskArn), taskType: cfn_parse.FromCloudFormation.getString(properties.TaskType), windowId: cfn_parse.FromCloudFormation.getString(properties.WindowId), description: properties.Description != null ? cfn_parse.FromCloudFormation.getString(properties.Description) : undefined, loggingInfo: properties.LoggingInfo != null ? CfnMaintenanceWindowTaskLoggingInfoPropertyFromCloudFormation(properties.LoggingInfo) : undefined, name: properties.Name != null ? cfn_parse.FromCloudFormation.getString(properties.Name) : undefined, serviceRoleArn: properties.ServiceRoleArn != null ? cfn_parse.FromCloudFormation.getString(properties.ServiceRoleArn) : undefined, taskInvocationParameters: properties.TaskInvocationParameters != null ? CfnMaintenanceWindowTaskTaskInvocationParametersPropertyFromCloudFormation(properties.TaskInvocationParameters) : undefined, taskParameters: properties.TaskParameters != null ? cfn_parse.FromCloudFormation.getAny(properties.TaskParameters) : undefined, }; } /** * A CloudFormation `AWS::SSM::MaintenanceWindowTask`. * * @see http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-ssm-maintenancewindowtask.html * @external * @cloudformationResource AWS::SSM::MaintenanceWindowTask */ class CfnMaintenanceWindowTask extends cdk.CfnResource { /** * Create a new `AWS::SSM::MaintenanceWindowTask`. * * @param scope - scope in which this resource is defined. * @param id - scoped id of the resource. * @param props - resource properties. * @external */ constructor(scope, id, props) { super(scope, id, { type: CfnMaintenanceWindowTask.CFN_RESOURCE_TYPE_NAME, properties: props }); cdk.requireProperty(props, 'maxConcurrency', this); cdk.requireProperty(props, 'maxErrors', this); cdk.requireProperty(props, 'priority', this); cdk.requireProperty(props, 'targets', this); cdk.requireProperty(props, 'taskArn', this); cdk.requireProperty(props, 'taskType', this); cdk.requireProperty(props, 'windowId', this); this.maxConcurrency = props.maxConcurrency; this.maxErrors = props.maxErrors; this.priority = props.priority; this.targets = props.targets; this.taskArn = props.taskArn; this.taskType = props.taskType; this.windowId = props.windowId; this.description = props.description; this.loggingInfo = props.loggingInfo; this.name = props.name; this.serviceRoleArn = props.serviceRoleArn; this.taskInvocationParameters = props.taskInvocationParameters; this.taskParameters = props.taskParameters; } /** * A factory method that creates a new instance of this class from an object * containing the CloudFormation properties of this resource. * Used in the @aws-cdk/cloudformation-include module. * * @internal */ static _fromCloudFormation(scope, id, resourceAttributes, options) { resourceAttributes = resourceAttributes || {}; const resourceProperties = options.parser.parseValue(resourceAttributes.Properties); const props = CfnMaintenanceWindowTaskPropsFromCloudFormation(resourceProperties); const ret = new CfnMaintenanceWindowTask(scope, id, props); options.parser.handleAttributes(ret, resourceAttributes, id); return ret; } /** * (experimental) Examines the CloudFormation resource and discloses attributes. * * @param inspector - tree inspector to collect and process attributes. * @experimental */ inspect(inspector) { inspector.addAttribute("aws:cdk:cloudformation:type", CfnMaintenanceWindowTask.CFN_RESOURCE_TYPE_NAME); inspector.addAttribute("aws:cdk:cloudformation:props", this.cfnProperties); } /** * @external */ get cfnProperties() { return { maxConcurrency: this.maxConcurrency, maxErrors: this.maxErrors, priority: this.priority, targets: this.targets, taskArn: this.taskArn, taskType: this.taskType, windowId: this.windowId, description: this.description, loggingInfo: this.loggingInfo,