Created
June 17, 2019 20:22
-
-
Save moofish32/015461b8a7692e53a8411de8d176279f to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Copyright 2012-2019 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":"2019-06-17T20:08:49.014Z","fingerprint":"Y9UchU9pctC6/xWTm7rE/XBp8d05mvBX9wvFf2MixrM="} | |
// tslint:disable:max-line-length | This is generated code - line lengths are difficult to control | |
import cdk = require('@aws-cdk/cdk'); | |
/** | |
* Properties for defining a `AWS::Lambda::Alias` | |
* @see http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-lambda-alias.html | |
*/ | |
export interface CfnAliasProps { | |
/** | |
* `AWS::Lambda::Alias.FunctionName` | |
* @see http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-lambda-alias.html#cfn-lambda-alias-functionname | |
*/ | |
readonly functionName: string; | |
/** | |
* `AWS::Lambda::Alias.FunctionVersion` | |
* @see http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-lambda-alias.html#cfn-lambda-alias-functionversion | |
*/ | |
readonly functionVersion: string; | |
/** | |
* `AWS::Lambda::Alias.Name` | |
* @see http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-lambda-alias.html#cfn-lambda-alias-name | |
*/ | |
readonly name: string; | |
/** | |
* `AWS::Lambda::Alias.Description` | |
* @see http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-lambda-alias.html#cfn-lambda-alias-description | |
*/ | |
readonly description?: string; | |
/** | |
* `AWS::Lambda::Alias.RoutingConfig` | |
* @see http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-lambda-alias.html#cfn-lambda-alias-routingconfig | |
*/ | |
readonly routingConfig?: CfnAlias.AliasRoutingConfigurationProperty | cdk.IResolvable; | |
} | |
/** | |
* Determine whether the given properties match those of a `CfnAliasProps` | |
* | |
* @param properties - the TypeScript properties of a `CfnAliasProps` | |
* | |
* @returns the result of the validation. | |
*/ | |
function CfnAliasPropsValidator(properties: any): cdk.ValidationResult { | |
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('functionName', cdk.requiredValidator)(properties.functionName)); | |
errors.collect(cdk.propertyValidator('functionName', cdk.validateString)(properties.functionName)); | |
errors.collect(cdk.propertyValidator('functionVersion', cdk.requiredValidator)(properties.functionVersion)); | |
errors.collect(cdk.propertyValidator('functionVersion', cdk.validateString)(properties.functionVersion)); | |
errors.collect(cdk.propertyValidator('name', cdk.requiredValidator)(properties.name)); | |
errors.collect(cdk.propertyValidator('name', cdk.validateString)(properties.name)); | |
errors.collect(cdk.propertyValidator('routingConfig', CfnAlias_AliasRoutingConfigurationPropertyValidator)(properties.routingConfig)); | |
return errors.wrap('supplied properties not correct for "CfnAliasProps"'); | |
} | |
/** | |
* Renders the AWS CloudFormation properties of an `AWS::Lambda::Alias` resource | |
* | |
* @param properties - the TypeScript properties of a `CfnAliasProps` | |
* | |
* @returns the AWS CloudFormation properties of an `AWS::Lambda::Alias` resource. | |
*/ | |
// @ts-ignore TS6133 | |
function cfnAliasPropsToCloudFormation(properties: any): any { | |
if (!cdk.canInspect(properties)) { return properties; } | |
CfnAliasPropsValidator(properties).assertSuccess(); | |
return { | |
FunctionName: cdk.stringToCloudFormation(properties.functionName), | |
FunctionVersion: cdk.stringToCloudFormation(properties.functionVersion), | |
Name: cdk.stringToCloudFormation(properties.name), | |
Description: cdk.stringToCloudFormation(properties.description), | |
RoutingConfig: cfnAliasAliasRoutingConfigurationPropertyToCloudFormation(properties.routingConfig), | |
}; | |
} | |
/** | |
* A CloudFormation `AWS::Lambda::Alias` | |
* | |
* @cloudformationResource AWS::Lambda::Alias | |
* @see http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-lambda-alias.html | |
*/ | |
export class CfnAlias extends cdk.CfnResource { | |
/** | |
* The CloudFormation resource type name for this resource class. | |
*/ | |
public static readonly cfnResourceTypeName = "AWS::Lambda::Alias"; | |
/** | |
* `AWS::Lambda::Alias.FunctionName` | |
* @see http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-lambda-alias.html#cfn-lambda-alias-functionname | |
*/ | |
public functionName: string; | |
/** | |
* `AWS::Lambda::Alias.FunctionVersion` | |
* @see http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-lambda-alias.html#cfn-lambda-alias-functionversion | |
*/ | |
public functionVersion: string; | |
/** | |
* `AWS::Lambda::Alias.Name` | |
* @see http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-lambda-alias.html#cfn-lambda-alias-name | |
*/ | |
public name: string; | |
/** | |
* `AWS::Lambda::Alias.Description` | |
* @see http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-lambda-alias.html#cfn-lambda-alias-description | |
*/ | |
public description: string | undefined; | |
/** | |
* `AWS::Lambda::Alias.RoutingConfig` | |
* @see http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-lambda-alias.html#cfn-lambda-alias-routingconfig | |
*/ | |
public routingConfig: CfnAlias.AliasRoutingConfigurationProperty | cdk.IResolvable | undefined; | |
/** | |
* Create a new `AWS::Lambda::Alias`. | |
* | |
* @param scope - scope in which this resource is defined | |
* @param id - scoped id of the resource | |
* @param props - resource properties | |
*/ | |
constructor(scope: cdk.Construct, id: string, props: CfnAliasProps) { | |
super(scope, id, { type: CfnAlias.cfnResourceTypeName, properties: props }); | |
cdk.requireProperty(props, 'functionName', this); | |
cdk.requireProperty(props, 'functionVersion', this); | |
cdk.requireProperty(props, 'name', this); | |
this.functionName = props.functionName; | |
this.functionVersion = props.functionVersion; | |
this.name = props.name; | |
this.description = props.description; | |
this.routingConfig = props.routingConfig; | |
} | |
protected get cfnProperties(): { [key: string]: any } { | |
return { | |
functionName: this.functionName, | |
functionVersion: this.functionVersion, | |
name: this.name, | |
description: this.description, | |
routingConfig: this.routingConfig, | |
}; | |
} | |
protected renderProperties(props: {[key: string]: any}): { [key: string]: any } { | |
return cfnAliasPropsToCloudFormation(props); | |
} | |
} | |
export namespace CfnAlias { | |
/** | |
* @see http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-lambda-alias-aliasroutingconfiguration.html | |
*/ | |
export interface AliasRoutingConfigurationProperty { | |
/** | |
* `CfnAlias.AliasRoutingConfigurationProperty.AdditionalVersionWeights` | |
* @see http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-lambda-alias-aliasroutingconfiguration.html#cfn-lambda-alias-aliasroutingconfiguration-additionalversionweights | |
*/ | |
readonly additionalVersionWeights: Array<CfnAlias.VersionWeightProperty | cdk.IResolvable> | cdk.IResolvable; | |
} | |
} | |
/** | |
* Determine whether the given properties match those of a `AliasRoutingConfigurationProperty` | |
* | |
* @param properties - the TypeScript properties of a `AliasRoutingConfigurationProperty` | |
* | |
* @returns the result of the validation. | |
*/ | |
function CfnAlias_AliasRoutingConfigurationPropertyValidator(properties: any): cdk.ValidationResult { | |
if (!cdk.canInspect(properties)) { return cdk.VALIDATION_SUCCESS; } | |
const errors = new cdk.ValidationResults(); | |
errors.collect(cdk.propertyValidator('additionalVersionWeights', cdk.requiredValidator)(properties.additionalVersionWeights)); | |
errors.collect(cdk.propertyValidator('additionalVersionWeights', cdk.listValidator(CfnAlias_VersionWeightPropertyValidator))(properties.additionalVersionWeights)); | |
return errors.wrap('supplied properties not correct for "AliasRoutingConfigurationProperty"'); | |
} | |
/** | |
* Renders the AWS CloudFormation properties of an `AWS::Lambda::Alias.AliasRoutingConfiguration` resource | |
* | |
* @param properties - the TypeScript properties of a `AliasRoutingConfigurationProperty` | |
* | |
* @returns the AWS CloudFormation properties of an `AWS::Lambda::Alias.AliasRoutingConfiguration` resource. | |
*/ | |
// @ts-ignore TS6133 | |
function cfnAliasAliasRoutingConfigurationPropertyToCloudFormation(properties: any): any { | |
if (!cdk.canInspect(properties)) { return properties; } | |
CfnAlias_AliasRoutingConfigurationPropertyValidator(properties).assertSuccess(); | |
return { | |
AdditionalVersionWeights: cdk.listMapper(cfnAliasVersionWeightPropertyToCloudFormation)(properties.additionalVersionWeights), | |
}; | |
} | |
export namespace CfnAlias { | |
/** | |
* @see http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-lambda-alias-versionweight.html | |
*/ | |
export interface VersionWeightProperty { | |
/** | |
* `CfnAlias.VersionWeightProperty.FunctionVersion` | |
* @see http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-lambda-alias-versionweight.html#cfn-lambda-alias-versionweight-functionversion | |
*/ | |
readonly functionVersion: string; | |
/** | |
* `CfnAlias.VersionWeightProperty.FunctionWeight` | |
* @see http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-lambda-alias-versionweight.html#cfn-lambda-alias-versionweight-functionweight | |
*/ | |
readonly functionWeight: number; | |
} | |
} | |
/** | |
* Determine whether the given properties match those of a `VersionWeightProperty` | |
* | |
* @param properties - the TypeScript properties of a `VersionWeightProperty` | |
* | |
* @returns the result of the validation. | |
*/ | |
function CfnAlias_VersionWeightPropertyValidator(properties: any): cdk.ValidationResult { | |
if (!cdk.canInspect(properties)) { return cdk.VALIDATION_SUCCESS; } | |
const errors = new cdk.ValidationResults(); | |
errors.collect(cdk.propertyValidator('functionVersion', cdk.requiredValidator)(properties.functionVersion)); | |
errors.collect(cdk.propertyValidator('functionVersion', cdk.validateString)(properties.functionVersion)); | |
errors.collect(cdk.propertyValidator('functionWeight', cdk.requiredValidator)(properties.functionWeight)); | |
errors.collect(cdk.propertyValidator('functionWeight', cdk.validateNumber)(properties.functionWeight)); | |
return errors.wrap('supplied properties not correct for "VersionWeightProperty"'); | |
} | |
/** | |
* Renders the AWS CloudFormation properties of an `AWS::Lambda::Alias.VersionWeight` resource | |
* | |
* @param properties - the TypeScript properties of a `VersionWeightProperty` | |
* | |
* @returns the AWS CloudFormation properties of an `AWS::Lambda::Alias.VersionWeight` resource. | |
*/ | |
// @ts-ignore TS6133 | |
function cfnAliasVersionWeightPropertyToCloudFormation(properties: any): any { | |
if (!cdk.canInspect(properties)) { return properties; } | |
CfnAlias_VersionWeightPropertyValidator(properties).assertSuccess(); | |
return { | |
FunctionVersion: cdk.stringToCloudFormation(properties.functionVersion), | |
FunctionWeight: cdk.numberToCloudFormation(properties.functionWeight), | |
}; | |
} | |
/** | |
* Properties for defining a `AWS::Lambda::EventSourceMapping` | |
* @see http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-lambda-eventsourcemapping.html | |
*/ | |
export interface CfnEventSourceMappingProps { | |
/** | |
* `AWS::Lambda::EventSourceMapping.EventSourceArn` | |
* @see http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-lambda-eventsourcemapping.html#cfn-lambda-eventsourcemapping-eventsourcearn | |
*/ | |
readonly eventSourceArn: string; | |
/** | |
* `AWS::Lambda::EventSourceMapping.FunctionName` | |
* @see http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-lambda-eventsourcemapping.html#cfn-lambda-eventsourcemapping-functionname | |
*/ | |
readonly functionName: string; | |
/** | |
* `AWS::Lambda::EventSourceMapping.BatchSize` | |
* @see http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-lambda-eventsourcemapping.html#cfn-lambda-eventsourcemapping-batchsize | |
*/ | |
readonly batchSize?: number; | |
/** | |
* `AWS::Lambda::EventSourceMapping.Enabled` | |
* @see http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-lambda-eventsourcemapping.html#cfn-lambda-eventsourcemapping-enabled | |
*/ | |
readonly enabled?: boolean | cdk.IResolvable; | |
/** | |
* `AWS::Lambda::EventSourceMapping.StartingPosition` | |
* @see http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-lambda-eventsourcemapping.html#cfn-lambda-eventsourcemapping-startingposition | |
*/ | |
readonly startingPosition?: string; | |
} | |
/** | |
* Determine whether the given properties match those of a `CfnEventSourceMappingProps` | |
* | |
* @param properties - the TypeScript properties of a `CfnEventSourceMappingProps` | |
* | |
* @returns the result of the validation. | |
*/ | |
function CfnEventSourceMappingPropsValidator(properties: any): cdk.ValidationResult { | |
if (!cdk.canInspect(properties)) { return cdk.VALIDATION_SUCCESS; } | |
const errors = new cdk.ValidationResults(); | |
errors.collect(cdk.propertyValidator('batchSize', cdk.validateNumber)(properties.batchSize)); | |
errors.collect(cdk.propertyValidator('enabled', cdk.validateBoolean)(properties.enabled)); | |
errors.collect(cdk.propertyValidator('eventSourceArn', cdk.requiredValidator)(properties.eventSourceArn)); | |
errors.collect(cdk.propertyValidator('eventSourceArn', cdk.validateString)(properties.eventSourceArn)); | |
errors.collect(cdk.propertyValidator('functionName', cdk.requiredValidator)(properties.functionName)); | |
errors.collect(cdk.propertyValidator('functionName', cdk.validateString)(properties.functionName)); | |
errors.collect(cdk.propertyValidator('startingPosition', cdk.validateString)(properties.startingPosition)); | |
return errors.wrap('supplied properties not correct for "CfnEventSourceMappingProps"'); | |
} | |
/** | |
* Renders the AWS CloudFormation properties of an `AWS::Lambda::EventSourceMapping` resource | |
* | |
* @param properties - the TypeScript properties of a `CfnEventSourceMappingProps` | |
* | |
* @returns the AWS CloudFormation properties of an `AWS::Lambda::EventSourceMapping` resource. | |
*/ | |
// @ts-ignore TS6133 | |
function cfnEventSourceMappingPropsToCloudFormation(properties: any): any { | |
if (!cdk.canInspect(properties)) { return properties; } | |
CfnEventSourceMappingPropsValidator(properties).assertSuccess(); | |
return { | |
EventSourceArn: cdk.stringToCloudFormation(properties.eventSourceArn), | |
FunctionName: cdk.stringToCloudFormation(properties.functionName), | |
BatchSize: cdk.numberToCloudFormation(properties.batchSize), | |
Enabled: cdk.booleanToCloudFormation(properties.enabled), | |
StartingPosition: cdk.stringToCloudFormation(properties.startingPosition), | |
}; | |
} | |
/** | |
* A CloudFormation `AWS::Lambda::EventSourceMapping` | |
* | |
* @cloudformationResource AWS::Lambda::EventSourceMapping | |
* @see http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-lambda-eventsourcemapping.html | |
*/ | |
export class CfnEventSourceMapping extends cdk.CfnResource { | |
/** | |
* The CloudFormation resource type name for this resource class. | |
*/ | |
public static readonly cfnResourceTypeName = "AWS::Lambda::EventSourceMapping"; | |
/** | |
* `AWS::Lambda::EventSourceMapping.EventSourceArn` | |
* @see http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-lambda-eventsourcemapping.html#cfn-lambda-eventsourcemapping-eventsourcearn | |
*/ | |
public eventSourceArn: string; | |
/** | |
* `AWS::Lambda::EventSourceMapping.FunctionName` | |
* @see http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-lambda-eventsourcemapping.html#cfn-lambda-eventsourcemapping-functionname | |
*/ | |
public functionName: string; | |
/** | |
* `AWS::Lambda::EventSourceMapping.BatchSize` | |
* @see http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-lambda-eventsourcemapping.html#cfn-lambda-eventsourcemapping-batchsize | |
*/ | |
public batchSize: number | undefined; | |
/** | |
* `AWS::Lambda::EventSourceMapping.Enabled` | |
* @see http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-lambda-eventsourcemapping.html#cfn-lambda-eventsourcemapping-enabled | |
*/ | |
public enabled: boolean | cdk.IResolvable | undefined; | |
/** | |
* `AWS::Lambda::EventSourceMapping.StartingPosition` | |
* @see http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-lambda-eventsourcemapping.html#cfn-lambda-eventsourcemapping-startingposition | |
*/ | |
public startingPosition: string | undefined; | |
/** | |
* Create a new `AWS::Lambda::EventSourceMapping`. | |
* | |
* @param scope - scope in which this resource is defined | |
* @param id - scoped id of the resource | |
* @param props - resource properties | |
*/ | |
constructor(scope: cdk.Construct, id: string, props: CfnEventSourceMappingProps) { | |
super(scope, id, { type: CfnEventSourceMapping.cfnResourceTypeName, properties: props }); | |
cdk.requireProperty(props, 'eventSourceArn', this); | |
cdk.requireProperty(props, 'functionName', this); | |
this.eventSourceArn = props.eventSourceArn; | |
this.functionName = props.functionName; | |
this.batchSize = props.batchSize; | |
this.enabled = props.enabled; | |
this.startingPosition = props.startingPosition; | |
} | |
protected get cfnProperties(): { [key: string]: any } { | |
return { | |
eventSourceArn: this.eventSourceArn, | |
functionName: this.functionName, | |
batchSize: this.batchSize, | |
enabled: this.enabled, | |
startingPosition: this.startingPosition, | |
}; | |
} | |
protected renderProperties(props: {[key: string]: any}): { [key: string]: any } { | |
return cfnEventSourceMappingPropsToCloudFormation(props); | |
} | |
} | |
/** | |
* Properties for defining a `AWS::Lambda::Function` | |
* @see http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-lambda-function.html | |
*/ | |
export interface CfnFunctionProps { | |
/** | |
* `AWS::Lambda::Function.Code` | |
* @see http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-lambda-function.html#cfn-lambda-function-code | |
*/ | |
readonly code: CfnFunction.CodeProperty | cdk.IResolvable; | |
/** | |
* `AWS::Lambda::Function.Handler` | |
* @see http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-lambda-function.html#cfn-lambda-function-handler | |
*/ | |
readonly handler: string; | |
/** | |
* `AWS::Lambda::Function.Role` | |
* @see http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-lambda-function.html#cfn-lambda-function-role | |
*/ | |
readonly role: string; | |
/** | |
* `AWS::Lambda::Function.Runtime` | |
* @see http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-lambda-function.html#cfn-lambda-function-runtime | |
*/ | |
readonly runtime: string; | |
/** | |
* `AWS::Lambda::Function.DeadLetterConfig` | |
* @see http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-lambda-function.html#cfn-lambda-function-deadletterconfig | |
*/ | |
readonly deadLetterConfig?: CfnFunction.DeadLetterConfigProperty | cdk.IResolvable; | |
/** | |
* `AWS::Lambda::Function.Description` | |
* @see http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-lambda-function.html#cfn-lambda-function-description | |
*/ | |
readonly description?: string; | |
/** | |
* `AWS::Lambda::Function.Environment` | |
* @see http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-lambda-function.html#cfn-lambda-function-environment | |
*/ | |
readonly environment?: CfnFunction.EnvironmentProperty | cdk.IResolvable; | |
/** | |
* `AWS::Lambda::Function.FunctionName` | |
* @see http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-lambda-function.html#cfn-lambda-function-functionname | |
*/ | |
readonly functionName?: string; | |
/** | |
* `AWS::Lambda::Function.KmsKeyArn` | |
* @see http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-lambda-function.html#cfn-lambda-function-kmskeyarn | |
*/ | |
readonly kmsKeyArn?: string; | |
/** | |
* `AWS::Lambda::Function.Layers` | |
* @see http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-lambda-function.html#cfn-lambda-function-layers | |
*/ | |
readonly layers?: string[]; | |
/** | |
* `AWS::Lambda::Function.MemorySize` | |
* @see http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-lambda-function.html#cfn-lambda-function-memorysize | |
*/ | |
readonly memorySize?: number; | |
/** | |
* `AWS::Lambda::Function.ReservedConcurrentExecutions` | |
* @see http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-lambda-function.html#cfn-lambda-function-reservedconcurrentexecutions | |
*/ | |
readonly reservedConcurrentExecutions?: number; | |
/** | |
* `AWS::Lambda::Function.Tags` | |
* @see http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-lambda-function.html#cfn-lambda-function-tags | |
*/ | |
readonly tags?: cdk.CfnTag[]; | |
/** | |
* `AWS::Lambda::Function.Timeout` | |
* @see http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-lambda-function.html#cfn-lambda-function-timeout | |
*/ | |
readonly timeout?: number; | |
/** | |
* `AWS::Lambda::Function.TracingConfig` | |
* @see http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-lambda-function.html#cfn-lambda-function-tracingconfig | |
*/ | |
readonly tracingConfig?: CfnFunction.TracingConfigProperty | cdk.IResolvable; | |
/** | |
* `AWS::Lambda::Function.VpcConfig` | |
* @see http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-lambda-function.html#cfn-lambda-function-vpcconfig | |
*/ | |
readonly vpcConfig?: CfnFunction.VpcConfigProperty | cdk.IResolvable; | |
} | |
/** | |
* Determine whether the given properties match those of a `CfnFunctionProps` | |
* | |
* @param properties - the TypeScript properties of a `CfnFunctionProps` | |
* | |
* @returns the result of the validation. | |
*/ | |
function CfnFunctionPropsValidator(properties: any): cdk.ValidationResult { | |
if (!cdk.canInspect(properties)) { return cdk.VALIDATION_SUCCESS; } | |
const errors = new cdk.ValidationResults(); | |
errors.collect(cdk.propertyValidator('code', cdk.requiredValidator)(properties.code)); | |
errors.collect(cdk.propertyValidator('code', CfnFunction_CodePropertyValidator)(properties.code)); | |
errors.collect(cdk.propertyValidator('deadLetterConfig', CfnFunction_DeadLetterConfigPropertyValidator)(properties.deadLetterConfig)); | |
errors.collect(cdk.propertyValidator('description', cdk.validateString)(properties.description)); | |
errors.collect(cdk.propertyValidator('environment', CfnFunction_EnvironmentPropertyValidator)(properties.environment)); | |
errors.collect(cdk.propertyValidator('functionName', cdk.validateString)(properties.functionName)); | |
errors.collect(cdk.propertyValidator('handler', cdk.requiredValidator)(properties.handler)); | |
errors.collect(cdk.propertyValidator('handler', cdk.validateString)(properties.handler)); | |
errors.collect(cdk.propertyValidator('kmsKeyArn', cdk.validateString)(properties.kmsKeyArn)); | |
errors.collect(cdk.propertyValidator('layers', cdk.listValidator(cdk.validateString))(properties.layers)); | |
errors.collect(cdk.propertyValidator('memorySize', cdk.validateNumber)(properties.memorySize)); | |
errors.collect(cdk.propertyValidator('reservedConcurrentExecutions', cdk.validateNumber)(properties.reservedConcurrentExecutions)); | |
errors.collect(cdk.propertyValidator('role', cdk.requiredValidator)(properties.role)); | |
errors.collect(cdk.propertyValidator('role', cdk.validateString)(properties.role)); | |
errors.collect(cdk.propertyValidator('runtime', cdk.requiredValidator)(properties.runtime)); | |
errors.collect(cdk.propertyValidator('runtime', cdk.validateString)(properties.runtime)); | |
errors.collect(cdk.propertyValidator('tags', cdk.listValidator(cdk.validateCfnTag))(properties.tags)); | |
errors.collect(cdk.propertyValidator('timeout', cdk.validateNumber)(properties.timeout)); | |
errors.collect(cdk.propertyValidator('tracingConfig', CfnFunction_TracingConfigPropertyValidator)(properties.tracingConfig)); | |
errors.collect(cdk.propertyValidator('vpcConfig', CfnFunction_VpcConfigPropertyValidator)(properties.vpcConfig)); | |
return errors.wrap('supplied properties not correct for "CfnFunctionProps"'); | |
} | |
/** | |
* Renders the AWS CloudFormation properties of an `AWS::Lambda::Function` resource | |
* | |
* @param properties - the TypeScript properties of a `CfnFunctionProps` | |
* | |
* @returns the AWS CloudFormation properties of an `AWS::Lambda::Function` resource. | |
*/ | |
// @ts-ignore TS6133 | |
function cfnFunctionPropsToCloudFormation(properties: any): any { | |
if (!cdk.canInspect(properties)) { return properties; } | |
CfnFunctionPropsValidator(properties).assertSuccess(); | |
return { | |
Code: cfnFunctionCodePropertyToCloudFormation(properties.code), | |
Handler: cdk.stringToCloudFormation(properties.handler), | |
Role: cdk.stringToCloudFormation(properties.role), | |
Runtime: cdk.stringToCloudFormation(properties.runtime), | |
DeadLetterConfig: cfnFunctionDeadLetterConfigPropertyToCloudFormation(properties.deadLetterConfig), | |
Description: cdk.stringToCloudFormation(properties.description), | |
Environment: cfnFunctionEnvironmentPropertyToCloudFormation(properties.environment), | |
FunctionName: cdk.stringToCloudFormation(properties.functionName), | |
KmsKeyArn: cdk.stringToCloudFormation(properties.kmsKeyArn), | |
Layers: cdk.listMapper(cdk.stringToCloudFormation)(properties.layers), | |
MemorySize: cdk.numberToCloudFormation(properties.memorySize), | |
ReservedConcurrentExecutions: cdk.numberToCloudFormation(properties.reservedConcurrentExecutions), | |
Tags: cdk.listMapper(cdk.cfnTagToCloudFormation)(properties.tags), | |
Timeout: cdk.numberToCloudFormation(properties.timeout), | |
TracingConfig: cfnFunctionTracingConfigPropertyToCloudFormation(properties.tracingConfig), | |
VpcConfig: cfnFunctionVpcConfigPropertyToCloudFormation(properties.vpcConfig), | |
}; | |
} | |
/** | |
* A CloudFormation `AWS::Lambda::Function` | |
* | |
* @cloudformationResource AWS::Lambda::Function | |
* @see http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-lambda-function.html | |
*/ | |
export class CfnFunction extends cdk.CfnResource { | |
/** | |
* The CloudFormation resource type name for this resource class. | |
*/ | |
public static readonly cfnResourceTypeName = "AWS::Lambda::Function"; | |
/** | |
* @cloudformationAttribute Arn | |
*/ | |
public readonly attrArn: string; | |
/** | |
* `AWS::Lambda::Function.Code` | |
* @see http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-lambda-function.html#cfn-lambda-function-code | |
*/ | |
public code: CfnFunction.CodeProperty | cdk.IResolvable; | |
/** | |
* `AWS::Lambda::Function.Handler` | |
* @see http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-lambda-function.html#cfn-lambda-function-handler | |
*/ | |
public handler: string; | |
/** | |
* `AWS::Lambda::Function.Role` | |
* @see http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-lambda-function.html#cfn-lambda-function-role | |
*/ | |
public role: string; | |
/** | |
* `AWS::Lambda::Function.Runtime` | |
* @see http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-lambda-function.html#cfn-lambda-function-runtime | |
*/ | |
public runtime: string; | |
/** | |
* `AWS::Lambda::Function.DeadLetterConfig` | |
* @see http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-lambda-function.html#cfn-lambda-function-deadletterconfig | |
*/ | |
public deadLetterConfig: CfnFunction.DeadLetterConfigProperty | cdk.IResolvable | undefined; | |
/** | |
* `AWS::Lambda::Function.Description` | |
* @see http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-lambda-function.html#cfn-lambda-function-description | |
*/ | |
public description: string | undefined; | |
/** | |
* `AWS::Lambda::Function.Environment` | |
* @see http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-lambda-function.html#cfn-lambda-function-environment | |
*/ | |
public environment: CfnFunction.EnvironmentProperty | cdk.IResolvable | undefined; | |
/** | |
* `AWS::Lambda::Function.FunctionName` | |
* @see http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-lambda-function.html#cfn-lambda-function-functionname | |
*/ | |
public functionName: string | undefined; | |
/** | |
* `AWS::Lambda::Function.KmsKeyArn` | |
* @see http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-lambda-function.html#cfn-lambda-function-kmskeyarn | |
*/ | |
public kmsKeyArn: string | undefined; | |
/** | |
* `AWS::Lambda::Function.Layers` | |
* @see http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-lambda-function.html#cfn-lambda-function-layers | |
*/ | |
public layers: string[] | undefined; | |
/** | |
* `AWS::Lambda::Function.MemorySize` | |
* @see http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-lambda-function.html#cfn-lambda-function-memorysize | |
*/ | |
public memorySize: number | undefined; | |
/** | |
* `AWS::Lambda::Function.ReservedConcurrentExecutions` | |
* @see http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-lambda-function.html#cfn-lambda-function-reservedconcurrentexecutions | |
*/ | |
public reservedConcurrentExecutions: number | undefined; | |
/** | |
* `AWS::Lambda::Function.Tags` | |
* @see http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-lambda-function.html#cfn-lambda-function-tags | |
*/ | |
public readonly tags: cdk.TagManager; | |
/** | |
* `AWS::Lambda::Function.Timeout` | |
* @see http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-lambda-function.html#cfn-lambda-function-timeout | |
*/ | |
public timeout: number | undefined; | |
/** | |
* `AWS::Lambda::Function.TracingConfig` | |
* @see http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-lambda-function.html#cfn-lambda-function-tracingconfig | |
*/ | |
public tracingConfig: CfnFunction.TracingConfigProperty | cdk.IResolvable | undefined; | |
/** | |
* `AWS::Lambda::Function.VpcConfig` | |
* @see http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-lambda-function.html#cfn-lambda-function-vpcconfig | |
*/ | |
public vpcConfig: CfnFunction.VpcConfigProperty | cdk.IResolvable | undefined; | |
/** | |
* Create a new `AWS::Lambda::Function`. | |
* | |
* @param scope - scope in which this resource is defined | |
* @param id - scoped id of the resource | |
* @param props - resource properties | |
*/ | |
constructor(scope: cdk.Construct, id: string, props: CfnFunctionProps) { | |
super(scope, id, { type: CfnFunction.cfnResourceTypeName, properties: props }); | |
cdk.requireProperty(props, 'code', this); | |
cdk.requireProperty(props, 'handler', this); | |
cdk.requireProperty(props, 'role', this); | |
cdk.requireProperty(props, 'runtime', this); | |
this.attrArn = cdk.Token.asString(this.getAtt('Arn')); | |
this.code = props.code; | |
this.handler = props.handler; | |
this.role = props.role; | |
this.runtime = props.runtime; | |
this.deadLetterConfig = props.deadLetterConfig; | |
this.description = props.description; | |
this.environment = props.environment; | |
this.functionName = props.functionName; | |
this.kmsKeyArn = props.kmsKeyArn; | |
this.layers = props.layers; | |
this.memorySize = props.memorySize; | |
this.reservedConcurrentExecutions = props.reservedConcurrentExecutions; | |
this.tags = new cdk.TagManager(cdk.TagType.Standard, "AWS::Lambda::Function", props.tags); | |
this.timeout = props.timeout; | |
this.tracingConfig = props.tracingConfig; | |
this.vpcConfig = props.vpcConfig; | |
} | |
protected get cfnProperties(): { [key: string]: any } { | |
return { | |
code: this.code, | |
handler: this.handler, | |
role: this.role, | |
runtime: this.runtime, | |
deadLetterConfig: this.deadLetterConfig, | |
description: this.description, | |
environment: this.environment, | |
functionName: this.functionName, | |
kmsKeyArn: this.kmsKeyArn, | |
layers: this.layers, | |
memorySize: this.memorySize, | |
reservedConcurrentExecutions: this.reservedConcurrentExecutions, | |
tags: this.tags.renderTags(), | |
timeout: this.timeout, | |
tracingConfig: this.tracingConfig, | |
vpcConfig: this.vpcConfig, | |
}; | |
} | |
protected renderProperties(props: {[key: string]: any}): { [key: string]: any } { | |
return cfnFunctionPropsToCloudFormation(props); | |
} | |
} | |
export namespace CfnFunction { | |
/** | |
* @see http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-lambda-function-code.html | |
*/ | |
export interface CodeProperty { | |
/** | |
* `CfnFunction.CodeProperty.S3Bucket` | |
* @see http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-lambda-function-code.html#cfn-lambda-function-code-s3bucket | |
*/ | |
readonly s3Bucket?: string; | |
/** | |
* `CfnFunction.CodeProperty.S3Key` | |
* @see http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-lambda-function-code.html#cfn-lambda-function-code-s3key | |
*/ | |
readonly s3Key?: string; | |
/** | |
* `CfnFunction.CodeProperty.S3ObjectVersion` | |
* @see http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-lambda-function-code.html#cfn-lambda-function-code-s3objectversion | |
*/ | |
readonly s3ObjectVersion?: string; | |
/** | |
* `CfnFunction.CodeProperty.ZipFile` | |
* @see http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-lambda-function-code.html#cfn-lambda-function-code-zipfile | |
*/ | |
readonly zipFile?: string; | |
} | |
} | |
/** | |
* Determine whether the given properties match those of a `CodeProperty` | |
* | |
* @param properties - the TypeScript properties of a `CodeProperty` | |
* | |
* @returns the result of the validation. | |
*/ | |
function CfnFunction_CodePropertyValidator(properties: any): cdk.ValidationResult { | |
if (!cdk.canInspect(properties)) { return cdk.VALIDATION_SUCCESS; } | |
const errors = new cdk.ValidationResults(); | |
errors.collect(cdk.propertyValidator('s3Bucket', cdk.validateString)(properties.s3Bucket)); | |
errors.collect(cdk.propertyValidator('s3Key', cdk.validateString)(properties.s3Key)); | |
errors.collect(cdk.propertyValidator('s3ObjectVersion', cdk.validateString)(properties.s3ObjectVersion)); | |
errors.collect(cdk.propertyValidator('zipFile', cdk.validateString)(properties.zipFile)); | |
return errors.wrap('supplied properties not correct for "CodeProperty"'); | |
} | |
/** | |
* Renders the AWS CloudFormation properties of an `AWS::Lambda::Function.Code` resource | |
* | |
* @param properties - the TypeScript properties of a `CodeProperty` | |
* | |
* @returns the AWS CloudFormation properties of an `AWS::Lambda::Function.Code` resource. | |
*/ | |
// @ts-ignore TS6133 | |
function cfnFunctionCodePropertyToCloudFormation(properties: any): any { | |
if (!cdk.canInspect(properties)) { return properties; } | |
CfnFunction_CodePropertyValidator(properties).assertSuccess(); | |
return { | |
S3Bucket: cdk.stringToCloudFormation(properties.s3Bucket), | |
S3Key: cdk.stringToCloudFormation(properties.s3Key), | |
S3ObjectVersion: cdk.stringToCloudFormation(properties.s3ObjectVersion), | |
ZipFile: cdk.stringToCloudFormation(properties.zipFile), | |
}; | |
} | |
export namespace CfnFunction { | |
/** | |
* @see http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-lambda-function-deadletterconfig.html | |
*/ | |
export interface DeadLetterConfigProperty { | |
/** | |
* `CfnFunction.DeadLetterConfigProperty.TargetArn` | |
* @see http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-lambda-function-deadletterconfig.html#cfn-lambda-function-deadletterconfig-targetarn | |
*/ | |
readonly targetArn?: string; | |
} | |
} | |
/** | |
* Determine whether the given properties match those of a `DeadLetterConfigProperty` | |
* | |
* @param properties - the TypeScript properties of a `DeadLetterConfigProperty` | |
* | |
* @returns the result of the validation. | |
*/ | |
function CfnFunction_DeadLetterConfigPropertyValidator(properties: any): cdk.ValidationResult { | |
if (!cdk.canInspect(properties)) { return cdk.VALIDATION_SUCCESS; } | |
const errors = new cdk.ValidationResults(); | |
errors.collect(cdk.propertyValidator('targetArn', cdk.validateString)(properties.targetArn)); | |
return errors.wrap('supplied properties not correct for "DeadLetterConfigProperty"'); | |
} | |
/** | |
* Renders the AWS CloudFormation properties of an `AWS::Lambda::Function.DeadLetterConfig` resource | |
* | |
* @param properties - the TypeScript properties of a `DeadLetterConfigProperty` | |
* | |
* @returns the AWS CloudFormation properties of an `AWS::Lambda::Function.DeadLetterConfig` resource. | |
*/ | |
// @ts-ignore TS6133 | |
function cfnFunctionDeadLetterConfigPropertyToCloudFormation(properties: any): any { | |
if (!cdk.canInspect(properties)) { return properties; } | |
CfnFunction_DeadLetterConfigPropertyValidator(properties).assertSuccess(); | |
return { | |
TargetArn: cdk.stringToCloudFormation(properties.targetArn), | |
}; | |
} | |
export namespace CfnFunction { | |
/** | |
* @see http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-lambda-function-environment.html | |
*/ | |
export interface EnvironmentProperty { | |
/** | |
* `CfnFunction.EnvironmentProperty.Variables` | |
* @see http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-lambda-function-environment.html#cfn-lambda-function-environment-variables | |
*/ | |
readonly variables?: { [key: string]: (string) } | cdk.IResolvable; | |
} | |
} | |
/** | |
* Determine whether the given properties match those of a `EnvironmentProperty` | |
* | |
* @param properties - the TypeScript properties of a `EnvironmentProperty` | |
* | |
* @returns the result of the validation. | |
*/ | |
function CfnFunction_EnvironmentPropertyValidator(properties: any): cdk.ValidationResult { | |
if (!cdk.canInspect(properties)) { return cdk.VALIDATION_SUCCESS; } | |
const errors = new cdk.ValidationResults(); | |
errors.collect(cdk.propertyValidator('variables', cdk.hashValidator(cdk.validateString))(properties.variables)); | |
return errors.wrap('supplied properties not correct for "EnvironmentProperty"'); | |
} | |
/** | |
* Renders the AWS CloudFormation properties of an `AWS::Lambda::Function.Environment` resource | |
* | |
* @param properties - the TypeScript properties of a `EnvironmentProperty` | |
* | |
* @returns the AWS CloudFormation properties of an `AWS::Lambda::Function.Environment` resource. | |
*/ | |
// @ts-ignore TS6133 | |
function cfnFunctionEnvironmentPropertyToCloudFormation(properties: any): any { | |
if (!cdk.canInspect(properties)) { return properties; } | |
CfnFunction_EnvironmentPropertyValidator(properties).assertSuccess(); | |
return { | |
Variables: cdk.hashMapper(cdk.stringToCloudFormation)(properties.variables), | |
}; | |
} | |
export namespace CfnFunction { | |
/** | |
* @see http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-lambda-function-tracingconfig.html | |
*/ | |
export interface TracingConfigProperty { | |
/** | |
* `CfnFunction.TracingConfigProperty.Mode` | |
* @see http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-lambda-function-tracingconfig.html#cfn-lambda-function-tracingconfig-mode | |
*/ | |
readonly mode?: string; | |
} | |
} | |
/** | |
* Determine whether the given properties match those of a `TracingConfigProperty` | |
* | |
* @param properties - the TypeScript properties of a `TracingConfigProperty` | |
* | |
* @returns the result of the validation. | |
*/ | |
function CfnFunction_TracingConfigPropertyValidator(properties: any): cdk.ValidationResult { | |
if (!cdk.canInspect(properties)) { return cdk.VALIDATION_SUCCESS; } | |
const errors = new cdk.ValidationResults(); | |
errors.collect(cdk.propertyValidator('mode', cdk.validateString)(properties.mode)); | |
return errors.wrap('supplied properties not correct for "TracingConfigProperty"'); | |
} | |
/** | |
* Renders the AWS CloudFormation properties of an `AWS::Lambda::Function.TracingConfig` resource | |
* | |
* @param properties - the TypeScript properties of a `TracingConfigProperty` | |
* | |
* @returns the AWS CloudFormation properties of an `AWS::Lambda::Function.TracingConfig` resource. | |
*/ | |
// @ts-ignore TS6133 | |
function cfnFunctionTracingConfigPropertyToCloudFormation(properties: any): any { | |
if (!cdk.canInspect(properties)) { return properties; } | |
CfnFunction_TracingConfigPropertyValidator(properties).assertSuccess(); | |
return { | |
Mode: cdk.stringToCloudFormation(properties.mode), | |
}; | |
} | |
export namespace CfnFunction { | |
/** | |
* @see http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-lambda-function-vpcconfig.html | |
*/ | |
export interface VpcConfigProperty { | |
/** | |
* `CfnFunction.VpcConfigProperty.SecurityGroupIds` | |
* @see http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-lambda-function-vpcconfig.html#cfn-lambda-function-vpcconfig-securitygroupids | |
*/ | |
readonly securityGroupIds: string[]; | |
/** | |
* `CfnFunction.VpcConfigProperty.SubnetIds` | |
* @see http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-lambda-function-vpcconfig.html#cfn-lambda-function-vpcconfig-subnetids | |
*/ | |
readonly subnetIds: string[]; | |
} | |
} | |
/** | |
* Determine whether the given properties match those of a `VpcConfigProperty` | |
* | |
* @param properties - the TypeScript properties of a `VpcConfigProperty` | |
* | |
* @returns the result of the validation. | |
*/ | |
function CfnFunction_VpcConfigPropertyValidator(properties: any): cdk.ValidationResult { | |
if (!cdk.canInspect(properties)) { return cdk.VALIDATION_SUCCESS; } | |
const errors = new cdk.ValidationResults(); | |
errors.collect(cdk.propertyValidator('securityGroupIds', cdk.requiredValidator)(properties.securityGroupIds)); | |
errors.collect(cdk.propertyValidator('securityGroupIds', cdk.listValidator(cdk.validateString))(properties.securityGroupIds)); | |
errors.collect(cdk.propertyValidator('subnetIds', cdk.requiredValidator)(properties.subnetIds)); | |
errors.collect(cdk.propertyValidator('subnetIds', cdk.listValidator(cdk.validateString))(properties.subnetIds)); | |
return errors.wrap('supplied properties not correct for "VpcConfigProperty"'); | |
} | |
/** | |
* Renders the AWS CloudFormation properties of an `AWS::Lambda::Function.VpcConfig` resource | |
* | |
* @param properties - the TypeScript properties of a `VpcConfigProperty` | |
* | |
* @returns the AWS CloudFormation properties of an `AWS::Lambda::Function.VpcConfig` resource. | |
*/ | |
// @ts-ignore TS6133 | |
function cfnFunctionVpcConfigPropertyToCloudFormation(properties: any): any { | |
if (!cdk.canInspect(properties)) { return properties; } | |
CfnFunction_VpcConfigPropertyValidator(properties).assertSuccess(); | |
return { | |
SecurityGroupIds: cdk.listMapper(cdk.stringToCloudFormation)(properties.securityGroupIds), | |
SubnetIds: cdk.listMapper(cdk.stringToCloudFormation)(properties.subnetIds), | |
}; | |
} | |
/** | |
* Properties for defining a `AWS::Lambda::LayerVersion` | |
* @see http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-lambda-layerversion.html | |
*/ | |
export interface CfnLayerVersionProps { | |
/** | |
* `AWS::Lambda::LayerVersion.Content` | |
* @see http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-lambda-layerversion.html#cfn-lambda-layerversion-content | |
*/ | |
readonly content: CfnLayerVersion.ContentProperty | cdk.IResolvable; | |
/** | |
* `AWS::Lambda::LayerVersion.CompatibleRuntimes` | |
* @see http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-lambda-layerversion.html#cfn-lambda-layerversion-compatibleruntimes | |
*/ | |
readonly compatibleRuntimes?: string[]; | |
/** | |
* `AWS::Lambda::LayerVersion.Description` | |
* @see http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-lambda-layerversion.html#cfn-lambda-layerversion-description | |
*/ | |
readonly description?: string; | |
/** | |
* `AWS::Lambda::LayerVersion.LayerName` | |
* @see http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-lambda-layerversion.html#cfn-lambda-layerversion-layername | |
*/ | |
readonly layerName?: string; | |
/** | |
* `AWS::Lambda::LayerVersion.LicenseInfo` | |
* @see http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-lambda-layerversion.html#cfn-lambda-layerversion-licenseinfo | |
*/ | |
readonly licenseInfo?: string; | |
} | |
/** | |
* Determine whether the given properties match those of a `CfnLayerVersionProps` | |
* | |
* @param properties - the TypeScript properties of a `CfnLayerVersionProps` | |
* | |
* @returns the result of the validation. | |
*/ | |
function CfnLayerVersionPropsValidator(properties: any): cdk.ValidationResult { | |
if (!cdk.canInspect(properties)) { return cdk.VALIDATION_SUCCESS; } | |
const errors = new cdk.ValidationResults(); | |
errors.collect(cdk.propertyValidator('compatibleRuntimes', cdk.listValidator(cdk.validateString))(properties.compatibleRuntimes)); | |
errors.collect(cdk.propertyValidator('content', cdk.requiredValidator)(properties.content)); | |
errors.collect(cdk.propertyValidator('content', CfnLayerVersion_ContentPropertyValidator)(properties.content)); | |
errors.collect(cdk.propertyValidator('description', cdk.validateString)(properties.description)); | |
errors.collect(cdk.propertyValidator('layerName', cdk.validateString)(properties.layerName)); | |
errors.collect(cdk.propertyValidator('licenseInfo', cdk.validateString)(properties.licenseInfo)); | |
return errors.wrap('supplied properties not correct for "CfnLayerVersionProps"'); | |
} | |
/** | |
* Renders the AWS CloudFormation properties of an `AWS::Lambda::LayerVersion` resource | |
* | |
* @param properties - the TypeScript properties of a `CfnLayerVersionProps` | |
* | |
* @returns the AWS CloudFormation properties of an `AWS::Lambda::LayerVersion` resource. | |
*/ | |
// @ts-ignore TS6133 | |
function cfnLayerVersionPropsToCloudFormation(properties: any): any { | |
if (!cdk.canInspect(properties)) { return properties; } | |
CfnLayerVersionPropsValidator(properties).assertSuccess(); | |
return { | |
Content: cfnLayerVersionContentPropertyToCloudFormation(properties.content), | |
CompatibleRuntimes: cdk.listMapper(cdk.stringToCloudFormation)(properties.compatibleRuntimes), | |
Description: cdk.stringToCloudFormation(properties.description), | |
LayerName: cdk.stringToCloudFormation(properties.layerName), | |
LicenseInfo: cdk.stringToCloudFormation(properties.licenseInfo), | |
}; | |
} | |
/** | |
* A CloudFormation `AWS::Lambda::LayerVersion` | |
* | |
* @cloudformationResource AWS::Lambda::LayerVersion | |
* @see http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-lambda-layerversion.html | |
*/ | |
export class CfnLayerVersion extends cdk.CfnResource { | |
/** | |
* The CloudFormation resource type name for this resource class. | |
*/ | |
public static readonly cfnResourceTypeName = "AWS::Lambda::LayerVersion"; | |
/** | |
* `AWS::Lambda::LayerVersion.Content` | |
* @see http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-lambda-layerversion.html#cfn-lambda-layerversion-content | |
*/ | |
public content: CfnLayerVersion.ContentProperty | cdk.IResolvable; | |
/** | |
* `AWS::Lambda::LayerVersion.CompatibleRuntimes` | |
* @see http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-lambda-layerversion.html#cfn-lambda-layerversion-compatibleruntimes | |
*/ | |
public compatibleRuntimes: string[] | undefined; | |
/** | |
* `AWS::Lambda::LayerVersion.Description` | |
* @see http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-lambda-layerversion.html#cfn-lambda-layerversion-description | |
*/ | |
public description: string | undefined; | |
/** | |
* `AWS::Lambda::LayerVersion.LayerName` | |
* @see http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-lambda-layerversion.html#cfn-lambda-layerversion-layername | |
*/ | |
public layerName: string | undefined; | |
/** | |
* `AWS::Lambda::LayerVersion.LicenseInfo` | |
* @see http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-lambda-layerversion.html#cfn-lambda-layerversion-licenseinfo | |
*/ | |
public licenseInfo: string | undefined; | |
/** | |
* Create a new `AWS::Lambda::LayerVersion`. | |
* | |
* @param scope - scope in which this resource is defined | |
* @param id - scoped id of the resource | |
* @param props - resource properties | |
*/ | |
constructor(scope: cdk.Construct, id: string, props: CfnLayerVersionProps) { | |
super(scope, id, { type: CfnLayerVersion.cfnResourceTypeName, properties: props }); | |
cdk.requireProperty(props, 'content', this); | |
this.content = props.content; | |
this.compatibleRuntimes = props.compatibleRuntimes; | |
this.description = props.description; | |
this.layerName = props.layerName; | |
this.licenseInfo = props.licenseInfo; | |
} | |
protected get cfnProperties(): { [key: string]: any } { | |
return { | |
content: this.content, | |
compatibleRuntimes: this.compatibleRuntimes, | |
description: this.description, | |
layerName: this.layerName, | |
licenseInfo: this.licenseInfo, | |
}; | |
} | |
protected renderProperties(props: {[key: string]: any}): { [key: string]: any } { | |
return cfnLayerVersionPropsToCloudFormation(props); | |
} | |
} | |
export namespace CfnLayerVersion { | |
/** | |
* @see http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-lambda-layerversion-content.html | |
*/ | |
export interface ContentProperty { | |
/** | |
* `CfnLayerVersion.ContentProperty.S3Bucket` | |
* @see http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-lambda-layerversion-content.html#cfn-lambda-layerversion-content-s3bucket | |
*/ | |
readonly s3Bucket: string; | |
/** | |
* `CfnLayerVersion.ContentProperty.S3Key` | |
* @see http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-lambda-layerversion-content.html#cfn-lambda-layerversion-content-s3key | |
*/ | |
readonly s3Key: string; | |
/** | |
* `CfnLayerVersion.ContentProperty.S3ObjectVersion` | |
* @see http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-lambda-layerversion-content.html#cfn-lambda-layerversion-content-s3objectversion | |
*/ | |
readonly s3ObjectVersion?: string; | |
} | |
} | |
/** | |
* Determine whether the given properties match those of a `ContentProperty` | |
* | |
* @param properties - the TypeScript properties of a `ContentProperty` | |
* | |
* @returns the result of the validation. | |
*/ | |
function CfnLayerVersion_ContentPropertyValidator(properties: any): cdk.ValidationResult { | |
if (!cdk.canInspect(properties)) { return cdk.VALIDATION_SUCCESS; } | |
const errors = new cdk.ValidationResults(); | |
errors.collect(cdk.propertyValidator('s3Bucket', cdk.requiredValidator)(properties.s3Bucket)); | |
errors.collect(cdk.propertyValidator('s3Bucket', cdk.validateString)(properties.s3Bucket)); | |
errors.collect(cdk.propertyValidator('s3Key', cdk.requiredValidator)(properties.s3Key)); | |
errors.collect(cdk.propertyValidator('s3Key', cdk.validateString)(properties.s3Key)); | |
errors.collect(cdk.propertyValidator('s3ObjectVersion', cdk.validateString)(properties.s3ObjectVersion)); | |
return errors.wrap('supplied properties not correct for "ContentProperty"'); | |
} | |
/** | |
* Renders the AWS CloudFormation properties of an `AWS::Lambda::LayerVersion.Content` resource | |
* | |
* @param properties - the TypeScript properties of a `ContentProperty` | |
* | |
* @returns the AWS CloudFormation properties of an `AWS::Lambda::LayerVersion.Content` resource. | |
*/ | |
// @ts-ignore TS6133 | |
function cfnLayerVersionContentPropertyToCloudFormation(properties: any): any { | |
if (!cdk.canInspect(properties)) { return properties; } | |
CfnLayerVersion_ContentPropertyValidator(properties).assertSuccess(); | |
return { | |
S3Bucket: cdk.stringToCloudFormation(properties.s3Bucket), | |
S3Key: cdk.stringToCloudFormation(properties.s3Key), | |
S3ObjectVersion: cdk.stringToCloudFormation(properties.s3ObjectVersion), | |
}; | |
} | |
/** | |
* Properties for defining a `AWS::Lambda::LayerVersionPermission` | |
* @see http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-lambda-layerversionpermission.html | |
*/ | |
export interface CfnLayerVersionPermissionProps { | |
/** | |
* `AWS::Lambda::LayerVersionPermission.Action` | |
* @see http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-lambda-layerversionpermission.html#cfn-lambda-layerversionpermission-action | |
*/ | |
readonly action: string; | |
/** | |
* `AWS::Lambda::LayerVersionPermission.LayerVersionArn` | |
* @see http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-lambda-layerversionpermission.html#cfn-lambda-layerversionpermission-layerversionarn | |
*/ | |
readonly layerVersionArn: string; | |
/** | |
* `AWS::Lambda::LayerVersionPermission.Principal` | |
* @see http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-lambda-layerversionpermission.html#cfn-lambda-layerversionpermission-principal | |
*/ | |
readonly principal: string; | |
/** | |
* `AWS::Lambda::LayerVersionPermission.OrganizationId` | |
* @see http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-lambda-layerversionpermission.html#cfn-lambda-layerversionpermission-organizationid | |
*/ | |
readonly organizationId?: string; | |
} | |
/** | |
* Determine whether the given properties match those of a `CfnLayerVersionPermissionProps` | |
* | |
* @param properties - the TypeScript properties of a `CfnLayerVersionPermissionProps` | |
* | |
* @returns the result of the validation. | |
*/ | |
function CfnLayerVersionPermissionPropsValidator(properties: any): cdk.ValidationResult { | |
if (!cdk.canInspect(properties)) { return cdk.VALIDATION_SUCCESS; } | |
const errors = new cdk.ValidationResults(); | |
errors.collect(cdk.propertyValidator('action', cdk.requiredValidator)(properties.action)); | |
errors.collect(cdk.propertyValidator('action', cdk.validateString)(properties.action)); | |
errors.collect(cdk.propertyValidator('layerVersionArn', cdk.requiredValidator)(properties.layerVersionArn)); | |
errors.collect(cdk.propertyValidator('layerVersionArn', cdk.validateString)(properties.layerVersionArn)); | |
errors.collect(cdk.propertyValidator('organizationId', cdk.validateString)(properties.organizationId)); | |
errors.collect(cdk.propertyValidator('principal', cdk.requiredValidator)(properties.principal)); | |
errors.collect(cdk.propertyValidator('principal', cdk.validateString)(properties.principal)); | |
return errors.wrap('supplied properties not correct for "CfnLayerVersionPermissionProps"'); | |
} | |
/** | |
* Renders the AWS CloudFormation properties of an `AWS::Lambda::LayerVersionPermission` resource | |
* | |
* @param properties - the TypeScript properties of a `CfnLayerVersionPermissionProps` | |
* | |
* @returns the AWS CloudFormation properties of an `AWS::Lambda::LayerVersionPermission` resource. | |
*/ | |
// @ts-ignore TS6133 | |
function cfnLayerVersionPermissionPropsToCloudFormation(properties: any): any { | |
if (!cdk.canInspect(properties)) { return properties; } | |
CfnLayerVersionPermissionPropsValidator(properties).assertSuccess(); | |
return { | |
Action: cdk.stringToCloudFormation(properties.action), | |
LayerVersionArn: cdk.stringToCloudFormation(properties.layerVersionArn), | |
Principal: cdk.stringToCloudFormation(properties.principal), | |
OrganizationId: cdk.stringToCloudFormation(properties.organizationId), | |
}; | |
} | |
/** | |
* A CloudFormation `AWS::Lambda::LayerVersionPermission` | |
* | |
* @cloudformationResource AWS::Lambda::LayerVersionPermission | |
* @see http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-lambda-layerversionpermission.html | |
*/ | |
export class CfnLayerVersionPermission extends cdk.CfnResource { | |
/** | |
* The CloudFormation resource type name for this resource class. | |
*/ | |
public static readonly cfnResourceTypeName = "AWS::Lambda::LayerVersionPermission"; | |
/** | |
* `AWS::Lambda::LayerVersionPermission.Action` | |
* @see http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-lambda-layerversionpermission.html#cfn-lambda-layerversionpermission-action | |
*/ | |
public action: string; | |
/** | |
* `AWS::Lambda::LayerVersionPermission.LayerVersionArn` | |
* @see http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-lambda-layerversionpermission.html#cfn-lambda-layerversionpermission-layerversionarn | |
*/ | |
public layerVersionArn: string; | |
/** | |
* `AWS::Lambda::LayerVersionPermission.Principal` | |
* @see http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-lambda-layerversionpermission.html#cfn-lambda-layerversionpermission-principal | |
*/ | |
public principal: string; | |
/** | |
* `AWS::Lambda::LayerVersionPermission.OrganizationId` | |
* @see http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-lambda-layerversionpermission.html#cfn-lambda-layerversionpermission-organizationid | |
*/ | |
public organizationId: string | undefined; | |
/** | |
* Create a new `AWS::Lambda::LayerVersionPermission`. | |
* | |
* @param scope - scope in which this resource is defined | |
* @param id - scoped id of the resource | |
* @param props - resource properties | |
*/ | |
constructor(scope: cdk.Construct, id: string, props: CfnLayerVersionPermissionProps) { | |
super(scope, id, { type: CfnLayerVersionPermission.cfnResourceTypeName, properties: props }); | |
cdk.requireProperty(props, 'action', this); | |
cdk.requireProperty(props, 'layerVersionArn', this); | |
cdk.requireProperty(props, 'principal', this); | |
this.action = props.action; | |
this.layerVersionArn = props.layerVersionArn; | |
this.principal = props.principal; | |
this.organizationId = props.organizationId; | |
} | |
protected get cfnProperties(): { [key: string]: any } { | |
return { | |
action: this.action, | |
layerVersionArn: this.layerVersionArn, | |
principal: this.principal, | |
organizationId: this.organizationId, | |
}; | |
} | |
protected renderProperties(props: {[key: string]: any}): { [key: string]: any } { | |
return cfnLayerVersionPermissionPropsToCloudFormation(props); | |
} | |
} | |
/** | |
* Properties for defining a `AWS::Lambda::Permission` | |
* @see http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-lambda-permission.html | |
*/ | |
export interface CfnPermissionProps { | |
/** | |
* `AWS::Lambda::Permission.Action` | |
* @see http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-lambda-permission.html#cfn-lambda-permission-action | |
*/ | |
readonly action: string; | |
/** | |
* `AWS::Lambda::Permission.FunctionName` | |
* @see http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-lambda-permission.html#cfn-lambda-permission-functionname | |
*/ | |
readonly functionName: string; | |
/** | |
* `AWS::Lambda::Permission.Principal` | |
* @see http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-lambda-permission.html#cfn-lambda-permission-principal | |
*/ | |
readonly principal: string; | |
/** | |
* `AWS::Lambda::Permission.EventSourceToken` | |
* @see http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-lambda-permission.html#cfn-lambda-permission-eventsourcetoken | |
*/ | |
readonly eventSourceToken?: string; | |
/** | |
* `AWS::Lambda::Permission.SourceAccount` | |
* @see http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-lambda-permission.html#cfn-lambda-permission-sourceaccount | |
*/ | |
readonly sourceAccount?: string; | |
/** | |
* `AWS::Lambda::Permission.SourceArn` | |
* @see http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-lambda-permission.html#cfn-lambda-permission-sourcearn | |
*/ | |
readonly sourceArn?: string; | |
} | |
/** | |
* Determine whether the given properties match those of a `CfnPermissionProps` | |
* | |
* @param properties - the TypeScript properties of a `CfnPermissionProps` | |
* | |
* @returns the result of the validation. | |
*/ | |
function CfnPermissionPropsValidator(properties: any): cdk.ValidationResult { | |
if (!cdk.canInspect(properties)) { return cdk.VALIDATION_SUCCESS; } | |
const errors = new cdk.ValidationResults(); | |
errors.collect(cdk.propertyValidator('action', cdk.requiredValidator)(properties.action)); | |
errors.collect(cdk.propertyValidator('action', cdk.validateString)(properties.action)); | |
errors.collect(cdk.propertyValidator('eventSourceToken', cdk.validateString)(properties.eventSourceToken)); | |
errors.collect(cdk.propertyValidator('functionName', cdk.requiredValidator)(properties.functionName)); | |
errors.collect(cdk.propertyValidator('functionName', cdk.validateString)(properties.functionName)); | |
errors.collect(cdk.propertyValidator('principal', cdk.requiredValidator)(properties.principal)); | |
errors.collect(cdk.propertyValidator('principal', cdk.validateString)(properties.principal)); | |
errors.collect(cdk.propertyValidator('sourceAccount', cdk.validateString)(properties.sourceAccount)); | |
errors.collect(cdk.propertyValidator('sourceArn', cdk.validateString)(properties.sourceArn)); | |
return errors.wrap('supplied properties not correct for "CfnPermissionProps"'); | |
} | |
/** | |
* Renders the AWS CloudFormation properties of an `AWS::Lambda::Permission` resource | |
* | |
* @param properties - the TypeScript properties of a `CfnPermissionProps` | |
* | |
* @returns the AWS CloudFormation properties of an `AWS::Lambda::Permission` resource. | |
*/ | |
// @ts-ignore TS6133 | |
function cfnPermissionPropsToCloudFormation(properties: any): any { | |
if (!cdk.canInspect(properties)) { return properties; } | |
CfnPermissionPropsValidator(properties).assertSuccess(); | |
return { | |
Action: cdk.stringToCloudFormation(properties.action), | |
FunctionName: cdk.stringToCloudFormation(properties.functionName), | |
Principal: cdk.stringToCloudFormation(properties.principal), | |
EventSourceToken: cdk.stringToCloudFormation(properties.eventSourceToken), | |
SourceAccount: cdk.stringToCloudFormation(properties.sourceAccount), | |
SourceArn: cdk.stringToCloudFormation(properties.sourceArn), | |
}; | |
} | |
/** | |
* A CloudFormation `AWS::Lambda::Permission` | |
* | |
* @cloudformationResource AWS::Lambda::Permission | |
* @see http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-lambda-permission.html | |
*/ | |
export class CfnPermission extends cdk.CfnResource { | |
/** | |
* The CloudFormation resource type name for this resource class. | |
*/ | |
public static readonly cfnResourceTypeName = "AWS::Lambda::Permission"; | |
/** | |
* `AWS::Lambda::Permission.Action` | |
* @see http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-lambda-permission.html#cfn-lambda-permission-action | |
*/ | |
public action: string; | |
/** | |
* `AWS::Lambda::Permission.FunctionName` | |
* @see http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-lambda-permission.html#cfn-lambda-permission-functionname | |
*/ | |
public functionName: string; | |
/** | |
* `AWS::Lambda::Permission.Principal` | |
* @see http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-lambda-permission.html#cfn-lambda-permission-principal | |
*/ | |
public principal: string; | |
/** | |
* `AWS::Lambda::Permission.EventSourceToken` | |
* @see http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-lambda-permission.html#cfn-lambda-permission-eventsourcetoken | |
*/ | |
public eventSourceToken: string | undefined; | |
/** | |
* `AWS::Lambda::Permission.SourceAccount` | |
* @see http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-lambda-permission.html#cfn-lambda-permission-sourceaccount | |
*/ | |
public sourceAccount: string | undefined; | |
/** | |
* `AWS::Lambda::Permission.SourceArn` | |
* @see http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-lambda-permission.html#cfn-lambda-permission-sourcearn | |
*/ | |
public sourceArn: string | undefined; | |
/** | |
* Create a new `AWS::Lambda::Permission`. | |
* | |
* @param scope - scope in which this resource is defined | |
* @param id - scoped id of the resource | |
* @param props - resource properties | |
*/ | |
constructor(scope: cdk.Construct, id: string, props: CfnPermissionProps) { | |
super(scope, id, { type: CfnPermission.cfnResourceTypeName, properties: props }); | |
cdk.requireProperty(props, 'action', this); | |
cdk.requireProperty(props, 'functionName', this); | |
cdk.requireProperty(props, 'principal', this); | |
this.action = props.action; | |
this.functionName = props.functionName; | |
this.principal = props.principal; | |
this.eventSourceToken = props.eventSourceToken; | |
this.sourceAccount = props.sourceAccount; | |
this.sourceArn = props.sourceArn; | |
} | |
protected get cfnProperties(): { [key: string]: any } { | |
return { | |
action: this.action, | |
functionName: this.functionName, | |
principal: this.principal, | |
eventSourceToken: this.eventSourceToken, | |
sourceAccount: this.sourceAccount, | |
sourceArn: this.sourceArn, | |
}; | |
} | |
protected renderProperties(props: {[key: string]: any}): { [key: string]: any } { | |
return cfnPermissionPropsToCloudFormation(props); | |
} | |
} | |
/** | |
* Properties for defining a `AWS::Lambda::Version` | |
* @see http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-lambda-version.html | |
*/ | |
export interface CfnVersionProps { | |
/** | |
* `AWS::Lambda::Version.FunctionName` | |
* @see http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-lambda-version.html#cfn-lambda-version-functionname | |
*/ | |
readonly functionName: string; | |
/** | |
* `AWS::Lambda::Version.CodeSha256` | |
* @see http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-lambda-version.html#cfn-lambda-version-codesha256 | |
*/ | |
readonly codeSha256?: string; | |
/** | |
* `AWS::Lambda::Version.Description` | |
* @see http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-lambda-version.html#cfn-lambda-version-description | |
*/ | |
readonly description?: string; | |
} | |
/** | |
* Determine whether the given properties match those of a `CfnVersionProps` | |
* | |
* @param properties - the TypeScript properties of a `CfnVersionProps` | |
* | |
* @returns the result of the validation. | |
*/ | |
function CfnVersionPropsValidator(properties: any): cdk.ValidationResult { | |
if (!cdk.canInspect(properties)) { return cdk.VALIDATION_SUCCESS; } | |
const errors = new cdk.ValidationResults(); | |
errors.collect(cdk.propertyValidator('codeSha256', cdk.validateString)(properties.codeSha256)); | |
errors.collect(cdk.propertyValidator('description', cdk.validateString)(properties.description)); | |
errors.collect(cdk.propertyValidator('functionName', cdk.requiredValidator)(properties.functionName)); | |
errors.collect(cdk.propertyValidator('functionName', cdk.validateString)(properties.functionName)); | |
return errors.wrap('supplied properties not correct for "CfnVersionProps"'); | |
} | |
/** | |
* Renders the AWS CloudFormation properties of an `AWS::Lambda::Version` resource | |
* | |
* @param properties - the TypeScript properties of a `CfnVersionProps` | |
* | |
* @returns the AWS CloudFormation properties of an `AWS::Lambda::Version` resource. | |
*/ | |
// @ts-ignore TS6133 | |
function cfnVersionPropsToCloudFormation(properties: any): any { | |
if (!cdk.canInspect(properties)) { return properties; } | |
CfnVersionPropsValidator(properties).assertSuccess(); | |
return { | |
FunctionName: cdk.stringToCloudFormation(properties.functionName), | |
CodeSha256: cdk.stringToCloudFormation(properties.codeSha256), | |
Description: cdk.stringToCloudFormation(properties.description), | |
}; | |
} | |
/** | |
* A CloudFormation `AWS::Lambda::Version` | |
* | |
* @cloudformationResource AWS::Lambda::Version | |
* @see http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-lambda-version.html | |
*/ | |
export class CfnVersion extends cdk.CfnResource { | |
/** | |
* The CloudFormation resource type name for this resource class. | |
*/ | |
public static readonly cfnResourceTypeName = "AWS::Lambda::Version"; | |
/** | |
* @cloudformationAttribute Version | |
*/ | |
public readonly attrVersion: string; | |
/** | |
* `AWS::Lambda::Version.FunctionName` | |
* @see http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-lambda-version.html#cfn-lambda-version-functionname | |
*/ | |
public functionName: string; | |
/** | |
* `AWS::Lambda::Version.CodeSha256` | |
* @see http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-lambda-version.html#cfn-lambda-version-codesha256 | |
*/ | |
public codeSha256: string | undefined; | |
/** | |
* `AWS::Lambda::Version.Description` | |
* @see http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-lambda-version.html#cfn-lambda-version-description | |
*/ | |
public description: string | undefined; | |
/** | |
* Create a new `AWS::Lambda::Version`. | |
* | |
* @param scope - scope in which this resource is defined | |
* @param id - scoped id of the resource | |
* @param props - resource properties | |
*/ | |
constructor(scope: cdk.Construct, id: string, props: CfnVersionProps) { | |
super(scope, id, { type: CfnVersion.cfnResourceTypeName, properties: props }); | |
cdk.requireProperty(props, 'functionName', this); | |
this.attrVersion = cdk.Token.asString(this.getAtt('Version')); | |
this.functionName = props.functionName; | |
this.codeSha256 = props.codeSha256; | |
this.description = props.description; | |
} | |
protected get cfnProperties(): { [key: string]: any } { | |
return { | |
functionName: this.functionName, | |
codeSha256: this.codeSha256, | |
description: this.description, | |
}; | |
} | |
protected renderProperties(props: {[key: string]: any}): { [key: string]: any } { | |
return cfnVersionPropsToCloudFormation(props); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment