Documentation ¶
Index ¶
- func Alias_IsConstruct(x interface{}) *bool
- func Alias_IsResource(construct awscdk.IConstruct) *bool
- func CfnAlias_CFN_RESOURCE_TYPE_NAME() *string
- func CfnAlias_IsCfnElement(x interface{}) *bool
- func CfnAlias_IsCfnResource(construct constructs.IConstruct) *bool
- func CfnAlias_IsConstruct(x interface{}) *bool
- func CfnCodeSigningConfig_CFN_RESOURCE_TYPE_NAME() *string
- func CfnCodeSigningConfig_IsCfnElement(x interface{}) *bool
- func CfnCodeSigningConfig_IsCfnResource(construct constructs.IConstruct) *bool
- func CfnCodeSigningConfig_IsConstruct(x interface{}) *bool
- func CfnEventInvokeConfig_CFN_RESOURCE_TYPE_NAME() *string
- func CfnEventInvokeConfig_IsCfnElement(x interface{}) *bool
- func CfnEventInvokeConfig_IsCfnResource(construct constructs.IConstruct) *bool
- func CfnEventInvokeConfig_IsConstruct(x interface{}) *bool
- func CfnEventSourceMapping_CFN_RESOURCE_TYPE_NAME() *string
- func CfnEventSourceMapping_IsCfnElement(x interface{}) *bool
- func CfnEventSourceMapping_IsCfnResource(construct constructs.IConstruct) *bool
- func CfnEventSourceMapping_IsConstruct(x interface{}) *bool
- func CfnFunction_CFN_RESOURCE_TYPE_NAME() *string
- func CfnFunction_IsCfnElement(x interface{}) *bool
- func CfnFunction_IsCfnResource(construct constructs.IConstruct) *bool
- func CfnFunction_IsConstruct(x interface{}) *bool
- func CfnLayerVersionPermission_CFN_RESOURCE_TYPE_NAME() *string
- func CfnLayerVersionPermission_IsCfnElement(x interface{}) *bool
- func CfnLayerVersionPermission_IsCfnResource(construct constructs.IConstruct) *bool
- func CfnLayerVersionPermission_IsConstruct(x interface{}) *bool
- func CfnLayerVersion_CFN_RESOURCE_TYPE_NAME() *string
- func CfnLayerVersion_IsCfnElement(x interface{}) *bool
- func CfnLayerVersion_IsCfnResource(construct constructs.IConstruct) *bool
- func CfnLayerVersion_IsConstruct(x interface{}) *bool
- func CfnPermission_CFN_RESOURCE_TYPE_NAME() *string
- func CfnPermission_IsCfnElement(x interface{}) *bool
- func CfnPermission_IsCfnResource(construct constructs.IConstruct) *bool
- func CfnPermission_IsConstruct(x interface{}) *bool
- func CfnUrl_CFN_RESOURCE_TYPE_NAME() *string
- func CfnUrl_IsCfnElement(x interface{}) *bool
- func CfnUrl_IsCfnResource(construct constructs.IConstruct) *bool
- func CfnUrl_IsConstruct(x interface{}) *bool
- func CfnVersion_CFN_RESOURCE_TYPE_NAME() *string
- func CfnVersion_IsCfnElement(x interface{}) *bool
- func CfnVersion_IsCfnResource(construct constructs.IConstruct) *bool
- func CfnVersion_IsConstruct(x interface{}) *bool
- func CodeSigningConfig_IsConstruct(x interface{}) *bool
- func CodeSigningConfig_IsResource(construct awscdk.IConstruct) *bool
- func DockerImageFunction_ClassifyVersionProperty(propertyName *string, locked *bool)
- func DockerImageFunction_IsConstruct(x interface{}) *bool
- func DockerImageFunction_IsResource(construct awscdk.IConstruct) *bool
- func DockerImageFunction_MetricAll(metricName *string, props *awscloudwatch.MetricOptions) awscloudwatch.Metric
- func DockerImageFunction_MetricAllConcurrentExecutions(props *awscloudwatch.MetricOptions) awscloudwatch.Metric
- func DockerImageFunction_MetricAllDuration(props *awscloudwatch.MetricOptions) awscloudwatch.Metric
- func DockerImageFunction_MetricAllErrors(props *awscloudwatch.MetricOptions) awscloudwatch.Metric
- func DockerImageFunction_MetricAllInvocations(props *awscloudwatch.MetricOptions) awscloudwatch.Metric
- func DockerImageFunction_MetricAllThrottles(props *awscloudwatch.MetricOptions) awscloudwatch.Metric
- func DockerImageFunction_MetricAllUnreservedConcurrentExecutions(props *awscloudwatch.MetricOptions) awscloudwatch.Metric
- func EventInvokeConfig_IsConstruct(x interface{}) *bool
- func EventInvokeConfig_IsResource(construct awscdk.IConstruct) *bool
- func EventSourceMapping_IsConstruct(x interface{}) *bool
- func EventSourceMapping_IsResource(construct awscdk.IConstruct) *bool
- func FunctionBase_IsConstruct(x interface{}) *bool
- func FunctionBase_IsResource(construct awscdk.IConstruct) *bool
- func FunctionUrl_IsConstruct(x interface{}) *bool
- func FunctionUrl_IsResource(construct awscdk.IConstruct) *bool
- func Function_ClassifyVersionProperty(propertyName *string, locked *bool)
- func Function_IsConstruct(x interface{}) *bool
- func Function_IsResource(construct awscdk.IConstruct) *bool
- func Function_MetricAll(metricName *string, props *awscloudwatch.MetricOptions) awscloudwatch.Metric
- func Function_MetricAllConcurrentExecutions(props *awscloudwatch.MetricOptions) awscloudwatch.Metric
- func Function_MetricAllDuration(props *awscloudwatch.MetricOptions) awscloudwatch.Metric
- func Function_MetricAllErrors(props *awscloudwatch.MetricOptions) awscloudwatch.Metric
- func Function_MetricAllInvocations(props *awscloudwatch.MetricOptions) awscloudwatch.Metric
- func Function_MetricAllThrottles(props *awscloudwatch.MetricOptions) awscloudwatch.Metric
- func Function_MetricAllUnreservedConcurrentExecutions(props *awscloudwatch.MetricOptions) awscloudwatch.Metric
- func Handler_FROM_IMAGE() *string
- func LayerVersion_IsConstruct(x interface{}) *bool
- func LayerVersion_IsResource(construct awscdk.IConstruct) *bool
- func LogRetention_IsConstruct(x interface{}) *bool
- func NewAlias_Override(a Alias, scope constructs.Construct, id *string, props *AliasProps)
- func NewAssetCode_Override(a AssetCode, path *string, options *awss3assets.AssetOptions)
- func NewAssetImageCode_Override(a AssetImageCode, directory *string, props *AssetImageCodeProps)
- func NewCfnAlias_Override(c CfnAlias, scope awscdk.Construct, id *string, props *CfnAliasProps)
- func NewCfnCodeSigningConfig_Override(c CfnCodeSigningConfig, scope awscdk.Construct, id *string, ...)
- func NewCfnEventInvokeConfig_Override(c CfnEventInvokeConfig, scope awscdk.Construct, id *string, ...)
- func NewCfnEventSourceMapping_Override(c CfnEventSourceMapping, scope awscdk.Construct, id *string, ...)
- func NewCfnFunction_Override(c CfnFunction, scope awscdk.Construct, id *string, props *CfnFunctionProps)
- func NewCfnLayerVersionPermission_Override(c CfnLayerVersionPermission, scope awscdk.Construct, id *string, ...)
- func NewCfnLayerVersion_Override(c CfnLayerVersion, scope awscdk.Construct, id *string, ...)
- func NewCfnParametersCode_Override(c CfnParametersCode, props *CfnParametersCodeProps)
- func NewCfnPermission_Override(c CfnPermission, scope awscdk.Construct, id *string, props *CfnPermissionProps)
- func NewCfnUrl_Override(c CfnUrl, scope awscdk.Construct, id *string, props *CfnUrlProps)
- func NewCfnVersion_Override(c CfnVersion, scope awscdk.Construct, id *string, props *CfnVersionProps)
- func NewCodeSigningConfig_Override(c CodeSigningConfig, scope constructs.Construct, id *string, ...)
- func NewCode_Override(c Code)
- func NewDockerImageCode_Override(d DockerImageCode)
- func NewDockerImageFunction_Override(d DockerImageFunction, scope constructs.Construct, id *string, ...)
- func NewEcrImageCode_Override(e EcrImageCode, repository awsecr.IRepository, props *EcrImageCodeProps)
- func NewEventInvokeConfig_Override(e EventInvokeConfig, scope constructs.Construct, id *string, ...)
- func NewEventSourceMapping_Override(e EventSourceMapping, scope constructs.Construct, id *string, ...)
- func NewFileSystem_Override(f FileSystem, config *FileSystemConfig)
- func NewFunctionBase_Override(f FunctionBase, scope constructs.Construct, id *string, ...)
- func NewFunctionUrl_Override(f FunctionUrl, scope constructs.Construct, id *string, props *FunctionUrlProps)
- func NewFunctionVersionUpgrade_Override(f FunctionVersionUpgrade, featureFlag *string, enabled *bool)
- func NewFunction_Override(f Function, scope constructs.Construct, id *string, props *FunctionProps)
- func NewInlineCode_Override(i InlineCode, code *string)
- func NewLambdaInsightsVersion_Override(l LambdaInsightsVersion)
- func NewLayerVersion_Override(l LayerVersion, scope constructs.Construct, id *string, ...)
- func NewLogRetention_Override(l LogRetention, scope constructs.Construct, id *string, ...)deprecated
- func NewQualifiedFunctionBase_Override(q QualifiedFunctionBase, scope constructs.Construct, id *string, ...)
- func NewRuntime_Override(r Runtime, name *string, family RuntimeFamily, props *LambdaRuntimeProps)
- func NewS3Code_Override(s S3Code, bucket awss3.IBucket, key *string, objectVersion *string)
- func NewSingletonFunction_Override(s SingletonFunction, scope constructs.Construct, id *string, ...)
- func NewVersion_Override(v Version, scope constructs.Construct, id *string, props *VersionProps)
- func QualifiedFunctionBase_IsConstruct(x interface{}) *bool
- func QualifiedFunctionBase_IsResource(construct awscdk.IConstruct) *bool
- func Runtime_ALL() *[]Runtime
- func SingletonFunction_IsConstruct(x interface{}) *bool
- func SingletonFunction_IsResource(construct awscdk.IConstruct) *bool
- func Version_IsConstruct(x interface{}) *bool
- func Version_IsResource(construct awscdk.IConstruct) *bool
- type Alias
- type AliasAttributes
- type AliasOptions
- type AliasProps
- type Architecture
- type AssetCode
- func AssetCode_Asset(path *string) AssetCode
- func AssetCode_FromAsset(path *string, options *awss3assets.AssetOptions) AssetCode
- func AssetCode_FromDockerBuild(path *string, options *DockerBuildAssetOptions) AssetCode
- func AssetImageCode_Asset(path *string) AssetCode
- func AssetImageCode_FromAsset(path *string, options *awss3assets.AssetOptions) AssetCode
- func AssetImageCode_FromDockerBuild(path *string, options *DockerBuildAssetOptions) AssetCode
- func CfnParametersCode_Asset(path *string) AssetCode
- func CfnParametersCode_FromAsset(path *string, options *awss3assets.AssetOptions) AssetCode
- func CfnParametersCode_FromDockerBuild(path *string, options *DockerBuildAssetOptions) AssetCode
- func Code_Asset(path *string) AssetCode
- func Code_FromAsset(path *string, options *awss3assets.AssetOptions) AssetCode
- func Code_FromDockerBuild(path *string, options *DockerBuildAssetOptions) AssetCode
- func EcrImageCode_Asset(path *string) AssetCode
- func EcrImageCode_FromAsset(path *string, options *awss3assets.AssetOptions) AssetCode
- func EcrImageCode_FromDockerBuild(path *string, options *DockerBuildAssetOptions) AssetCode
- func InlineCode_Asset(path *string) AssetCode
- func InlineCode_FromAsset(path *string, options *awss3assets.AssetOptions) AssetCode
- func InlineCode_FromDockerBuild(path *string, options *DockerBuildAssetOptions) AssetCode
- func NewAssetCode(path *string, options *awss3assets.AssetOptions) AssetCode
- func S3Code_Asset(path *string) AssetCode
- func S3Code_FromAsset(path *string, options *awss3assets.AssetOptions) AssetCode
- func S3Code_FromDockerBuild(path *string, options *DockerBuildAssetOptions) AssetCode
- type AssetImageCode
- func AssetCode_FromAssetImage(directory *string, props *AssetImageCodeProps) AssetImageCode
- func AssetImageCode_FromAssetImage(directory *string, props *AssetImageCodeProps) AssetImageCode
- func CfnParametersCode_FromAssetImage(directory *string, props *AssetImageCodeProps) AssetImageCode
- func Code_FromAssetImage(directory *string, props *AssetImageCodeProps) AssetImageCode
- func EcrImageCode_FromAssetImage(directory *string, props *AssetImageCodeProps) AssetImageCode
- func InlineCode_FromAssetImage(directory *string, props *AssetImageCodeProps) AssetImageCode
- func NewAssetImageCode(directory *string, props *AssetImageCodeProps) AssetImageCode
- func S3Code_FromAssetImage(directory *string, props *AssetImageCodeProps) AssetImageCode
- type AssetImageCodeProps
- type AutoScalingOptions
- type CfnAlias
- type CfnAliasProps
- type CfnAlias_AliasRoutingConfigurationProperty
- type CfnAlias_ProvisionedConcurrencyConfigurationProperty
- type CfnAlias_VersionWeightProperty
- type CfnCodeSigningConfig
- type CfnCodeSigningConfigProps
- type CfnCodeSigningConfig_AllowedPublishersProperty
- type CfnCodeSigningConfig_CodeSigningPoliciesProperty
- type CfnEventInvokeConfig
- type CfnEventInvokeConfigProps
- type CfnEventInvokeConfig_DestinationConfigProperty
- type CfnEventInvokeConfig_OnFailureProperty
- type CfnEventInvokeConfig_OnSuccessProperty
- type CfnEventSourceMapping
- type CfnEventSourceMappingProps
- type CfnEventSourceMapping_AmazonManagedKafkaEventSourceConfigProperty
- type CfnEventSourceMapping_DestinationConfigProperty
- type CfnEventSourceMapping_DocumentDBEventSourceConfigProperty
- type CfnEventSourceMapping_EndpointsProperty
- type CfnEventSourceMapping_FilterCriteriaProperty
- type CfnEventSourceMapping_FilterProperty
- type CfnEventSourceMapping_OnFailureProperty
- type CfnEventSourceMapping_ScalingConfigProperty
- type CfnEventSourceMapping_SelfManagedEventSourceProperty
- type CfnEventSourceMapping_SelfManagedKafkaEventSourceConfigProperty
- type CfnEventSourceMapping_SourceAccessConfigurationProperty
- type CfnFunction
- type CfnFunctionProps
- type CfnFunction_CodeProperty
- type CfnFunction_DeadLetterConfigProperty
- type CfnFunction_EnvironmentProperty
- type CfnFunction_EphemeralStorageProperty
- type CfnFunction_FileSystemConfigProperty
- type CfnFunction_ImageConfigProperty
- type CfnFunction_RuntimeManagementConfigProperty
- type CfnFunction_SnapStartProperty
- type CfnFunction_SnapStartResponseProperty
- type CfnFunction_TracingConfigProperty
- type CfnFunction_VpcConfigProperty
- type CfnLayerVersion
- type CfnLayerVersionPermission
- type CfnLayerVersionPermissionProps
- type CfnLayerVersionProps
- type CfnLayerVersion_ContentProperty
- type CfnParametersCode
- func AssetCode_CfnParameters(props *CfnParametersCodeProps) CfnParametersCode
- func AssetCode_FromCfnParameters(props *CfnParametersCodeProps) CfnParametersCode
- func AssetImageCode_CfnParameters(props *CfnParametersCodeProps) CfnParametersCode
- func AssetImageCode_FromCfnParameters(props *CfnParametersCodeProps) CfnParametersCode
- func CfnParametersCode_CfnParameters(props *CfnParametersCodeProps) CfnParametersCode
- func CfnParametersCode_FromCfnParameters(props *CfnParametersCodeProps) CfnParametersCode
- func Code_CfnParameters(props *CfnParametersCodeProps) CfnParametersCode
- func Code_FromCfnParameters(props *CfnParametersCodeProps) CfnParametersCode
- func EcrImageCode_CfnParameters(props *CfnParametersCodeProps) CfnParametersCode
- func EcrImageCode_FromCfnParameters(props *CfnParametersCodeProps) CfnParametersCode
- func InlineCode_CfnParameters(props *CfnParametersCodeProps) CfnParametersCode
- func InlineCode_FromCfnParameters(props *CfnParametersCodeProps) CfnParametersCode
- func NewCfnParametersCode(props *CfnParametersCodeProps) CfnParametersCode
- func S3Code_CfnParameters(props *CfnParametersCodeProps) CfnParametersCode
- func S3Code_FromCfnParameters(props *CfnParametersCodeProps) CfnParametersCode
- type CfnParametersCodeProps
- type CfnPermission
- type CfnPermissionProps
- type CfnUrl
- type CfnUrlProps
- type CfnUrl_CorsProperty
- type CfnVersion
- type CfnVersionProps
- type CfnVersion_ProvisionedConcurrencyConfigurationProperty
- type Code
- type CodeConfig
- type CodeImageConfig
- type CodeSigningConfig
- type CodeSigningConfigProps
- type DestinationConfig
- type DestinationOptions
- type DestinationType
- type DlqDestinationConfig
- type DockerBuildAssetOptions
- type DockerImageCode
- type DockerImageFunction
- type DockerImageFunctionProps
- type EcrImageCode
- func AssetCode_FromEcrImage(repository awsecr.IRepository, props *EcrImageCodeProps) EcrImageCode
- func AssetImageCode_FromEcrImage(repository awsecr.IRepository, props *EcrImageCodeProps) EcrImageCode
- func CfnParametersCode_FromEcrImage(repository awsecr.IRepository, props *EcrImageCodeProps) EcrImageCode
- func Code_FromEcrImage(repository awsecr.IRepository, props *EcrImageCodeProps) EcrImageCode
- func EcrImageCode_FromEcrImage(repository awsecr.IRepository, props *EcrImageCodeProps) EcrImageCode
- func InlineCode_FromEcrImage(repository awsecr.IRepository, props *EcrImageCodeProps) EcrImageCode
- func NewEcrImageCode(repository awsecr.IRepository, props *EcrImageCodeProps) EcrImageCode
- func S3Code_FromEcrImage(repository awsecr.IRepository, props *EcrImageCodeProps) EcrImageCode
- type EcrImageCodeProps
- type EnvironmentOptions
- type EventInvokeConfig
- type EventInvokeConfigOptions
- type EventInvokeConfigProps
- type EventSourceMapping
- type EventSourceMappingOptions
- type EventSourceMappingProps
- type FileSystem
- type FileSystemConfig
- type Function
- type FunctionAttributes
- type FunctionBase
- type FunctionOptions
- type FunctionProps
- type FunctionUrl
- type FunctionUrlAuthType
- type FunctionUrlCorsOptions
- type FunctionUrlOptions
- type FunctionUrlProps
- type FunctionVersionUpgrade
- type Handler
- type HttpMethod
- type IAlias
- type ICodeSigningConfig
- type IDestination
- type IEventSource
- type IEventSourceDlq
- type IEventSourceMapping
- type IFunction
- func DockerImageFunction_FromFunctionArn(scope constructs.Construct, id *string, functionArn *string) IFunction
- func DockerImageFunction_FromFunctionAttributes(scope constructs.Construct, id *string, attrs *FunctionAttributes) IFunction
- func DockerImageFunction_FromFunctionName(scope constructs.Construct, id *string, functionName *string) IFunction
- func Function_FromFunctionArn(scope constructs.Construct, id *string, functionArn *string) IFunction
- func Function_FromFunctionAttributes(scope constructs.Construct, id *string, attrs *FunctionAttributes) IFunction
- func Function_FromFunctionName(scope constructs.Construct, id *string, functionName *string) IFunction
- type IFunctionUrl
- type ILayerVersion
- type IScalableFunctionAttribute
- type IVersion
- type InlineCode
- func AssetCode_FromInline(code *string) InlineCode
- func AssetCode_Inline(code *string) InlineCode
- func AssetImageCode_FromInline(code *string) InlineCode
- func AssetImageCode_Inline(code *string) InlineCode
- func CfnParametersCode_FromInline(code *string) InlineCode
- func CfnParametersCode_Inline(code *string) InlineCode
- func Code_FromInline(code *string) InlineCode
- func Code_Inline(code *string) InlineCode
- func EcrImageCode_FromInline(code *string) InlineCode
- func EcrImageCode_Inline(code *string) InlineCode
- func InlineCode_FromInline(code *string) InlineCode
- func InlineCode_Inline(code *string) InlineCode
- func NewInlineCode(code *string) InlineCode
- func S3Code_FromInline(code *string) InlineCode
- func S3Code_Inline(code *string) InlineCode
- type LambdaInsightsVersion
- func LambdaInsightsVersion_FromInsightVersionArn(arn *string) LambdaInsightsVersion
- func LambdaInsightsVersion_VERSION_1_0_119_0() LambdaInsightsVersion
- func LambdaInsightsVersion_VERSION_1_0_135_0() LambdaInsightsVersion
- func LambdaInsightsVersion_VERSION_1_0_54_0() LambdaInsightsVersion
- func LambdaInsightsVersion_VERSION_1_0_86_0() LambdaInsightsVersion
- func LambdaInsightsVersion_VERSION_1_0_89_0() LambdaInsightsVersion
- func LambdaInsightsVersion_VERSION_1_0_98_0() LambdaInsightsVersion
- type LambdaRuntimeProps
- type LayerVersion
- type LayerVersionAttributes
- type LayerVersionOptions
- type LayerVersionPermission
- type LayerVersionProps
- type LogRetentiondeprecated
- type LogRetentionPropsdeprecated
- type LogRetentionRetryOptions
- type Permission
- type QualifiedFunctionBase
- type ResourceBindOptions
- type Runtime
- func NewRuntime(name *string, family RuntimeFamily, props *LambdaRuntimeProps) Runtime
- func Runtime_DOTNET_6() Runtime
- func Runtime_DOTNET_CORE_1() Runtime
- func Runtime_DOTNET_CORE_2() Runtime
- func Runtime_DOTNET_CORE_2_1() Runtime
- func Runtime_DOTNET_CORE_3_1() Runtime
- func Runtime_FROM_IMAGE() Runtime
- func Runtime_GO_1_X() Runtime
- func Runtime_JAVA_11() Runtime
- func Runtime_JAVA_8() Runtime
- func Runtime_JAVA_8_CORRETTO() Runtime
- func Runtime_NODEJS() Runtime
- func Runtime_NODEJS_10_X() Runtime
- func Runtime_NODEJS_12_X() Runtime
- func Runtime_NODEJS_14_X() Runtime
- func Runtime_NODEJS_16_X() Runtime
- func Runtime_NODEJS_4_3() Runtime
- func Runtime_NODEJS_6_10() Runtime
- func Runtime_NODEJS_8_10() Runtime
- func Runtime_PROVIDED() Runtime
- func Runtime_PROVIDED_AL2() Runtime
- func Runtime_PYTHON_2_7() Runtime
- func Runtime_PYTHON_3_6() Runtime
- func Runtime_PYTHON_3_7() Runtime
- func Runtime_PYTHON_3_8() Runtime
- func Runtime_PYTHON_3_9() Runtime
- func Runtime_RUBY_2_5() Runtime
- func Runtime_RUBY_2_7() Runtime
- type RuntimeFamily
- type S3Code
- func AssetCode_Bucket(bucket awss3.IBucket, key *string, objectVersion *string) S3Code
- func AssetCode_FromBucket(bucket awss3.IBucket, key *string, objectVersion *string) S3Code
- func AssetImageCode_Bucket(bucket awss3.IBucket, key *string, objectVersion *string) S3Code
- func AssetImageCode_FromBucket(bucket awss3.IBucket, key *string, objectVersion *string) S3Code
- func CfnParametersCode_Bucket(bucket awss3.IBucket, key *string, objectVersion *string) S3Code
- func CfnParametersCode_FromBucket(bucket awss3.IBucket, key *string, objectVersion *string) S3Code
- func Code_Bucket(bucket awss3.IBucket, key *string, objectVersion *string) S3Code
- func Code_FromBucket(bucket awss3.IBucket, key *string, objectVersion *string) S3Code
- func EcrImageCode_Bucket(bucket awss3.IBucket, key *string, objectVersion *string) S3Code
- func EcrImageCode_FromBucket(bucket awss3.IBucket, key *string, objectVersion *string) S3Code
- func InlineCode_Bucket(bucket awss3.IBucket, key *string, objectVersion *string) S3Code
- func InlineCode_FromBucket(bucket awss3.IBucket, key *string, objectVersion *string) S3Code
- func NewS3Code(bucket awss3.IBucket, key *string, objectVersion *string) S3Code
- func S3Code_Bucket(bucket awss3.IBucket, key *string, objectVersion *string) S3Code
- func S3Code_FromBucket(bucket awss3.IBucket, key *string, objectVersion *string) S3Code
- type SingletonFunction
- type SingletonFunctionProps
- type SourceAccessConfiguration
- type SourceAccessConfigurationType
- func SourceAccessConfigurationType_BASIC_AUTH() SourceAccessConfigurationType
- func SourceAccessConfigurationType_CLIENT_CERTIFICATE_TLS_AUTH() SourceAccessConfigurationType
- func SourceAccessConfigurationType_Of(name *string) SourceAccessConfigurationType
- func SourceAccessConfigurationType_SASL_SCRAM_256_AUTH() SourceAccessConfigurationType
- func SourceAccessConfigurationType_SASL_SCRAM_512_AUTH() SourceAccessConfigurationType
- func SourceAccessConfigurationType_VPC_SECURITY_GROUP() SourceAccessConfigurationType
- func SourceAccessConfigurationType_VPC_SUBNET() SourceAccessConfigurationType
- type StartingPosition
- type Tracing
- type UntrustedArtifactOnDeployment
- type UtilizationScalingOptions
- type Version
- type VersionAttributes
- type VersionOptions
- type VersionProps
- type VersionWeight
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Alias_IsConstruct ¶
func Alias_IsConstruct(x interface{}) *bool
Return whether the given object is a Construct. Experimental.
func Alias_IsResource ¶
func Alias_IsResource(construct awscdk.IConstruct) *bool
Check whether the given construct is a Resource. Experimental.
func CfnAlias_CFN_RESOURCE_TYPE_NAME ¶
func CfnAlias_CFN_RESOURCE_TYPE_NAME() *string
func CfnAlias_IsCfnElement ¶
func CfnAlias_IsCfnElement(x interface{}) *bool
Returns `true` if a construct is a stack element (i.e. part of the synthesized cloudformation template).
Uses duck-typing instead of `instanceof` to allow stack elements from different versions of this library to be included in the same stack.
Returns: The construct as a stack element or undefined if it is not a stack element. Experimental.
func CfnAlias_IsCfnResource ¶
func CfnAlias_IsCfnResource(construct constructs.IConstruct) *bool
Check whether the given construct is a CfnResource. Experimental.
func CfnAlias_IsConstruct ¶
func CfnAlias_IsConstruct(x interface{}) *bool
Return whether the given object is a Construct. Experimental.
func CfnCodeSigningConfig_CFN_RESOURCE_TYPE_NAME ¶
func CfnCodeSigningConfig_CFN_RESOURCE_TYPE_NAME() *string
func CfnCodeSigningConfig_IsCfnElement ¶
func CfnCodeSigningConfig_IsCfnElement(x interface{}) *bool
Returns `true` if a construct is a stack element (i.e. part of the synthesized cloudformation template).
Uses duck-typing instead of `instanceof` to allow stack elements from different versions of this library to be included in the same stack.
Returns: The construct as a stack element or undefined if it is not a stack element. Experimental.
func CfnCodeSigningConfig_IsCfnResource ¶
func CfnCodeSigningConfig_IsCfnResource(construct constructs.IConstruct) *bool
Check whether the given construct is a CfnResource. Experimental.
func CfnCodeSigningConfig_IsConstruct ¶
func CfnCodeSigningConfig_IsConstruct(x interface{}) *bool
Return whether the given object is a Construct. Experimental.
func CfnEventInvokeConfig_CFN_RESOURCE_TYPE_NAME ¶
func CfnEventInvokeConfig_CFN_RESOURCE_TYPE_NAME() *string
func CfnEventInvokeConfig_IsCfnElement ¶
func CfnEventInvokeConfig_IsCfnElement(x interface{}) *bool
Returns `true` if a construct is a stack element (i.e. part of the synthesized cloudformation template).
Uses duck-typing instead of `instanceof` to allow stack elements from different versions of this library to be included in the same stack.
Returns: The construct as a stack element or undefined if it is not a stack element. Experimental.
func CfnEventInvokeConfig_IsCfnResource ¶
func CfnEventInvokeConfig_IsCfnResource(construct constructs.IConstruct) *bool
Check whether the given construct is a CfnResource. Experimental.
func CfnEventInvokeConfig_IsConstruct ¶
func CfnEventInvokeConfig_IsConstruct(x interface{}) *bool
Return whether the given object is a Construct. Experimental.
func CfnEventSourceMapping_CFN_RESOURCE_TYPE_NAME ¶
func CfnEventSourceMapping_CFN_RESOURCE_TYPE_NAME() *string
func CfnEventSourceMapping_IsCfnElement ¶
func CfnEventSourceMapping_IsCfnElement(x interface{}) *bool
Returns `true` if a construct is a stack element (i.e. part of the synthesized cloudformation template).
Uses duck-typing instead of `instanceof` to allow stack elements from different versions of this library to be included in the same stack.
Returns: The construct as a stack element or undefined if it is not a stack element. Experimental.
func CfnEventSourceMapping_IsCfnResource ¶
func CfnEventSourceMapping_IsCfnResource(construct constructs.IConstruct) *bool
Check whether the given construct is a CfnResource. Experimental.
func CfnEventSourceMapping_IsConstruct ¶
func CfnEventSourceMapping_IsConstruct(x interface{}) *bool
Return whether the given object is a Construct. Experimental.
func CfnFunction_CFN_RESOURCE_TYPE_NAME ¶
func CfnFunction_CFN_RESOURCE_TYPE_NAME() *string
func CfnFunction_IsCfnElement ¶
func CfnFunction_IsCfnElement(x interface{}) *bool
Returns `true` if a construct is a stack element (i.e. part of the synthesized cloudformation template).
Uses duck-typing instead of `instanceof` to allow stack elements from different versions of this library to be included in the same stack.
Returns: The construct as a stack element or undefined if it is not a stack element. Experimental.
func CfnFunction_IsCfnResource ¶
func CfnFunction_IsCfnResource(construct constructs.IConstruct) *bool
Check whether the given construct is a CfnResource. Experimental.
func CfnFunction_IsConstruct ¶
func CfnFunction_IsConstruct(x interface{}) *bool
Return whether the given object is a Construct. Experimental.
func CfnLayerVersionPermission_CFN_RESOURCE_TYPE_NAME ¶
func CfnLayerVersionPermission_CFN_RESOURCE_TYPE_NAME() *string
func CfnLayerVersionPermission_IsCfnElement ¶
func CfnLayerVersionPermission_IsCfnElement(x interface{}) *bool
Returns `true` if a construct is a stack element (i.e. part of the synthesized cloudformation template).
Uses duck-typing instead of `instanceof` to allow stack elements from different versions of this library to be included in the same stack.
Returns: The construct as a stack element or undefined if it is not a stack element. Experimental.
func CfnLayerVersionPermission_IsCfnResource ¶
func CfnLayerVersionPermission_IsCfnResource(construct constructs.IConstruct) *bool
Check whether the given construct is a CfnResource. Experimental.
func CfnLayerVersionPermission_IsConstruct ¶
func CfnLayerVersionPermission_IsConstruct(x interface{}) *bool
Return whether the given object is a Construct. Experimental.
func CfnLayerVersion_CFN_RESOURCE_TYPE_NAME ¶
func CfnLayerVersion_CFN_RESOURCE_TYPE_NAME() *string
func CfnLayerVersion_IsCfnElement ¶
func CfnLayerVersion_IsCfnElement(x interface{}) *bool
Returns `true` if a construct is a stack element (i.e. part of the synthesized cloudformation template).
Uses duck-typing instead of `instanceof` to allow stack elements from different versions of this library to be included in the same stack.
Returns: The construct as a stack element or undefined if it is not a stack element. Experimental.
func CfnLayerVersion_IsCfnResource ¶
func CfnLayerVersion_IsCfnResource(construct constructs.IConstruct) *bool
Check whether the given construct is a CfnResource. Experimental.
func CfnLayerVersion_IsConstruct ¶
func CfnLayerVersion_IsConstruct(x interface{}) *bool
Return whether the given object is a Construct. Experimental.
func CfnPermission_CFN_RESOURCE_TYPE_NAME ¶
func CfnPermission_CFN_RESOURCE_TYPE_NAME() *string
func CfnPermission_IsCfnElement ¶
func CfnPermission_IsCfnElement(x interface{}) *bool
Returns `true` if a construct is a stack element (i.e. part of the synthesized cloudformation template).
Uses duck-typing instead of `instanceof` to allow stack elements from different versions of this library to be included in the same stack.
Returns: The construct as a stack element or undefined if it is not a stack element. Experimental.
func CfnPermission_IsCfnResource ¶
func CfnPermission_IsCfnResource(construct constructs.IConstruct) *bool
Check whether the given construct is a CfnResource. Experimental.
func CfnPermission_IsConstruct ¶
func CfnPermission_IsConstruct(x interface{}) *bool
Return whether the given object is a Construct. Experimental.
func CfnUrl_CFN_RESOURCE_TYPE_NAME ¶
func CfnUrl_CFN_RESOURCE_TYPE_NAME() *string
func CfnUrl_IsCfnElement ¶
func CfnUrl_IsCfnElement(x interface{}) *bool
Returns `true` if a construct is a stack element (i.e. part of the synthesized cloudformation template).
Uses duck-typing instead of `instanceof` to allow stack elements from different versions of this library to be included in the same stack.
Returns: The construct as a stack element or undefined if it is not a stack element. Experimental.
func CfnUrl_IsCfnResource ¶
func CfnUrl_IsCfnResource(construct constructs.IConstruct) *bool
Check whether the given construct is a CfnResource. Experimental.
func CfnUrl_IsConstruct ¶
func CfnUrl_IsConstruct(x interface{}) *bool
Return whether the given object is a Construct. Experimental.
func CfnVersion_CFN_RESOURCE_TYPE_NAME ¶
func CfnVersion_CFN_RESOURCE_TYPE_NAME() *string
func CfnVersion_IsCfnElement ¶
func CfnVersion_IsCfnElement(x interface{}) *bool
Returns `true` if a construct is a stack element (i.e. part of the synthesized cloudformation template).
Uses duck-typing instead of `instanceof` to allow stack elements from different versions of this library to be included in the same stack.
Returns: The construct as a stack element or undefined if it is not a stack element. Experimental.
func CfnVersion_IsCfnResource ¶
func CfnVersion_IsCfnResource(construct constructs.IConstruct) *bool
Check whether the given construct is a CfnResource. Experimental.
func CfnVersion_IsConstruct ¶
func CfnVersion_IsConstruct(x interface{}) *bool
Return whether the given object is a Construct. Experimental.
func CodeSigningConfig_IsConstruct ¶
func CodeSigningConfig_IsConstruct(x interface{}) *bool
Return whether the given object is a Construct. Experimental.
func CodeSigningConfig_IsResource ¶
func CodeSigningConfig_IsResource(construct awscdk.IConstruct) *bool
Check whether the given construct is a Resource. Experimental.
func DockerImageFunction_ClassifyVersionProperty ¶
Record whether specific properties in the `AWS::Lambda::Function` resource should also be associated to the Version resource.
See 'currentVersion' section in the module README for more details. Experimental.
func DockerImageFunction_IsConstruct ¶
func DockerImageFunction_IsConstruct(x interface{}) *bool
Return whether the given object is a Construct. Experimental.
func DockerImageFunction_IsResource ¶
func DockerImageFunction_IsResource(construct awscdk.IConstruct) *bool
Check whether the given construct is a Resource. Experimental.
func DockerImageFunction_MetricAll ¶
func DockerImageFunction_MetricAll(metricName *string, props *awscloudwatch.MetricOptions) awscloudwatch.Metric
Return the given named metric for this Lambda. Experimental.
func DockerImageFunction_MetricAllConcurrentExecutions ¶
func DockerImageFunction_MetricAllConcurrentExecutions(props *awscloudwatch.MetricOptions) awscloudwatch.Metric
Metric for the number of concurrent executions across all Lambdas. Experimental.
func DockerImageFunction_MetricAllDuration ¶
func DockerImageFunction_MetricAllDuration(props *awscloudwatch.MetricOptions) awscloudwatch.Metric
Metric for the Duration executing all Lambdas. Experimental.
func DockerImageFunction_MetricAllErrors ¶
func DockerImageFunction_MetricAllErrors(props *awscloudwatch.MetricOptions) awscloudwatch.Metric
Metric for the number of Errors executing all Lambdas. Experimental.
func DockerImageFunction_MetricAllInvocations ¶
func DockerImageFunction_MetricAllInvocations(props *awscloudwatch.MetricOptions) awscloudwatch.Metric
Metric for the number of invocations of all Lambdas. Experimental.
func DockerImageFunction_MetricAllThrottles ¶
func DockerImageFunction_MetricAllThrottles(props *awscloudwatch.MetricOptions) awscloudwatch.Metric
Metric for the number of throttled invocations of all Lambdas. Experimental.
func DockerImageFunction_MetricAllUnreservedConcurrentExecutions ¶
func DockerImageFunction_MetricAllUnreservedConcurrentExecutions(props *awscloudwatch.MetricOptions) awscloudwatch.Metric
Metric for the number of unreserved concurrent executions across all Lambdas. Experimental.
func EventInvokeConfig_IsConstruct ¶
func EventInvokeConfig_IsConstruct(x interface{}) *bool
Return whether the given object is a Construct. Experimental.
func EventInvokeConfig_IsResource ¶
func EventInvokeConfig_IsResource(construct awscdk.IConstruct) *bool
Check whether the given construct is a Resource. Experimental.
func EventSourceMapping_IsConstruct ¶
func EventSourceMapping_IsConstruct(x interface{}) *bool
Return whether the given object is a Construct. Experimental.
func EventSourceMapping_IsResource ¶
func EventSourceMapping_IsResource(construct awscdk.IConstruct) *bool
Check whether the given construct is a Resource. Experimental.
func FunctionBase_IsConstruct ¶
func FunctionBase_IsConstruct(x interface{}) *bool
Return whether the given object is a Construct. Experimental.
func FunctionBase_IsResource ¶
func FunctionBase_IsResource(construct awscdk.IConstruct) *bool
Check whether the given construct is a Resource. Experimental.
func FunctionUrl_IsConstruct ¶
func FunctionUrl_IsConstruct(x interface{}) *bool
Return whether the given object is a Construct. Experimental.
func FunctionUrl_IsResource ¶
func FunctionUrl_IsResource(construct awscdk.IConstruct) *bool
Check whether the given construct is a Resource. Experimental.
func Function_ClassifyVersionProperty ¶
Record whether specific properties in the `AWS::Lambda::Function` resource should also be associated to the Version resource.
See 'currentVersion' section in the module README for more details. Experimental.
func Function_IsConstruct ¶
func Function_IsConstruct(x interface{}) *bool
Return whether the given object is a Construct. Experimental.
func Function_IsResource ¶
func Function_IsResource(construct awscdk.IConstruct) *bool
Check whether the given construct is a Resource. Experimental.
func Function_MetricAll ¶
func Function_MetricAll(metricName *string, props *awscloudwatch.MetricOptions) awscloudwatch.Metric
Return the given named metric for this Lambda. Experimental.
func Function_MetricAllConcurrentExecutions ¶
func Function_MetricAllConcurrentExecutions(props *awscloudwatch.MetricOptions) awscloudwatch.Metric
Metric for the number of concurrent executions across all Lambdas. Experimental.
func Function_MetricAllDuration ¶
func Function_MetricAllDuration(props *awscloudwatch.MetricOptions) awscloudwatch.Metric
Metric for the Duration executing all Lambdas. Experimental.
func Function_MetricAllErrors ¶
func Function_MetricAllErrors(props *awscloudwatch.MetricOptions) awscloudwatch.Metric
Metric for the number of Errors executing all Lambdas. Experimental.
func Function_MetricAllInvocations ¶
func Function_MetricAllInvocations(props *awscloudwatch.MetricOptions) awscloudwatch.Metric
Metric for the number of invocations of all Lambdas. Experimental.
func Function_MetricAllThrottles ¶
func Function_MetricAllThrottles(props *awscloudwatch.MetricOptions) awscloudwatch.Metric
Metric for the number of throttled invocations of all Lambdas. Experimental.
func Function_MetricAllUnreservedConcurrentExecutions ¶
func Function_MetricAllUnreservedConcurrentExecutions(props *awscloudwatch.MetricOptions) awscloudwatch.Metric
Metric for the number of unreserved concurrent executions across all Lambdas. Experimental.
func Handler_FROM_IMAGE ¶
func Handler_FROM_IMAGE() *string
func LayerVersion_IsConstruct ¶
func LayerVersion_IsConstruct(x interface{}) *bool
Return whether the given object is a Construct. Experimental.
func LayerVersion_IsResource ¶
func LayerVersion_IsResource(construct awscdk.IConstruct) *bool
Check whether the given construct is a Resource. Experimental.
func LogRetention_IsConstruct ¶
func LogRetention_IsConstruct(x interface{}) *bool
Return whether the given object is a Construct. Deprecated: use `LogRetention` from '.
func NewAlias_Override ¶
func NewAlias_Override(a Alias, scope constructs.Construct, id *string, props *AliasProps)
Experimental.
func NewAssetCode_Override ¶
func NewAssetCode_Override(a AssetCode, path *string, options *awss3assets.AssetOptions)
Experimental.
func NewAssetImageCode_Override ¶
func NewAssetImageCode_Override(a AssetImageCode, directory *string, props *AssetImageCodeProps)
Experimental.
func NewCfnAlias_Override ¶
func NewCfnAlias_Override(c CfnAlias, scope awscdk.Construct, id *string, props *CfnAliasProps)
Create a new `AWS::Lambda::Alias`.
func NewCfnCodeSigningConfig_Override ¶
func NewCfnCodeSigningConfig_Override(c CfnCodeSigningConfig, scope awscdk.Construct, id *string, props *CfnCodeSigningConfigProps)
Create a new `AWS::Lambda::CodeSigningConfig`.
func NewCfnEventInvokeConfig_Override ¶
func NewCfnEventInvokeConfig_Override(c CfnEventInvokeConfig, scope awscdk.Construct, id *string, props *CfnEventInvokeConfigProps)
Create a new `AWS::Lambda::EventInvokeConfig`.
func NewCfnEventSourceMapping_Override ¶
func NewCfnEventSourceMapping_Override(c CfnEventSourceMapping, scope awscdk.Construct, id *string, props *CfnEventSourceMappingProps)
Create a new `AWS::Lambda::EventSourceMapping`.
func NewCfnFunction_Override ¶
func NewCfnFunction_Override(c CfnFunction, scope awscdk.Construct, id *string, props *CfnFunctionProps)
Create a new `AWS::Lambda::Function`.
func NewCfnLayerVersionPermission_Override ¶
func NewCfnLayerVersionPermission_Override(c CfnLayerVersionPermission, scope awscdk.Construct, id *string, props *CfnLayerVersionPermissionProps)
Create a new `AWS::Lambda::LayerVersionPermission`.
func NewCfnLayerVersion_Override ¶
func NewCfnLayerVersion_Override(c CfnLayerVersion, scope awscdk.Construct, id *string, props *CfnLayerVersionProps)
Create a new `AWS::Lambda::LayerVersion`.
func NewCfnParametersCode_Override ¶
func NewCfnParametersCode_Override(c CfnParametersCode, props *CfnParametersCodeProps)
Experimental.
func NewCfnPermission_Override ¶
func NewCfnPermission_Override(c CfnPermission, scope awscdk.Construct, id *string, props *CfnPermissionProps)
Create a new `AWS::Lambda::Permission`.
func NewCfnUrl_Override ¶
func NewCfnUrl_Override(c CfnUrl, scope awscdk.Construct, id *string, props *CfnUrlProps)
Create a new `AWS::Lambda::Url`.
func NewCfnVersion_Override ¶
func NewCfnVersion_Override(c CfnVersion, scope awscdk.Construct, id *string, props *CfnVersionProps)
Create a new `AWS::Lambda::Version`.
func NewCodeSigningConfig_Override ¶
func NewCodeSigningConfig_Override(c CodeSigningConfig, scope constructs.Construct, id *string, props *CodeSigningConfigProps)
Experimental.
func NewDockerImageCode_Override ¶
func NewDockerImageCode_Override(d DockerImageCode)
Experimental.
func NewDockerImageFunction_Override ¶
func NewDockerImageFunction_Override(d DockerImageFunction, scope constructs.Construct, id *string, props *DockerImageFunctionProps)
Experimental.
func NewEcrImageCode_Override ¶
func NewEcrImageCode_Override(e EcrImageCode, repository awsecr.IRepository, props *EcrImageCodeProps)
Experimental.
func NewEventInvokeConfig_Override ¶
func NewEventInvokeConfig_Override(e EventInvokeConfig, scope constructs.Construct, id *string, props *EventInvokeConfigProps)
Experimental.
func NewEventSourceMapping_Override ¶
func NewEventSourceMapping_Override(e EventSourceMapping, scope constructs.Construct, id *string, props *EventSourceMappingProps)
Experimental.
func NewFileSystem_Override ¶
func NewFileSystem_Override(f FileSystem, config *FileSystemConfig)
Experimental.
func NewFunctionBase_Override ¶
func NewFunctionBase_Override(f FunctionBase, scope constructs.Construct, id *string, props *awscdk.ResourceProps)
Experimental.
func NewFunctionUrl_Override ¶
func NewFunctionUrl_Override(f FunctionUrl, scope constructs.Construct, id *string, props *FunctionUrlProps)
Experimental.
func NewFunctionVersionUpgrade_Override ¶
func NewFunctionVersionUpgrade_Override(f FunctionVersionUpgrade, featureFlag *string, enabled *bool)
Experimental.
func NewFunction_Override ¶
func NewFunction_Override(f Function, scope constructs.Construct, id *string, props *FunctionProps)
Experimental.
func NewLambdaInsightsVersion_Override ¶
func NewLambdaInsightsVersion_Override(l LambdaInsightsVersion)
Experimental.
func NewLayerVersion_Override ¶
func NewLayerVersion_Override(l LayerVersion, scope constructs.Construct, id *string, props *LayerVersionProps)
Experimental.
func NewLogRetention_Override
deprecated
func NewLogRetention_Override(l LogRetention, scope constructs.Construct, id *string, props *LogRetentionProps)
Deprecated: use `LogRetention` from '.
func NewQualifiedFunctionBase_Override ¶
func NewQualifiedFunctionBase_Override(q QualifiedFunctionBase, scope constructs.Construct, id *string, props *awscdk.ResourceProps)
Experimental.
func NewRuntime_Override ¶
func NewRuntime_Override(r Runtime, name *string, family RuntimeFamily, props *LambdaRuntimeProps)
Experimental.
func NewS3Code_Override ¶
Experimental.
func NewSingletonFunction_Override ¶
func NewSingletonFunction_Override(s SingletonFunction, scope constructs.Construct, id *string, props *SingletonFunctionProps)
Experimental.
func NewVersion_Override ¶
func NewVersion_Override(v Version, scope constructs.Construct, id *string, props *VersionProps)
Experimental.
func QualifiedFunctionBase_IsConstruct ¶
func QualifiedFunctionBase_IsConstruct(x interface{}) *bool
Return whether the given object is a Construct. Experimental.
func QualifiedFunctionBase_IsResource ¶
func QualifiedFunctionBase_IsResource(construct awscdk.IConstruct) *bool
Check whether the given construct is a Resource. Experimental.
func Runtime_ALL ¶
func Runtime_ALL() *[]Runtime
func SingletonFunction_IsConstruct ¶
func SingletonFunction_IsConstruct(x interface{}) *bool
Return whether the given object is a Construct. Experimental.
func SingletonFunction_IsResource ¶
func SingletonFunction_IsResource(construct awscdk.IConstruct) *bool
Check whether the given construct is a Resource. Experimental.
func Version_IsConstruct ¶
func Version_IsConstruct(x interface{}) *bool
Return whether the given object is a Construct. Experimental.
func Version_IsResource ¶
func Version_IsResource(construct awscdk.IConstruct) *bool
Check whether the given construct is a Resource. Experimental.
Types ¶
type Alias ¶
type Alias interface { QualifiedFunctionBase IAlias // Name of this alias. // Experimental. AliasName() *string // The architecture of this Lambda Function. // Experimental. Architecture() Architecture // Whether the addPermission() call adds any permissions. // // True for new Lambdas, false for version $LATEST and imported Lambdas // from different accounts. // Experimental. CanCreatePermissions() *bool // Access the Connections object. // // Will fail if not a VPC-enabled Lambda Function. // Experimental. Connections() awsec2.Connections // The environment this resource belongs to. // // For resources that are created and managed by the CDK // (generally, those created by creating new class instances like Role, Bucket, etc.), // this is always the same as the environment of the stack they belong to; // however, for imported resources // (those obtained from static methods like fromRoleArn, fromBucketName, etc.), // that might be different than the stack they were imported into. // Experimental. Env() *awscdk.ResourceEnvironment // ARN of this alias. // // Used to be able to use Alias in place of a regular Lambda. Lambda accepts // ARNs everywhere it accepts function names. // Experimental. FunctionArn() *string // ARN of this alias. // // Used to be able to use Alias in place of a regular Lambda. Lambda accepts // ARNs everywhere it accepts function names. // Experimental. FunctionName() *string // The principal this Lambda Function is running as. // Experimental. GrantPrincipal() awsiam.IPrincipal // Whether or not this Lambda function was bound to a VPC. // // If this is is `false`, trying to access the `connections` object will fail. // Experimental. IsBoundToVpc() *bool // Experimental. Lambda() IFunction // The `$LATEST` version of this function. // // Note that this is reference to a non-specific AWS Lambda version, which // means the function this version refers to can return different results in // different invocations. // // To obtain a reference to an explicit version which references the current // function configuration, use `lambdaFunction.currentVersion` instead. // Experimental. LatestVersion() IVersion // The construct tree node associated with this construct. // Experimental. Node() awscdk.ConstructNode // The construct node where permissions are attached. // Experimental. PermissionsNode() awscdk.ConstructNode // Returns a string-encoded token that resolves to the physical name that should be passed to the CloudFormation resource. // // This value will resolve to one of the following: // - a concrete value (e.g. `"my-awesome-bucket"`) // - `undefined`, when a name should be generated by CloudFormation // - a concrete name generated automatically during synthesis, in // cross-environment scenarios. // Experimental. PhysicalName() *string // The qualifier of the version or alias of this function. // // A qualifier is the identifier that's appended to a version or alias ARN. // Experimental. Qualifier() *string // The ARN(s) to put into the resource field of the generated IAM policy for grantInvoke(). // Experimental. ResourceArnsForGrantInvoke() *[]*string // The IAM role associated with this function. // // Undefined if the function was imported without a role. // Experimental. Role() awsiam.IRole // The stack in which this resource is defined. // Experimental. Stack() awscdk.Stack // The underlying Lambda function version. // Experimental. Version() IVersion // Configure provisioned concurrency autoscaling on a function alias. // // Returns a scalable attribute that can call // `scaleOnUtilization()` and `scaleOnSchedule()`. // Experimental. AddAutoScaling(options *AutoScalingOptions) IScalableFunctionAttribute // Adds an event source to this function. // // Event sources are implemented in the @aws-cdk/aws-lambda-event-sources module. // // The following example adds an SQS Queue as an event source: // “` // import { SqsEventSource } from '@aws-cdk/aws-lambda-event-sources'; // myFunction.addEventSource(new SqsEventSource(myQueue)); // “`. // Experimental. AddEventSource(source IEventSource) // Adds an event source that maps to this AWS Lambda function. // Experimental. AddEventSourceMapping(id *string, options *EventSourceMappingOptions) EventSourceMapping // Adds a url to this lambda function. // Experimental. AddFunctionUrl(options *FunctionUrlOptions) FunctionUrl // Adds a permission to the Lambda resource policy. // See: Permission for details. // // Experimental. AddPermission(id *string, permission *Permission) // Adds a statement to the IAM role assumed by the instance. // Experimental. AddToRolePolicy(statement awsiam.PolicyStatement) // Apply the given removal policy to this resource. // // The Removal Policy controls what happens to this resource when it stops // being managed by CloudFormation, either because you've removed it from the // CDK application or because you've made a change that requires the resource // to be replaced. // // The resource can be deleted (`RemovalPolicy.DESTROY`), or left in your AWS // account for data recovery and cleanup later (`RemovalPolicy.RETAIN`). // Experimental. ApplyRemovalPolicy(policy awscdk.RemovalPolicy) // Configures options for asynchronous invocation. // Experimental. ConfigureAsyncInvoke(options *EventInvokeConfigOptions) // A warning will be added to functions under the following conditions: - permissions that include `lambda:InvokeFunction` are added to the unqualified function. // // - function.currentVersion is invoked before or after the permission is created. // // This applies only to permissions on Lambda functions, not versions or aliases. // This function is overridden as a noOp for QualifiedFunctionBase. // Experimental. ConsiderWarningOnInvokeFunctionPermissions(_scope awscdk.Construct, _action *string) // Experimental. GeneratePhysicalName() *string // Returns an environment-sensitive token that should be used for the resource's "ARN" attribute (e.g. `bucket.bucketArn`). // // Normally, this token will resolve to `arnAttr`, but if the resource is // referenced across environments, `arnComponents` will be used to synthesize // a concrete ARN with the resource's physical name. Make sure to reference // `this.physicalName` in `arnComponents`. // Experimental. GetResourceArnAttribute(arnAttr *string, arnComponents *awscdk.ArnComponents) *string // Returns an environment-sensitive token that should be used for the resource's "name" attribute (e.g. `bucket.bucketName`). // // Normally, this token will resolve to `nameAttr`, but if the resource is // referenced across environments, it will be resolved to `this.physicalName`, // which will be a concrete name. // Experimental. GetResourceNameAttribute(nameAttr *string) *string // Grant the given identity permissions to invoke this Lambda. // Experimental. GrantInvoke(grantee awsiam.IGrantable) awsiam.Grant // Grant the given identity permissions to invoke this Lambda Function URL. // Experimental. GrantInvokeUrl(grantee awsiam.IGrantable) awsiam.Grant // Return the given named metric for this Function. // Experimental. Metric(metricName *string, props *awscloudwatch.MetricOptions) awscloudwatch.Metric // How long execution of this Lambda takes. // // Average over 5 minutes. // Experimental. MetricDuration(props *awscloudwatch.MetricOptions) awscloudwatch.Metric // How many invocations of this Lambda fail. // // Sum over 5 minutes. // Experimental. MetricErrors(props *awscloudwatch.MetricOptions) awscloudwatch.Metric // How often this Lambda is invoked. // // Sum over 5 minutes. // Experimental. MetricInvocations(props *awscloudwatch.MetricOptions) awscloudwatch.Metric // How often this Lambda is throttled. // // Sum over 5 minutes. // Experimental. MetricThrottles(props *awscloudwatch.MetricOptions) awscloudwatch.Metric // Perform final modifications before synthesis. // // This method can be implemented by derived constructs in order to perform // final changes before synthesis. prepare() will be called after child // constructs have been prepared. // // This is an advanced framework feature. Only use this if you // understand the implications. // Experimental. OnPrepare() // Allows this construct to emit artifacts into the cloud assembly during synthesis. // // This method is usually implemented by framework-level constructs such as `Stack` and `Asset` // as they participate in synthesizing the cloud assembly. // Experimental. OnSynthesize(session constructs.ISynthesisSession) // Validate the current construct. // // This method can be implemented by derived constructs in order to perform // validation logic. It is called on all constructs before synthesis. // // Returns: An array of validation error messages, or an empty array if the construct is valid. // Experimental. OnValidate() *[]*string // Perform final modifications before synthesis. // // This method can be implemented by derived constructs in order to perform // final changes before synthesis. prepare() will be called after child // constructs have been prepared. // // This is an advanced framework feature. Only use this if you // understand the implications. // Experimental. Prepare() // Allows this construct to emit artifacts into the cloud assembly during synthesis. // // This method is usually implemented by framework-level constructs such as `Stack` and `Asset` // as they participate in synthesizing the cloud assembly. // Experimental. Synthesize(session awscdk.ISynthesisSession) // Returns a string representation of this construct. // Experimental. ToString() *string // Validate the current construct. // // This method can be implemented by derived constructs in order to perform // validation logic. It is called on all constructs before synthesis. // // Returns: An array of validation error messages, or an empty array if the construct is valid. // Experimental. Validate() *[]*string // Experimental. WarnInvokeFunctionPermissions(scope awscdk.Construct) }
A new alias to a particular version of a Lambda function.
Example:
lambdaCode := lambda.Code_FromCfnParameters() func := lambda.NewFunction(this, jsii.String("Lambda"), &FunctionProps{ Code: lambdaCode, Handler: jsii.String("index.handler"), Runtime: lambda.Runtime_NODEJS_14_X(), }) // used to make sure each CDK synthesis produces a different Version version := func.currentVersion alias := lambda.NewAlias(this, jsii.String("LambdaAlias"), &AliasProps{ AliasName: jsii.String("Prod"), Version: Version, }) codedeploy.NewLambdaDeploymentGroup(this, jsii.String("DeploymentGroup"), &LambdaDeploymentGroupProps{ Alias: Alias, DeploymentConfig: codedeploy.LambdaDeploymentConfig_LINEAR_10PERCENT_EVERY_1MINUTE(), })
Experimental.
func NewAlias ¶
func NewAlias(scope constructs.Construct, id *string, props *AliasProps) Alias
Experimental.
type AliasAttributes ¶
type AliasAttributes struct { // Experimental. AliasName *string `field:"required" json:"aliasName" yaml:"aliasName"` // Experimental. AliasVersion IVersion `field:"required" json:"aliasVersion" yaml:"aliasVersion"` }
Example:
// The code below shows an example of how to instantiate this type. // The values are placeholders you should change. import "github.com/aws/aws-cdk-go/awscdk" var version version aliasAttributes := &AliasAttributes{ AliasName: jsii.String("aliasName"), AliasVersion: version, }
Experimental.
type AliasOptions ¶
type AliasOptions struct { // The maximum age of a request that Lambda sends to a function for processing. // // Minimum: 60 seconds // Maximum: 6 hours. // Experimental. MaxEventAge awscdk.Duration `field:"optional" json:"maxEventAge" yaml:"maxEventAge"` // The destination for failed invocations. // Experimental. OnFailure IDestination `field:"optional" json:"onFailure" yaml:"onFailure"` // The destination for successful invocations. // Experimental. OnSuccess IDestination `field:"optional" json:"onSuccess" yaml:"onSuccess"` // The maximum number of times to retry when the function returns an error. // // Minimum: 0 // Maximum: 2. // Experimental. RetryAttempts *float64 `field:"optional" json:"retryAttempts" yaml:"retryAttempts"` // Additional versions with individual weights this alias points to. // // Individual additional version weights specified here should add up to // (less than) one. All remaining weight is routed to the default // version. // // For example, the config is // // version: "1" // additionalVersions: [{ version: "2", weight: 0.05 }] // // Then 5% of traffic will be routed to function version 2, while // the remaining 95% of traffic will be routed to function version 1. // Experimental. AdditionalVersions *[]*VersionWeight `field:"optional" json:"additionalVersions" yaml:"additionalVersions"` // Description for the alias. // Experimental. Description *string `field:"optional" json:"description" yaml:"description"` // Specifies a provisioned concurrency configuration for a function's alias. // Experimental. ProvisionedConcurrentExecutions *float64 `field:"optional" json:"provisionedConcurrentExecutions" yaml:"provisionedConcurrentExecutions"` }
Options for `lambda.Alias`.
Example:
// The code below shows an example of how to instantiate this type. // The values are placeholders you should change. import monocdk "github.com/aws/aws-cdk-go/awscdk" import "github.com/aws/aws-cdk-go/awscdk" var destination iDestination var duration duration var version version aliasOptions := &AliasOptions{ AdditionalVersions: []versionWeight{ &versionWeight{ Version: version, Weight: jsii.Number(123), }, }, Description: jsii.String("description"), MaxEventAge: duration, OnFailure: destination, OnSuccess: destination, ProvisionedConcurrentExecutions: jsii.Number(123), RetryAttempts: jsii.Number(123), }
Experimental.
type AliasProps ¶
type AliasProps struct { // The maximum age of a request that Lambda sends to a function for processing. // // Minimum: 60 seconds // Maximum: 6 hours. // Experimental. MaxEventAge awscdk.Duration `field:"optional" json:"maxEventAge" yaml:"maxEventAge"` // The destination for failed invocations. // Experimental. OnFailure IDestination `field:"optional" json:"onFailure" yaml:"onFailure"` // The destination for successful invocations. // Experimental. OnSuccess IDestination `field:"optional" json:"onSuccess" yaml:"onSuccess"` // The maximum number of times to retry when the function returns an error. // // Minimum: 0 // Maximum: 2. // Experimental. RetryAttempts *float64 `field:"optional" json:"retryAttempts" yaml:"retryAttempts"` // Additional versions with individual weights this alias points to. // // Individual additional version weights specified here should add up to // (less than) one. All remaining weight is routed to the default // version. // // For example, the config is // // version: "1" // additionalVersions: [{ version: "2", weight: 0.05 }] // // Then 5% of traffic will be routed to function version 2, while // the remaining 95% of traffic will be routed to function version 1. // Experimental. AdditionalVersions *[]*VersionWeight `field:"optional" json:"additionalVersions" yaml:"additionalVersions"` // Description for the alias. // Experimental. Description *string `field:"optional" json:"description" yaml:"description"` // Specifies a provisioned concurrency configuration for a function's alias. // Experimental. ProvisionedConcurrentExecutions *float64 `field:"optional" json:"provisionedConcurrentExecutions" yaml:"provisionedConcurrentExecutions"` // Name of this alias. // Experimental. AliasName *string `field:"required" json:"aliasName" yaml:"aliasName"` // Function version this alias refers to. // // Use lambda.currentVersion to reference a version with your latest changes. // Experimental. Version IVersion `field:"required" json:"version" yaml:"version"` }
Properties for a new Lambda alias.
Example:
lambdaCode := lambda.Code_FromCfnParameters() func := lambda.NewFunction(this, jsii.String("Lambda"), &FunctionProps{ Code: lambdaCode, Handler: jsii.String("index.handler"), Runtime: lambda.Runtime_NODEJS_14_X(), }) // used to make sure each CDK synthesis produces a different Version version := func.currentVersion alias := lambda.NewAlias(this, jsii.String("LambdaAlias"), &AliasProps{ AliasName: jsii.String("Prod"), Version: Version, }) codedeploy.NewLambdaDeploymentGroup(this, jsii.String("DeploymentGroup"), &LambdaDeploymentGroupProps{ Alias: Alias, DeploymentConfig: codedeploy.LambdaDeploymentConfig_LINEAR_10PERCENT_EVERY_1MINUTE(), })
Experimental.
type Architecture ¶
type Architecture interface { // The platform to use for this architecture when building with Docker. // Experimental. DockerPlatform() *string // The name of the architecture as recognized by the AWS Lambda service APIs. // Experimental. Name() *string }
Architectures supported by AWS Lambda.
Example:
lambda.NewFunction(this, jsii.String("MyFunction"), &FunctionProps{ Runtime: lambda.Runtime_NODEJS_16_X(), Handler: jsii.String("index.handler"), Architecture: lambda.Architecture_ARM_64(), Code: lambda.Code_FromAsset(path.join(__dirname, jsii.String("lambda-handler"))), InsightsVersion: lambda.LambdaInsightsVersion_VERSION_1_0_119_0(), })
Experimental.
func Architecture_ARM_64 ¶
func Architecture_ARM_64() Architecture
func Architecture_Custom ¶
func Architecture_Custom(name *string, dockerPlatform *string) Architecture
Used to specify a custom architecture name.
Use this if the architecture name is not yet supported by the CDK. Experimental.
func Architecture_X86_64 ¶
func Architecture_X86_64() Architecture
type AssetCode ¶
type AssetCode interface { Code // Determines whether this Code is inline code or not. // Experimental. IsInline() *bool // The path to the asset file or directory. // Experimental. Path() *string // Called when the lambda or layer is initialized to allow this object to bind to the stack, add resources and have fun. // Experimental. Bind(scope awscdk.Construct) *CodeConfig // Called after the CFN function resource has been created to allow the code class to bind to it. // // Specifically it's required to allow assets to add // metadata for tooling like SAM CLI to be able to find their origins. // Experimental. BindToResource(resource awscdk.CfnResource, options *ResourceBindOptions) }
Lambda code from a local directory.
Example:
import path "github.com/aws-samples/dummy/path" import "github.com/aws/aws-cdk-go/awscdk" import "github.com/aws/aws-cdk-go/awscdk" import "github.com/aws/aws-cdk-go/awscdk" /* * Stack verification steps: * * `curl -s -o /dev/null -w "%{http_code}" <url>` should return 401 * * `curl -s -o /dev/null -w "%{http_code}" -H 'Authorization: deny' <url>` should return 403 * * `curl -s -o /dev/null -w "%{http_code}" -H 'Authorization: allow' <url>` should return 200 */ app := awscdk.NewApp() stack := awscdk.NewStack(app, jsii.String("TokenAuthorizerInteg")) authorizerFn := lambda.NewFunction(stack, jsii.String("MyAuthorizerFunction"), &FunctionProps{ Runtime: lambda.Runtime_NODEJS_14_X(), Handler: jsii.String("index.handler"), Code: lambda.AssetCode_FromAsset(path.join(__dirname, jsii.String("integ.token-authorizer.handler"))), }) restapi := awscdk.NewRestApi(stack, jsii.String("MyRestApi")) authorizer := awscdk.NewTokenAuthorizer(stack, jsii.String("MyAuthorizer"), &TokenAuthorizerProps{ Handler: authorizerFn, }) restapi.Root.AddMethod(jsii.String("ANY"), awscdk.NewMockIntegration(&IntegrationOptions{ IntegrationResponses: []integrationResponse{ &integrationResponse{ StatusCode: jsii.String("200"), }, }, PassthroughBehavior: awscdk.PassthroughBehavior_NEVER, RequestTemplates: map[string]*string{ "application/json": jsii.String("{ \"statusCode\": 200 }"), }, }), &MethodOptions{ MethodResponses: []methodResponse{ &methodResponse{ StatusCode: jsii.String("200"), }, }, Authorizer: Authorizer, })
Experimental.
func AssetCode_Asset ¶
DEPRECATED. Deprecated: use `fromAsset`.
func AssetCode_FromAsset ¶
func AssetCode_FromAsset(path *string, options *awss3assets.AssetOptions) AssetCode
Loads the function code from a local disk path. Experimental.
func AssetCode_FromDockerBuild ¶
func AssetCode_FromDockerBuild(path *string, options *DockerBuildAssetOptions) AssetCode
Loads the function code from an asset created by a Docker build.
By default, the asset is expected to be located at `/asset` in the image. Experimental.
func AssetImageCode_Asset ¶
DEPRECATED. Deprecated: use `fromAsset`.
func AssetImageCode_FromAsset ¶
func AssetImageCode_FromAsset(path *string, options *awss3assets.AssetOptions) AssetCode
Loads the function code from a local disk path. Experimental.
func AssetImageCode_FromDockerBuild ¶
func AssetImageCode_FromDockerBuild(path *string, options *DockerBuildAssetOptions) AssetCode
Loads the function code from an asset created by a Docker build.
By default, the asset is expected to be located at `/asset` in the image. Experimental.
func CfnParametersCode_Asset ¶
DEPRECATED. Deprecated: use `fromAsset`.
func CfnParametersCode_FromAsset ¶
func CfnParametersCode_FromAsset(path *string, options *awss3assets.AssetOptions) AssetCode
Loads the function code from a local disk path. Experimental.
func CfnParametersCode_FromDockerBuild ¶
func CfnParametersCode_FromDockerBuild(path *string, options *DockerBuildAssetOptions) AssetCode
Loads the function code from an asset created by a Docker build.
By default, the asset is expected to be located at `/asset` in the image. Experimental.
func Code_FromAsset ¶
func Code_FromAsset(path *string, options *awss3assets.AssetOptions) AssetCode
Loads the function code from a local disk path. Experimental.
func Code_FromDockerBuild ¶
func Code_FromDockerBuild(path *string, options *DockerBuildAssetOptions) AssetCode
Loads the function code from an asset created by a Docker build.
By default, the asset is expected to be located at `/asset` in the image. Experimental.
func EcrImageCode_Asset ¶
DEPRECATED. Deprecated: use `fromAsset`.
func EcrImageCode_FromAsset ¶
func EcrImageCode_FromAsset(path *string, options *awss3assets.AssetOptions) AssetCode
Loads the function code from a local disk path. Experimental.
func EcrImageCode_FromDockerBuild ¶
func EcrImageCode_FromDockerBuild(path *string, options *DockerBuildAssetOptions) AssetCode
Loads the function code from an asset created by a Docker build.
By default, the asset is expected to be located at `/asset` in the image. Experimental.
func InlineCode_Asset ¶
DEPRECATED. Deprecated: use `fromAsset`.
func InlineCode_FromAsset ¶
func InlineCode_FromAsset(path *string, options *awss3assets.AssetOptions) AssetCode
Loads the function code from a local disk path. Experimental.
func InlineCode_FromDockerBuild ¶
func InlineCode_FromDockerBuild(path *string, options *DockerBuildAssetOptions) AssetCode
Loads the function code from an asset created by a Docker build.
By default, the asset is expected to be located at `/asset` in the image. Experimental.
func NewAssetCode ¶
func NewAssetCode(path *string, options *awss3assets.AssetOptions) AssetCode
Experimental.
func S3Code_Asset ¶
DEPRECATED. Deprecated: use `fromAsset`.
func S3Code_FromAsset ¶
func S3Code_FromAsset(path *string, options *awss3assets.AssetOptions) AssetCode
Loads the function code from a local disk path. Experimental.
func S3Code_FromDockerBuild ¶
func S3Code_FromDockerBuild(path *string, options *DockerBuildAssetOptions) AssetCode
Loads the function code from an asset created by a Docker build.
By default, the asset is expected to be located at `/asset` in the image. Experimental.
type AssetImageCode ¶
type AssetImageCode interface { Code // Determines whether this Code is inline code or not. // Experimental. IsInline() *bool // Called when the lambda or layer is initialized to allow this object to bind to the stack, add resources and have fun. // Experimental. Bind(scope awscdk.Construct) *CodeConfig // Called after the CFN function resource has been created to allow the code class to bind to it. // // Specifically it's required to allow assets to add // metadata for tooling like SAM CLI to be able to find their origins. // Experimental. BindToResource(resource awscdk.CfnResource, options *ResourceBindOptions) }
Represents an ECR image that will be constructed from the specified asset and can be bound as Lambda code.
Example:
// The code below shows an example of how to instantiate this type. // The values are placeholders you should change. import "github.com/aws/aws-cdk-go/awscdk" import "github.com/aws/aws-cdk-go/awscdk" import "github.com/aws/aws-cdk-go/awscdk" import "github.com/aws/aws-cdk-go/awscdk" var networkMode networkMode var platform platform assetImageCode := awscdk.Aws_lambda.NewAssetImageCode(jsii.String("directory"), &AssetImageCodeProps{ BuildArgs: map[string]*string{ "buildArgsKey": jsii.String("buildArgs"), }, Cmd: []*string{ jsii.String("cmd"), }, Entrypoint: []*string{ jsii.String("entrypoint"), }, Exclude: []*string{ jsii.String("exclude"), }, ExtraHash: jsii.String("extraHash"), File: jsii.String("file"), Follow: awscdk.Assets.FollowMode_NEVER, FollowSymlinks: monocdk.SymlinkFollowMode_NEVER, IgnoreMode: monocdk.IgnoreMode_GLOB, Invalidation: &DockerImageAssetInvalidationOptions{ BuildArgs: jsii.Boolean(false), ExtraHash: jsii.Boolean(false), File: jsii.Boolean(false), NetworkMode: jsii.Boolean(false), Platform: jsii.Boolean(false), RepositoryName: jsii.Boolean(false), Target: jsii.Boolean(false), }, NetworkMode: networkMode, Platform: platform, RepositoryName: jsii.String("repositoryName"), Target: jsii.String("target"), WorkingDirectory: jsii.String("workingDirectory"), })
Experimental.
func AssetCode_FromAssetImage ¶
func AssetCode_FromAssetImage(directory *string, props *AssetImageCodeProps) AssetImageCode
Create an ECR image from the specified asset and bind it as the Lambda code. Experimental.
func AssetImageCode_FromAssetImage ¶
func AssetImageCode_FromAssetImage(directory *string, props *AssetImageCodeProps) AssetImageCode
Create an ECR image from the specified asset and bind it as the Lambda code. Experimental.
func CfnParametersCode_FromAssetImage ¶
func CfnParametersCode_FromAssetImage(directory *string, props *AssetImageCodeProps) AssetImageCode
Create an ECR image from the specified asset and bind it as the Lambda code. Experimental.
func Code_FromAssetImage ¶
func Code_FromAssetImage(directory *string, props *AssetImageCodeProps) AssetImageCode
Create an ECR image from the specified asset and bind it as the Lambda code. Experimental.
func EcrImageCode_FromAssetImage ¶
func EcrImageCode_FromAssetImage(directory *string, props *AssetImageCodeProps) AssetImageCode
Create an ECR image from the specified asset and bind it as the Lambda code. Experimental.
func InlineCode_FromAssetImage ¶
func InlineCode_FromAssetImage(directory *string, props *AssetImageCodeProps) AssetImageCode
Create an ECR image from the specified asset and bind it as the Lambda code. Experimental.
func NewAssetImageCode ¶
func NewAssetImageCode(directory *string, props *AssetImageCodeProps) AssetImageCode
Experimental.
func S3Code_FromAssetImage ¶
func S3Code_FromAssetImage(directory *string, props *AssetImageCodeProps) AssetImageCode
Create an ECR image from the specified asset and bind it as the Lambda code. Experimental.
type AssetImageCodeProps ¶
type AssetImageCodeProps struct { // Glob patterns to exclude from the copy. // Experimental. Exclude *[]*string `field:"optional" json:"exclude" yaml:"exclude"` // A strategy for how to handle symlinks. // Deprecated: use `followSymlinks` instead. Follow assets.FollowMode `field:"optional" json:"follow" yaml:"follow"` // The ignore behavior to use for exclude patterns. // Experimental. IgnoreMode awscdk.IgnoreMode `field:"optional" json:"ignoreMode" yaml:"ignoreMode"` // Extra information to encode into the fingerprint (e.g. build instructions and other inputs). // Experimental. ExtraHash *string `field:"optional" json:"extraHash" yaml:"extraHash"` // A strategy for how to handle symlinks. // Experimental. FollowSymlinks awscdk.SymlinkFollowMode `field:"optional" json:"followSymlinks" yaml:"followSymlinks"` // Build args to pass to the `docker build` command. // // Since Docker build arguments are resolved before deployment, keys and // values cannot refer to unresolved tokens (such as `lambda.functionArn` or // `queue.queueUrl`). // Experimental. BuildArgs *map[string]*string `field:"optional" json:"buildArgs" yaml:"buildArgs"` // Path to the Dockerfile (relative to the directory). // Experimental. File *string `field:"optional" json:"file" yaml:"file"` // Options to control which parameters are used to invalidate the asset hash. // Experimental. Invalidation *awsecrassets.DockerImageAssetInvalidationOptions `field:"optional" json:"invalidation" yaml:"invalidation"` // Networking mode for the RUN commands during build. // // Support docker API 1.25+. // Experimental. NetworkMode awsecrassets.NetworkMode `field:"optional" json:"networkMode" yaml:"networkMode"` // Platform to build for. // // _Requires Docker Buildx_. // Experimental. Platform awsecrassets.Platform `field:"optional" json:"platform" yaml:"platform"` // ECR repository name. // // Specify this property if you need to statically address the image, e.g. // from a Kubernetes Pod. Note, this is only the repository name, without the // registry and the tag parts. // Deprecated: to control the location of docker image assets, please override // `Stack.addDockerImageAsset`. this feature will be removed in future // releases. RepositoryName *string `field:"optional" json:"repositoryName" yaml:"repositoryName"` // Docker target to build to. // Experimental. Target *string `field:"optional" json:"target" yaml:"target"` // Specify or override the CMD on the specified Docker image or Dockerfile. // // This needs to be in the 'exec form', viz., `[ 'executable', 'param1', 'param2' ]`. // See: https://docs.docker.com/engine/reference/builder/#cmd // // Experimental. Cmd *[]*string `field:"optional" json:"cmd" yaml:"cmd"` // Specify or override the ENTRYPOINT on the specified Docker image or Dockerfile. // // An ENTRYPOINT allows you to configure a container that will run as an executable. // This needs to be in the 'exec form', viz., `[ 'executable', 'param1', 'param2' ]`. // See: https://docs.docker.com/engine/reference/builder/#entrypoint // // Experimental. Entrypoint *[]*string `field:"optional" json:"entrypoint" yaml:"entrypoint"` // Specify or override the WORKDIR on the specified Docker image or Dockerfile. // // A WORKDIR allows you to configure the working directory the container will use. // See: https://docs.docker.com/engine/reference/builder/#workdir // // Experimental. WorkingDirectory *string `field:"optional" json:"workingDirectory" yaml:"workingDirectory"` }
Properties to initialize a new AssetImage.
Example:
// The code below shows an example of how to instantiate this type. // The values are placeholders you should change. import "github.com/aws/aws-cdk-go/awscdk" import "github.com/aws/aws-cdk-go/awscdk" import "github.com/aws/aws-cdk-go/awscdk" import "github.com/aws/aws-cdk-go/awscdk" var networkMode networkMode var platform platform assetImageCodeProps := &AssetImageCodeProps{ BuildArgs: map[string]*string{ "buildArgsKey": jsii.String("buildArgs"), }, Cmd: []*string{ jsii.String("cmd"), }, Entrypoint: []*string{ jsii.String("entrypoint"), }, Exclude: []*string{ jsii.String("exclude"), }, ExtraHash: jsii.String("extraHash"), File: jsii.String("file"), Follow: awscdk.Assets.FollowMode_NEVER, FollowSymlinks: monocdk.SymlinkFollowMode_NEVER, IgnoreMode: monocdk.IgnoreMode_GLOB, Invalidation: &DockerImageAssetInvalidationOptions{ BuildArgs: jsii.Boolean(false), ExtraHash: jsii.Boolean(false), File: jsii.Boolean(false), NetworkMode: jsii.Boolean(false), Platform: jsii.Boolean(false), RepositoryName: jsii.Boolean(false), Target: jsii.Boolean(false), }, NetworkMode: networkMode, Platform: platform, RepositoryName: jsii.String("repositoryName"), Target: jsii.String("target"), WorkingDirectory: jsii.String("workingDirectory"), }
Experimental.
type AutoScalingOptions ¶
type AutoScalingOptions struct { // Maximum capacity to scale to. // Experimental. MaxCapacity *float64 `field:"required" json:"maxCapacity" yaml:"maxCapacity"` // Minimum capacity to scale to. // Experimental. MinCapacity *float64 `field:"optional" json:"minCapacity" yaml:"minCapacity"` }
Properties for enabling Lambda autoscaling.
Example:
import autoscaling "github.com/aws/aws-cdk-go/awscdk" var fn function alias := fn.AddAlias(jsii.String("prod")) // Create AutoScaling target as := alias.AddAutoScaling(&AutoScalingOptions{ MaxCapacity: jsii.Number(50), }) // Configure Target Tracking as.ScaleOnUtilization(&UtilizationScalingOptions{ UtilizationTarget: jsii.Number(0.5), }) // Configure Scheduled Scaling as.ScaleOnSchedule(jsii.String("ScaleUpInTheMorning"), &ScalingSchedule{ Schedule: autoscaling.Schedule_Cron(&CronOptions{ Hour: jsii.String("8"), Minute: jsii.String("0"), }), MinCapacity: jsii.Number(20), })
Experimental.
type CfnAlias ¶
type CfnAlias interface { awscdk.CfnResource awscdk.IInspectable // Options for this resource, such as condition, update policy etc. // Experimental. CfnOptions() awscdk.ICfnResourceOptions CfnProperties() *map[string]interface{} // AWS resource type. // Experimental. CfnResourceType() *string // Returns: the stack trace of the point where this Resource was created from, sourced // from the +metadata+ entry typed +aws:cdk:logicalId+, and with the bottom-most // node +internal+ entries filtered. // Experimental. CreationStack() *[]*string // A description of the alias. Description() *string SetDescription(val *string) // The name of the Lambda function. // // **Name formats** - *Function name* - `MyFunction` . // - *Function ARN* - `arn:aws:lambda:us-west-2:123456789012:function:MyFunction` . // - *Partial ARN* - `123456789012:function:MyFunction` . // // The length constraint applies only to the full ARN. If you specify only the function name, it is limited to 64 characters in length. FunctionName() *string SetFunctionName(val *string) // The function version that the alias invokes. FunctionVersion() *string SetFunctionVersion(val *string) // The logical ID for this CloudFormation stack element. // // The logical ID of the element // is calculated from the path of the resource node in the construct tree. // // To override this value, use `overrideLogicalId(newLogicalId)`. // // Returns: the logical ID as a stringified token. This value will only get // resolved during synthesis. // Experimental. LogicalId() *string // The name of the alias. Name() *string SetName(val *string) // The construct tree node associated with this construct. // Experimental. Node() awscdk.ConstructNode // Specifies a [provisioned concurrency](https://docs.aws.amazon.com/lambda/latest/dg/configuration-concurrency.html) configuration for a function's alias. ProvisionedConcurrencyConfig() interface{} SetProvisionedConcurrencyConfig(val interface{}) // Return a string that will be resolved to a CloudFormation `{ Ref }` for this element. // // If, by any chance, the intrinsic reference of a resource is not a string, you could // coerce it to an IResolvable through `Lazy.any({ produce: resource.ref })`. // Experimental. Ref() *string // The [routing configuration](https://docs.aws.amazon.com/lambda/latest/dg/lambda-traffic-shifting-using-aliases.html) of the alias. RoutingConfig() interface{} SetRoutingConfig(val interface{}) // The stack in which this element is defined. // // CfnElements must be defined within a stack scope (directly or indirectly). // Experimental. Stack() awscdk.Stack // Return properties modified after initiation. // // Resources that expose mutable properties should override this function to // collect and return the properties object for this resource. // Experimental. UpdatedProperites() *map[string]interface{} // Syntactic sugar for `addOverride(path, undefined)`. // Experimental. AddDeletionOverride(path *string) // Indicates that this resource depends on another resource and cannot be provisioned unless the other resource has been successfully provisioned. // // This can be used for resources across stacks (or nested stack) boundaries // and the dependency will automatically be transferred to the relevant scope. // Experimental. AddDependsOn(target awscdk.CfnResource) // Add a value to the CloudFormation Resource Metadata. // See: https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/metadata-section-structure.html // // Note that this is a different set of metadata from CDK node metadata; this // metadata ends up in the stack template under the resource, whereas CDK // node metadata ends up in the Cloud Assembly. // // Experimental. AddMetadata(key *string, value interface{}) // Adds an override to the synthesized CloudFormation resource. // // To add a // property override, either use `addPropertyOverride` or prefix `path` with // "Properties." (i.e. `Properties.TopicName`). // // If the override is nested, separate each nested level using a dot (.) in the path parameter. // If there is an array as part of the nesting, specify the index in the path. // // To include a literal `.` in the property name, prefix with a `\`. In most // programming languages you will need to write this as `"\\."` because the // `\` itself will need to be escaped. // // For example, // “`typescript // cfnResource.addOverride('Properties.GlobalSecondaryIndexes.0.Projection.NonKeyAttributes', ['myattribute']); // cfnResource.addOverride('Properties.GlobalSecondaryIndexes.1.ProjectionType', 'INCLUDE'); // “` // would add the overrides // “`json // "Properties": { // "GlobalSecondaryIndexes": [ // { // "Projection": { // "NonKeyAttributes": [ "myattribute" ] // ... // } // ... // }, // { // "ProjectionType": "INCLUDE" // ... // }, // ] // ... // } // “` // // The `value` argument to `addOverride` will not be processed or translated // in any way. Pass raw JSON values in here with the correct capitalization // for CloudFormation. If you pass CDK classes or structs, they will be // rendered with lowercased key names, and CloudFormation will reject the // template. // Experimental. AddOverride(path *string, value interface{}) // Adds an override that deletes the value of a property from the resource definition. // Experimental. AddPropertyDeletionOverride(propertyPath *string) // Adds an override to a resource property. // // Syntactic sugar for `addOverride("Properties.<...>", value)`. // Experimental. AddPropertyOverride(propertyPath *string, value interface{}) // Sets the deletion policy of the resource based on the removal policy specified. // // The Removal Policy controls what happens to this resource when it stops // being managed by CloudFormation, either because you've removed it from the // CDK application or because you've made a change that requires the resource // to be replaced. // // The resource can be deleted (`RemovalPolicy.DESTROY`), or left in your AWS // account for data recovery and cleanup later (`RemovalPolicy.RETAIN`). // Experimental. ApplyRemovalPolicy(policy awscdk.RemovalPolicy, options *awscdk.RemovalPolicyOptions) // Returns a token for an runtime attribute of this resource. // // Ideally, use generated attribute accessors (e.g. `resource.arn`), but this can be used for future compatibility // in case there is no generated attribute. // Experimental. GetAtt(attributeName *string) awscdk.Reference // Retrieve a value value from the CloudFormation Resource Metadata. // See: https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/metadata-section-structure.html // // Note that this is a different set of metadata from CDK node metadata; this // metadata ends up in the stack template under the resource, whereas CDK // node metadata ends up in the Cloud Assembly. // // Experimental. GetMetadata(key *string) interface{} // Examines the CloudFormation resource and discloses attributes. Inspect(inspector awscdk.TreeInspector) // Perform final modifications before synthesis. // // This method can be implemented by derived constructs in order to perform // final changes before synthesis. prepare() will be called after child // constructs have been prepared. // // This is an advanced framework feature. Only use this if you // understand the implications. // Experimental. OnPrepare() // Allows this construct to emit artifacts into the cloud assembly during synthesis. // // This method is usually implemented by framework-level constructs such as `Stack` and `Asset` // as they participate in synthesizing the cloud assembly. // Experimental. OnSynthesize(session constructs.ISynthesisSession) // Validate the current construct. // // This method can be implemented by derived constructs in order to perform // validation logic. It is called on all constructs before synthesis. // // Returns: An array of validation error messages, or an empty array if the construct is valid. // Experimental. OnValidate() *[]*string // Overrides the auto-generated logical ID with a specific ID. // Experimental. OverrideLogicalId(newLogicalId *string) // Perform final modifications before synthesis. // // This method can be implemented by derived constructs in order to perform // final changes before synthesis. prepare() will be called after child // constructs have been prepared. // // This is an advanced framework feature. Only use this if you // understand the implications. // Experimental. Prepare() RenderProperties(props *map[string]interface{}) *map[string]interface{} // Can be overridden by subclasses to determine if this resource will be rendered into the cloudformation template. // // Returns: `true` if the resource should be included or `false` is the resource // should be omitted. // Experimental. ShouldSynthesize() *bool // Allows this construct to emit artifacts into the cloud assembly during synthesis. // // This method is usually implemented by framework-level constructs such as `Stack` and `Asset` // as they participate in synthesizing the cloud assembly. // Experimental. Synthesize(session awscdk.ISynthesisSession) // Returns a string representation of this construct. // // Returns: a string representation of this resource. // Experimental. ToString() *string // Validate the current construct. // // This method can be implemented by derived constructs in order to perform // validation logic. It is called on all constructs before synthesis. // // Returns: An array of validation error messages, or an empty array if the construct is valid. // Experimental. Validate() *[]*string // Experimental. ValidateProperties(_properties interface{}) }
A CloudFormation `AWS::Lambda::Alias`.
The `AWS::Lambda::Alias` resource creates an [alias](https://docs.aws.amazon.com/lambda/latest/dg/configuration-aliases.html) for a Lambda function version. Use aliases to provide clients with a function identifier that you can update to invoke a different version.
You can also map an alias to split invocation requests between two versions. Use the `RoutingConfig` parameter to specify a second version and the percentage of invocation requests that it receives.
Example:
// The code below shows an example of how to instantiate this type. // The values are placeholders you should change. import "github.com/aws/aws-cdk-go/awscdk" cfnAlias := awscdk.Aws_lambda.NewCfnAlias(this, jsii.String("MyCfnAlias"), &CfnAliasProps{ FunctionName: jsii.String("functionName"), FunctionVersion: jsii.String("functionVersion"), Name: jsii.String("name"), // the properties below are optional Description: jsii.String("description"), ProvisionedConcurrencyConfig: &ProvisionedConcurrencyConfigurationProperty{ ProvisionedConcurrentExecutions: jsii.Number(123), }, RoutingConfig: &AliasRoutingConfigurationProperty{ AdditionalVersionWeights: []interface{}{ &VersionWeightProperty{ FunctionVersion: jsii.String("functionVersion"), FunctionWeight: jsii.Number(123), }, }, }, })
func NewCfnAlias ¶
func NewCfnAlias(scope awscdk.Construct, id *string, props *CfnAliasProps) CfnAlias
Create a new `AWS::Lambda::Alias`.
type CfnAliasProps ¶
type CfnAliasProps struct { // The name of the Lambda function. // // **Name formats** - *Function name* - `MyFunction` . // - *Function ARN* - `arn:aws:lambda:us-west-2:123456789012:function:MyFunction` . // - *Partial ARN* - `123456789012:function:MyFunction` . // // The length constraint applies only to the full ARN. If you specify only the function name, it is limited to 64 characters in length. FunctionName *string `field:"required" json:"functionName" yaml:"functionName"` // The function version that the alias invokes. FunctionVersion *string `field:"required" json:"functionVersion" yaml:"functionVersion"` // The name of the alias. Name *string `field:"required" json:"name" yaml:"name"` // A description of the alias. Description *string `field:"optional" json:"description" yaml:"description"` // Specifies a [provisioned concurrency](https://docs.aws.amazon.com/lambda/latest/dg/configuration-concurrency.html) configuration for a function's alias. ProvisionedConcurrencyConfig interface{} `field:"optional" json:"provisionedConcurrencyConfig" yaml:"provisionedConcurrencyConfig"` // The [routing configuration](https://docs.aws.amazon.com/lambda/latest/dg/lambda-traffic-shifting-using-aliases.html) of the alias. RoutingConfig interface{} `field:"optional" json:"routingConfig" yaml:"routingConfig"` }
Properties for defining a `CfnAlias`.
Example:
// The code below shows an example of how to instantiate this type. // The values are placeholders you should change. import "github.com/aws/aws-cdk-go/awscdk" cfnAliasProps := &CfnAliasProps{ FunctionName: jsii.String("functionName"), FunctionVersion: jsii.String("functionVersion"), Name: jsii.String("name"), // the properties below are optional Description: jsii.String("description"), ProvisionedConcurrencyConfig: &ProvisionedConcurrencyConfigurationProperty{ ProvisionedConcurrentExecutions: jsii.Number(123), }, RoutingConfig: &AliasRoutingConfigurationProperty{ AdditionalVersionWeights: []interface{}{ &VersionWeightProperty{ FunctionVersion: jsii.String("functionVersion"), FunctionWeight: jsii.Number(123), }, }, }, }
type CfnAlias_AliasRoutingConfigurationProperty ¶
type CfnAlias_AliasRoutingConfigurationProperty struct {
// The second version, and the percentage of traffic that's routed to it.
AdditionalVersionWeights interface{} `field:"required" json:"additionalVersionWeights" yaml:"additionalVersionWeights"`
}
The [traffic-shifting](https://docs.aws.amazon.com/lambda/latest/dg/lambda-traffic-shifting-using-aliases.html) configuration of a Lambda function alias.
Example:
// The code below shows an example of how to instantiate this type. // The values are placeholders you should change. import "github.com/aws/aws-cdk-go/awscdk" aliasRoutingConfigurationProperty := &AliasRoutingConfigurationProperty{ AdditionalVersionWeights: []interface{}{ &VersionWeightProperty{ FunctionVersion: jsii.String("functionVersion"), FunctionWeight: jsii.Number(123), }, }, }
type CfnAlias_ProvisionedConcurrencyConfigurationProperty ¶
type CfnAlias_ProvisionedConcurrencyConfigurationProperty struct { // The amount of provisioned concurrency to allocate for the alias. ProvisionedConcurrentExecutions *float64 `field:"required" json:"provisionedConcurrentExecutions" yaml:"provisionedConcurrentExecutions"` }
A provisioned concurrency configuration for a function's alias.
Example:
// The code below shows an example of how to instantiate this type. // The values are placeholders you should change. import "github.com/aws/aws-cdk-go/awscdk" provisionedConcurrencyConfigurationProperty := &ProvisionedConcurrencyConfigurationProperty{ ProvisionedConcurrentExecutions: jsii.Number(123), }
type CfnAlias_VersionWeightProperty ¶
type CfnAlias_VersionWeightProperty struct { // The qualifier of the second version. FunctionVersion *string `field:"required" json:"functionVersion" yaml:"functionVersion"` // The percentage of traffic that the alias routes to the second version. FunctionWeight *float64 `field:"required" json:"functionWeight" yaml:"functionWeight"` }
The [traffic-shifting](https://docs.aws.amazon.com/lambda/latest/dg/lambda-traffic-shifting-using-aliases.html) configuration of a Lambda function alias.
Example:
// The code below shows an example of how to instantiate this type. // The values are placeholders you should change. import "github.com/aws/aws-cdk-go/awscdk" versionWeightProperty := &VersionWeightProperty{ FunctionVersion: jsii.String("functionVersion"), FunctionWeight: jsii.Number(123), }
type CfnCodeSigningConfig ¶
type CfnCodeSigningConfig interface { awscdk.CfnResource awscdk.IInspectable // List of allowed publishers. AllowedPublishers() interface{} SetAllowedPublishers(val interface{}) // The Amazon Resource Name (ARN) of the code signing configuration. AttrCodeSigningConfigArn() *string // The code signing configuration ID. AttrCodeSigningConfigId() *string // Options for this resource, such as condition, update policy etc. // Experimental. CfnOptions() awscdk.ICfnResourceOptions CfnProperties() *map[string]interface{} // AWS resource type. // Experimental. CfnResourceType() *string // The code signing policy controls the validation failure action for signature mismatch or expiry. CodeSigningPolicies() interface{} SetCodeSigningPolicies(val interface{}) // Returns: the stack trace of the point where this Resource was created from, sourced // from the +metadata+ entry typed +aws:cdk:logicalId+, and with the bottom-most // node +internal+ entries filtered. // Experimental. CreationStack() *[]*string // Code signing configuration description. Description() *string SetDescription(val *string) // The logical ID for this CloudFormation stack element. // // The logical ID of the element // is calculated from the path of the resource node in the construct tree. // // To override this value, use `overrideLogicalId(newLogicalId)`. // // Returns: the logical ID as a stringified token. This value will only get // resolved during synthesis. // Experimental. LogicalId() *string // The construct tree node associated with this construct. // Experimental. Node() awscdk.ConstructNode // Return a string that will be resolved to a CloudFormation `{ Ref }` for this element. // // If, by any chance, the intrinsic reference of a resource is not a string, you could // coerce it to an IResolvable through `Lazy.any({ produce: resource.ref })`. // Experimental. Ref() *string // The stack in which this element is defined. // // CfnElements must be defined within a stack scope (directly or indirectly). // Experimental. Stack() awscdk.Stack // Return properties modified after initiation. // // Resources that expose mutable properties should override this function to // collect and return the properties object for this resource. // Experimental. UpdatedProperites() *map[string]interface{} // Syntactic sugar for `addOverride(path, undefined)`. // Experimental. AddDeletionOverride(path *string) // Indicates that this resource depends on another resource and cannot be provisioned unless the other resource has been successfully provisioned. // // This can be used for resources across stacks (or nested stack) boundaries // and the dependency will automatically be transferred to the relevant scope. // Experimental. AddDependsOn(target awscdk.CfnResource) // Add a value to the CloudFormation Resource Metadata. // See: https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/metadata-section-structure.html // // Note that this is a different set of metadata from CDK node metadata; this // metadata ends up in the stack template under the resource, whereas CDK // node metadata ends up in the Cloud Assembly. // // Experimental. AddMetadata(key *string, value interface{}) // Adds an override to the synthesized CloudFormation resource. // // To add a // property override, either use `addPropertyOverride` or prefix `path` with // "Properties." (i.e. `Properties.TopicName`). // // If the override is nested, separate each nested level using a dot (.) in the path parameter. // If there is an array as part of the nesting, specify the index in the path. // // To include a literal `.` in the property name, prefix with a `\`. In most // programming languages you will need to write this as `"\\."` because the // `\` itself will need to be escaped. // // For example, // “`typescript // cfnResource.addOverride('Properties.GlobalSecondaryIndexes.0.Projection.NonKeyAttributes', ['myattribute']); // cfnResource.addOverride('Properties.GlobalSecondaryIndexes.1.ProjectionType', 'INCLUDE'); // “` // would add the overrides // “`json // "Properties": { // "GlobalSecondaryIndexes": [ // { // "Projection": { // "NonKeyAttributes": [ "myattribute" ] // ... // } // ... // }, // { // "ProjectionType": "INCLUDE" // ... // }, // ] // ... // } // “` // // The `value` argument to `addOverride` will not be processed or translated // in any way. Pass raw JSON values in here with the correct capitalization // for CloudFormation. If you pass CDK classes or structs, they will be // rendered with lowercased key names, and CloudFormation will reject the // template. // Experimental. AddOverride(path *string, value interface{}) // Adds an override that deletes the value of a property from the resource definition. // Experimental. AddPropertyDeletionOverride(propertyPath *string) // Adds an override to a resource property. // // Syntactic sugar for `addOverride("Properties.<...>", value)`. // Experimental. AddPropertyOverride(propertyPath *string, value interface{}) // Sets the deletion policy of the resource based on the removal policy specified. // // The Removal Policy controls what happens to this resource when it stops // being managed by CloudFormation, either because you've removed it from the // CDK application or because you've made a change that requires the resource // to be replaced. // // The resource can be deleted (`RemovalPolicy.DESTROY`), or left in your AWS // account for data recovery and cleanup later (`RemovalPolicy.RETAIN`). // Experimental. ApplyRemovalPolicy(policy awscdk.RemovalPolicy, options *awscdk.RemovalPolicyOptions) // Returns a token for an runtime attribute of this resource. // // Ideally, use generated attribute accessors (e.g. `resource.arn`), but this can be used for future compatibility // in case there is no generated attribute. // Experimental. GetAtt(attributeName *string) awscdk.Reference // Retrieve a value value from the CloudFormation Resource Metadata. // See: https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/metadata-section-structure.html // // Note that this is a different set of metadata from CDK node metadata; this // metadata ends up in the stack template under the resource, whereas CDK // node metadata ends up in the Cloud Assembly. // // Experimental. GetMetadata(key *string) interface{} // Examines the CloudFormation resource and discloses attributes. Inspect(inspector awscdk.TreeInspector) // Perform final modifications before synthesis. // // This method can be implemented by derived constructs in order to perform // final changes before synthesis. prepare() will be called after child // constructs have been prepared. // // This is an advanced framework feature. Only use this if you // understand the implications. // Experimental. OnPrepare() // Allows this construct to emit artifacts into the cloud assembly during synthesis. // // This method is usually implemented by framework-level constructs such as `Stack` and `Asset` // as they participate in synthesizing the cloud assembly. // Experimental. OnSynthesize(session constructs.ISynthesisSession) // Validate the current construct. // // This method can be implemented by derived constructs in order to perform // validation logic. It is called on all constructs before synthesis. // // Returns: An array of validation error messages, or an empty array if the construct is valid. // Experimental. OnValidate() *[]*string // Overrides the auto-generated logical ID with a specific ID. // Experimental. OverrideLogicalId(newLogicalId *string) // Perform final modifications before synthesis. // // This method can be implemented by derived constructs in order to perform // final changes before synthesis. prepare() will be called after child // constructs have been prepared. // // This is an advanced framework feature. Only use this if you // understand the implications. // Experimental. Prepare() RenderProperties(props *map[string]interface{}) *map[string]interface{} // Can be overridden by subclasses to determine if this resource will be rendered into the cloudformation template. // // Returns: `true` if the resource should be included or `false` is the resource // should be omitted. // Experimental. ShouldSynthesize() *bool // Allows this construct to emit artifacts into the cloud assembly during synthesis. // // This method is usually implemented by framework-level constructs such as `Stack` and `Asset` // as they participate in synthesizing the cloud assembly. // Experimental. Synthesize(session awscdk.ISynthesisSession) // Returns a string representation of this construct. // // Returns: a string representation of this resource. // Experimental. ToString() *string // Validate the current construct. // // This method can be implemented by derived constructs in order to perform // validation logic. It is called on all constructs before synthesis. // // Returns: An array of validation error messages, or an empty array if the construct is valid. // Experimental. Validate() *[]*string // Experimental. ValidateProperties(_properties interface{}) }
A CloudFormation `AWS::Lambda::CodeSigningConfig`.
Details about a [Code signing configuration](https://docs.aws.amazon.com/lambda/latest/dg/configuration-codesigning.html) .
Example:
// The code below shows an example of how to instantiate this type. // The values are placeholders you should change. import "github.com/aws/aws-cdk-go/awscdk" cfnCodeSigningConfig := awscdk.Aws_lambda.NewCfnCodeSigningConfig(this, jsii.String("MyCfnCodeSigningConfig"), &CfnCodeSigningConfigProps{ AllowedPublishers: &AllowedPublishersProperty{ SigningProfileVersionArns: []*string{ jsii.String("signingProfileVersionArns"), }, }, // the properties below are optional CodeSigningPolicies: &CodeSigningPoliciesProperty{ UntrustedArtifactOnDeployment: jsii.String("untrustedArtifactOnDeployment"), }, Description: jsii.String("description"), })
func NewCfnCodeSigningConfig ¶
func NewCfnCodeSigningConfig(scope awscdk.Construct, id *string, props *CfnCodeSigningConfigProps) CfnCodeSigningConfig
Create a new `AWS::Lambda::CodeSigningConfig`.
type CfnCodeSigningConfigProps ¶
type CfnCodeSigningConfigProps struct { // List of allowed publishers. AllowedPublishers interface{} `field:"required" json:"allowedPublishers" yaml:"allowedPublishers"` // The code signing policy controls the validation failure action for signature mismatch or expiry. CodeSigningPolicies interface{} `field:"optional" json:"codeSigningPolicies" yaml:"codeSigningPolicies"` // Code signing configuration description. Description *string `field:"optional" json:"description" yaml:"description"` }
Properties for defining a `CfnCodeSigningConfig`.
Example:
// The code below shows an example of how to instantiate this type. // The values are placeholders you should change. import "github.com/aws/aws-cdk-go/awscdk" cfnCodeSigningConfigProps := &CfnCodeSigningConfigProps{ AllowedPublishers: &AllowedPublishersProperty{ SigningProfileVersionArns: []*string{ jsii.String("signingProfileVersionArns"), }, }, // the properties below are optional CodeSigningPolicies: &CodeSigningPoliciesProperty{ UntrustedArtifactOnDeployment: jsii.String("untrustedArtifactOnDeployment"), }, Description: jsii.String("description"), }
type CfnCodeSigningConfig_AllowedPublishersProperty ¶
type CfnCodeSigningConfig_AllowedPublishersProperty struct { // The Amazon Resource Name (ARN) for each of the signing profiles. // // A signing profile defines a trusted user who can sign a code package. SigningProfileVersionArns *[]*string `field:"required" json:"signingProfileVersionArns" yaml:"signingProfileVersionArns"` }
List of signing profiles that can sign a code package.
Example:
// The code below shows an example of how to instantiate this type. // The values are placeholders you should change. import "github.com/aws/aws-cdk-go/awscdk" allowedPublishersProperty := &AllowedPublishersProperty{ SigningProfileVersionArns: []*string{ jsii.String("signingProfileVersionArns"), }, }
type CfnCodeSigningConfig_CodeSigningPoliciesProperty ¶
type CfnCodeSigningConfig_CodeSigningPoliciesProperty struct { // Code signing configuration policy for deployment validation failure. // // If you set the policy to `Enforce` , Lambda blocks the deployment request if signature validation checks fail. If you set the policy to `Warn` , Lambda allows the deployment and creates a CloudWatch log. // // Default value: `Warn`. UntrustedArtifactOnDeployment *string `field:"required" json:"untrustedArtifactOnDeployment" yaml:"untrustedArtifactOnDeployment"` }
Code signing configuration [policies](https://docs.aws.amazon.com/lambda/latest/dg/configuration-codesigning.html#config-codesigning-policies) specify the validation failure action for signature mismatch or expiry.
Example:
// The code below shows an example of how to instantiate this type. // The values are placeholders you should change. import "github.com/aws/aws-cdk-go/awscdk" codeSigningPoliciesProperty := &CodeSigningPoliciesProperty{ UntrustedArtifactOnDeployment: jsii.String("untrustedArtifactOnDeployment"), }
type CfnEventInvokeConfig ¶
type CfnEventInvokeConfig interface { awscdk.CfnResource awscdk.IInspectable // Options for this resource, such as condition, update policy etc. // Experimental. CfnOptions() awscdk.ICfnResourceOptions CfnProperties() *map[string]interface{} // AWS resource type. // Experimental. CfnResourceType() *string // Returns: the stack trace of the point where this Resource was created from, sourced // from the +metadata+ entry typed +aws:cdk:logicalId+, and with the bottom-most // node +internal+ entries filtered. // Experimental. CreationStack() *[]*string // A destination for events after they have been sent to a function for processing. // // **Destinations** - *Function* - The Amazon Resource Name (ARN) of a Lambda function. // - *Queue* - The ARN of a standard SQS queue. // - *Topic* - The ARN of a standard SNS topic. // - *Event Bus* - The ARN of an Amazon EventBridge event bus. DestinationConfig() interface{} SetDestinationConfig(val interface{}) // The name of the Lambda function. // // *Minimum* : `1` // // *Maximum* : `64` // // *Pattern* : `([a-zA-Z0-9-_]+)`. FunctionName() *string SetFunctionName(val *string) // The logical ID for this CloudFormation stack element. // // The logical ID of the element // is calculated from the path of the resource node in the construct tree. // // To override this value, use `overrideLogicalId(newLogicalId)`. // // Returns: the logical ID as a stringified token. This value will only get // resolved during synthesis. // Experimental. LogicalId() *string // The maximum age of a request that Lambda sends to a function for processing. MaximumEventAgeInSeconds() *float64 SetMaximumEventAgeInSeconds(val *float64) // The maximum number of times to retry when the function returns an error. MaximumRetryAttempts() *float64 SetMaximumRetryAttempts(val *float64) // The construct tree node associated with this construct. // Experimental. Node() awscdk.ConstructNode // The identifier of a version or alias. // // - *Version* - A version number. // - *Alias* - An alias name. // - *Latest* - To specify the unpublished version, use `$LATEST` . Qualifier() *string SetQualifier(val *string) // Return a string that will be resolved to a CloudFormation `{ Ref }` for this element. // // If, by any chance, the intrinsic reference of a resource is not a string, you could // coerce it to an IResolvable through `Lazy.any({ produce: resource.ref })`. // Experimental. Ref() *string // The stack in which this element is defined. // // CfnElements must be defined within a stack scope (directly or indirectly). // Experimental. Stack() awscdk.Stack // Return properties modified after initiation. // // Resources that expose mutable properties should override this function to // collect and return the properties object for this resource. // Experimental. UpdatedProperites() *map[string]interface{} // Syntactic sugar for `addOverride(path, undefined)`. // Experimental. AddDeletionOverride(path *string) // Indicates that this resource depends on another resource and cannot be provisioned unless the other resource has been successfully provisioned. // // This can be used for resources across stacks (or nested stack) boundaries // and the dependency will automatically be transferred to the relevant scope. // Experimental. AddDependsOn(target awscdk.CfnResource) // Add a value to the CloudFormation Resource Metadata. // See: https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/metadata-section-structure.html // // Note that this is a different set of metadata from CDK node metadata; this // metadata ends up in the stack template under the resource, whereas CDK // node metadata ends up in the Cloud Assembly. // // Experimental. AddMetadata(key *string, value interface{}) // Adds an override to the synthesized CloudFormation resource. // // To add a // property override, either use `addPropertyOverride` or prefix `path` with // "Properties." (i.e. `Properties.TopicName`). // // If the override is nested, separate each nested level using a dot (.) in the path parameter. // If there is an array as part of the nesting, specify the index in the path. // // To include a literal `.` in the property name, prefix with a `\`. In most // programming languages you will need to write this as `"\\."` because the // `\` itself will need to be escaped. // // For example, // “`typescript // cfnResource.addOverride('Properties.GlobalSecondaryIndexes.0.Projection.NonKeyAttributes', ['myattribute']); // cfnResource.addOverride('Properties.GlobalSecondaryIndexes.1.ProjectionType', 'INCLUDE'); // “` // would add the overrides // “`json // "Properties": { // "GlobalSecondaryIndexes": [ // { // "Projection": { // "NonKeyAttributes": [ "myattribute" ] // ... // } // ... // }, // { // "ProjectionType": "INCLUDE" // ... // }, // ] // ... // } // “` // // The `value` argument to `addOverride` will not be processed or translated // in any way. Pass raw JSON values in here with the correct capitalization // for CloudFormation. If you pass CDK classes or structs, they will be // rendered with lowercased key names, and CloudFormation will reject the // template. // Experimental. AddOverride(path *string, value interface{}) // Adds an override that deletes the value of a property from the resource definition. // Experimental. AddPropertyDeletionOverride(propertyPath *string) // Adds an override to a resource property. // // Syntactic sugar for `addOverride("Properties.<...>", value)`. // Experimental. AddPropertyOverride(propertyPath *string, value interface{}) // Sets the deletion policy of the resource based on the removal policy specified. // // The Removal Policy controls what happens to this resource when it stops // being managed by CloudFormation, either because you've removed it from the // CDK application or because you've made a change that requires the resource // to be replaced. // // The resource can be deleted (`RemovalPolicy.DESTROY`), or left in your AWS // account for data recovery and cleanup later (`RemovalPolicy.RETAIN`). // Experimental. ApplyRemovalPolicy(policy awscdk.RemovalPolicy, options *awscdk.RemovalPolicyOptions) // Returns a token for an runtime attribute of this resource. // // Ideally, use generated attribute accessors (e.g. `resource.arn`), but this can be used for future compatibility // in case there is no generated attribute. // Experimental. GetAtt(attributeName *string) awscdk.Reference // Retrieve a value value from the CloudFormation Resource Metadata. // See: https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/metadata-section-structure.html // // Note that this is a different set of metadata from CDK node metadata; this // metadata ends up in the stack template under the resource, whereas CDK // node metadata ends up in the Cloud Assembly. // // Experimental. GetMetadata(key *string) interface{} // Examines the CloudFormation resource and discloses attributes. Inspect(inspector awscdk.TreeInspector) // Perform final modifications before synthesis. // // This method can be implemented by derived constructs in order to perform // final changes before synthesis. prepare() will be called after child // constructs have been prepared. // // This is an advanced framework feature. Only use this if you // understand the implications. // Experimental. OnPrepare() // Allows this construct to emit artifacts into the cloud assembly during synthesis. // // This method is usually implemented by framework-level constructs such as `Stack` and `Asset` // as they participate in synthesizing the cloud assembly. // Experimental. OnSynthesize(session constructs.ISynthesisSession) // Validate the current construct. // // This method can be implemented by derived constructs in order to perform // validation logic. It is called on all constructs before synthesis. // // Returns: An array of validation error messages, or an empty array if the construct is valid. // Experimental. OnValidate() *[]*string // Overrides the auto-generated logical ID with a specific ID. // Experimental. OverrideLogicalId(newLogicalId *string) // Perform final modifications before synthesis. // // This method can be implemented by derived constructs in order to perform // final changes before synthesis. prepare() will be called after child // constructs have been prepared. // // This is an advanced framework feature. Only use this if you // understand the implications. // Experimental. Prepare() RenderProperties(props *map[string]interface{}) *map[string]interface{} // Can be overridden by subclasses to determine if this resource will be rendered into the cloudformation template. // // Returns: `true` if the resource should be included or `false` is the resource // should be omitted. // Experimental. ShouldSynthesize() *bool // Allows this construct to emit artifacts into the cloud assembly during synthesis. // // This method is usually implemented by framework-level constructs such as `Stack` and `Asset` // as they participate in synthesizing the cloud assembly. // Experimental. Synthesize(session awscdk.ISynthesisSession) // Returns a string representation of this construct. // // Returns: a string representation of this resource. // Experimental. ToString() *string // Validate the current construct. // // This method can be implemented by derived constructs in order to perform // validation logic. It is called on all constructs before synthesis. // // Returns: An array of validation error messages, or an empty array if the construct is valid. // Experimental. Validate() *[]*string // Experimental. ValidateProperties(_properties interface{}) }
A CloudFormation `AWS::Lambda::EventInvokeConfig`.
The `AWS::Lambda::EventInvokeConfig` resource configures options for [asynchronous invocation](https://docs.aws.amazon.com/lambda/latest/dg/invocation-async.html) on a version or an alias.
By default, Lambda retries an asynchronous invocation twice if the function returns an error. It retains events in a queue for up to six hours. When an event fails all processing attempts or stays in the asynchronous invocation queue for too long, Lambda discards it.
Example:
// The code below shows an example of how to instantiate this type. // The values are placeholders you should change. import "github.com/aws/aws-cdk-go/awscdk" cfnEventInvokeConfig := awscdk.Aws_lambda.NewCfnEventInvokeConfig(this, jsii.String("MyCfnEventInvokeConfig"), &CfnEventInvokeConfigProps{ FunctionName: jsii.String("functionName"), Qualifier: jsii.String("qualifier"), // the properties below are optional DestinationConfig: &DestinationConfigProperty{ OnFailure: &OnFailureProperty{ Destination: jsii.String("destination"), }, OnSuccess: &OnSuccessProperty{ Destination: jsii.String("destination"), }, }, MaximumEventAgeInSeconds: jsii.Number(123), MaximumRetryAttempts: jsii.Number(123), })
func NewCfnEventInvokeConfig ¶
func NewCfnEventInvokeConfig(scope awscdk.Construct, id *string, props *CfnEventInvokeConfigProps) CfnEventInvokeConfig
Create a new `AWS::Lambda::EventInvokeConfig`.
type CfnEventInvokeConfigProps ¶
type CfnEventInvokeConfigProps struct { // The name of the Lambda function. // // *Minimum* : `1` // // *Maximum* : `64` // // *Pattern* : `([a-zA-Z0-9-_]+)`. FunctionName *string `field:"required" json:"functionName" yaml:"functionName"` // The identifier of a version or alias. // // - *Version* - A version number. // - *Alias* - An alias name. // - *Latest* - To specify the unpublished version, use `$LATEST` . Qualifier *string `field:"required" json:"qualifier" yaml:"qualifier"` // A destination for events after they have been sent to a function for processing. // // **Destinations** - *Function* - The Amazon Resource Name (ARN) of a Lambda function. // - *Queue* - The ARN of a standard SQS queue. // - *Topic* - The ARN of a standard SNS topic. // - *Event Bus* - The ARN of an Amazon EventBridge event bus. DestinationConfig interface{} `field:"optional" json:"destinationConfig" yaml:"destinationConfig"` // The maximum age of a request that Lambda sends to a function for processing. MaximumEventAgeInSeconds *float64 `field:"optional" json:"maximumEventAgeInSeconds" yaml:"maximumEventAgeInSeconds"` // The maximum number of times to retry when the function returns an error. MaximumRetryAttempts *float64 `field:"optional" json:"maximumRetryAttempts" yaml:"maximumRetryAttempts"` }
Properties for defining a `CfnEventInvokeConfig`.
Example:
// The code below shows an example of how to instantiate this type. // The values are placeholders you should change. import "github.com/aws/aws-cdk-go/awscdk" cfnEventInvokeConfigProps := &CfnEventInvokeConfigProps{ FunctionName: jsii.String("functionName"), Qualifier: jsii.String("qualifier"), // the properties below are optional DestinationConfig: &DestinationConfigProperty{ OnFailure: &OnFailureProperty{ Destination: jsii.String("destination"), }, OnSuccess: &OnSuccessProperty{ Destination: jsii.String("destination"), }, }, MaximumEventAgeInSeconds: jsii.Number(123), MaximumRetryAttempts: jsii.Number(123), }
type CfnEventInvokeConfig_DestinationConfigProperty ¶
type CfnEventInvokeConfig_DestinationConfigProperty struct { // The destination configuration for failed invocations. OnFailure interface{} `field:"optional" json:"onFailure" yaml:"onFailure"` // The destination configuration for successful invocations. OnSuccess interface{} `field:"optional" json:"onSuccess" yaml:"onSuccess"` }
A configuration object that specifies the destination of an event after Lambda processes it.
Example:
// The code below shows an example of how to instantiate this type. // The values are placeholders you should change. import "github.com/aws/aws-cdk-go/awscdk" destinationConfigProperty := &DestinationConfigProperty{ OnFailure: &OnFailureProperty{ Destination: jsii.String("destination"), }, OnSuccess: &OnSuccessProperty{ Destination: jsii.String("destination"), }, }
type CfnEventInvokeConfig_OnFailureProperty ¶
type CfnEventInvokeConfig_OnFailureProperty struct { // The Amazon Resource Name (ARN) of the destination resource. Destination *string `field:"required" json:"destination" yaml:"destination"` }
A destination for events that failed processing.
Example:
// The code below shows an example of how to instantiate this type. // The values are placeholders you should change. import "github.com/aws/aws-cdk-go/awscdk" onFailureProperty := &OnFailureProperty{ Destination: jsii.String("destination"), }
type CfnEventInvokeConfig_OnSuccessProperty ¶
type CfnEventInvokeConfig_OnSuccessProperty struct { // The Amazon Resource Name (ARN) of the destination resource. Destination *string `field:"required" json:"destination" yaml:"destination"` }
A destination for events that were processed successfully.
Example:
// The code below shows an example of how to instantiate this type. // The values are placeholders you should change. import "github.com/aws/aws-cdk-go/awscdk" onSuccessProperty := &OnSuccessProperty{ Destination: jsii.String("destination"), }
type CfnEventSourceMapping ¶
type CfnEventSourceMapping interface { awscdk.CfnResource awscdk.IInspectable // Specific configuration settings for an Amazon Managed Streaming for Apache Kafka (Amazon MSK) event source. AmazonManagedKafkaEventSourceConfig() interface{} SetAmazonManagedKafkaEventSourceConfig(val interface{}) // The event source mapping's ID. AttrId() *string // The maximum number of records in each batch that Lambda pulls from your stream or queue and sends to your function. // // Lambda passes all of the records in the batch to the function in a single call, up to the payload limit for synchronous invocation (6 MB). // // - *Amazon Kinesis* – Default 100. Max 10,000. // - *Amazon DynamoDB Streams* – Default 100. Max 10,000. // - *Amazon Simple Queue Service* – Default 10. For standard queues the max is 10,000. For FIFO queues the max is 10. // - *Amazon Managed Streaming for Apache Kafka* – Default 100. Max 10,000. // - *Self-managed Apache Kafka* – Default 100. Max 10,000. // - *Amazon MQ (ActiveMQ and RabbitMQ)* – Default 100. Max 10,000. // - *DocumentDB* – Default 100. Max 10,000. BatchSize() *float64 SetBatchSize(val *float64) // (Kinesis and DynamoDB Streams only) If the function returns an error, split the batch in two and retry. // // The default value is false. BisectBatchOnFunctionError() interface{} SetBisectBatchOnFunctionError(val interface{}) // Options for this resource, such as condition, update policy etc. // Experimental. CfnOptions() awscdk.ICfnResourceOptions CfnProperties() *map[string]interface{} // AWS resource type. // Experimental. CfnResourceType() *string // Returns: the stack trace of the point where this Resource was created from, sourced // from the +metadata+ entry typed +aws:cdk:logicalId+, and with the bottom-most // node +internal+ entries filtered. // Experimental. CreationStack() *[]*string // (Kinesis and DynamoDB Streams only) An Amazon SQS queue or Amazon SNS topic destination for discarded records. DestinationConfig() interface{} SetDestinationConfig(val interface{}) // Specific configuration settings for a DocumentDB event source. DocumentDbEventSourceConfig() interface{} SetDocumentDbEventSourceConfig(val interface{}) // When true, the event source mapping is active. When false, Lambda pauses polling and invocation. // // Default: True. Enabled() interface{} SetEnabled(val interface{}) // The Amazon Resource Name (ARN) of the event source. // // - *Amazon Kinesis* – The ARN of the data stream or a stream consumer. // - *Amazon DynamoDB Streams* – The ARN of the stream. // - *Amazon Simple Queue Service* – The ARN of the queue. // - *Amazon Managed Streaming for Apache Kafka* – The ARN of the cluster. // - *Amazon MQ* – The ARN of the broker. // - *Amazon DocumentDB* – The ARN of the DocumentDB change stream. EventSourceArn() *string SetEventSourceArn(val *string) // An object that defines the filter criteria that determine whether Lambda should process an event. // // For more information, see [Lambda event filtering](https://docs.aws.amazon.com/lambda/latest/dg/invocation-eventfiltering.html) . FilterCriteria() interface{} SetFilterCriteria(val interface{}) // The name of the Lambda function. // // **Name formats** - *Function name* – `MyFunction` . // - *Function ARN* – `arn:aws:lambda:us-west-2:123456789012:function:MyFunction` . // - *Version or Alias ARN* – `arn:aws:lambda:us-west-2:123456789012:function:MyFunction:PROD` . // - *Partial ARN* – `123456789012:function:MyFunction` . // // The length constraint applies only to the full ARN. If you specify only the function name, it's limited to 64 characters in length. FunctionName() *string SetFunctionName(val *string) // (Streams and SQS) A list of current response type enums applied to the event source mapping. // // Valid Values: `ReportBatchItemFailures`. FunctionResponseTypes() *[]*string SetFunctionResponseTypes(val *[]*string) // The logical ID for this CloudFormation stack element. // // The logical ID of the element // is calculated from the path of the resource node in the construct tree. // // To override this value, use `overrideLogicalId(newLogicalId)`. // // Returns: the logical ID as a stringified token. This value will only get // resolved during synthesis. // Experimental. LogicalId() *string // The maximum amount of time, in seconds, that Lambda spends gathering records before invoking the function. // // *Default ( Kinesis , DynamoDB , Amazon SQS event sources)* : 0 // // *Default ( Amazon MSK , Kafka, Amazon MQ , Amazon DocumentDB event sources)* : 500 ms // // *Related setting:* For Amazon SQS event sources, when you set `BatchSize` to a value greater than 10, you must set `MaximumBatchingWindowInSeconds` to at least 1. MaximumBatchingWindowInSeconds() *float64 SetMaximumBatchingWindowInSeconds(val *float64) // (Kinesis and DynamoDB Streams only) Discard records older than the specified age. // // The default value is -1, // which sets the maximum age to infinite. When the value is set to infinite, Lambda never discards old records. // // > The minimum valid value for maximum record age is 60s. Although values less than 60 and greater than -1 fall within the parameter's absolute range, they are not allowed MaximumRecordAgeInSeconds() *float64 SetMaximumRecordAgeInSeconds(val *float64) // (Kinesis and DynamoDB Streams only) Discard records after the specified number of retries. // // The default value is -1, // which sets the maximum number of retries to infinite. When MaximumRetryAttempts is infinite, Lambda retries failed records until the record expires in the event source. MaximumRetryAttempts() *float64 SetMaximumRetryAttempts(val *float64) // The construct tree node associated with this construct. // Experimental. Node() awscdk.ConstructNode // (Kinesis and DynamoDB Streams only) The number of batches to process concurrently from each shard. // // The default value is 1. ParallelizationFactor() *float64 SetParallelizationFactor(val *float64) // (Amazon MQ) The name of the Amazon MQ broker destination queue to consume. Queues() *[]*string SetQueues(val *[]*string) // Return a string that will be resolved to a CloudFormation `{ Ref }` for this element. // // If, by any chance, the intrinsic reference of a resource is not a string, you could // coerce it to an IResolvable through `Lazy.any({ produce: resource.ref })`. // Experimental. Ref() *string // (Amazon SQS only) The scaling configuration for the event source. // // For more information, see [Configuring maximum concurrency for Amazon SQS event sources](https://docs.aws.amazon.com/lambda/latest/dg/with-sqs.html#events-sqs-max-concurrency) . ScalingConfig() interface{} SetScalingConfig(val interface{}) // The self-managed Apache Kafka cluster for your event source. SelfManagedEventSource() interface{} SetSelfManagedEventSource(val interface{}) // Specific configuration settings for a self-managed Apache Kafka event source. SelfManagedKafkaEventSourceConfig() interface{} SetSelfManagedKafkaEventSourceConfig(val interface{}) // An array of the authentication protocol, VPC components, or virtual host to secure and define your event source. SourceAccessConfigurations() interface{} SetSourceAccessConfigurations(val interface{}) // The stack in which this element is defined. // // CfnElements must be defined within a stack scope (directly or indirectly). // Experimental. Stack() awscdk.Stack // The position in a stream from which to start reading. Required for Amazon Kinesis and Amazon DynamoDB. // // - *LATEST* - Read only new records. // - *TRIM_HORIZON* - Process all available records. // - *AT_TIMESTAMP* - Specify a time from which to start reading records. StartingPosition() *string SetStartingPosition(val *string) // With `StartingPosition` set to `AT_TIMESTAMP` , the time from which to start reading, in Unix time seconds. StartingPositionTimestamp() *float64 SetStartingPositionTimestamp(val *float64) // The name of the Kafka topic. Topics() *[]*string SetTopics(val *[]*string) // (Kinesis and DynamoDB Streams only) The duration in seconds of a processing window for DynamoDB and Kinesis Streams event sources. // // A value of 0 seconds indicates no tumbling window. TumblingWindowInSeconds() *float64 SetTumblingWindowInSeconds(val *float64) // Return properties modified after initiation. // // Resources that expose mutable properties should override this function to // collect and return the properties object for this resource. // Experimental. UpdatedProperites() *map[string]interface{} // Syntactic sugar for `addOverride(path, undefined)`. // Experimental. AddDeletionOverride(path *string) // Indicates that this resource depends on another resource and cannot be provisioned unless the other resource has been successfully provisioned. // // This can be used for resources across stacks (or nested stack) boundaries // and the dependency will automatically be transferred to the relevant scope. // Experimental. AddDependsOn(target awscdk.CfnResource) // Add a value to the CloudFormation Resource Metadata. // See: https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/metadata-section-structure.html // // Note that this is a different set of metadata from CDK node metadata; this // metadata ends up in the stack template under the resource, whereas CDK // node metadata ends up in the Cloud Assembly. // // Experimental. AddMetadata(key *string, value interface{}) // Adds an override to the synthesized CloudFormation resource. // // To add a // property override, either use `addPropertyOverride` or prefix `path` with // "Properties." (i.e. `Properties.TopicName`). // // If the override is nested, separate each nested level using a dot (.) in the path parameter. // If there is an array as part of the nesting, specify the index in the path. // // To include a literal `.` in the property name, prefix with a `\`. In most // programming languages you will need to write this as `"\\."` because the // `\` itself will need to be escaped. // // For example, // “`typescript // cfnResource.addOverride('Properties.GlobalSecondaryIndexes.0.Projection.NonKeyAttributes', ['myattribute']); // cfnResource.addOverride('Properties.GlobalSecondaryIndexes.1.ProjectionType', 'INCLUDE'); // “` // would add the overrides // “`json // "Properties": { // "GlobalSecondaryIndexes": [ // { // "Projection": { // "NonKeyAttributes": [ "myattribute" ] // ... // } // ... // }, // { // "ProjectionType": "INCLUDE" // ... // }, // ] // ... // } // “` // // The `value` argument to `addOverride` will not be processed or translated // in any way. Pass raw JSON values in here with the correct capitalization // for CloudFormation. If you pass CDK classes or structs, they will be // rendered with lowercased key names, and CloudFormation will reject the // template. // Experimental. AddOverride(path *string, value interface{}) // Adds an override that deletes the value of a property from the resource definition. // Experimental. AddPropertyDeletionOverride(propertyPath *string) // Adds an override to a resource property. // // Syntactic sugar for `addOverride("Properties.<...>", value)`. // Experimental. AddPropertyOverride(propertyPath *string, value interface{}) // Sets the deletion policy of the resource based on the removal policy specified. // // The Removal Policy controls what happens to this resource when it stops // being managed by CloudFormation, either because you've removed it from the // CDK application or because you've made a change that requires the resource // to be replaced. // // The resource can be deleted (`RemovalPolicy.DESTROY`), or left in your AWS // account for data recovery and cleanup later (`RemovalPolicy.RETAIN`). // Experimental. ApplyRemovalPolicy(policy awscdk.RemovalPolicy, options *awscdk.RemovalPolicyOptions) // Returns a token for an runtime attribute of this resource. // // Ideally, use generated attribute accessors (e.g. `resource.arn`), but this can be used for future compatibility // in case there is no generated attribute. // Experimental. GetAtt(attributeName *string) awscdk.Reference // Retrieve a value value from the CloudFormation Resource Metadata. // See: https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/metadata-section-structure.html // // Note that this is a different set of metadata from CDK node metadata; this // metadata ends up in the stack template under the resource, whereas CDK // node metadata ends up in the Cloud Assembly. // // Experimental. GetMetadata(key *string) interface{} // Examines the CloudFormation resource and discloses attributes. Inspect(inspector awscdk.TreeInspector) // Perform final modifications before synthesis. // // This method can be implemented by derived constructs in order to perform // final changes before synthesis. prepare() will be called after child // constructs have been prepared. // // This is an advanced framework feature. Only use this if you // understand the implications. // Experimental. OnPrepare() // Allows this construct to emit artifacts into the cloud assembly during synthesis. // // This method is usually implemented by framework-level constructs such as `Stack` and `Asset` // as they participate in synthesizing the cloud assembly. // Experimental. OnSynthesize(session constructs.ISynthesisSession) // Validate the current construct. // // This method can be implemented by derived constructs in order to perform // validation logic. It is called on all constructs before synthesis. // // Returns: An array of validation error messages, or an empty array if the construct is valid. // Experimental. OnValidate() *[]*string // Overrides the auto-generated logical ID with a specific ID. // Experimental. OverrideLogicalId(newLogicalId *string) // Perform final modifications before synthesis. // // This method can be implemented by derived constructs in order to perform // final changes before synthesis. prepare() will be called after child // constructs have been prepared. // // This is an advanced framework feature. Only use this if you // understand the implications. // Experimental. Prepare() RenderProperties(props *map[string]interface{}) *map[string]interface{} // Can be overridden by subclasses to determine if this resource will be rendered into the cloudformation template. // // Returns: `true` if the resource should be included or `false` is the resource // should be omitted. // Experimental. ShouldSynthesize() *bool // Allows this construct to emit artifacts into the cloud assembly during synthesis. // // This method is usually implemented by framework-level constructs such as `Stack` and `Asset` // as they participate in synthesizing the cloud assembly. // Experimental. Synthesize(session awscdk.ISynthesisSession) // Returns a string representation of this construct. // // Returns: a string representation of this resource. // Experimental. ToString() *string // Validate the current construct. // // This method can be implemented by derived constructs in order to perform // validation logic. It is called on all constructs before synthesis. // // Returns: An array of validation error messages, or an empty array if the construct is valid. // Experimental. Validate() *[]*string // Experimental. ValidateProperties(_properties interface{}) }
A CloudFormation `AWS::Lambda::EventSourceMapping`.
The `AWS::Lambda::EventSourceMapping` resource creates a mapping between an event source and an AWS Lambda function. Lambda reads items from the event source and triggers the function.
For details about each event source type, see the following topics. In particular, each of the topics describes the required and optional parameters for the specific event source.
- [Configuring a Dynamo DB stream as an event source](https://docs.aws.amazon.com/lambda/latest/dg/with-ddb.html#services-dynamodb-eventsourcemapping) - [Configuring a Kinesis stream as an event source](https://docs.aws.amazon.com/lambda/latest/dg/with-kinesis.html#services-kinesis-eventsourcemapping) - [Configuring an SQS queue as an event source](https://docs.aws.amazon.com/lambda/latest/dg/with-sqs.html#events-sqs-eventsource) - [Configuring an MQ broker as an event source](https://docs.aws.amazon.com/lambda/latest/dg/with-mq.html#services-mq-eventsourcemapping) - [Configuring MSK as an event source](https://docs.aws.amazon.com/lambda/latest/dg/with-msk.html) - [Configuring Self-Managed Apache Kafka as an event source](https://docs.aws.amazon.com/lambda/latest/dg/kafka-smaa.html) - [Configuring Amazon DocumentDB as an event source](https://docs.aws.amazon.com/lambda/latest/dg/with-documentdb.html)
Example:
// The code below shows an example of how to instantiate this type. // The values are placeholders you should change. import "github.com/aws/aws-cdk-go/awscdk" cfnEventSourceMapping := awscdk.Aws_lambda.NewCfnEventSourceMapping(this, jsii.String("MyCfnEventSourceMapping"), &CfnEventSourceMappingProps{ FunctionName: jsii.String("functionName"), // the properties below are optional AmazonManagedKafkaEventSourceConfig: &AmazonManagedKafkaEventSourceConfigProperty{ ConsumerGroupId: jsii.String("consumerGroupId"), }, BatchSize: jsii.Number(123), BisectBatchOnFunctionError: jsii.Boolean(false), DestinationConfig: &DestinationConfigProperty{ OnFailure: &OnFailureProperty{ Destination: jsii.String("destination"), }, }, DocumentDbEventSourceConfig: &DocumentDBEventSourceConfigProperty{ CollectionName: jsii.String("collectionName"), DatabaseName: jsii.String("databaseName"), FullDocument: jsii.String("fullDocument"), }, Enabled: jsii.Boolean(false), EventSourceArn: jsii.String("eventSourceArn"), FilterCriteria: &FilterCriteriaProperty{ Filters: []interface{}{ &FilterProperty{ Pattern: jsii.String("pattern"), }, }, }, FunctionResponseTypes: []*string{ jsii.String("functionResponseTypes"), }, MaximumBatchingWindowInSeconds: jsii.Number(123), MaximumRecordAgeInSeconds: jsii.Number(123), MaximumRetryAttempts: jsii.Number(123), ParallelizationFactor: jsii.Number(123), Queues: []*string{ jsii.String("queues"), }, ScalingConfig: &ScalingConfigProperty{ MaximumConcurrency: jsii.Number(123), }, SelfManagedEventSource: &SelfManagedEventSourceProperty{ Endpoints: &EndpointsProperty{ KafkaBootstrapServers: []*string{ jsii.String("kafkaBootstrapServers"), }, }, }, SelfManagedKafkaEventSourceConfig: &SelfManagedKafkaEventSourceConfigProperty{ ConsumerGroupId: jsii.String("consumerGroupId"), }, SourceAccessConfigurations: []interface{}{ &SourceAccessConfigurationProperty{ Type: jsii.String("type"), Uri: jsii.String("uri"), }, }, StartingPosition: jsii.String("startingPosition"), StartingPositionTimestamp: jsii.Number(123), Topics: []*string{ jsii.String("topics"), }, TumblingWindowInSeconds: jsii.Number(123), })
func NewCfnEventSourceMapping ¶
func NewCfnEventSourceMapping(scope awscdk.Construct, id *string, props *CfnEventSourceMappingProps) CfnEventSourceMapping
Create a new `AWS::Lambda::EventSourceMapping`.
type CfnEventSourceMappingProps ¶
type CfnEventSourceMappingProps struct { // The name of the Lambda function. // // **Name formats** - *Function name* – `MyFunction` . // - *Function ARN* – `arn:aws:lambda:us-west-2:123456789012:function:MyFunction` . // - *Version or Alias ARN* – `arn:aws:lambda:us-west-2:123456789012:function:MyFunction:PROD` . // - *Partial ARN* – `123456789012:function:MyFunction` . // // The length constraint applies only to the full ARN. If you specify only the function name, it's limited to 64 characters in length. FunctionName *string `field:"required" json:"functionName" yaml:"functionName"` // Specific configuration settings for an Amazon Managed Streaming for Apache Kafka (Amazon MSK) event source. AmazonManagedKafkaEventSourceConfig interface{} `field:"optional" json:"amazonManagedKafkaEventSourceConfig" yaml:"amazonManagedKafkaEventSourceConfig"` // The maximum number of records in each batch that Lambda pulls from your stream or queue and sends to your function. // // Lambda passes all of the records in the batch to the function in a single call, up to the payload limit for synchronous invocation (6 MB). // // - *Amazon Kinesis* – Default 100. Max 10,000. // - *Amazon DynamoDB Streams* – Default 100. Max 10,000. // - *Amazon Simple Queue Service* – Default 10. For standard queues the max is 10,000. For FIFO queues the max is 10. // - *Amazon Managed Streaming for Apache Kafka* – Default 100. Max 10,000. // - *Self-managed Apache Kafka* – Default 100. Max 10,000. // - *Amazon MQ (ActiveMQ and RabbitMQ)* – Default 100. Max 10,000. // - *DocumentDB* – Default 100. Max 10,000. BatchSize *float64 `field:"optional" json:"batchSize" yaml:"batchSize"` // (Kinesis and DynamoDB Streams only) If the function returns an error, split the batch in two and retry. // // The default value is false. BisectBatchOnFunctionError interface{} `field:"optional" json:"bisectBatchOnFunctionError" yaml:"bisectBatchOnFunctionError"` // (Kinesis and DynamoDB Streams only) An Amazon SQS queue or Amazon SNS topic destination for discarded records. DestinationConfig interface{} `field:"optional" json:"destinationConfig" yaml:"destinationConfig"` // Specific configuration settings for a DocumentDB event source. DocumentDbEventSourceConfig interface{} `field:"optional" json:"documentDbEventSourceConfig" yaml:"documentDbEventSourceConfig"` // When true, the event source mapping is active. When false, Lambda pauses polling and invocation. // // Default: True. Enabled interface{} `field:"optional" json:"enabled" yaml:"enabled"` // The Amazon Resource Name (ARN) of the event source. // // - *Amazon Kinesis* – The ARN of the data stream or a stream consumer. // - *Amazon DynamoDB Streams* – The ARN of the stream. // - *Amazon Simple Queue Service* – The ARN of the queue. // - *Amazon Managed Streaming for Apache Kafka* – The ARN of the cluster. // - *Amazon MQ* – The ARN of the broker. // - *Amazon DocumentDB* – The ARN of the DocumentDB change stream. EventSourceArn *string `field:"optional" json:"eventSourceArn" yaml:"eventSourceArn"` // An object that defines the filter criteria that determine whether Lambda should process an event. // // For more information, see [Lambda event filtering](https://docs.aws.amazon.com/lambda/latest/dg/invocation-eventfiltering.html) . FilterCriteria interface{} `field:"optional" json:"filterCriteria" yaml:"filterCriteria"` // (Streams and SQS) A list of current response type enums applied to the event source mapping. // // Valid Values: `ReportBatchItemFailures`. FunctionResponseTypes *[]*string `field:"optional" json:"functionResponseTypes" yaml:"functionResponseTypes"` // The maximum amount of time, in seconds, that Lambda spends gathering records before invoking the function. // // *Default ( Kinesis , DynamoDB , Amazon SQS event sources)* : 0 // // *Default ( Amazon MSK , Kafka, Amazon MQ , Amazon DocumentDB event sources)* : 500 ms // // *Related setting:* For Amazon SQS event sources, when you set `BatchSize` to a value greater than 10, you must set `MaximumBatchingWindowInSeconds` to at least 1. MaximumBatchingWindowInSeconds *float64 `field:"optional" json:"maximumBatchingWindowInSeconds" yaml:"maximumBatchingWindowInSeconds"` // (Kinesis and DynamoDB Streams only) Discard records older than the specified age. // // The default value is -1, // which sets the maximum age to infinite. When the value is set to infinite, Lambda never discards old records. // // > The minimum valid value for maximum record age is 60s. Although values less than 60 and greater than -1 fall within the parameter's absolute range, they are not allowed MaximumRecordAgeInSeconds *float64 `field:"optional" json:"maximumRecordAgeInSeconds" yaml:"maximumRecordAgeInSeconds"` // (Kinesis and DynamoDB Streams only) Discard records after the specified number of retries. // // The default value is -1, // which sets the maximum number of retries to infinite. When MaximumRetryAttempts is infinite, Lambda retries failed records until the record expires in the event source. MaximumRetryAttempts *float64 `field:"optional" json:"maximumRetryAttempts" yaml:"maximumRetryAttempts"` // (Kinesis and DynamoDB Streams only) The number of batches to process concurrently from each shard. // // The default value is 1. ParallelizationFactor *float64 `field:"optional" json:"parallelizationFactor" yaml:"parallelizationFactor"` // (Amazon MQ) The name of the Amazon MQ broker destination queue to consume. Queues *[]*string `field:"optional" json:"queues" yaml:"queues"` // (Amazon SQS only) The scaling configuration for the event source. // // For more information, see [Configuring maximum concurrency for Amazon SQS event sources](https://docs.aws.amazon.com/lambda/latest/dg/with-sqs.html#events-sqs-max-concurrency) . ScalingConfig interface{} `field:"optional" json:"scalingConfig" yaml:"scalingConfig"` // The self-managed Apache Kafka cluster for your event source. SelfManagedEventSource interface{} `field:"optional" json:"selfManagedEventSource" yaml:"selfManagedEventSource"` // Specific configuration settings for a self-managed Apache Kafka event source. SelfManagedKafkaEventSourceConfig interface{} `field:"optional" json:"selfManagedKafkaEventSourceConfig" yaml:"selfManagedKafkaEventSourceConfig"` // An array of the authentication protocol, VPC components, or virtual host to secure and define your event source. SourceAccessConfigurations interface{} `field:"optional" json:"sourceAccessConfigurations" yaml:"sourceAccessConfigurations"` // The position in a stream from which to start reading. Required for Amazon Kinesis and Amazon DynamoDB. // // - *LATEST* - Read only new records. // - *TRIM_HORIZON* - Process all available records. // - *AT_TIMESTAMP* - Specify a time from which to start reading records. StartingPosition *string `field:"optional" json:"startingPosition" yaml:"startingPosition"` // With `StartingPosition` set to `AT_TIMESTAMP` , the time from which to start reading, in Unix time seconds. StartingPositionTimestamp *float64 `field:"optional" json:"startingPositionTimestamp" yaml:"startingPositionTimestamp"` // The name of the Kafka topic. Topics *[]*string `field:"optional" json:"topics" yaml:"topics"` // (Kinesis and DynamoDB Streams only) The duration in seconds of a processing window for DynamoDB and Kinesis Streams event sources. // // A value of 0 seconds indicates no tumbling window. TumblingWindowInSeconds *float64 `field:"optional" json:"tumblingWindowInSeconds" yaml:"tumblingWindowInSeconds"` }
Properties for defining a `CfnEventSourceMapping`.
Example:
// The code below shows an example of how to instantiate this type. // The values are placeholders you should change. import "github.com/aws/aws-cdk-go/awscdk" cfnEventSourceMappingProps := &CfnEventSourceMappingProps{ FunctionName: jsii.String("functionName"), // the properties below are optional AmazonManagedKafkaEventSourceConfig: &AmazonManagedKafkaEventSourceConfigProperty{ ConsumerGroupId: jsii.String("consumerGroupId"), }, BatchSize: jsii.Number(123), BisectBatchOnFunctionError: jsii.Boolean(false), DestinationConfig: &DestinationConfigProperty{ OnFailure: &OnFailureProperty{ Destination: jsii.String("destination"), }, }, DocumentDbEventSourceConfig: &DocumentDBEventSourceConfigProperty{ CollectionName: jsii.String("collectionName"), DatabaseName: jsii.String("databaseName"), FullDocument: jsii.String("fullDocument"), }, Enabled: jsii.Boolean(false), EventSourceArn: jsii.String("eventSourceArn"), FilterCriteria: &FilterCriteriaProperty{ Filters: []interface{}{ &FilterProperty{ Pattern: jsii.String("pattern"), }, }, }, FunctionResponseTypes: []*string{ jsii.String("functionResponseTypes"), }, MaximumBatchingWindowInSeconds: jsii.Number(123), MaximumRecordAgeInSeconds: jsii.Number(123), MaximumRetryAttempts: jsii.Number(123), ParallelizationFactor: jsii.Number(123), Queues: []*string{ jsii.String("queues"), }, ScalingConfig: &ScalingConfigProperty{ MaximumConcurrency: jsii.Number(123), }, SelfManagedEventSource: &SelfManagedEventSourceProperty{ Endpoints: &EndpointsProperty{ KafkaBootstrapServers: []*string{ jsii.String("kafkaBootstrapServers"), }, }, }, SelfManagedKafkaEventSourceConfig: &SelfManagedKafkaEventSourceConfigProperty{ ConsumerGroupId: jsii.String("consumerGroupId"), }, SourceAccessConfigurations: []interface{}{ &SourceAccessConfigurationProperty{ Type: jsii.String("type"), Uri: jsii.String("uri"), }, }, StartingPosition: jsii.String("startingPosition"), StartingPositionTimestamp: jsii.Number(123), Topics: []*string{ jsii.String("topics"), }, TumblingWindowInSeconds: jsii.Number(123), }
type CfnEventSourceMapping_AmazonManagedKafkaEventSourceConfigProperty ¶
type CfnEventSourceMapping_AmazonManagedKafkaEventSourceConfigProperty struct { // The identifier for the Kafka consumer group to join. // // The consumer group ID must be unique among all your Kafka event sources. After creating a Kafka event source mapping with the consumer group ID specified, you cannot update this value. For more information, see [Customizable consumer group ID](https://docs.aws.amazon.com/lambda/latest/dg/with-msk.html#services-msk-consumer-group-id) . ConsumerGroupId *string `field:"optional" json:"consumerGroupId" yaml:"consumerGroupId"` }
Specific configuration settings for an Amazon Managed Streaming for Apache Kafka (Amazon MSK) event source.
Example:
// The code below shows an example of how to instantiate this type. // The values are placeholders you should change. import "github.com/aws/aws-cdk-go/awscdk" amazonManagedKafkaEventSourceConfigProperty := &AmazonManagedKafkaEventSourceConfigProperty{ ConsumerGroupId: jsii.String("consumerGroupId"), }
type CfnEventSourceMapping_DestinationConfigProperty ¶
type CfnEventSourceMapping_DestinationConfigProperty struct {
// The destination configuration for failed invocations.
OnFailure interface{} `field:"optional" json:"onFailure" yaml:"onFailure"`
}
A configuration object that specifies the destination of an event after Lambda processes it.
Example:
// The code below shows an example of how to instantiate this type. // The values are placeholders you should change. import "github.com/aws/aws-cdk-go/awscdk" destinationConfigProperty := &DestinationConfigProperty{ OnFailure: &OnFailureProperty{ Destination: jsii.String("destination"), }, }
type CfnEventSourceMapping_DocumentDBEventSourceConfigProperty ¶
type CfnEventSourceMapping_DocumentDBEventSourceConfigProperty struct { // The name of the collection to consume within the database. // // If you do not specify a collection, Lambda consumes all collections. CollectionName *string `field:"optional" json:"collectionName" yaml:"collectionName"` // The name of the database to consume within the DocumentDB cluster. DatabaseName *string `field:"optional" json:"databaseName" yaml:"databaseName"` // Determines what DocumentDB sends to your event stream during document update operations. // // If set to UpdateLookup, DocumentDB sends a delta describing the changes, along with a copy of the entire document. Otherwise, DocumentDB sends only a partial document that contains the changes. FullDocument *string `field:"optional" json:"fullDocument" yaml:"fullDocument"` }
Specific configuration settings for a DocumentDB event source.
Example:
// The code below shows an example of how to instantiate this type. // The values are placeholders you should change. import "github.com/aws/aws-cdk-go/awscdk" documentDBEventSourceConfigProperty := &DocumentDBEventSourceConfigProperty{ CollectionName: jsii.String("collectionName"), DatabaseName: jsii.String("databaseName"), FullDocument: jsii.String("fullDocument"), }
type CfnEventSourceMapping_EndpointsProperty ¶
type CfnEventSourceMapping_EndpointsProperty struct { // The list of bootstrap servers for your Kafka brokers in the following format: `"KafkaBootstrapServers": ["abc.xyz.com:xxxx","abc2.xyz.com:xxxx"]` . KafkaBootstrapServers *[]*string `field:"optional" json:"kafkaBootstrapServers" yaml:"kafkaBootstrapServers"` }
The list of bootstrap servers for your Kafka brokers in the following format: `"KafkaBootstrapServers": ["abc.xyz.com:xxxx","abc2.xyz.com:xxxx"]` .
Example:
// The code below shows an example of how to instantiate this type. // The values are placeholders you should change. import "github.com/aws/aws-cdk-go/awscdk" endpointsProperty := &EndpointsProperty{ KafkaBootstrapServers: []*string{ jsii.String("kafkaBootstrapServers"), }, }
type CfnEventSourceMapping_FilterCriteriaProperty ¶
type CfnEventSourceMapping_FilterCriteriaProperty struct {
// A list of filters.
Filters interface{} `field:"optional" json:"filters" yaml:"filters"`
}
An object that contains the filters for an event source.
Example:
// The code below shows an example of how to instantiate this type. // The values are placeholders you should change. import "github.com/aws/aws-cdk-go/awscdk" filterCriteriaProperty := &FilterCriteriaProperty{ Filters: []interface{}{ &FilterProperty{ Pattern: jsii.String("pattern"), }, }, }
type CfnEventSourceMapping_FilterProperty ¶
type CfnEventSourceMapping_FilterProperty struct { // A filter pattern. // // For more information on the syntax of a filter pattern, see [Filter rule syntax](https://docs.aws.amazon.com/lambda/latest/dg/invocation-eventfiltering.html#filtering-syntax) . Pattern *string `field:"optional" json:"pattern" yaml:"pattern"` }
A structure within a `FilterCriteria` object that defines an event filtering pattern.
Example:
// The code below shows an example of how to instantiate this type. // The values are placeholders you should change. import "github.com/aws/aws-cdk-go/awscdk" filterProperty := &FilterProperty{ Pattern: jsii.String("pattern"), }
type CfnEventSourceMapping_OnFailureProperty ¶
type CfnEventSourceMapping_OnFailureProperty struct { // The Amazon Resource Name (ARN) of the destination resource. Destination *string `field:"optional" json:"destination" yaml:"destination"` }
A destination for events that failed processing.
Example:
// The code below shows an example of how to instantiate this type. // The values are placeholders you should change. import "github.com/aws/aws-cdk-go/awscdk" onFailureProperty := &OnFailureProperty{ Destination: jsii.String("destination"), }
type CfnEventSourceMapping_ScalingConfigProperty ¶
type CfnEventSourceMapping_ScalingConfigProperty struct { // Limits the number of concurrent instances that the Amazon SQS event source can invoke. MaximumConcurrency *float64 `field:"optional" json:"maximumConcurrency" yaml:"maximumConcurrency"` }
(Amazon SQS only) The scaling configuration for the event source.
To remove the configuration, pass an empty value.
Example:
// The code below shows an example of how to instantiate this type. // The values are placeholders you should change. import "github.com/aws/aws-cdk-go/awscdk" scalingConfigProperty := &ScalingConfigProperty{ MaximumConcurrency: jsii.Number(123), }
type CfnEventSourceMapping_SelfManagedEventSourceProperty ¶
type CfnEventSourceMapping_SelfManagedEventSourceProperty struct {
// The list of bootstrap servers for your Kafka brokers in the following format: `"KafkaBootstrapServers": ["abc.xyz.com:xxxx","abc2.xyz.com:xxxx"]` .
Endpoints interface{} `field:"optional" json:"endpoints" yaml:"endpoints"`
}
The self-managed Apache Kafka cluster for your event source.
Example:
// The code below shows an example of how to instantiate this type. // The values are placeholders you should change. import "github.com/aws/aws-cdk-go/awscdk" selfManagedEventSourceProperty := &SelfManagedEventSourceProperty{ Endpoints: &EndpointsProperty{ KafkaBootstrapServers: []*string{ jsii.String("kafkaBootstrapServers"), }, }, }
type CfnEventSourceMapping_SelfManagedKafkaEventSourceConfigProperty ¶
type CfnEventSourceMapping_SelfManagedKafkaEventSourceConfigProperty struct { // The identifier for the Kafka consumer group to join. // // The consumer group ID must be unique among all your Kafka event sources. After creating a Kafka event source mapping with the consumer group ID specified, you cannot update this value. For more information, see [Customizable consumer group ID](https://docs.aws.amazon.com/lambda/latest/dg/with-msk.html#services-msk-consumer-group-id) . ConsumerGroupId *string `field:"optional" json:"consumerGroupId" yaml:"consumerGroupId"` }
Specific configuration settings for a self-managed Apache Kafka event source.
Example:
// The code below shows an example of how to instantiate this type. // The values are placeholders you should change. import "github.com/aws/aws-cdk-go/awscdk" selfManagedKafkaEventSourceConfigProperty := &SelfManagedKafkaEventSourceConfigProperty{ ConsumerGroupId: jsii.String("consumerGroupId"), }
type CfnEventSourceMapping_SourceAccessConfigurationProperty ¶
type CfnEventSourceMapping_SourceAccessConfigurationProperty struct { // The type of authentication protocol, VPC components, or virtual host for your event source. For example: `"Type":"SASL_SCRAM_512_AUTH"` . // // - `BASIC_AUTH` – (Amazon MQ) The AWS Secrets Manager secret that stores your broker credentials. // - `BASIC_AUTH` – (Self-managed Apache Kafka) The Secrets Manager ARN of your secret key used for SASL/PLAIN authentication of your Apache Kafka brokers. // - `VPC_SUBNET` – (Self-managed Apache Kafka) The subnets associated with your VPC. Lambda connects to these subnets to fetch data from your self-managed Apache Kafka cluster. // - `VPC_SECURITY_GROUP` – (Self-managed Apache Kafka) The VPC security group used to manage access to your self-managed Apache Kafka brokers. // - `SASL_SCRAM_256_AUTH` – (Self-managed Apache Kafka) The Secrets Manager ARN of your secret key used for SASL SCRAM-256 authentication of your self-managed Apache Kafka brokers. // - `SASL_SCRAM_512_AUTH` – (Amazon MSK, Self-managed Apache Kafka) The Secrets Manager ARN of your secret key used for SASL SCRAM-512 authentication of your self-managed Apache Kafka brokers. // - `VIRTUAL_HOST` –- (RabbitMQ) The name of the virtual host in your RabbitMQ broker. Lambda uses this RabbitMQ host as the event source. This property cannot be specified in an UpdateEventSourceMapping API call. // - `CLIENT_CERTIFICATE_TLS_AUTH` – (Amazon MSK, self-managed Apache Kafka) The Secrets Manager ARN of your secret key containing the certificate chain (X.509 PEM), private key (PKCS#8 PEM), and private key password (optional) used for mutual TLS authentication of your MSK/Apache Kafka brokers. // - `SERVER_ROOT_CA_CERTIFICATE` – (Self-managed Apache Kafka) The Secrets Manager ARN of your secret key containing the root CA certificate (X.509 PEM) used for TLS encryption of your Apache Kafka brokers. Type *string `field:"optional" json:"type" yaml:"type"` // The value for your chosen configuration in `Type` . // // For example: `"URI": "arn:aws:secretsmanager:us-east-1:01234567890:secret:MyBrokerSecretName"` . Uri *string `field:"optional" json:"uri" yaml:"uri"` }
An array of the authentication protocol, VPC components, or virtual host to secure and define your event source.
Example:
// The code below shows an example of how to instantiate this type. // The values are placeholders you should change. import "github.com/aws/aws-cdk-go/awscdk" sourceAccessConfigurationProperty := &SourceAccessConfigurationProperty{ Type: jsii.String("type"), Uri: jsii.String("uri"), }
type CfnFunction ¶
type CfnFunction interface { awscdk.CfnResource awscdk.IInspectable // The instruction set architecture that the function supports. // // Enter a string array with one of the valid values (arm64 or x86_64). The default value is `x86_64` . Architectures() *[]*string SetArchitectures(val *[]*string) // The Amazon Resource Name (ARN) of the function. AttrArn() *string AttrSnapStartResponseApplyOn() *string AttrSnapStartResponseOptimizationStatus() *string // Options for this resource, such as condition, update policy etc. // Experimental. CfnOptions() awscdk.ICfnResourceOptions CfnProperties() *map[string]interface{} // AWS resource type. // Experimental. CfnResourceType() *string // The code for the function. Code() interface{} SetCode(val interface{}) // To enable code signing for this function, specify the ARN of a code-signing configuration. // // A code-signing configuration // includes a set of signing profiles, which define the trusted publishers for this function. CodeSigningConfigArn() *string SetCodeSigningConfigArn(val *string) // Returns: the stack trace of the point where this Resource was created from, sourced // from the +metadata+ entry typed +aws:cdk:logicalId+, and with the bottom-most // node +internal+ entries filtered. // Experimental. CreationStack() *[]*string // A dead-letter queue configuration that specifies the queue or topic where Lambda sends asynchronous events when they fail processing. // // For more information, see [Dead-letter queues](https://docs.aws.amazon.com/lambda/latest/dg/invocation-async.html#invocation-dlq) . DeadLetterConfig() interface{} SetDeadLetterConfig(val interface{}) // A description of the function. Description() *string SetDescription(val *string) // Environment variables that are accessible from function code during execution. Environment() interface{} SetEnvironment(val interface{}) // The size of the function's `/tmp` directory in MB. // // The default value is 512, but it can be any whole number between 512 and 10,240 MB. EphemeralStorage() interface{} SetEphemeralStorage(val interface{}) // Connection settings for an Amazon EFS file system. // // To connect a function to a file system, a mount target must be available in every Availability Zone that your function connects to. If your template contains an [AWS::EFS::MountTarget](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-efs-mounttarget.html) resource, you must also specify a `DependsOn` attribute to ensure that the mount target is created or updated before the function. // // For more information about using the `DependsOn` attribute, see [DependsOn Attribute](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-attribute-dependson.html) . FileSystemConfigs() interface{} SetFileSystemConfigs(val interface{}) // The name of the Lambda function, up to 64 characters in length. // // If you don't specify a name, AWS CloudFormation generates one. // // If you specify a name, you cannot perform updates that require replacement of this resource. You can perform updates that require no or some interruption. If you must replace the resource, specify a new name. FunctionName() *string SetFunctionName(val *string) // The name of the method within your code that Lambda calls to run your function. // // Handler is required if the deployment package is a .zip file archive. The format includes the file name. It can also include namespaces and other qualifiers, depending on the runtime. For more information, see [Lambda programming model](https://docs.aws.amazon.com/lambda/latest/dg/foundation-progmodel.html) . Handler() *string SetHandler(val *string) // Configuration values that override the container image Dockerfile settings. // // For more information, see [Container image settings](https://docs.aws.amazon.com/lambda/latest/dg/images-create.html#images-parms) . ImageConfig() interface{} SetImageConfig(val interface{}) // The ARN of the AWS Key Management Service ( AWS KMS ) customer managed key that's used to encrypt your function's [environment variables](https://docs.aws.amazon.com/lambda/latest/dg/configuration-envvars.html#configuration-envvars-encryption) . When [Lambda SnapStart](https://docs.aws.amazon.com/lambda/latest/dg/snapstart-security.html) is activated, Lambda also uses this key is to encrypt your function's snapshot. If you deploy your function using a container image, Lambda also uses this key to encrypt your function when it's deployed. Note that this is not the same key that's used to protect your container image in the Amazon Elastic Container Registry (Amazon ECR). If you don't provide a customer managed key, Lambda uses a default service key. KmsKeyArn() *string SetKmsKeyArn(val *string) // A list of [function layers](https://docs.aws.amazon.com/lambda/latest/dg/configuration-layers.html) to add to the function's execution environment. Specify each layer by its ARN, including the version. Layers() *[]*string SetLayers(val *[]*string) // The logical ID for this CloudFormation stack element. // // The logical ID of the element // is calculated from the path of the resource node in the construct tree. // // To override this value, use `overrideLogicalId(newLogicalId)`. // // Returns: the logical ID as a stringified token. This value will only get // resolved during synthesis. // Experimental. LogicalId() *string // The amount of [memory available to the function](https://docs.aws.amazon.com/lambda/latest/dg/configuration-function-common.html#configuration-memory-console) at runtime. Increasing the function memory also increases its CPU allocation. The default value is 128 MB. The value can be any multiple of 1 MB. MemorySize() *float64 SetMemorySize(val *float64) // The construct tree node associated with this construct. // Experimental. Node() awscdk.ConstructNode // The type of deployment package. // // Set to `Image` for container image and set `Zip` for .zip file archive. PackageType() *string SetPackageType(val *string) // Return a string that will be resolved to a CloudFormation `{ Ref }` for this element. // // If, by any chance, the intrinsic reference of a resource is not a string, you could // coerce it to an IResolvable through `Lazy.any({ produce: resource.ref })`. // Experimental. Ref() *string // The number of simultaneous executions to reserve for the function. ReservedConcurrentExecutions() *float64 SetReservedConcurrentExecutions(val *float64) // The Amazon Resource Name (ARN) of the function's execution role. Role() *string SetRole(val *string) // The identifier of the function's [runtime](https://docs.aws.amazon.com/lambda/latest/dg/lambda-runtimes.html) . Runtime is required if the deployment package is a .zip file archive. // // The following list includes deprecated runtimes. For more information, see [Runtime deprecation policy](https://docs.aws.amazon.com/lambda/latest/dg/lambda-runtimes.html#runtime-support-policy) . Runtime() *string SetRuntime(val *string) // Sets the runtime management configuration for a function's version. // // For more information, see [Runtime updates](https://docs.aws.amazon.com/lambda/latest/dg/runtimes-update.html) . RuntimeManagementConfig() interface{} SetRuntimeManagementConfig(val interface{}) // The function's [AWS Lambda SnapStart](https://docs.aws.amazon.com/lambda/latest/dg/snapstart.html) setting. SnapStart() interface{} SetSnapStart(val interface{}) // The stack in which this element is defined. // // CfnElements must be defined within a stack scope (directly or indirectly). // Experimental. Stack() awscdk.Stack // A list of [tags](https://docs.aws.amazon.com/lambda/latest/dg/tagging.html) to apply to the function. Tags() awscdk.TagManager // The amount of time (in seconds) that Lambda allows a function to run before stopping it. // // The default is 3 seconds. The maximum allowed value is 900 seconds. For more information, see [Lambda execution environment](https://docs.aws.amazon.com/lambda/latest/dg/runtimes-context.html) . Timeout() *float64 SetTimeout(val *float64) // Set `Mode` to `Active` to sample and trace a subset of incoming requests with [X-Ray](https://docs.aws.amazon.com/lambda/latest/dg/services-xray.html) . TracingConfig() interface{} SetTracingConfig(val interface{}) // Return properties modified after initiation. // // Resources that expose mutable properties should override this function to // collect and return the properties object for this resource. // Experimental. UpdatedProperites() *map[string]interface{} // For network connectivity to AWS resources in a VPC, specify a list of security groups and subnets in the VPC. // // When you connect a function to a VPC, it can access resources and the internet only through that VPC. For more information, see [Configuring a Lambda function to access resources in a VPC](https://docs.aws.amazon.com/lambda/latest/dg/configuration-vpc.html) . VpcConfig() interface{} SetVpcConfig(val interface{}) // Syntactic sugar for `addOverride(path, undefined)`. // Experimental. AddDeletionOverride(path *string) // Indicates that this resource depends on another resource and cannot be provisioned unless the other resource has been successfully provisioned. // // This can be used for resources across stacks (or nested stack) boundaries // and the dependency will automatically be transferred to the relevant scope. // Experimental. AddDependsOn(target awscdk.CfnResource) // Add a value to the CloudFormation Resource Metadata. // See: https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/metadata-section-structure.html // // Note that this is a different set of metadata from CDK node metadata; this // metadata ends up in the stack template under the resource, whereas CDK // node metadata ends up in the Cloud Assembly. // // Experimental. AddMetadata(key *string, value interface{}) // Adds an override to the synthesized CloudFormation resource. // // To add a // property override, either use `addPropertyOverride` or prefix `path` with // "Properties." (i.e. `Properties.TopicName`). // // If the override is nested, separate each nested level using a dot (.) in the path parameter. // If there is an array as part of the nesting, specify the index in the path. // // To include a literal `.` in the property name, prefix with a `\`. In most // programming languages you will need to write this as `"\\."` because the // `\` itself will need to be escaped. // // For example, // “`typescript // cfnResource.addOverride('Properties.GlobalSecondaryIndexes.0.Projection.NonKeyAttributes', ['myattribute']); // cfnResource.addOverride('Properties.GlobalSecondaryIndexes.1.ProjectionType', 'INCLUDE'); // “` // would add the overrides // “`json // "Properties": { // "GlobalSecondaryIndexes": [ // { // "Projection": { // "NonKeyAttributes": [ "myattribute" ] // ... // } // ... // }, // { // "ProjectionType": "INCLUDE" // ... // }, // ] // ... // } // “` // // The `value` argument to `addOverride` will not be processed or translated // in any way. Pass raw JSON values in here with the correct capitalization // for CloudFormation. If you pass CDK classes or structs, they will be // rendered with lowercased key names, and CloudFormation will reject the // template. // Experimental. AddOverride(path *string, value interface{}) // Adds an override that deletes the value of a property from the resource definition. // Experimental. AddPropertyDeletionOverride(propertyPath *string) // Adds an override to a resource property. // // Syntactic sugar for `addOverride("Properties.<...>", value)`. // Experimental. AddPropertyOverride(propertyPath *string, value interface{}) // Sets the deletion policy of the resource based on the removal policy specified. // // The Removal Policy controls what happens to this resource when it stops // being managed by CloudFormation, either because you've removed it from the // CDK application or because you've made a change that requires the resource // to be replaced. // // The resource can be deleted (`RemovalPolicy.DESTROY`), or left in your AWS // account for data recovery and cleanup later (`RemovalPolicy.RETAIN`). // Experimental. ApplyRemovalPolicy(policy awscdk.RemovalPolicy, options *awscdk.RemovalPolicyOptions) // Returns a token for an runtime attribute of this resource. // // Ideally, use generated attribute accessors (e.g. `resource.arn`), but this can be used for future compatibility // in case there is no generated attribute. // Experimental. GetAtt(attributeName *string) awscdk.Reference // Retrieve a value value from the CloudFormation Resource Metadata. // See: https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/metadata-section-structure.html // // Note that this is a different set of metadata from CDK node metadata; this // metadata ends up in the stack template under the resource, whereas CDK // node metadata ends up in the Cloud Assembly. // // Experimental. GetMetadata(key *string) interface{} // Examines the CloudFormation resource and discloses attributes. Inspect(inspector awscdk.TreeInspector) // Perform final modifications before synthesis. // // This method can be implemented by derived constructs in order to perform // final changes before synthesis. prepare() will be called after child // constructs have been prepared. // // This is an advanced framework feature. Only use this if you // understand the implications. // Experimental. OnPrepare() // Allows this construct to emit artifacts into the cloud assembly during synthesis. // // This method is usually implemented by framework-level constructs such as `Stack` and `Asset` // as they participate in synthesizing the cloud assembly. // Experimental. OnSynthesize(session constructs.ISynthesisSession) // Validate the current construct. // // This method can be implemented by derived constructs in order to perform // validation logic. It is called on all constructs before synthesis. // // Returns: An array of validation error messages, or an empty array if the construct is valid. // Experimental. OnValidate() *[]*string // Overrides the auto-generated logical ID with a specific ID. // Experimental. OverrideLogicalId(newLogicalId *string) // Perform final modifications before synthesis. // // This method can be implemented by derived constructs in order to perform // final changes before synthesis. prepare() will be called after child // constructs have been prepared. // // This is an advanced framework feature. Only use this if you // understand the implications. // Experimental. Prepare() RenderProperties(props *map[string]interface{}) *map[string]interface{} // Can be overridden by subclasses to determine if this resource will be rendered into the cloudformation template. // // Returns: `true` if the resource should be included or `false` is the resource // should be omitted. // Experimental. ShouldSynthesize() *bool // Allows this construct to emit artifacts into the cloud assembly during synthesis. // // This method is usually implemented by framework-level constructs such as `Stack` and `Asset` // as they participate in synthesizing the cloud assembly. // Experimental. Synthesize(session awscdk.ISynthesisSession) // Returns a string representation of this construct. // // Returns: a string representation of this resource. // Experimental. ToString() *string // Validate the current construct. // // This method can be implemented by derived constructs in order to perform // validation logic. It is called on all constructs before synthesis. // // Returns: An array of validation error messages, or an empty array if the construct is valid. // Experimental. Validate() *[]*string // Experimental. ValidateProperties(_properties interface{}) }
A CloudFormation `AWS::Lambda::Function`.
The `AWS::Lambda::Function` resource creates a Lambda function. To create a function, you need a [deployment package](https://docs.aws.amazon.com/lambda/latest/dg/gettingstarted-package.html) and an [execution role](https://docs.aws.amazon.com/lambda/latest/dg/lambda-intro-execution-role.html) . The deployment package is a .zip file archive or container image that contains your function code. The execution role grants the function permission to use AWS services, such as Amazon CloudWatch Logs for log streaming and AWS X-Ray for request tracing.
You set the package type to `Image` if the deployment package is a [container image](https://docs.aws.amazon.com/lambda/latest/dg/lambda-images.html) . For a container image, the code property must include the URI of a container image in the Amazon ECR registry. You do not need to specify the handler and runtime properties.
You set the package type to `Zip` if the deployment package is a [.zip file archive](https://docs.aws.amazon.com/lambda/latest/dg/gettingstarted-package.html#gettingstarted-package-zip) . For a .zip file archive, the code property specifies the location of the .zip file. You must also specify the handler and runtime properties. For a Python example, see [Deploy Python Lambda functions with .zip file archives](https://docs.aws.amazon.com/lambda/latest/dg/python-package.html) .
You can use [code signing](https://docs.aws.amazon.com/lambda/latest/dg/configuration-codesigning.html) if your deployment package is a .zip file archive. To enable code signing for this function, specify the ARN of a code-signing configuration. When a user attempts to deploy a code package with `UpdateFunctionCode` , Lambda checks that the code package has a valid signature from a trusted publisher. The code-signing configuration includes a set of signing profiles, which define the trusted publishers for this function.
Note that you configure [provisioned concurrency](https://docs.aws.amazon.com/lambda/latest/dg/provisioned-concurrency.html) on a `AWS::Lambda::Version` or a `AWS::Lambda::Alias` .
For a complete introduction to Lambda functions, see [What is Lambda?](https://docs.aws.amazon.com/lambda/latest/dg/lambda-welcome.html) in the *Lambda developer guide.*
Example:
// The code below shows an example of how to instantiate this type. // The values are placeholders you should change. import "github.com/aws/aws-cdk-go/awscdk" cfnFunction := awscdk.Aws_lambda.NewCfnFunction(this, jsii.String("MyCfnFunction"), &CfnFunctionProps{ Code: &CodeProperty{ ImageUri: jsii.String("imageUri"), S3Bucket: jsii.String("s3Bucket"), S3Key: jsii.String("s3Key"), S3ObjectVersion: jsii.String("s3ObjectVersion"), ZipFile: jsii.String("zipFile"), }, Role: jsii.String("role"), // the properties below are optional Architectures: []*string{ jsii.String("architectures"), }, CodeSigningConfigArn: jsii.String("codeSigningConfigArn"), DeadLetterConfig: &DeadLetterConfigProperty{ TargetArn: jsii.String("targetArn"), }, Description: jsii.String("description"), Environment: &EnvironmentProperty{ Variables: map[string]*string{ "variablesKey": jsii.String("variables"), }, }, EphemeralStorage: &EphemeralStorageProperty{ Size: jsii.Number(123), }, FileSystemConfigs: []interface{}{ &FileSystemConfigProperty{ Arn: jsii.String("arn"), LocalMountPath: jsii.String("localMountPath"), }, }, FunctionName: jsii.String("functionName"), Handler: jsii.String("handler"), ImageConfig: &ImageConfigProperty{ Command: []*string{ jsii.String("command"), }, EntryPoint: []*string{ jsii.String("entryPoint"), }, WorkingDirectory: jsii.String("workingDirectory"), }, KmsKeyArn: jsii.String("kmsKeyArn"), Layers: []*string{ jsii.String("layers"), }, MemorySize: jsii.Number(123), PackageType: jsii.String("packageType"), ReservedConcurrentExecutions: jsii.Number(123), Runtime: jsii.String("runtime"), RuntimeManagementConfig: &RuntimeManagementConfigProperty{ UpdateRuntimeOn: jsii.String("updateRuntimeOn"), // the properties below are optional RuntimeVersionArn: jsii.String("runtimeVersionArn"), }, SnapStart: &SnapStartProperty{ ApplyOn: jsii.String("applyOn"), }, Tags: []cfnTag{ &cfnTag{ Key: jsii.String("key"), Value: jsii.String("value"), }, }, Timeout: jsii.Number(123), TracingConfig: &TracingConfigProperty{ Mode: jsii.String("mode"), }, VpcConfig: &VpcConfigProperty{ SecurityGroupIds: []*string{ jsii.String("securityGroupIds"), }, SubnetIds: []*string{ jsii.String("subnetIds"), }, }, })
func NewCfnFunction ¶
func NewCfnFunction(scope awscdk.Construct, id *string, props *CfnFunctionProps) CfnFunction
Create a new `AWS::Lambda::Function`.
type CfnFunctionProps ¶
type CfnFunctionProps struct { // The code for the function. Code interface{} `field:"required" json:"code" yaml:"code"` // The Amazon Resource Name (ARN) of the function's execution role. Role *string `field:"required" json:"role" yaml:"role"` // The instruction set architecture that the function supports. // // Enter a string array with one of the valid values (arm64 or x86_64). The default value is `x86_64` . Architectures *[]*string `field:"optional" json:"architectures" yaml:"architectures"` // To enable code signing for this function, specify the ARN of a code-signing configuration. // // A code-signing configuration // includes a set of signing profiles, which define the trusted publishers for this function. CodeSigningConfigArn *string `field:"optional" json:"codeSigningConfigArn" yaml:"codeSigningConfigArn"` // A dead-letter queue configuration that specifies the queue or topic where Lambda sends asynchronous events when they fail processing. // // For more information, see [Dead-letter queues](https://docs.aws.amazon.com/lambda/latest/dg/invocation-async.html#invocation-dlq) . DeadLetterConfig interface{} `field:"optional" json:"deadLetterConfig" yaml:"deadLetterConfig"` // A description of the function. Description *string `field:"optional" json:"description" yaml:"description"` // Environment variables that are accessible from function code during execution. Environment interface{} `field:"optional" json:"environment" yaml:"environment"` // The size of the function's `/tmp` directory in MB. // // The default value is 512, but it can be any whole number between 512 and 10,240 MB. EphemeralStorage interface{} `field:"optional" json:"ephemeralStorage" yaml:"ephemeralStorage"` // Connection settings for an Amazon EFS file system. // // To connect a function to a file system, a mount target must be available in every Availability Zone that your function connects to. If your template contains an [AWS::EFS::MountTarget](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-efs-mounttarget.html) resource, you must also specify a `DependsOn` attribute to ensure that the mount target is created or updated before the function. // // For more information about using the `DependsOn` attribute, see [DependsOn Attribute](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-attribute-dependson.html) . FileSystemConfigs interface{} `field:"optional" json:"fileSystemConfigs" yaml:"fileSystemConfigs"` // The name of the Lambda function, up to 64 characters in length. // // If you don't specify a name, AWS CloudFormation generates one. // // If you specify a name, you cannot perform updates that require replacement of this resource. You can perform updates that require no or some interruption. If you must replace the resource, specify a new name. FunctionName *string `field:"optional" json:"functionName" yaml:"functionName"` // The name of the method within your code that Lambda calls to run your function. // // Handler is required if the deployment package is a .zip file archive. The format includes the file name. It can also include namespaces and other qualifiers, depending on the runtime. For more information, see [Lambda programming model](https://docs.aws.amazon.com/lambda/latest/dg/foundation-progmodel.html) . Handler *string `field:"optional" json:"handler" yaml:"handler"` // Configuration values that override the container image Dockerfile settings. // // For more information, see [Container image settings](https://docs.aws.amazon.com/lambda/latest/dg/images-create.html#images-parms) . ImageConfig interface{} `field:"optional" json:"imageConfig" yaml:"imageConfig"` // The ARN of the AWS Key Management Service ( AWS KMS ) customer managed key that's used to encrypt your function's [environment variables](https://docs.aws.amazon.com/lambda/latest/dg/configuration-envvars.html#configuration-envvars-encryption) . When [Lambda SnapStart](https://docs.aws.amazon.com/lambda/latest/dg/snapstart-security.html) is activated, Lambda also uses this key is to encrypt your function's snapshot. If you deploy your function using a container image, Lambda also uses this key to encrypt your function when it's deployed. Note that this is not the same key that's used to protect your container image in the Amazon Elastic Container Registry (Amazon ECR). If you don't provide a customer managed key, Lambda uses a default service key. KmsKeyArn *string `field:"optional" json:"kmsKeyArn" yaml:"kmsKeyArn"` // A list of [function layers](https://docs.aws.amazon.com/lambda/latest/dg/configuration-layers.html) to add to the function's execution environment. Specify each layer by its ARN, including the version. Layers *[]*string `field:"optional" json:"layers" yaml:"layers"` // The amount of [memory available to the function](https://docs.aws.amazon.com/lambda/latest/dg/configuration-function-common.html#configuration-memory-console) at runtime. Increasing the function memory also increases its CPU allocation. The default value is 128 MB. The value can be any multiple of 1 MB. MemorySize *float64 `field:"optional" json:"memorySize" yaml:"memorySize"` // The type of deployment package. // // Set to `Image` for container image and set `Zip` for .zip file archive. PackageType *string `field:"optional" json:"packageType" yaml:"packageType"` // The number of simultaneous executions to reserve for the function. ReservedConcurrentExecutions *float64 `field:"optional" json:"reservedConcurrentExecutions" yaml:"reservedConcurrentExecutions"` // The identifier of the function's [runtime](https://docs.aws.amazon.com/lambda/latest/dg/lambda-runtimes.html) . Runtime is required if the deployment package is a .zip file archive. // // The following list includes deprecated runtimes. For more information, see [Runtime deprecation policy](https://docs.aws.amazon.com/lambda/latest/dg/lambda-runtimes.html#runtime-support-policy) . Runtime *string `field:"optional" json:"runtime" yaml:"runtime"` // Sets the runtime management configuration for a function's version. // // For more information, see [Runtime updates](https://docs.aws.amazon.com/lambda/latest/dg/runtimes-update.html) . RuntimeManagementConfig interface{} `field:"optional" json:"runtimeManagementConfig" yaml:"runtimeManagementConfig"` // The function's [AWS Lambda SnapStart](https://docs.aws.amazon.com/lambda/latest/dg/snapstart.html) setting. SnapStart interface{} `field:"optional" json:"snapStart" yaml:"snapStart"` // A list of [tags](https://docs.aws.amazon.com/lambda/latest/dg/tagging.html) to apply to the function. Tags *[]*awscdk.CfnTag `field:"optional" json:"tags" yaml:"tags"` // The amount of time (in seconds) that Lambda allows a function to run before stopping it. // // The default is 3 seconds. The maximum allowed value is 900 seconds. For more information, see [Lambda execution environment](https://docs.aws.amazon.com/lambda/latest/dg/runtimes-context.html) . Timeout *float64 `field:"optional" json:"timeout" yaml:"timeout"` // Set `Mode` to `Active` to sample and trace a subset of incoming requests with [X-Ray](https://docs.aws.amazon.com/lambda/latest/dg/services-xray.html) . TracingConfig interface{} `field:"optional" json:"tracingConfig" yaml:"tracingConfig"` // For network connectivity to AWS resources in a VPC, specify a list of security groups and subnets in the VPC. // // When you connect a function to a VPC, it can access resources and the internet only through that VPC. For more information, see [Configuring a Lambda function to access resources in a VPC](https://docs.aws.amazon.com/lambda/latest/dg/configuration-vpc.html) . VpcConfig interface{} `field:"optional" json:"vpcConfig" yaml:"vpcConfig"` }
Properties for defining a `CfnFunction`.
Example:
// The code below shows an example of how to instantiate this type. // The values are placeholders you should change. import "github.com/aws/aws-cdk-go/awscdk" cfnFunctionProps := &CfnFunctionProps{ Code: &CodeProperty{ ImageUri: jsii.String("imageUri"), S3Bucket: jsii.String("s3Bucket"), S3Key: jsii.String("s3Key"), S3ObjectVersion: jsii.String("s3ObjectVersion"), ZipFile: jsii.String("zipFile"), }, Role: jsii.String("role"), // the properties below are optional Architectures: []*string{ jsii.String("architectures"), }, CodeSigningConfigArn: jsii.String("codeSigningConfigArn"), DeadLetterConfig: &DeadLetterConfigProperty{ TargetArn: jsii.String("targetArn"), }, Description: jsii.String("description"), Environment: &EnvironmentProperty{ Variables: map[string]*string{ "variablesKey": jsii.String("variables"), }, }, EphemeralStorage: &EphemeralStorageProperty{ Size: jsii.Number(123), }, FileSystemConfigs: []interface{}{ &FileSystemConfigProperty{ Arn: jsii.String("arn"), LocalMountPath: jsii.String("localMountPath"), }, }, FunctionName: jsii.String("functionName"), Handler: jsii.String("handler"), ImageConfig: &ImageConfigProperty{ Command: []*string{ jsii.String("command"), }, EntryPoint: []*string{ jsii.String("entryPoint"), }, WorkingDirectory: jsii.String("workingDirectory"), }, KmsKeyArn: jsii.String("kmsKeyArn"), Layers: []*string{ jsii.String("layers"), }, MemorySize: jsii.Number(123), PackageType: jsii.String("packageType"), ReservedConcurrentExecutions: jsii.Number(123), Runtime: jsii.String("runtime"), RuntimeManagementConfig: &RuntimeManagementConfigProperty{ UpdateRuntimeOn: jsii.String("updateRuntimeOn"), // the properties below are optional RuntimeVersionArn: jsii.String("runtimeVersionArn"), }, SnapStart: &SnapStartProperty{ ApplyOn: jsii.String("applyOn"), }, Tags: []cfnTag{ &cfnTag{ Key: jsii.String("key"), Value: jsii.String("value"), }, }, Timeout: jsii.Number(123), TracingConfig: &TracingConfigProperty{ Mode: jsii.String("mode"), }, VpcConfig: &VpcConfigProperty{ SecurityGroupIds: []*string{ jsii.String("securityGroupIds"), }, SubnetIds: []*string{ jsii.String("subnetIds"), }, }, }
type CfnFunction_CodeProperty ¶
type CfnFunction_CodeProperty struct { // URI of a [container image](https://docs.aws.amazon.com/lambda/latest/dg/lambda-images.html) in the Amazon ECR registry. ImageUri *string `field:"optional" json:"imageUri" yaml:"imageUri"` // An Amazon S3 bucket in the same AWS Region as your function. // // The bucket can be in a different AWS account . S3Bucket *string `field:"optional" json:"s3Bucket" yaml:"s3Bucket"` // The Amazon S3 key of the deployment package. S3Key *string `field:"optional" json:"s3Key" yaml:"s3Key"` // For versioned objects, the version of the deployment package object to use. S3ObjectVersion *string `field:"optional" json:"s3ObjectVersion" yaml:"s3ObjectVersion"` // (Node.js and Python) The source code of your Lambda function. If you include your function source inline with this parameter, AWS CloudFormation places it in a file named `index` and zips it to create a [deployment package](https://docs.aws.amazon.com/lambda/latest/dg/gettingstarted-package.html) . This zip file cannot exceed 4MB. For the `Handler` property, the first part of the handler identifier must be `index` . For example, `index.handler` . // // For JSON, you must escape quotes and special characters such as newline ( `\n` ) with a backslash. // // If you specify a function that interacts with an AWS CloudFormation custom resource, you don't have to write your own functions to send responses to the custom resource that invoked the function. AWS CloudFormation provides a response module ( [cfn-response](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/cfn-lambda-function-code-cfnresponsemodule.html) ) that simplifies sending responses. See [Using AWS Lambda with AWS CloudFormation](https://docs.aws.amazon.com/lambda/latest/dg/services-cloudformation.html) for details. ZipFile *string `field:"optional" json:"zipFile" yaml:"zipFile"` }
The [deployment package](https://docs.aws.amazon.com/lambda/latest/dg/gettingstarted-package.html) for a Lambda function. To deploy a function defined as a container image, you specify the location of a container image in the Amazon ECR registry. For a .zip file deployment package, you can specify the location of an object in Amazon S3. For Node.js and Python functions, you can specify the function code inline in the template.
Changes to a deployment package in Amazon S3 are not detected automatically during stack updates. To update the function code, change the object key or version in the template.
Example:
// The code below shows an example of how to instantiate this type. // The values are placeholders you should change. import "github.com/aws/aws-cdk-go/awscdk" codeProperty := &CodeProperty{ ImageUri: jsii.String("imageUri"), S3Bucket: jsii.String("s3Bucket"), S3Key: jsii.String("s3Key"), S3ObjectVersion: jsii.String("s3ObjectVersion"), ZipFile: jsii.String("zipFile"), }
type CfnFunction_DeadLetterConfigProperty ¶
type CfnFunction_DeadLetterConfigProperty struct { // The Amazon Resource Name (ARN) of an Amazon SQS queue or Amazon SNS topic. TargetArn *string `field:"optional" json:"targetArn" yaml:"targetArn"` }
The [dead-letter queue](https://docs.aws.amazon.com/lambda/latest/dg/invocation-async.html#dlq) for failed asynchronous invocations.
Example:
// The code below shows an example of how to instantiate this type. // The values are placeholders you should change. import "github.com/aws/aws-cdk-go/awscdk" deadLetterConfigProperty := &DeadLetterConfigProperty{ TargetArn: jsii.String("targetArn"), }
type CfnFunction_EnvironmentProperty ¶
type CfnFunction_EnvironmentProperty struct { // Environment variable key-value pairs. // // For more information, see [Using Lambda environment variables](https://docs.aws.amazon.com/lambda/latest/dg/configuration-envvars.html) . Variables interface{} `field:"optional" json:"variables" yaml:"variables"` }
A function's environment variable settings.
You can use environment variables to adjust your function's behavior without updating code. An environment variable is a pair of strings that are stored in a function's version-specific configuration.
Example:
// The code below shows an example of how to instantiate this type. // The values are placeholders you should change. import "github.com/aws/aws-cdk-go/awscdk" environmentProperty := &EnvironmentProperty{ Variables: map[string]*string{ "variablesKey": jsii.String("variables"), }, }
type CfnFunction_EphemeralStorageProperty ¶
type CfnFunction_EphemeralStorageProperty struct { // The size of the function's `/tmp` directory. Size *float64 `field:"required" json:"size" yaml:"size"` }
The size of the function's `/tmp` directory in MB.
The default value is 512, but it can be any whole number between 512 and 10,240 MB.
Example:
// The code below shows an example of how to instantiate this type. // The values are placeholders you should change. import "github.com/aws/aws-cdk-go/awscdk" ephemeralStorageProperty := &EphemeralStorageProperty{ Size: jsii.Number(123), }
type CfnFunction_FileSystemConfigProperty ¶
type CfnFunction_FileSystemConfigProperty struct { // The Amazon Resource Name (ARN) of the Amazon EFS access point that provides access to the file system. Arn *string `field:"required" json:"arn" yaml:"arn"` // The path where the function can access the file system, starting with `/mnt/` . LocalMountPath *string `field:"required" json:"localMountPath" yaml:"localMountPath"` }
Details about the connection between a Lambda function and an [Amazon EFS file system](https://docs.aws.amazon.com/lambda/latest/dg/configuration-filesystem.html) .
Example:
// The code below shows an example of how to instantiate this type. // The values are placeholders you should change. import "github.com/aws/aws-cdk-go/awscdk" fileSystemConfigProperty := &FileSystemConfigProperty{ Arn: jsii.String("arn"), LocalMountPath: jsii.String("localMountPath"), }
type CfnFunction_ImageConfigProperty ¶
type CfnFunction_ImageConfigProperty struct { // Specifies parameters that you want to pass in with ENTRYPOINT. // // You can specify a maximum of 1,500 parameters in the list. Command *[]*string `field:"optional" json:"command" yaml:"command"` // Specifies the entry point to their application, which is typically the location of the runtime executable. // // You can specify a maximum of 1,500 string entries in the list. EntryPoint *[]*string `field:"optional" json:"entryPoint" yaml:"entryPoint"` // Specifies the working directory. // // The length of the directory string cannot exceed 1,000 characters. WorkingDirectory *string `field:"optional" json:"workingDirectory" yaml:"workingDirectory"` }
Configuration values that override the container image Dockerfile settings.
For more information, see [Container image settings](https://docs.aws.amazon.com/lambda/latest/dg/images-create.html#images-parms) .
Example:
// The code below shows an example of how to instantiate this type. // The values are placeholders you should change. import "github.com/aws/aws-cdk-go/awscdk" imageConfigProperty := &ImageConfigProperty{ Command: []*string{ jsii.String("command"), }, EntryPoint: []*string{ jsii.String("entryPoint"), }, WorkingDirectory: jsii.String("workingDirectory"), }
type CfnFunction_RuntimeManagementConfigProperty ¶
type CfnFunction_RuntimeManagementConfigProperty struct { // Specify the runtime update mode. // // - *Auto (default)* - Automatically update to the most recent and secure runtime version using a [Two-phase runtime version rollout](https://docs.aws.amazon.com/lambda/latest/dg/runtimes-update.html#runtime-management-two-phase) . This is the best choice for most customers to ensure they always benefit from runtime updates. // - *FunctionUpdate* - Lambda updates the runtime of you function to the most recent and secure runtime version when you update your function. This approach synchronizes runtime updates with function deployments, giving you control over when runtime updates are applied and allowing you to detect and mitigate rare runtime update incompatibilities early. When using this setting, you need to regularly update your functions to keep their runtime up-to-date. // - *Manual* - You specify a runtime version in your function configuration. The function will use this runtime version indefinitely. In the rare case where a new runtime version is incompatible with an existing function, this allows you to roll back your function to an earlier runtime version. For more information, see [Roll back a runtime version](https://docs.aws.amazon.com/lambda/latest/dg/runtimes-update.html#runtime-management-rollback) . // // *Valid Values* : `Auto` | `FunctionUpdate` | `Manual`. UpdateRuntimeOn *string `field:"required" json:"updateRuntimeOn" yaml:"updateRuntimeOn"` // The ARN of the runtime version you want the function to use. // // > This is only required if you're using the *Manual* runtime update mode. RuntimeVersionArn *string `field:"optional" json:"runtimeVersionArn" yaml:"runtimeVersionArn"` }
Sets the runtime management configuration for a function's version.
For more information, see [Runtime updates](https://docs.aws.amazon.com/lambda/latest/dg/runtimes-update.html) .
Example:
// The code below shows an example of how to instantiate this type. // The values are placeholders you should change. import "github.com/aws/aws-cdk-go/awscdk" runtimeManagementConfigProperty := &RuntimeManagementConfigProperty{ UpdateRuntimeOn: jsii.String("updateRuntimeOn"), // the properties below are optional RuntimeVersionArn: jsii.String("runtimeVersionArn"), }
type CfnFunction_SnapStartProperty ¶
type CfnFunction_SnapStartProperty struct { // Set `ApplyOn` to `PublishedVersions` to create a snapshot of the initialized execution environment when you publish a function version. ApplyOn *string `field:"required" json:"applyOn" yaml:"applyOn"` }
The function's [AWS Lambda SnapStart](https://docs.aws.amazon.com/lambda/latest/dg/snapstart.html) setting.
Example:
// The code below shows an example of how to instantiate this type. // The values are placeholders you should change. import "github.com/aws/aws-cdk-go/awscdk" snapStartProperty := &SnapStartProperty{ ApplyOn: jsii.String("applyOn"), }
type CfnFunction_SnapStartResponseProperty ¶
type CfnFunction_SnapStartResponseProperty struct { // When set to `PublishedVersions` , Lambda creates a snapshot of the execution environment when you publish a function version. ApplyOn *string `field:"optional" json:"applyOn" yaml:"applyOn"` // When you provide a [qualified Amazon Resource Name (ARN)](https://docs.aws.amazon.com/lambda/latest/dg/configuration-versions.html#versioning-versions-using) , this response element indicates whether SnapStart is activated for the specified function version. OptimizationStatus *string `field:"optional" json:"optimizationStatus" yaml:"optimizationStatus"` }
The function's [SnapStart](https://docs.aws.amazon.com/lambda/latest/dg/snapstart.html) setting.
Example:
// The code below shows an example of how to instantiate this type. // The values are placeholders you should change. import "github.com/aws/aws-cdk-go/awscdk" snapStartResponseProperty := &SnapStartResponseProperty{ ApplyOn: jsii.String("applyOn"), OptimizationStatus: jsii.String("optimizationStatus"), }
type CfnFunction_TracingConfigProperty ¶
type CfnFunction_TracingConfigProperty struct { // The tracing mode. Mode *string `field:"optional" json:"mode" yaml:"mode"` }
The function's [AWS X-Ray](https://docs.aws.amazon.com/lambda/latest/dg/services-xray.html) tracing configuration. To sample and record incoming requests, set `Mode` to `Active` .
Example:
// The code below shows an example of how to instantiate this type. // The values are placeholders you should change. import "github.com/aws/aws-cdk-go/awscdk" tracingConfigProperty := &TracingConfigProperty{ Mode: jsii.String("mode"), }
type CfnFunction_VpcConfigProperty ¶
type CfnFunction_VpcConfigProperty struct { // A list of VPC security group IDs. SecurityGroupIds *[]*string `field:"optional" json:"securityGroupIds" yaml:"securityGroupIds"` // A list of VPC subnet IDs. SubnetIds *[]*string `field:"optional" json:"subnetIds" yaml:"subnetIds"` }
The VPC security groups and subnets that are attached to a Lambda function.
When you connect a function to a VPC, Lambda creates an elastic network interface for each combination of security group and subnet in the function's VPC configuration. The function can only access resources and the internet through that VPC. For more information, see [VPC Settings](https://docs.aws.amazon.com/lambda/latest/dg/configuration-vpc.html) .
> When you delete a function, AWS CloudFormation monitors the state of its network interfaces and waits for Lambda to delete them before proceeding. If the VPC is defined in the same stack, the network interfaces need to be deleted by Lambda before AWS CloudFormation can delete the VPC's resources. > > To monitor network interfaces, AWS CloudFormation needs the `ec2:DescribeNetworkInterfaces` permission. It obtains this from the user or role that modifies the stack. If you don't provide this permission, AWS CloudFormation does not wait for network interfaces to be deleted.
Example:
// The code below shows an example of how to instantiate this type. // The values are placeholders you should change. import "github.com/aws/aws-cdk-go/awscdk" vpcConfigProperty := &VpcConfigProperty{ SecurityGroupIds: []*string{ jsii.String("securityGroupIds"), }, SubnetIds: []*string{ jsii.String("subnetIds"), }, }
type CfnLayerVersion ¶
type CfnLayerVersion interface { awscdk.CfnResource awscdk.IInspectable // Options for this resource, such as condition, update policy etc. // Experimental. CfnOptions() awscdk.ICfnResourceOptions CfnProperties() *map[string]interface{} // AWS resource type. // Experimental. CfnResourceType() *string // A list of compatible [instruction set architectures](https://docs.aws.amazon.com/lambda/latest/dg/foundation-arch.html) . CompatibleArchitectures() *[]*string SetCompatibleArchitectures(val *[]*string) // A list of compatible [function runtimes](https://docs.aws.amazon.com/lambda/latest/dg/lambda-runtimes.html) . Used for filtering with [ListLayers](https://docs.aws.amazon.com/lambda/latest/dg/API_ListLayers.html) and [ListLayerVersions](https://docs.aws.amazon.com/lambda/latest/dg/API_ListLayerVersions.html) . CompatibleRuntimes() *[]*string SetCompatibleRuntimes(val *[]*string) // The function layer archive. Content() interface{} SetContent(val interface{}) // Returns: the stack trace of the point where this Resource was created from, sourced // from the +metadata+ entry typed +aws:cdk:logicalId+, and with the bottom-most // node +internal+ entries filtered. // Experimental. CreationStack() *[]*string // The description of the version. Description() *string SetDescription(val *string) // The name or Amazon Resource Name (ARN) of the layer. LayerName() *string SetLayerName(val *string) // The layer's software license. It can be any of the following:. // // - An [SPDX license identifier](https://docs.aws.amazon.com/https://spdx.org/licenses/) . For example, `MIT` . // - The URL of a license hosted on the internet. For example, `https://opensource.org/licenses/MIT` . // - The full text of the license. LicenseInfo() *string SetLicenseInfo(val *string) // The logical ID for this CloudFormation stack element. // // The logical ID of the element // is calculated from the path of the resource node in the construct tree. // // To override this value, use `overrideLogicalId(newLogicalId)`. // // Returns: the logical ID as a stringified token. This value will only get // resolved during synthesis. // Experimental. LogicalId() *string // The construct tree node associated with this construct. // Experimental. Node() awscdk.ConstructNode // Return a string that will be resolved to a CloudFormation `{ Ref }` for this element. // // If, by any chance, the intrinsic reference of a resource is not a string, you could // coerce it to an IResolvable through `Lazy.any({ produce: resource.ref })`. // Experimental. Ref() *string // The stack in which this element is defined. // // CfnElements must be defined within a stack scope (directly or indirectly). // Experimental. Stack() awscdk.Stack // Return properties modified after initiation. // // Resources that expose mutable properties should override this function to // collect and return the properties object for this resource. // Experimental. UpdatedProperites() *map[string]interface{} // Syntactic sugar for `addOverride(path, undefined)`. // Experimental. AddDeletionOverride(path *string) // Indicates that this resource depends on another resource and cannot be provisioned unless the other resource has been successfully provisioned. // // This can be used for resources across stacks (or nested stack) boundaries // and the dependency will automatically be transferred to the relevant scope. // Experimental. AddDependsOn(target awscdk.CfnResource) // Add a value to the CloudFormation Resource Metadata. // See: https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/metadata-section-structure.html // // Note that this is a different set of metadata from CDK node metadata; this // metadata ends up in the stack template under the resource, whereas CDK // node metadata ends up in the Cloud Assembly. // // Experimental. AddMetadata(key *string, value interface{}) // Adds an override to the synthesized CloudFormation resource. // // To add a // property override, either use `addPropertyOverride` or prefix `path` with // "Properties." (i.e. `Properties.TopicName`). // // If the override is nested, separate each nested level using a dot (.) in the path parameter. // If there is an array as part of the nesting, specify the index in the path. // // To include a literal `.` in the property name, prefix with a `\`. In most // programming languages you will need to write this as `"\\."` because the // `\` itself will need to be escaped. // // For example, // “`typescript // cfnResource.addOverride('Properties.GlobalSecondaryIndexes.0.Projection.NonKeyAttributes', ['myattribute']); // cfnResource.addOverride('Properties.GlobalSecondaryIndexes.1.ProjectionType', 'INCLUDE'); // “` // would add the overrides // “`json // "Properties": { // "GlobalSecondaryIndexes": [ // { // "Projection": { // "NonKeyAttributes": [ "myattribute" ] // ... // } // ... // }, // { // "ProjectionType": "INCLUDE" // ... // }, // ] // ... // } // “` // // The `value` argument to `addOverride` will not be processed or translated // in any way. Pass raw JSON values in here with the correct capitalization // for CloudFormation. If you pass CDK classes or structs, they will be // rendered with lowercased key names, and CloudFormation will reject the // template. // Experimental. AddOverride(path *string, value interface{}) // Adds an override that deletes the value of a property from the resource definition. // Experimental. AddPropertyDeletionOverride(propertyPath *string) // Adds an override to a resource property. // // Syntactic sugar for `addOverride("Properties.<...>", value)`. // Experimental. AddPropertyOverride(propertyPath *string, value interface{}) // Sets the deletion policy of the resource based on the removal policy specified. // // The Removal Policy controls what happens to this resource when it stops // being managed by CloudFormation, either because you've removed it from the // CDK application or because you've made a change that requires the resource // to be replaced. // // The resource can be deleted (`RemovalPolicy.DESTROY`), or left in your AWS // account for data recovery and cleanup later (`RemovalPolicy.RETAIN`). // Experimental. ApplyRemovalPolicy(policy awscdk.RemovalPolicy, options *awscdk.RemovalPolicyOptions) // Returns a token for an runtime attribute of this resource. // // Ideally, use generated attribute accessors (e.g. `resource.arn`), but this can be used for future compatibility // in case there is no generated attribute. // Experimental. GetAtt(attributeName *string) awscdk.Reference // Retrieve a value value from the CloudFormation Resource Metadata. // See: https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/metadata-section-structure.html // // Note that this is a different set of metadata from CDK node metadata; this // metadata ends up in the stack template under the resource, whereas CDK // node metadata ends up in the Cloud Assembly. // // Experimental. GetMetadata(key *string) interface{} // Examines the CloudFormation resource and discloses attributes. Inspect(inspector awscdk.TreeInspector) // Perform final modifications before synthesis. // // This method can be implemented by derived constructs in order to perform // final changes before synthesis. prepare() will be called after child // constructs have been prepared. // // This is an advanced framework feature. Only use this if you // understand the implications. // Experimental. OnPrepare() // Allows this construct to emit artifacts into the cloud assembly during synthesis. // // This method is usually implemented by framework-level constructs such as `Stack` and `Asset` // as they participate in synthesizing the cloud assembly. // Experimental. OnSynthesize(session constructs.ISynthesisSession) // Validate the current construct. // // This method can be implemented by derived constructs in order to perform // validation logic. It is called on all constructs before synthesis. // // Returns: An array of validation error messages, or an empty array if the construct is valid. // Experimental. OnValidate() *[]*string // Overrides the auto-generated logical ID with a specific ID. // Experimental. OverrideLogicalId(newLogicalId *string) // Perform final modifications before synthesis. // // This method can be implemented by derived constructs in order to perform // final changes before synthesis. prepare() will be called after child // constructs have been prepared. // // This is an advanced framework feature. Only use this if you // understand the implications. // Experimental. Prepare() RenderProperties(props *map[string]interface{}) *map[string]interface{} // Can be overridden by subclasses to determine if this resource will be rendered into the cloudformation template. // // Returns: `true` if the resource should be included or `false` is the resource // should be omitted. // Experimental. ShouldSynthesize() *bool // Allows this construct to emit artifacts into the cloud assembly during synthesis. // // This method is usually implemented by framework-level constructs such as `Stack` and `Asset` // as they participate in synthesizing the cloud assembly. // Experimental. Synthesize(session awscdk.ISynthesisSession) // Returns a string representation of this construct. // // Returns: a string representation of this resource. // Experimental. ToString() *string // Validate the current construct. // // This method can be implemented by derived constructs in order to perform // validation logic. It is called on all constructs before synthesis. // // Returns: An array of validation error messages, or an empty array if the construct is valid. // Experimental. Validate() *[]*string // Experimental. ValidateProperties(_properties interface{}) }
A CloudFormation `AWS::Lambda::LayerVersion`.
The `AWS::Lambda::LayerVersion` resource creates a [Lambda layer](https://docs.aws.amazon.com/lambda/latest/dg/configuration-layers.html) from a ZIP archive.
Example:
// The code below shows an example of how to instantiate this type. // The values are placeholders you should change. import "github.com/aws/aws-cdk-go/awscdk" cfnLayerVersion := awscdk.Aws_lambda.NewCfnLayerVersion(this, jsii.String("MyCfnLayerVersion"), &CfnLayerVersionProps{ Content: &ContentProperty{ S3Bucket: jsii.String("s3Bucket"), S3Key: jsii.String("s3Key"), // the properties below are optional S3ObjectVersion: jsii.String("s3ObjectVersion"), }, // the properties below are optional CompatibleArchitectures: []*string{ jsii.String("compatibleArchitectures"), }, CompatibleRuntimes: []*string{ jsii.String("compatibleRuntimes"), }, Description: jsii.String("description"), LayerName: jsii.String("layerName"), LicenseInfo: jsii.String("licenseInfo"), })
func NewCfnLayerVersion ¶
func NewCfnLayerVersion(scope awscdk.Construct, id *string, props *CfnLayerVersionProps) CfnLayerVersion
Create a new `AWS::Lambda::LayerVersion`.
type CfnLayerVersionPermission ¶
type CfnLayerVersionPermission interface { awscdk.CfnResource awscdk.IInspectable // The API action that grants access to the layer. // // For example, `lambda:GetLayerVersion` . Action() *string SetAction(val *string) // Options for this resource, such as condition, update policy etc. // Experimental. CfnOptions() awscdk.ICfnResourceOptions CfnProperties() *map[string]interface{} // AWS resource type. // Experimental. CfnResourceType() *string // Returns: the stack trace of the point where this Resource was created from, sourced // from the +metadata+ entry typed +aws:cdk:logicalId+, and with the bottom-most // node +internal+ entries filtered. // Experimental. CreationStack() *[]*string // The name or Amazon Resource Name (ARN) of the layer. LayerVersionArn() *string SetLayerVersionArn(val *string) // The logical ID for this CloudFormation stack element. // // The logical ID of the element // is calculated from the path of the resource node in the construct tree. // // To override this value, use `overrideLogicalId(newLogicalId)`. // // Returns: the logical ID as a stringified token. This value will only get // resolved during synthesis. // Experimental. LogicalId() *string // The construct tree node associated with this construct. // Experimental. Node() awscdk.ConstructNode // With the principal set to `*` , grant permission to all accounts in the specified organization. OrganizationId() *string SetOrganizationId(val *string) // An account ID, or `*` to grant layer usage permission to all accounts in an organization, or all AWS accounts (if `organizationId` is not specified). // // For the last case, make sure that you really do want all AWS accounts to have usage permission to this layer. Principal() *string SetPrincipal(val *string) // Return a string that will be resolved to a CloudFormation `{ Ref }` for this element. // // If, by any chance, the intrinsic reference of a resource is not a string, you could // coerce it to an IResolvable through `Lazy.any({ produce: resource.ref })`. // Experimental. Ref() *string // The stack in which this element is defined. // // CfnElements must be defined within a stack scope (directly or indirectly). // Experimental. Stack() awscdk.Stack // Return properties modified after initiation. // // Resources that expose mutable properties should override this function to // collect and return the properties object for this resource. // Experimental. UpdatedProperites() *map[string]interface{} // Syntactic sugar for `addOverride(path, undefined)`. // Experimental. AddDeletionOverride(path *string) // Indicates that this resource depends on another resource and cannot be provisioned unless the other resource has been successfully provisioned. // // This can be used for resources across stacks (or nested stack) boundaries // and the dependency will automatically be transferred to the relevant scope. // Experimental. AddDependsOn(target awscdk.CfnResource) // Add a value to the CloudFormation Resource Metadata. // See: https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/metadata-section-structure.html // // Note that this is a different set of metadata from CDK node metadata; this // metadata ends up in the stack template under the resource, whereas CDK // node metadata ends up in the Cloud Assembly. // // Experimental. AddMetadata(key *string, value interface{}) // Adds an override to the synthesized CloudFormation resource. // // To add a // property override, either use `addPropertyOverride` or prefix `path` with // "Properties." (i.e. `Properties.TopicName`). // // If the override is nested, separate each nested level using a dot (.) in the path parameter. // If there is an array as part of the nesting, specify the index in the path. // // To include a literal `.` in the property name, prefix with a `\`. In most // programming languages you will need to write this as `"\\."` because the // `\` itself will need to be escaped. // // For example, // “`typescript // cfnResource.addOverride('Properties.GlobalSecondaryIndexes.0.Projection.NonKeyAttributes', ['myattribute']); // cfnResource.addOverride('Properties.GlobalSecondaryIndexes.1.ProjectionType', 'INCLUDE'); // “` // would add the overrides // “`json // "Properties": { // "GlobalSecondaryIndexes": [ // { // "Projection": { // "NonKeyAttributes": [ "myattribute" ] // ... // } // ... // }, // { // "ProjectionType": "INCLUDE" // ... // }, // ] // ... // } // “` // // The `value` argument to `addOverride` will not be processed or translated // in any way. Pass raw JSON values in here with the correct capitalization // for CloudFormation. If you pass CDK classes or structs, they will be // rendered with lowercased key names, and CloudFormation will reject the // template. // Experimental. AddOverride(path *string, value interface{}) // Adds an override that deletes the value of a property from the resource definition. // Experimental. AddPropertyDeletionOverride(propertyPath *string) // Adds an override to a resource property. // // Syntactic sugar for `addOverride("Properties.<...>", value)`. // Experimental. AddPropertyOverride(propertyPath *string, value interface{}) // Sets the deletion policy of the resource based on the removal policy specified. // // The Removal Policy controls what happens to this resource when it stops // being managed by CloudFormation, either because you've removed it from the // CDK application or because you've made a change that requires the resource // to be replaced. // // The resource can be deleted (`RemovalPolicy.DESTROY`), or left in your AWS // account for data recovery and cleanup later (`RemovalPolicy.RETAIN`). // Experimental. ApplyRemovalPolicy(policy awscdk.RemovalPolicy, options *awscdk.RemovalPolicyOptions) // Returns a token for an runtime attribute of this resource. // // Ideally, use generated attribute accessors (e.g. `resource.arn`), but this can be used for future compatibility // in case there is no generated attribute. // Experimental. GetAtt(attributeName *string) awscdk.Reference // Retrieve a value value from the CloudFormation Resource Metadata. // See: https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/metadata-section-structure.html // // Note that this is a different set of metadata from CDK node metadata; this // metadata ends up in the stack template under the resource, whereas CDK // node metadata ends up in the Cloud Assembly. // // Experimental. GetMetadata(key *string) interface{} // Examines the CloudFormation resource and discloses attributes. Inspect(inspector awscdk.TreeInspector) // Perform final modifications before synthesis. // // This method can be implemented by derived constructs in order to perform // final changes before synthesis. prepare() will be called after child // constructs have been prepared. // // This is an advanced framework feature. Only use this if you // understand the implications. // Experimental. OnPrepare() // Allows this construct to emit artifacts into the cloud assembly during synthesis. // // This method is usually implemented by framework-level constructs such as `Stack` and `Asset` // as they participate in synthesizing the cloud assembly. // Experimental. OnSynthesize(session constructs.ISynthesisSession) // Validate the current construct. // // This method can be implemented by derived constructs in order to perform // validation logic. It is called on all constructs before synthesis. // // Returns: An array of validation error messages, or an empty array if the construct is valid. // Experimental. OnValidate() *[]*string // Overrides the auto-generated logical ID with a specific ID. // Experimental. OverrideLogicalId(newLogicalId *string) // Perform final modifications before synthesis. // // This method can be implemented by derived constructs in order to perform // final changes before synthesis. prepare() will be called after child // constructs have been prepared. // // This is an advanced framework feature. Only use this if you // understand the implications. // Experimental. Prepare() RenderProperties(props *map[string]interface{}) *map[string]interface{} // Can be overridden by subclasses to determine if this resource will be rendered into the cloudformation template. // // Returns: `true` if the resource should be included or `false` is the resource // should be omitted. // Experimental. ShouldSynthesize() *bool // Allows this construct to emit artifacts into the cloud assembly during synthesis. // // This method is usually implemented by framework-level constructs such as `Stack` and `Asset` // as they participate in synthesizing the cloud assembly. // Experimental. Synthesize(session awscdk.ISynthesisSession) // Returns a string representation of this construct. // // Returns: a string representation of this resource. // Experimental. ToString() *string // Validate the current construct. // // This method can be implemented by derived constructs in order to perform // validation logic. It is called on all constructs before synthesis. // // Returns: An array of validation error messages, or an empty array if the construct is valid. // Experimental. Validate() *[]*string // Experimental. ValidateProperties(_properties interface{}) }
A CloudFormation `AWS::Lambda::LayerVersionPermission`.
The `AWS::Lambda::LayerVersionPermission` resource adds permissions to the resource-based policy of a version of an [Lambda layer](https://docs.aws.amazon.com/lambda/latest/dg/configuration-layers.html) . Use this action to grant layer usage permission to other accounts. You can grant permission to a single account, all AWS accounts, or all accounts in an organization.
> Since the release of the [UpdateReplacePolicy](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-attribute-updatereplacepolicy.html) both `UpdateReplacePolicy` and `DeletionPolicy` are required to protect your Resources/LayerPermissions from deletion.
Example:
// The code below shows an example of how to instantiate this type. // The values are placeholders you should change. import "github.com/aws/aws-cdk-go/awscdk" cfnLayerVersionPermission := awscdk.Aws_lambda.NewCfnLayerVersionPermission(this, jsii.String("MyCfnLayerVersionPermission"), &CfnLayerVersionPermissionProps{ Action: jsii.String("action"), LayerVersionArn: jsii.String("layerVersionArn"), Principal: jsii.String("principal"), // the properties below are optional OrganizationId: jsii.String("organizationId"), })
func NewCfnLayerVersionPermission ¶
func NewCfnLayerVersionPermission(scope awscdk.Construct, id *string, props *CfnLayerVersionPermissionProps) CfnLayerVersionPermission
Create a new `AWS::Lambda::LayerVersionPermission`.
type CfnLayerVersionPermissionProps ¶
type CfnLayerVersionPermissionProps struct { // The API action that grants access to the layer. // // For example, `lambda:GetLayerVersion` . Action *string `field:"required" json:"action" yaml:"action"` // The name or Amazon Resource Name (ARN) of the layer. LayerVersionArn *string `field:"required" json:"layerVersionArn" yaml:"layerVersionArn"` // An account ID, or `*` to grant layer usage permission to all accounts in an organization, or all AWS accounts (if `organizationId` is not specified). // // For the last case, make sure that you really do want all AWS accounts to have usage permission to this layer. Principal *string `field:"required" json:"principal" yaml:"principal"` // With the principal set to `*` , grant permission to all accounts in the specified organization. OrganizationId *string `field:"optional" json:"organizationId" yaml:"organizationId"` }
Properties for defining a `CfnLayerVersionPermission`.
Example:
// The code below shows an example of how to instantiate this type. // The values are placeholders you should change. import "github.com/aws/aws-cdk-go/awscdk" cfnLayerVersionPermissionProps := &CfnLayerVersionPermissionProps{ Action: jsii.String("action"), LayerVersionArn: jsii.String("layerVersionArn"), Principal: jsii.String("principal"), // the properties below are optional OrganizationId: jsii.String("organizationId"), }
type CfnLayerVersionProps ¶
type CfnLayerVersionProps struct { // The function layer archive. Content interface{} `field:"required" json:"content" yaml:"content"` // A list of compatible [instruction set architectures](https://docs.aws.amazon.com/lambda/latest/dg/foundation-arch.html) . CompatibleArchitectures *[]*string `field:"optional" json:"compatibleArchitectures" yaml:"compatibleArchitectures"` // A list of compatible [function runtimes](https://docs.aws.amazon.com/lambda/latest/dg/lambda-runtimes.html) . Used for filtering with [ListLayers](https://docs.aws.amazon.com/lambda/latest/dg/API_ListLayers.html) and [ListLayerVersions](https://docs.aws.amazon.com/lambda/latest/dg/API_ListLayerVersions.html) . CompatibleRuntimes *[]*string `field:"optional" json:"compatibleRuntimes" yaml:"compatibleRuntimes"` // The description of the version. Description *string `field:"optional" json:"description" yaml:"description"` // The name or Amazon Resource Name (ARN) of the layer. LayerName *string `field:"optional" json:"layerName" yaml:"layerName"` // The layer's software license. It can be any of the following:. // // - An [SPDX license identifier](https://docs.aws.amazon.com/https://spdx.org/licenses/) . For example, `MIT` . // - The URL of a license hosted on the internet. For example, `https://opensource.org/licenses/MIT` . // - The full text of the license. LicenseInfo *string `field:"optional" json:"licenseInfo" yaml:"licenseInfo"` }
Properties for defining a `CfnLayerVersion`.
Example:
// The code below shows an example of how to instantiate this type. // The values are placeholders you should change. import "github.com/aws/aws-cdk-go/awscdk" cfnLayerVersionProps := &CfnLayerVersionProps{ Content: &ContentProperty{ S3Bucket: jsii.String("s3Bucket"), S3Key: jsii.String("s3Key"), // the properties below are optional S3ObjectVersion: jsii.String("s3ObjectVersion"), }, // the properties below are optional CompatibleArchitectures: []*string{ jsii.String("compatibleArchitectures"), }, CompatibleRuntimes: []*string{ jsii.String("compatibleRuntimes"), }, Description: jsii.String("description"), LayerName: jsii.String("layerName"), LicenseInfo: jsii.String("licenseInfo"), }
type CfnLayerVersion_ContentProperty ¶
type CfnLayerVersion_ContentProperty struct { // The Amazon S3 bucket of the layer archive. S3Bucket *string `field:"required" json:"s3Bucket" yaml:"s3Bucket"` // The Amazon S3 key of the layer archive. S3Key *string `field:"required" json:"s3Key" yaml:"s3Key"` // For versioned objects, the version of the layer archive object to use. S3ObjectVersion *string `field:"optional" json:"s3ObjectVersion" yaml:"s3ObjectVersion"` }
A ZIP archive that contains the contents of an [Lambda layer](https://docs.aws.amazon.com/lambda/latest/dg/configuration-layers.html) .
Example:
// The code below shows an example of how to instantiate this type. // The values are placeholders you should change. import "github.com/aws/aws-cdk-go/awscdk" contentProperty := &ContentProperty{ S3Bucket: jsii.String("s3Bucket"), S3Key: jsii.String("s3Key"), // the properties below are optional S3ObjectVersion: jsii.String("s3ObjectVersion"), }
type CfnParametersCode ¶
type CfnParametersCode interface { Code // Experimental. BucketNameParam() *string // Determines whether this Code is inline code or not. // Experimental. IsInline() *bool // Experimental. ObjectKeyParam() *string // Create a parameters map from this instance's CloudFormation parameters. // // It returns a map with 2 keys that correspond to the names of the parameters defined in this Lambda code, // and as values it contains the appropriate expressions pointing at the provided S3 location // (most likely, obtained from a CodePipeline Artifact by calling the `artifact.s3Location` method). // The result should be provided to the CloudFormation Action // that is deploying the Stack that the Lambda with this code is part of, // in the `parameterOverrides` property. // Experimental. Assign(location *awss3.Location) *map[string]interface{} // Called when the lambda or layer is initialized to allow this object to bind to the stack, add resources and have fun. // Experimental. Bind(scope awscdk.Construct) *CodeConfig // Called after the CFN function resource has been created to allow the code class to bind to it. // // Specifically it's required to allow assets to add // metadata for tooling like SAM CLI to be able to find their origins. // Experimental. BindToResource(_resource awscdk.CfnResource, _options *ResourceBindOptions) }
Lambda code defined using 2 CloudFormation parameters.
Useful when you don't have access to the code of your Lambda from your CDK code, so you can't use Assets, and you want to deploy the Lambda in a CodePipeline, using CloudFormation Actions - you can fill the parameters using the {@link #assign} method.
Example:
lambdaStack := cdk.NewStack(app, jsii.String("LambdaStack")) lambdaCode := lambda.Code_FromCfnParameters() lambda.NewFunction(lambdaStack, jsii.String("Lambda"), &FunctionProps{ Code: lambdaCode, Handler: jsii.String("index.handler"), Runtime: lambda.Runtime_NODEJS_14_X(), }) // other resources that your Lambda needs, added to the lambdaStack... pipelineStack := cdk.NewStack(app, jsii.String("PipelineStack")) pipeline := codepipeline.NewPipeline(pipelineStack, jsii.String("Pipeline")) // add the source code repository containing this code to your Pipeline, // and the source code of the Lambda Function, if they're separate cdkSourceOutput := codepipeline.NewArtifact() cdkSourceAction := codepipeline_actions.NewCodeCommitSourceAction(&CodeCommitSourceActionProps{ Repository: codecommit.NewRepository(pipelineStack, jsii.String("CdkCodeRepo"), &RepositoryProps{ RepositoryName: jsii.String("CdkCodeRepo"), }), ActionName: jsii.String("CdkCode_Source"), Output: cdkSourceOutput, }) lambdaSourceOutput := codepipeline.NewArtifact() lambdaSourceAction := codepipeline_actions.NewCodeCommitSourceAction(&CodeCommitSourceActionProps{ Repository: codecommit.NewRepository(pipelineStack, jsii.String("LambdaCodeRepo"), &RepositoryProps{ RepositoryName: jsii.String("LambdaCodeRepo"), }), ActionName: jsii.String("LambdaCode_Source"), Output: lambdaSourceOutput, }) pipeline.AddStage(&StageOptions{ StageName: jsii.String("Source"), Actions: []iAction{ cdkSourceAction, lambdaSourceAction, }, }) // synthesize the Lambda CDK template, using CodeBuild // the below values are just examples, assuming your CDK code is in TypeScript/JavaScript - // adjust the build environment and/or commands accordingly cdkBuildProject := codebuild.NewProject(pipelineStack, jsii.String("CdkBuildProject"), &ProjectProps{ Environment: &BuildEnvironment{ BuildImage: codebuild.LinuxBuildImage_UBUNTU_14_04_NODEJS_10_1_0(), }, BuildSpec: codebuild.BuildSpec_FromObject(map[string]interface{}{ "version": jsii.String("0.2"), "phases": map[string]map[string]*string{ "install": map[string]*string{ "commands": jsii.String("npm install"), }, "build": map[string][]*string{ "commands": []*string{ jsii.String("npm run build"), jsii.String("npm run cdk synth LambdaStack -- -o ."), }, }, }, "artifacts": map[string]*string{ "files": jsii.String("LambdaStack.template.yaml"), }, }), }) cdkBuildOutput := codepipeline.NewArtifact() cdkBuildAction := codepipeline_actions.NewCodeBuildAction(&CodeBuildActionProps{ ActionName: jsii.String("CDK_Build"), Project: cdkBuildProject, Input: cdkSourceOutput, Outputs: []artifact{ cdkBuildOutput, }, }) // build your Lambda code, using CodeBuild // again, this example assumes your Lambda is written in TypeScript/JavaScript - // make sure to adjust the build environment and/or commands if they don't match your specific situation lambdaBuildProject := codebuild.NewProject(pipelineStack, jsii.String("LambdaBuildProject"), &ProjectProps{ Environment: &BuildEnvironment{ BuildImage: codebuild.LinuxBuildImage_UBUNTU_14_04_NODEJS_10_1_0(), }, BuildSpec: codebuild.BuildSpec_*FromObject(map[string]interface{}{ "version": jsii.String("0.2"), "phases": map[string]map[string]*string{ "install": map[string]*string{ "commands": jsii.String("npm install"), }, "build": map[string]*string{ "commands": jsii.String("npm run build"), }, }, "artifacts": map[string][]*string{ "files": []*string{ jsii.String("index.js"), jsii.String("node_modules/**/*"), }, }, }), }) lambdaBuildOutput := codepipeline.NewArtifact() lambdaBuildAction := codepipeline_actions.NewCodeBuildAction(&CodeBuildActionProps{ ActionName: jsii.String("Lambda_Build"), Project: lambdaBuildProject, Input: lambdaSourceOutput, Outputs: []*artifact{ lambdaBuildOutput, }, }) pipeline.AddStage(&StageOptions{ StageName: jsii.String("Build"), Actions: []*iAction{ cdkBuildAction, lambdaBuildAction, }, }) // finally, deploy your Lambda Stack pipeline.AddStage(&StageOptions{ StageName: jsii.String("Deploy"), Actions: []*iAction{ codepipeline_actions.NewCloudFormationCreateUpdateStackAction(&CloudFormationCreateUpdateStackActionProps{ ActionName: jsii.String("Lambda_CFN_Deploy"), TemplatePath: cdkBuildOutput.AtPath(jsii.String("LambdaStack.template.yaml")), StackName: jsii.String("LambdaStackDeployedName"), AdminPermissions: jsii.Boolean(true), ParameterOverrides: lambdaCode.Assign(lambdaBuildOutput.s3Location), ExtraInputs: []*artifact{ lambdaBuildOutput, }, }), }, })
Experimental.
func AssetCode_CfnParameters ¶
func AssetCode_CfnParameters(props *CfnParametersCodeProps) CfnParametersCode
DEPRECATED. Deprecated: use `fromCfnParameters`.
func AssetCode_FromCfnParameters ¶
func AssetCode_FromCfnParameters(props *CfnParametersCodeProps) CfnParametersCode
Creates a new Lambda source defined using CloudFormation parameters.
Returns: a new instance of `CfnParametersCode`. Experimental.
func AssetImageCode_CfnParameters ¶
func AssetImageCode_CfnParameters(props *CfnParametersCodeProps) CfnParametersCode
DEPRECATED. Deprecated: use `fromCfnParameters`.
func AssetImageCode_FromCfnParameters ¶
func AssetImageCode_FromCfnParameters(props *CfnParametersCodeProps) CfnParametersCode
Creates a new Lambda source defined using CloudFormation parameters.
Returns: a new instance of `CfnParametersCode`. Experimental.
func CfnParametersCode_CfnParameters ¶
func CfnParametersCode_CfnParameters(props *CfnParametersCodeProps) CfnParametersCode
DEPRECATED. Deprecated: use `fromCfnParameters`.
func CfnParametersCode_FromCfnParameters ¶
func CfnParametersCode_FromCfnParameters(props *CfnParametersCodeProps) CfnParametersCode
Creates a new Lambda source defined using CloudFormation parameters.
Returns: a new instance of `CfnParametersCode`. Experimental.
func Code_CfnParameters ¶
func Code_CfnParameters(props *CfnParametersCodeProps) CfnParametersCode
DEPRECATED. Deprecated: use `fromCfnParameters`.
func Code_FromCfnParameters ¶
func Code_FromCfnParameters(props *CfnParametersCodeProps) CfnParametersCode
Creates a new Lambda source defined using CloudFormation parameters.
Returns: a new instance of `CfnParametersCode`. Experimental.
func EcrImageCode_CfnParameters ¶
func EcrImageCode_CfnParameters(props *CfnParametersCodeProps) CfnParametersCode
DEPRECATED. Deprecated: use `fromCfnParameters`.
func EcrImageCode_FromCfnParameters ¶
func EcrImageCode_FromCfnParameters(props *CfnParametersCodeProps) CfnParametersCode
Creates a new Lambda source defined using CloudFormation parameters.
Returns: a new instance of `CfnParametersCode`. Experimental.
func InlineCode_CfnParameters ¶
func InlineCode_CfnParameters(props *CfnParametersCodeProps) CfnParametersCode
DEPRECATED. Deprecated: use `fromCfnParameters`.
func InlineCode_FromCfnParameters ¶
func InlineCode_FromCfnParameters(props *CfnParametersCodeProps) CfnParametersCode
Creates a new Lambda source defined using CloudFormation parameters.
Returns: a new instance of `CfnParametersCode`. Experimental.
func NewCfnParametersCode ¶
func NewCfnParametersCode(props *CfnParametersCodeProps) CfnParametersCode
Experimental.
func S3Code_CfnParameters ¶
func S3Code_CfnParameters(props *CfnParametersCodeProps) CfnParametersCode
DEPRECATED. Deprecated: use `fromCfnParameters`.
func S3Code_FromCfnParameters ¶
func S3Code_FromCfnParameters(props *CfnParametersCodeProps) CfnParametersCode
Creates a new Lambda source defined using CloudFormation parameters.
Returns: a new instance of `CfnParametersCode`. Experimental.
type CfnParametersCodeProps ¶
type CfnParametersCodeProps struct { // The CloudFormation parameter that represents the name of the S3 Bucket where the Lambda code will be located in. // // Must be of type 'String'. // Experimental. BucketNameParam awscdk.CfnParameter `field:"optional" json:"bucketNameParam" yaml:"bucketNameParam"` // The CloudFormation parameter that represents the path inside the S3 Bucket where the Lambda code will be located at. // // Must be of type 'String'. // Experimental. ObjectKeyParam awscdk.CfnParameter `field:"optional" json:"objectKeyParam" yaml:"objectKeyParam"` }
Construction properties for {@link CfnParametersCode}.
Example:
// The code below shows an example of how to instantiate this type. // The values are placeholders you should change. import monocdk "github.com/aws/aws-cdk-go/awscdk" import "github.com/aws/aws-cdk-go/awscdk" var cfnParameter cfnParameter cfnParametersCodeProps := &CfnParametersCodeProps{ BucketNameParam: cfnParameter, ObjectKeyParam: cfnParameter, }
Experimental.
type CfnPermission ¶
type CfnPermission interface { awscdk.CfnResource awscdk.IInspectable // The action that the principal can use on the function. // // For example, `lambda:InvokeFunction` or `lambda:GetFunction` . Action() *string SetAction(val *string) // Options for this resource, such as condition, update policy etc. // Experimental. CfnOptions() awscdk.ICfnResourceOptions CfnProperties() *map[string]interface{} // AWS resource type. // Experimental. CfnResourceType() *string // Returns: the stack trace of the point where this Resource was created from, sourced // from the +metadata+ entry typed +aws:cdk:logicalId+, and with the bottom-most // node +internal+ entries filtered. // Experimental. CreationStack() *[]*string // For Alexa Smart Home functions, a token that the invoker must supply. EventSourceToken() *string SetEventSourceToken(val *string) // The name of the Lambda function, version, or alias. // // **Name formats** - *Function name* – `my-function` (name-only), `my-function:v1` (with alias). // - *Function ARN* – `arn:aws:lambda:us-west-2:123456789012:function:my-function` . // - *Partial ARN* – `123456789012:function:my-function` . // // You can append a version number or alias to any of the formats. The length constraint applies only to the full ARN. If you specify only the function name, it is limited to 64 characters in length. FunctionName() *string SetFunctionName(val *string) // The type of authentication that your function URL uses. // // Set to `AWS_IAM` if you want to restrict access to authenticated users only. Set to `NONE` if you want to bypass IAM authentication to create a public endpoint. For more information, see [Security and auth model for Lambda function URLs](https://docs.aws.amazon.com/lambda/latest/dg/urls-auth.html) . FunctionUrlAuthType() *string SetFunctionUrlAuthType(val *string) // The logical ID for this CloudFormation stack element. // // The logical ID of the element // is calculated from the path of the resource node in the construct tree. // // To override this value, use `overrideLogicalId(newLogicalId)`. // // Returns: the logical ID as a stringified token. This value will only get // resolved during synthesis. // Experimental. LogicalId() *string // The construct tree node associated with this construct. // Experimental. Node() awscdk.ConstructNode // The AWS service or AWS account that invokes the function. // // If you specify a service, use `SourceArn` or `SourceAccount` to limit who can invoke the function through that service. Principal() *string SetPrincipal(val *string) // The identifier for your organization in AWS Organizations . // // Use this to grant permissions to all the AWS accounts under this organization. PrincipalOrgId() *string SetPrincipalOrgId(val *string) // Return a string that will be resolved to a CloudFormation `{ Ref }` for this element. // // If, by any chance, the intrinsic reference of a resource is not a string, you could // coerce it to an IResolvable through `Lazy.any({ produce: resource.ref })`. // Experimental. Ref() *string // For AWS service , the ID of the AWS account that owns the resource. // // Use this together with `SourceArn` to ensure that the specified account owns the resource. It is possible for an Amazon S3 bucket to be deleted by its owner and recreated by another account. SourceAccount() *string SetSourceAccount(val *string) // For AWS services , the ARN of the AWS resource that invokes the function. // // For example, an Amazon S3 bucket or Amazon SNS topic. // // Note that Lambda configures the comparison using the `StringLike` operator. SourceArn() *string SetSourceArn(val *string) // The stack in which this element is defined. // // CfnElements must be defined within a stack scope (directly or indirectly). // Experimental. Stack() awscdk.Stack // Return properties modified after initiation. // // Resources that expose mutable properties should override this function to // collect and return the properties object for this resource. // Experimental. UpdatedProperites() *map[string]interface{} // Syntactic sugar for `addOverride(path, undefined)`. // Experimental. AddDeletionOverride(path *string) // Indicates that this resource depends on another resource and cannot be provisioned unless the other resource has been successfully provisioned. // // This can be used for resources across stacks (or nested stack) boundaries // and the dependency will automatically be transferred to the relevant scope. // Experimental. AddDependsOn(target awscdk.CfnResource) // Add a value to the CloudFormation Resource Metadata. // See: https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/metadata-section-structure.html // // Note that this is a different set of metadata from CDK node metadata; this // metadata ends up in the stack template under the resource, whereas CDK // node metadata ends up in the Cloud Assembly. // // Experimental. AddMetadata(key *string, value interface{}) // Adds an override to the synthesized CloudFormation resource. // // To add a // property override, either use `addPropertyOverride` or prefix `path` with // "Properties." (i.e. `Properties.TopicName`). // // If the override is nested, separate each nested level using a dot (.) in the path parameter. // If there is an array as part of the nesting, specify the index in the path. // // To include a literal `.` in the property name, prefix with a `\`. In most // programming languages you will need to write this as `"\\."` because the // `\` itself will need to be escaped. // // For example, // “`typescript // cfnResource.addOverride('Properties.GlobalSecondaryIndexes.0.Projection.NonKeyAttributes', ['myattribute']); // cfnResource.addOverride('Properties.GlobalSecondaryIndexes.1.ProjectionType', 'INCLUDE'); // “` // would add the overrides // “`json // "Properties": { // "GlobalSecondaryIndexes": [ // { // "Projection": { // "NonKeyAttributes": [ "myattribute" ] // ... // } // ... // }, // { // "ProjectionType": "INCLUDE" // ... // }, // ] // ... // } // “` // // The `value` argument to `addOverride` will not be processed or translated // in any way. Pass raw JSON values in here with the correct capitalization // for CloudFormation. If you pass CDK classes or structs, they will be // rendered with lowercased key names, and CloudFormation will reject the // template. // Experimental. AddOverride(path *string, value interface{}) // Adds an override that deletes the value of a property from the resource definition. // Experimental. AddPropertyDeletionOverride(propertyPath *string) // Adds an override to a resource property. // // Syntactic sugar for `addOverride("Properties.<...>", value)`. // Experimental. AddPropertyOverride(propertyPath *string, value interface{}) // Sets the deletion policy of the resource based on the removal policy specified. // // The Removal Policy controls what happens to this resource when it stops // being managed by CloudFormation, either because you've removed it from the // CDK application or because you've made a change that requires the resource // to be replaced. // // The resource can be deleted (`RemovalPolicy.DESTROY`), or left in your AWS // account for data recovery and cleanup later (`RemovalPolicy.RETAIN`). // Experimental. ApplyRemovalPolicy(policy awscdk.RemovalPolicy, options *awscdk.RemovalPolicyOptions) // Returns a token for an runtime attribute of this resource. // // Ideally, use generated attribute accessors (e.g. `resource.arn`), but this can be used for future compatibility // in case there is no generated attribute. // Experimental. GetAtt(attributeName *string) awscdk.Reference // Retrieve a value value from the CloudFormation Resource Metadata. // See: https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/metadata-section-structure.html // // Note that this is a different set of metadata from CDK node metadata; this // metadata ends up in the stack template under the resource, whereas CDK // node metadata ends up in the Cloud Assembly. // // Experimental. GetMetadata(key *string) interface{} // Examines the CloudFormation resource and discloses attributes. Inspect(inspector awscdk.TreeInspector) // Perform final modifications before synthesis. // // This method can be implemented by derived constructs in order to perform // final changes before synthesis. prepare() will be called after child // constructs have been prepared. // // This is an advanced framework feature. Only use this if you // understand the implications. // Experimental. OnPrepare() // Allows this construct to emit artifacts into the cloud assembly during synthesis. // // This method is usually implemented by framework-level constructs such as `Stack` and `Asset` // as they participate in synthesizing the cloud assembly. // Experimental. OnSynthesize(session constructs.ISynthesisSession) // Validate the current construct. // // This method can be implemented by derived constructs in order to perform // validation logic. It is called on all constructs before synthesis. // // Returns: An array of validation error messages, or an empty array if the construct is valid. // Experimental. OnValidate() *[]*string // Overrides the auto-generated logical ID with a specific ID. // Experimental. OverrideLogicalId(newLogicalId *string) // Perform final modifications before synthesis. // // This method can be implemented by derived constructs in order to perform // final changes before synthesis. prepare() will be called after child // constructs have been prepared. // // This is an advanced framework feature. Only use this if you // understand the implications. // Experimental. Prepare() RenderProperties(props *map[string]interface{}) *map[string]interface{} // Can be overridden by subclasses to determine if this resource will be rendered into the cloudformation template. // // Returns: `true` if the resource should be included or `false` is the resource // should be omitted. // Experimental. ShouldSynthesize() *bool // Allows this construct to emit artifacts into the cloud assembly during synthesis. // // This method is usually implemented by framework-level constructs such as `Stack` and `Asset` // as they participate in synthesizing the cloud assembly. // Experimental. Synthesize(session awscdk.ISynthesisSession) // Returns a string representation of this construct. // // Returns: a string representation of this resource. // Experimental. ToString() *string // Validate the current construct. // // This method can be implemented by derived constructs in order to perform // validation logic. It is called on all constructs before synthesis. // // Returns: An array of validation error messages, or an empty array if the construct is valid. // Experimental. Validate() *[]*string // Experimental. ValidateProperties(_properties interface{}) }
A CloudFormation `AWS::Lambda::Permission`.
The `AWS::Lambda::Permission` resource grants an AWS service or another account permission to use a function. You can apply the policy at the function level, or specify a qualifier to restrict access to a single version or alias. If you use a qualifier, the invoker must use the full Amazon Resource Name (ARN) of that version or alias to invoke the function.
To grant permission to another account, specify the account ID as the `Principal` . To grant permission to an organization defined in AWS Organizations , specify the organization ID as the `PrincipalOrgID` . For AWS services, the principal is a domain-style identifier defined by the service, like `s3.amazonaws.com` or `sns.amazonaws.com` . For AWS services, you can also specify the ARN of the associated resource as the `SourceArn` . If you grant permission to a service principal without specifying the source, other accounts could potentially configure resources in their account to invoke your Lambda function.
If your function has a function URL, you can specify the `FunctionUrlAuthType` parameter. This adds a condition to your permission that only applies when your function URL's `AuthType` matches the specified `FunctionUrlAuthType` . For more information about the `AuthType` parameter, see [Security and auth model for Lambda function URLs](https://docs.aws.amazon.com/lambda/latest/dg/urls-auth.html) .
This resource adds a statement to a resource-based permission policy for the function. For more information about function policies, see [Lambda Function Policies](https://docs.aws.amazon.com/lambda/latest/dg/access-control-resource-based.html) .
Example:
// The code below shows an example of how to instantiate this type. // The values are placeholders you should change. import "github.com/aws/aws-cdk-go/awscdk" cfnPermission := awscdk.Aws_lambda.NewCfnPermission(this, jsii.String("MyCfnPermission"), &CfnPermissionProps{ Action: jsii.String("action"), FunctionName: jsii.String("functionName"), Principal: jsii.String("principal"), // the properties below are optional EventSourceToken: jsii.String("eventSourceToken"), FunctionUrlAuthType: jsii.String("functionUrlAuthType"), PrincipalOrgId: jsii.String("principalOrgId"), SourceAccount: jsii.String("sourceAccount"), SourceArn: jsii.String("sourceArn"), })
func NewCfnPermission ¶
func NewCfnPermission(scope awscdk.Construct, id *string, props *CfnPermissionProps) CfnPermission
Create a new `AWS::Lambda::Permission`.
type CfnPermissionProps ¶
type CfnPermissionProps struct { // The action that the principal can use on the function. // // For example, `lambda:InvokeFunction` or `lambda:GetFunction` . Action *string `field:"required" json:"action" yaml:"action"` // The name of the Lambda function, version, or alias. // // **Name formats** - *Function name* – `my-function` (name-only), `my-function:v1` (with alias). // - *Function ARN* – `arn:aws:lambda:us-west-2:123456789012:function:my-function` . // - *Partial ARN* – `123456789012:function:my-function` . // // You can append a version number or alias to any of the formats. The length constraint applies only to the full ARN. If you specify only the function name, it is limited to 64 characters in length. FunctionName *string `field:"required" json:"functionName" yaml:"functionName"` // The AWS service or AWS account that invokes the function. // // If you specify a service, use `SourceArn` or `SourceAccount` to limit who can invoke the function through that service. Principal *string `field:"required" json:"principal" yaml:"principal"` // For Alexa Smart Home functions, a token that the invoker must supply. EventSourceToken *string `field:"optional" json:"eventSourceToken" yaml:"eventSourceToken"` // The type of authentication that your function URL uses. // // Set to `AWS_IAM` if you want to restrict access to authenticated users only. Set to `NONE` if you want to bypass IAM authentication to create a public endpoint. For more information, see [Security and auth model for Lambda function URLs](https://docs.aws.amazon.com/lambda/latest/dg/urls-auth.html) . FunctionUrlAuthType *string `field:"optional" json:"functionUrlAuthType" yaml:"functionUrlAuthType"` // The identifier for your organization in AWS Organizations . // // Use this to grant permissions to all the AWS accounts under this organization. PrincipalOrgId *string `field:"optional" json:"principalOrgId" yaml:"principalOrgId"` // For AWS service , the ID of the AWS account that owns the resource. // // Use this together with `SourceArn` to ensure that the specified account owns the resource. It is possible for an Amazon S3 bucket to be deleted by its owner and recreated by another account. SourceAccount *string `field:"optional" json:"sourceAccount" yaml:"sourceAccount"` // For AWS services , the ARN of the AWS resource that invokes the function. // // For example, an Amazon S3 bucket or Amazon SNS topic. // // Note that Lambda configures the comparison using the `StringLike` operator. SourceArn *string `field:"optional" json:"sourceArn" yaml:"sourceArn"` }
Properties for defining a `CfnPermission`.
Example:
// The code below shows an example of how to instantiate this type. // The values are placeholders you should change. import "github.com/aws/aws-cdk-go/awscdk" cfnPermissionProps := &CfnPermissionProps{ Action: jsii.String("action"), FunctionName: jsii.String("functionName"), Principal: jsii.String("principal"), // the properties below are optional EventSourceToken: jsii.String("eventSourceToken"), FunctionUrlAuthType: jsii.String("functionUrlAuthType"), PrincipalOrgId: jsii.String("principalOrgId"), SourceAccount: jsii.String("sourceAccount"), SourceArn: jsii.String("sourceArn"), }
type CfnUrl ¶
type CfnUrl interface { awscdk.CfnResource awscdk.IInspectable // The Amazon Resource Name (ARN) of the function. AttrFunctionArn() *string // The HTTP URL endpoint for your function. AttrFunctionUrl() *string // The type of authentication that your function URL uses. // // Set to `AWS_IAM` if you want to restrict access to authenticated users only. Set to `NONE` if you want to bypass IAM authentication to create a public endpoint. For more information, see [Security and auth model for Lambda function URLs](https://docs.aws.amazon.com/lambda/latest/dg/urls-auth.html) . AuthType() *string SetAuthType(val *string) // Options for this resource, such as condition, update policy etc. // Experimental. CfnOptions() awscdk.ICfnResourceOptions CfnProperties() *map[string]interface{} // AWS resource type. // Experimental. CfnResourceType() *string // The [Cross-Origin Resource Sharing (CORS)](https://docs.aws.amazon.com/https://developer.mozilla.org/en-US/docs/Web/HTTP/CORS) settings for your function URL. Cors() interface{} SetCors(val interface{}) // Returns: the stack trace of the point where this Resource was created from, sourced // from the +metadata+ entry typed +aws:cdk:logicalId+, and with the bottom-most // node +internal+ entries filtered. // Experimental. CreationStack() *[]*string // Use one of the following options:. // // - `BUFFERED` – This is the default option. Lambda invokes your function using the `Invoke` API operation. Invocation results are available when the payload is complete. The maximum payload size is 6 MB. // - `RESPONSE_STREAM` – Your function streams payload results as they become available. Lambda invokes your function using the `InvokeWithResponseStream` API operation. The maximum response payload size is 20 MB, however, you can [request a quota increase](https://docs.aws.amazon.com/servicequotas/latest/userguide/request-quota-increase.html) . InvokeMode() *string SetInvokeMode(val *string) // The logical ID for this CloudFormation stack element. // // The logical ID of the element // is calculated from the path of the resource node in the construct tree. // // To override this value, use `overrideLogicalId(newLogicalId)`. // // Returns: the logical ID as a stringified token. This value will only get // resolved during synthesis. // Experimental. LogicalId() *string // The construct tree node associated with this construct. // Experimental. Node() awscdk.ConstructNode // The alias name. Qualifier() *string SetQualifier(val *string) // Return a string that will be resolved to a CloudFormation `{ Ref }` for this element. // // If, by any chance, the intrinsic reference of a resource is not a string, you could // coerce it to an IResolvable through `Lazy.any({ produce: resource.ref })`. // Experimental. Ref() *string // The stack in which this element is defined. // // CfnElements must be defined within a stack scope (directly or indirectly). // Experimental. Stack() awscdk.Stack // The name of the Lambda function. // // **Name formats** - *Function name* - `my-function` . // - *Function ARN* - `arn:aws:lambda:us-west-2:123456789012:function:my-function` . // - *Partial ARN* - `123456789012:function:my-function` . // // The length constraint applies only to the full ARN. If you specify only the function name, it is limited to 64 characters in length. TargetFunctionArn() *string SetTargetFunctionArn(val *string) // Return properties modified after initiation. // // Resources that expose mutable properties should override this function to // collect and return the properties object for this resource. // Experimental. UpdatedProperites() *map[string]interface{} // Syntactic sugar for `addOverride(path, undefined)`. // Experimental. AddDeletionOverride(path *string) // Indicates that this resource depends on another resource and cannot be provisioned unless the other resource has been successfully provisioned. // // This can be used for resources across stacks (or nested stack) boundaries // and the dependency will automatically be transferred to the relevant scope. // Experimental. AddDependsOn(target awscdk.CfnResource) // Add a value to the CloudFormation Resource Metadata. // See: https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/metadata-section-structure.html // // Note that this is a different set of metadata from CDK node metadata; this // metadata ends up in the stack template under the resource, whereas CDK // node metadata ends up in the Cloud Assembly. // // Experimental. AddMetadata(key *string, value interface{}) // Adds an override to the synthesized CloudFormation resource. // // To add a // property override, either use `addPropertyOverride` or prefix `path` with // "Properties." (i.e. `Properties.TopicName`). // // If the override is nested, separate each nested level using a dot (.) in the path parameter. // If there is an array as part of the nesting, specify the index in the path. // // To include a literal `.` in the property name, prefix with a `\`. In most // programming languages you will need to write this as `"\\."` because the // `\` itself will need to be escaped. // // For example, // “`typescript // cfnResource.addOverride('Properties.GlobalSecondaryIndexes.0.Projection.NonKeyAttributes', ['myattribute']); // cfnResource.addOverride('Properties.GlobalSecondaryIndexes.1.ProjectionType', 'INCLUDE'); // “` // would add the overrides // “`json // "Properties": { // "GlobalSecondaryIndexes": [ // { // "Projection": { // "NonKeyAttributes": [ "myattribute" ] // ... // } // ... // }, // { // "ProjectionType": "INCLUDE" // ... // }, // ] // ... // } // “` // // The `value` argument to `addOverride` will not be processed or translated // in any way. Pass raw JSON values in here with the correct capitalization // for CloudFormation. If you pass CDK classes or structs, they will be // rendered with lowercased key names, and CloudFormation will reject the // template. // Experimental. AddOverride(path *string, value interface{}) // Adds an override that deletes the value of a property from the resource definition. // Experimental. AddPropertyDeletionOverride(propertyPath *string) // Adds an override to a resource property. // // Syntactic sugar for `addOverride("Properties.<...>", value)`. // Experimental. AddPropertyOverride(propertyPath *string, value interface{}) // Sets the deletion policy of the resource based on the removal policy specified. // // The Removal Policy controls what happens to this resource when it stops // being managed by CloudFormation, either because you've removed it from the // CDK application or because you've made a change that requires the resource // to be replaced. // // The resource can be deleted (`RemovalPolicy.DESTROY`), or left in your AWS // account for data recovery and cleanup later (`RemovalPolicy.RETAIN`). // Experimental. ApplyRemovalPolicy(policy awscdk.RemovalPolicy, options *awscdk.RemovalPolicyOptions) // Returns a token for an runtime attribute of this resource. // // Ideally, use generated attribute accessors (e.g. `resource.arn`), but this can be used for future compatibility // in case there is no generated attribute. // Experimental. GetAtt(attributeName *string) awscdk.Reference // Retrieve a value value from the CloudFormation Resource Metadata. // See: https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/metadata-section-structure.html // // Note that this is a different set of metadata from CDK node metadata; this // metadata ends up in the stack template under the resource, whereas CDK // node metadata ends up in the Cloud Assembly. // // Experimental. GetMetadata(key *string) interface{} // Examines the CloudFormation resource and discloses attributes. Inspect(inspector awscdk.TreeInspector) // Perform final modifications before synthesis. // // This method can be implemented by derived constructs in order to perform // final changes before synthesis. prepare() will be called after child // constructs have been prepared. // // This is an advanced framework feature. Only use this if you // understand the implications. // Experimental. OnPrepare() // Allows this construct to emit artifacts into the cloud assembly during synthesis. // // This method is usually implemented by framework-level constructs such as `Stack` and `Asset` // as they participate in synthesizing the cloud assembly. // Experimental. OnSynthesize(session constructs.ISynthesisSession) // Validate the current construct. // // This method can be implemented by derived constructs in order to perform // validation logic. It is called on all constructs before synthesis. // // Returns: An array of validation error messages, or an empty array if the construct is valid. // Experimental. OnValidate() *[]*string // Overrides the auto-generated logical ID with a specific ID. // Experimental. OverrideLogicalId(newLogicalId *string) // Perform final modifications before synthesis. // // This method can be implemented by derived constructs in order to perform // final changes before synthesis. prepare() will be called after child // constructs have been prepared. // // This is an advanced framework feature. Only use this if you // understand the implications. // Experimental. Prepare() RenderProperties(props *map[string]interface{}) *map[string]interface{} // Can be overridden by subclasses to determine if this resource will be rendered into the cloudformation template. // // Returns: `true` if the resource should be included or `false` is the resource // should be omitted. // Experimental. ShouldSynthesize() *bool // Allows this construct to emit artifacts into the cloud assembly during synthesis. // // This method is usually implemented by framework-level constructs such as `Stack` and `Asset` // as they participate in synthesizing the cloud assembly. // Experimental. Synthesize(session awscdk.ISynthesisSession) // Returns a string representation of this construct. // // Returns: a string representation of this resource. // Experimental. ToString() *string // Validate the current construct. // // This method can be implemented by derived constructs in order to perform // validation logic. It is called on all constructs before synthesis. // // Returns: An array of validation error messages, or an empty array if the construct is valid. // Experimental. Validate() *[]*string // Experimental. ValidateProperties(_properties interface{}) }
A CloudFormation `AWS::Lambda::Url`.
The `AWS::Lambda::Url` resource creates a function URL with the specified configuration parameters. A [function URL](https://docs.aws.amazon.com/lambda/latest/dg/lambda-urls.html) is a dedicated HTTP(S) endpoint that you can use to invoke your function.
Example:
// The code below shows an example of how to instantiate this type. // The values are placeholders you should change. import "github.com/aws/aws-cdk-go/awscdk" cfnUrl := awscdk.Aws_lambda.NewCfnUrl(this, jsii.String("MyCfnUrl"), &CfnUrlProps{ AuthType: jsii.String("authType"), TargetFunctionArn: jsii.String("targetFunctionArn"), // the properties below are optional Cors: &CorsProperty{ AllowCredentials: jsii.Boolean(false), AllowHeaders: []*string{ jsii.String("allowHeaders"), }, AllowMethods: []*string{ jsii.String("allowMethods"), }, AllowOrigins: []*string{ jsii.String("allowOrigins"), }, ExposeHeaders: []*string{ jsii.String("exposeHeaders"), }, MaxAge: jsii.Number(123), }, InvokeMode: jsii.String("invokeMode"), Qualifier: jsii.String("qualifier"), })
type CfnUrlProps ¶
type CfnUrlProps struct { // The type of authentication that your function URL uses. // // Set to `AWS_IAM` if you want to restrict access to authenticated users only. Set to `NONE` if you want to bypass IAM authentication to create a public endpoint. For more information, see [Security and auth model for Lambda function URLs](https://docs.aws.amazon.com/lambda/latest/dg/urls-auth.html) . AuthType *string `field:"required" json:"authType" yaml:"authType"` // The name of the Lambda function. // // **Name formats** - *Function name* - `my-function` . // - *Function ARN* - `arn:aws:lambda:us-west-2:123456789012:function:my-function` . // - *Partial ARN* - `123456789012:function:my-function` . // // The length constraint applies only to the full ARN. If you specify only the function name, it is limited to 64 characters in length. TargetFunctionArn *string `field:"required" json:"targetFunctionArn" yaml:"targetFunctionArn"` // The [Cross-Origin Resource Sharing (CORS)](https://docs.aws.amazon.com/https://developer.mozilla.org/en-US/docs/Web/HTTP/CORS) settings for your function URL. Cors interface{} `field:"optional" json:"cors" yaml:"cors"` // Use one of the following options:. // // - `BUFFERED` – This is the default option. Lambda invokes your function using the `Invoke` API operation. Invocation results are available when the payload is complete. The maximum payload size is 6 MB. // - `RESPONSE_STREAM` – Your function streams payload results as they become available. Lambda invokes your function using the `InvokeWithResponseStream` API operation. The maximum response payload size is 20 MB, however, you can [request a quota increase](https://docs.aws.amazon.com/servicequotas/latest/userguide/request-quota-increase.html) . InvokeMode *string `field:"optional" json:"invokeMode" yaml:"invokeMode"` // The alias name. Qualifier *string `field:"optional" json:"qualifier" yaml:"qualifier"` }
Properties for defining a `CfnUrl`.
Example:
// The code below shows an example of how to instantiate this type. // The values are placeholders you should change. import "github.com/aws/aws-cdk-go/awscdk" cfnUrlProps := &CfnUrlProps{ AuthType: jsii.String("authType"), TargetFunctionArn: jsii.String("targetFunctionArn"), // the properties below are optional Cors: &CorsProperty{ AllowCredentials: jsii.Boolean(false), AllowHeaders: []*string{ jsii.String("allowHeaders"), }, AllowMethods: []*string{ jsii.String("allowMethods"), }, AllowOrigins: []*string{ jsii.String("allowOrigins"), }, ExposeHeaders: []*string{ jsii.String("exposeHeaders"), }, MaxAge: jsii.Number(123), }, InvokeMode: jsii.String("invokeMode"), Qualifier: jsii.String("qualifier"), }
type CfnUrl_CorsProperty ¶
type CfnUrl_CorsProperty struct { // Whether you want to allow cookies or other credentials in requests to your function URL. // // The default is `false` . AllowCredentials interface{} `field:"optional" json:"allowCredentials" yaml:"allowCredentials"` // The HTTP headers that origins can include in requests to your function URL. // // For example: `Date` , `Keep-Alive` , `X-Custom-Header` . AllowHeaders *[]*string `field:"optional" json:"allowHeaders" yaml:"allowHeaders"` // The HTTP methods that are allowed when calling your function URL. // // For example: `GET` , `POST` , `DELETE` , or the wildcard character ( `*` ). AllowMethods *[]*string `field:"optional" json:"allowMethods" yaml:"allowMethods"` // The origins that can access your function URL. // // You can list any number of specific origins, separated by a comma. For example: `https://www.example.com` , `http://localhost:60905` . // // Alternatively, you can grant access to all origins with the wildcard character ( `*` ). AllowOrigins *[]*string `field:"optional" json:"allowOrigins" yaml:"allowOrigins"` // The HTTP headers in your function response that you want to expose to origins that call your function URL. // // For example: `Date` , `Keep-Alive` , `X-Custom-Header` . ExposeHeaders *[]*string `field:"optional" json:"exposeHeaders" yaml:"exposeHeaders"` // The maximum amount of time, in seconds, that browsers can cache results of a preflight request. // // By default, this is set to `0` , which means the browser will not cache results. MaxAge *float64 `field:"optional" json:"maxAge" yaml:"maxAge"` }
The [Cross-Origin Resource Sharing (CORS)](https://docs.aws.amazon.com/https://developer.mozilla.org/en-US/docs/Web/HTTP/CORS) settings for your function URL. Use CORS to grant access to your function URL from any origin. You can also use CORS to control access for specific HTTP headers and methods in requests to your function URL.
Example:
// The code below shows an example of how to instantiate this type. // The values are placeholders you should change. import "github.com/aws/aws-cdk-go/awscdk" corsProperty := &CorsProperty{ AllowCredentials: jsii.Boolean(false), AllowHeaders: []*string{ jsii.String("allowHeaders"), }, AllowMethods: []*string{ jsii.String("allowMethods"), }, AllowOrigins: []*string{ jsii.String("allowOrigins"), }, ExposeHeaders: []*string{ jsii.String("exposeHeaders"), }, MaxAge: jsii.Number(123), }
type CfnVersion ¶
type CfnVersion interface { awscdk.CfnResource awscdk.IInspectable // The version number. AttrVersion() *string // Options for this resource, such as condition, update policy etc. // Experimental. CfnOptions() awscdk.ICfnResourceOptions CfnProperties() *map[string]interface{} // AWS resource type. // Experimental. CfnResourceType() *string // Only publish a version if the hash value matches the value that's specified. // // Use this option to avoid publishing a version if the function code has changed since you last updated it. Updates are not supported for this property. CodeSha256() *string SetCodeSha256(val *string) // Returns: the stack trace of the point where this Resource was created from, sourced // from the +metadata+ entry typed +aws:cdk:logicalId+, and with the bottom-most // node +internal+ entries filtered. // Experimental. CreationStack() *[]*string // A description for the version to override the description in the function configuration. // // Updates are not supported for this property. Description() *string SetDescription(val *string) // The name of the Lambda function. // // **Name formats** - *Function name* - `MyFunction` . // - *Function ARN* - `arn:aws:lambda:us-west-2:123456789012:function:MyFunction` . // - *Partial ARN* - `123456789012:function:MyFunction` . // // The length constraint applies only to the full ARN. If you specify only the function name, it is limited to 64 characters in length. FunctionName() *string SetFunctionName(val *string) // The logical ID for this CloudFormation stack element. // // The logical ID of the element // is calculated from the path of the resource node in the construct tree. // // To override this value, use `overrideLogicalId(newLogicalId)`. // // Returns: the logical ID as a stringified token. This value will only get // resolved during synthesis. // Experimental. LogicalId() *string // The construct tree node associated with this construct. // Experimental. Node() awscdk.ConstructNode // Specifies a provisioned concurrency configuration for a function's version. // // Updates are not supported for this property. ProvisionedConcurrencyConfig() interface{} SetProvisionedConcurrencyConfig(val interface{}) // Return a string that will be resolved to a CloudFormation `{ Ref }` for this element. // // If, by any chance, the intrinsic reference of a resource is not a string, you could // coerce it to an IResolvable through `Lazy.any({ produce: resource.ref })`. // Experimental. Ref() *string // The stack in which this element is defined. // // CfnElements must be defined within a stack scope (directly or indirectly). // Experimental. Stack() awscdk.Stack // Return properties modified after initiation. // // Resources that expose mutable properties should override this function to // collect and return the properties object for this resource. // Experimental. UpdatedProperites() *map[string]interface{} // Syntactic sugar for `addOverride(path, undefined)`. // Experimental. AddDeletionOverride(path *string) // Indicates that this resource depends on another resource and cannot be provisioned unless the other resource has been successfully provisioned. // // This can be used for resources across stacks (or nested stack) boundaries // and the dependency will automatically be transferred to the relevant scope. // Experimental. AddDependsOn(target awscdk.CfnResource) // Add a value to the CloudFormation Resource Metadata. // See: https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/metadata-section-structure.html // // Note that this is a different set of metadata from CDK node metadata; this // metadata ends up in the stack template under the resource, whereas CDK // node metadata ends up in the Cloud Assembly. // // Experimental. AddMetadata(key *string, value interface{}) // Adds an override to the synthesized CloudFormation resource. // // To add a // property override, either use `addPropertyOverride` or prefix `path` with // "Properties." (i.e. `Properties.TopicName`). // // If the override is nested, separate each nested level using a dot (.) in the path parameter. // If there is an array as part of the nesting, specify the index in the path. // // To include a literal `.` in the property name, prefix with a `\`. In most // programming languages you will need to write this as `"\\."` because the // `\` itself will need to be escaped. // // For example, // “`typescript // cfnResource.addOverride('Properties.GlobalSecondaryIndexes.0.Projection.NonKeyAttributes', ['myattribute']); // cfnResource.addOverride('Properties.GlobalSecondaryIndexes.1.ProjectionType', 'INCLUDE'); // “` // would add the overrides // “`json // "Properties": { // "GlobalSecondaryIndexes": [ // { // "Projection": { // "NonKeyAttributes": [ "myattribute" ] // ... // } // ... // }, // { // "ProjectionType": "INCLUDE" // ... // }, // ] // ... // } // “` // // The `value` argument to `addOverride` will not be processed or translated // in any way. Pass raw JSON values in here with the correct capitalization // for CloudFormation. If you pass CDK classes or structs, they will be // rendered with lowercased key names, and CloudFormation will reject the // template. // Experimental. AddOverride(path *string, value interface{}) // Adds an override that deletes the value of a property from the resource definition. // Experimental. AddPropertyDeletionOverride(propertyPath *string) // Adds an override to a resource property. // // Syntactic sugar for `addOverride("Properties.<...>", value)`. // Experimental. AddPropertyOverride(propertyPath *string, value interface{}) // Sets the deletion policy of the resource based on the removal policy specified. // // The Removal Policy controls what happens to this resource when it stops // being managed by CloudFormation, either because you've removed it from the // CDK application or because you've made a change that requires the resource // to be replaced. // // The resource can be deleted (`RemovalPolicy.DESTROY`), or left in your AWS // account for data recovery and cleanup later (`RemovalPolicy.RETAIN`). // Experimental. ApplyRemovalPolicy(policy awscdk.RemovalPolicy, options *awscdk.RemovalPolicyOptions) // Returns a token for an runtime attribute of this resource. // // Ideally, use generated attribute accessors (e.g. `resource.arn`), but this can be used for future compatibility // in case there is no generated attribute. // Experimental. GetAtt(attributeName *string) awscdk.Reference // Retrieve a value value from the CloudFormation Resource Metadata. // See: https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/metadata-section-structure.html // // Note that this is a different set of metadata from CDK node metadata; this // metadata ends up in the stack template under the resource, whereas CDK // node metadata ends up in the Cloud Assembly. // // Experimental. GetMetadata(key *string) interface{} // Examines the CloudFormation resource and discloses attributes. Inspect(inspector awscdk.TreeInspector) // Perform final modifications before synthesis. // // This method can be implemented by derived constructs in order to perform // final changes before synthesis. prepare() will be called after child // constructs have been prepared. // // This is an advanced framework feature. Only use this if you // understand the implications. // Experimental. OnPrepare() // Allows this construct to emit artifacts into the cloud assembly during synthesis. // // This method is usually implemented by framework-level constructs such as `Stack` and `Asset` // as they participate in synthesizing the cloud assembly. // Experimental. OnSynthesize(session constructs.ISynthesisSession) // Validate the current construct. // // This method can be implemented by derived constructs in order to perform // validation logic. It is called on all constructs before synthesis. // // Returns: An array of validation error messages, or an empty array if the construct is valid. // Experimental. OnValidate() *[]*string // Overrides the auto-generated logical ID with a specific ID. // Experimental. OverrideLogicalId(newLogicalId *string) // Perform final modifications before synthesis. // // This method can be implemented by derived constructs in order to perform // final changes before synthesis. prepare() will be called after child // constructs have been prepared. // // This is an advanced framework feature. Only use this if you // understand the implications. // Experimental. Prepare() RenderProperties(props *map[string]interface{}) *map[string]interface{} // Can be overridden by subclasses to determine if this resource will be rendered into the cloudformation template. // // Returns: `true` if the resource should be included or `false` is the resource // should be omitted. // Experimental. ShouldSynthesize() *bool // Allows this construct to emit artifacts into the cloud assembly during synthesis. // // This method is usually implemented by framework-level constructs such as `Stack` and `Asset` // as they participate in synthesizing the cloud assembly. // Experimental. Synthesize(session awscdk.ISynthesisSession) // Returns a string representation of this construct. // // Returns: a string representation of this resource. // Experimental. ToString() *string // Validate the current construct. // // This method can be implemented by derived constructs in order to perform // validation logic. It is called on all constructs before synthesis. // // Returns: An array of validation error messages, or an empty array if the construct is valid. // Experimental. Validate() *[]*string // Experimental. ValidateProperties(_properties interface{}) }
A CloudFormation `AWS::Lambda::Version`.
The `AWS::Lambda::Version` resource creates a [version](https://docs.aws.amazon.com/lambda/latest/dg/versioning-aliases.html) from the current code and configuration of a function. Use versions to create a snapshot of your function code and configuration that doesn't change.
Example:
// The code below shows an example of how to instantiate this type. // The values are placeholders you should change. import "github.com/aws/aws-cdk-go/awscdk" cfnVersion := awscdk.Aws_lambda.NewCfnVersion(this, jsii.String("MyCfnVersion"), &CfnVersionProps{ FunctionName: jsii.String("functionName"), // the properties below are optional CodeSha256: jsii.String("codeSha256"), Description: jsii.String("description"), ProvisionedConcurrencyConfig: &ProvisionedConcurrencyConfigurationProperty{ ProvisionedConcurrentExecutions: jsii.Number(123), }, })
func NewCfnVersion ¶
func NewCfnVersion(scope awscdk.Construct, id *string, props *CfnVersionProps) CfnVersion
Create a new `AWS::Lambda::Version`.
type CfnVersionProps ¶
type CfnVersionProps struct { // The name of the Lambda function. // // **Name formats** - *Function name* - `MyFunction` . // - *Function ARN* - `arn:aws:lambda:us-west-2:123456789012:function:MyFunction` . // - *Partial ARN* - `123456789012:function:MyFunction` . // // The length constraint applies only to the full ARN. If you specify only the function name, it is limited to 64 characters in length. FunctionName *string `field:"required" json:"functionName" yaml:"functionName"` // Only publish a version if the hash value matches the value that's specified. // // Use this option to avoid publishing a version if the function code has changed since you last updated it. Updates are not supported for this property. CodeSha256 *string `field:"optional" json:"codeSha256" yaml:"codeSha256"` // A description for the version to override the description in the function configuration. // // Updates are not supported for this property. Description *string `field:"optional" json:"description" yaml:"description"` // Specifies a provisioned concurrency configuration for a function's version. // // Updates are not supported for this property. ProvisionedConcurrencyConfig interface{} `field:"optional" json:"provisionedConcurrencyConfig" yaml:"provisionedConcurrencyConfig"` }
Properties for defining a `CfnVersion`.
Example:
// The code below shows an example of how to instantiate this type. // The values are placeholders you should change. import "github.com/aws/aws-cdk-go/awscdk" cfnVersionProps := &CfnVersionProps{ FunctionName: jsii.String("functionName"), // the properties below are optional CodeSha256: jsii.String("codeSha256"), Description: jsii.String("description"), ProvisionedConcurrencyConfig: &ProvisionedConcurrencyConfigurationProperty{ ProvisionedConcurrentExecutions: jsii.Number(123), }, }
type CfnVersion_ProvisionedConcurrencyConfigurationProperty ¶
type CfnVersion_ProvisionedConcurrencyConfigurationProperty struct { // The amount of provisioned concurrency to allocate for the version. ProvisionedConcurrentExecutions *float64 `field:"required" json:"provisionedConcurrentExecutions" yaml:"provisionedConcurrentExecutions"` }
A [provisioned concurrency](https://docs.aws.amazon.com/lambda/latest/dg/configuration-concurrency.html) configuration for a function's version.
Example:
// The code below shows an example of how to instantiate this type. // The values are placeholders you should change. import "github.com/aws/aws-cdk-go/awscdk" provisionedConcurrencyConfigurationProperty := &ProvisionedConcurrencyConfigurationProperty{ ProvisionedConcurrentExecutions: jsii.Number(123), }
type Code ¶
type Code interface { // Determines whether this Code is inline code or not. // Deprecated: this value is ignored since inline is now determined based on the // the `inlineCode` field of `CodeConfig` returned from `bind()`. IsInline() *bool // Called when the lambda or layer is initialized to allow this object to bind to the stack, add resources and have fun. // Experimental. Bind(scope awscdk.Construct) *CodeConfig // Called after the CFN function resource has been created to allow the code class to bind to it. // // Specifically it's required to allow assets to add // metadata for tooling like SAM CLI to be able to find their origins. // Experimental. BindToResource(_resource awscdk.CfnResource, _options *ResourceBindOptions) }
Represents the Lambda Handler Code.
Example:
import "github.com/aws/aws-cdk-go/awscdk" signingProfile := signer.NewSigningProfile(this, jsii.String("SigningProfile"), &SigningProfileProps{ Platform: signer.Platform_AWS_LAMBDA_SHA384_ECDSA(), }) codeSigningConfig := lambda.NewCodeSigningConfig(this, jsii.String("CodeSigningConfig"), &CodeSigningConfigProps{ SigningProfiles: []iSigningProfile{ signingProfile, }, }) lambda.NewFunction(this, jsii.String("Function"), &FunctionProps{ CodeSigningConfig: CodeSigningConfig, Runtime: lambda.Runtime_NODEJS_16_X(), Handler: jsii.String("index.handler"), Code: lambda.Code_FromAsset(path.join(__dirname, jsii.String("lambda-handler"))), })
Experimental.
type CodeConfig ¶
type CodeConfig struct { // Docker image configuration (mutually exclusive with `s3Location` and `inlineCode`). // Experimental. Image *CodeImageConfig `field:"optional" json:"image" yaml:"image"` // Inline code (mutually exclusive with `s3Location` and `image`). // Experimental. InlineCode *string `field:"optional" json:"inlineCode" yaml:"inlineCode"` // The location of the code in S3 (mutually exclusive with `inlineCode` and `image`). // Experimental. S3Location *awss3.Location `field:"optional" json:"s3Location" yaml:"s3Location"` }
Result of binding `Code` into a `Function`.
Example:
// The code below shows an example of how to instantiate this type. // The values are placeholders you should change. import "github.com/aws/aws-cdk-go/awscdk" codeConfig := &CodeConfig{ Image: &CodeImageConfig{ ImageUri: jsii.String("imageUri"), // the properties below are optional Cmd: []*string{ jsii.String("cmd"), }, Entrypoint: []*string{ jsii.String("entrypoint"), }, WorkingDirectory: jsii.String("workingDirectory"), }, InlineCode: jsii.String("inlineCode"), S3Location: &Location{ BucketName: jsii.String("bucketName"), ObjectKey: jsii.String("objectKey"), // the properties below are optional ObjectVersion: jsii.String("objectVersion"), }, }
Experimental.
type CodeImageConfig ¶
type CodeImageConfig struct { // URI to the Docker image. // Experimental. ImageUri *string `field:"required" json:"imageUri" yaml:"imageUri"` // Specify or override the CMD on the specified Docker image or Dockerfile. // // This needs to be in the 'exec form', viz., `[ 'executable', 'param1', 'param2' ]`. // See: https://docs.docker.com/engine/reference/builder/#cmd // // Experimental. Cmd *[]*string `field:"optional" json:"cmd" yaml:"cmd"` // Specify or override the ENTRYPOINT on the specified Docker image or Dockerfile. // // An ENTRYPOINT allows you to configure a container that will run as an executable. // This needs to be in the 'exec form', viz., `[ 'executable', 'param1', 'param2' ]`. // See: https://docs.docker.com/engine/reference/builder/#entrypoint // // Experimental. Entrypoint *[]*string `field:"optional" json:"entrypoint" yaml:"entrypoint"` // Specify or override the WORKDIR on the specified Docker image or Dockerfile. // // A WORKDIR allows you to configure the working directory the container will use. // See: https://docs.docker.com/engine/reference/builder/#workdir // // Experimental. WorkingDirectory *string `field:"optional" json:"workingDirectory" yaml:"workingDirectory"` }
Result of the bind when an ECR image is used.
Example:
// The code below shows an example of how to instantiate this type. // The values are placeholders you should change. import "github.com/aws/aws-cdk-go/awscdk" codeImageConfig := &CodeImageConfig{ ImageUri: jsii.String("imageUri"), // the properties below are optional Cmd: []*string{ jsii.String("cmd"), }, Entrypoint: []*string{ jsii.String("entrypoint"), }, WorkingDirectory: jsii.String("workingDirectory"), }
Experimental.
type CodeSigningConfig ¶
type CodeSigningConfig interface { awscdk.Resource ICodeSigningConfig // The ARN of Code Signing Config. // Experimental. CodeSigningConfigArn() *string // The id of Code Signing Config. // Experimental. CodeSigningConfigId() *string // The environment this resource belongs to. // // For resources that are created and managed by the CDK // (generally, those created by creating new class instances like Role, Bucket, etc.), // this is always the same as the environment of the stack they belong to; // however, for imported resources // (those obtained from static methods like fromRoleArn, fromBucketName, etc.), // that might be different than the stack they were imported into. // Experimental. Env() *awscdk.ResourceEnvironment // The construct tree node associated with this construct. // Experimental. Node() awscdk.ConstructNode // Returns a string-encoded token that resolves to the physical name that should be passed to the CloudFormation resource. // // This value will resolve to one of the following: // - a concrete value (e.g. `"my-awesome-bucket"`) // - `undefined`, when a name should be generated by CloudFormation // - a concrete name generated automatically during synthesis, in // cross-environment scenarios. // Experimental. PhysicalName() *string // The stack in which this resource is defined. // Experimental. Stack() awscdk.Stack // Apply the given removal policy to this resource. // // The Removal Policy controls what happens to this resource when it stops // being managed by CloudFormation, either because you've removed it from the // CDK application or because you've made a change that requires the resource // to be replaced. // // The resource can be deleted (`RemovalPolicy.DESTROY`), or left in your AWS // account for data recovery and cleanup later (`RemovalPolicy.RETAIN`). // Experimental. ApplyRemovalPolicy(policy awscdk.RemovalPolicy) // Experimental. GeneratePhysicalName() *string // Returns an environment-sensitive token that should be used for the resource's "ARN" attribute (e.g. `bucket.bucketArn`). // // Normally, this token will resolve to `arnAttr`, but if the resource is // referenced across environments, `arnComponents` will be used to synthesize // a concrete ARN with the resource's physical name. Make sure to reference // `this.physicalName` in `arnComponents`. // Experimental. GetResourceArnAttribute(arnAttr *string, arnComponents *awscdk.ArnComponents) *string // Returns an environment-sensitive token that should be used for the resource's "name" attribute (e.g. `bucket.bucketName`). // // Normally, this token will resolve to `nameAttr`, but if the resource is // referenced across environments, it will be resolved to `this.physicalName`, // which will be a concrete name. // Experimental. GetResourceNameAttribute(nameAttr *string) *string // Perform final modifications before synthesis. // // This method can be implemented by derived constructs in order to perform // final changes before synthesis. prepare() will be called after child // constructs have been prepared. // // This is an advanced framework feature. Only use this if you // understand the implications. // Experimental. OnPrepare() // Allows this construct to emit artifacts into the cloud assembly during synthesis. // // This method is usually implemented by framework-level constructs such as `Stack` and `Asset` // as they participate in synthesizing the cloud assembly. // Experimental. OnSynthesize(session constructs.ISynthesisSession) // Validate the current construct. // // This method can be implemented by derived constructs in order to perform // validation logic. It is called on all constructs before synthesis. // // Returns: An array of validation error messages, or an empty array if the construct is valid. // Experimental. OnValidate() *[]*string // Perform final modifications before synthesis. // // This method can be implemented by derived constructs in order to perform // final changes before synthesis. prepare() will be called after child // constructs have been prepared. // // This is an advanced framework feature. Only use this if you // understand the implications. // Experimental. Prepare() // Allows this construct to emit artifacts into the cloud assembly during synthesis. // // This method is usually implemented by framework-level constructs such as `Stack` and `Asset` // as they participate in synthesizing the cloud assembly. // Experimental. Synthesize(session awscdk.ISynthesisSession) // Returns a string representation of this construct. // Experimental. ToString() *string // Validate the current construct. // // This method can be implemented by derived constructs in order to perform // validation logic. It is called on all constructs before synthesis. // // Returns: An array of validation error messages, or an empty array if the construct is valid. // Experimental. Validate() *[]*string }
Defines a Code Signing Config.
Example:
import "github.com/aws/aws-cdk-go/awscdk" signingProfile := signer.NewSigningProfile(this, jsii.String("SigningProfile"), &SigningProfileProps{ Platform: signer.Platform_AWS_LAMBDA_SHA384_ECDSA(), }) codeSigningConfig := lambda.NewCodeSigningConfig(this, jsii.String("CodeSigningConfig"), &CodeSigningConfigProps{ SigningProfiles: []iSigningProfile{ signingProfile, }, }) lambda.NewFunction(this, jsii.String("Function"), &FunctionProps{ CodeSigningConfig: CodeSigningConfig, Runtime: lambda.Runtime_NODEJS_16_X(), Handler: jsii.String("index.handler"), Code: lambda.Code_FromAsset(path.join(__dirname, jsii.String("lambda-handler"))), })
Experimental.
func NewCodeSigningConfig ¶
func NewCodeSigningConfig(scope constructs.Construct, id *string, props *CodeSigningConfigProps) CodeSigningConfig
Experimental.
type CodeSigningConfigProps ¶
type CodeSigningConfigProps struct { // List of signing profiles that defines a trusted user who can sign a code package. // Experimental. SigningProfiles *[]awssigner.ISigningProfile `field:"required" json:"signingProfiles" yaml:"signingProfiles"` // Code signing configuration description. // Experimental. Description *string `field:"optional" json:"description" yaml:"description"` // Code signing configuration policy for deployment validation failure. // // If you set the policy to Enforce, Lambda blocks the deployment request // if signature validation checks fail. // If you set the policy to Warn, Lambda allows the deployment and // creates a CloudWatch log. // Experimental. UntrustedArtifactOnDeployment UntrustedArtifactOnDeployment `field:"optional" json:"untrustedArtifactOnDeployment" yaml:"untrustedArtifactOnDeployment"` }
Construction properties for a Code Signing Config object.
Example:
import "github.com/aws/aws-cdk-go/awscdk" signingProfile := signer.NewSigningProfile(this, jsii.String("SigningProfile"), &SigningProfileProps{ Platform: signer.Platform_AWS_LAMBDA_SHA384_ECDSA(), }) codeSigningConfig := lambda.NewCodeSigningConfig(this, jsii.String("CodeSigningConfig"), &CodeSigningConfigProps{ SigningProfiles: []iSigningProfile{ signingProfile, }, }) lambda.NewFunction(this, jsii.String("Function"), &FunctionProps{ CodeSigningConfig: CodeSigningConfig, Runtime: lambda.Runtime_NODEJS_16_X(), Handler: jsii.String("index.handler"), Code: lambda.Code_FromAsset(path.join(__dirname, jsii.String("lambda-handler"))), })
Experimental.
type DestinationConfig ¶
type DestinationConfig struct { // The Amazon Resource Name (ARN) of the destination resource. // Experimental. Destination *string `field:"required" json:"destination" yaml:"destination"` }
A destination configuration.
Example:
// The code below shows an example of how to instantiate this type. // The values are placeholders you should change. import "github.com/aws/aws-cdk-go/awscdk" destinationConfig := &DestinationConfig{ Destination: jsii.String("destination"), }
Experimental.
type DestinationOptions ¶
type DestinationOptions struct { // The destination type. // Experimental. Type DestinationType `field:"required" json:"type" yaml:"type"` }
Options when binding a destination to a function.
Example:
// The code below shows an example of how to instantiate this type. // The values are placeholders you should change. import "github.com/aws/aws-cdk-go/awscdk" destinationOptions := &DestinationOptions{ Type: awscdk.Aws_lambda.DestinationType_FAILURE, }
Experimental.
type DestinationType ¶
type DestinationType string
The type of destination. Experimental.
const ( // Failure. // Experimental. DestinationType_FAILURE DestinationType = "FAILURE" // Success. // Experimental. DestinationType_SUCCESS DestinationType = "SUCCESS" )
type DlqDestinationConfig ¶
type DlqDestinationConfig struct { // The Amazon Resource Name (ARN) of the destination resource. // Experimental. Destination *string `field:"required" json:"destination" yaml:"destination"` }
A destination configuration.
Example:
// The code below shows an example of how to instantiate this type. // The values are placeholders you should change. import "github.com/aws/aws-cdk-go/awscdk" dlqDestinationConfig := &DlqDestinationConfig{ Destination: jsii.String("destination"), }
Experimental.
type DockerBuildAssetOptions ¶
type DockerBuildAssetOptions struct { // Build args. // Experimental. BuildArgs *map[string]*string `field:"optional" json:"buildArgs" yaml:"buildArgs"` // Name of the Dockerfile, must relative to the docker build path. // Experimental. File *string `field:"optional" json:"file" yaml:"file"` // Set platform if server is multi-platform capable. _Requires Docker Engine API v1.38+_. // // Example value: `linux/amd64`. // Experimental. Platform *string `field:"optional" json:"platform" yaml:"platform"` // The path in the Docker image where the asset is located after the build operation. // Experimental. ImagePath *string `field:"optional" json:"imagePath" yaml:"imagePath"` // The path on the local filesystem where the asset will be copied using `docker cp`. // Experimental. OutputPath *string `field:"optional" json:"outputPath" yaml:"outputPath"` }
Options when creating an asset from a Docker build.
Example:
// The code below shows an example of how to instantiate this type. // The values are placeholders you should change. import "github.com/aws/aws-cdk-go/awscdk" dockerBuildAssetOptions := &DockerBuildAssetOptions{ BuildArgs: map[string]*string{ "buildArgsKey": jsii.String("buildArgs"), }, File: jsii.String("file"), ImagePath: jsii.String("imagePath"), OutputPath: jsii.String("outputPath"), Platform: jsii.String("platform"), }
Experimental.
type DockerImageCode ¶
type DockerImageCode interface { }
Code property for the DockerImageFunction construct.
Example:
lambda.NewDockerImageFunction(this, jsii.String("AssetFunction"), &DockerImageFunctionProps{ Code: lambda.DockerImageCode_FromImageAsset(path.join(__dirname, jsii.String("docker-handler"))), })
Experimental.
func DockerImageCode_FromEcr ¶
func DockerImageCode_FromEcr(repository awsecr.IRepository, props *EcrImageCodeProps) DockerImageCode
Use an existing ECR image as the Lambda code. Experimental.
func DockerImageCode_FromImageAsset ¶
func DockerImageCode_FromImageAsset(directory *string, props *AssetImageCodeProps) DockerImageCode
Create an ECR image from the specified asset and bind it as the Lambda code. Experimental.
type DockerImageFunction ¶
type DockerImageFunction interface { Function // The architecture of this Lambda Function (this is an optional attribute and defaults to X86_64). // Experimental. Architecture() Architecture // Whether the addPermission() call adds any permissions. // // True for new Lambdas, false for version $LATEST and imported Lambdas // from different accounts. // Experimental. CanCreatePermissions() *bool // Access the Connections object. // // Will fail if not a VPC-enabled Lambda Function. // Experimental. Connections() awsec2.Connections // Returns a `lambda.Version` which represents the current version of this Lambda function. A new version will be created every time the function's configuration changes. // // You can specify options for this version using the `currentVersionOptions` // prop when initializing the `lambda.Function`. // Experimental. CurrentVersion() Version // The DLQ (as queue) associated with this Lambda Function (this is an optional attribute). // Experimental. DeadLetterQueue() awssqs.IQueue // The DLQ (as topic) associated with this Lambda Function (this is an optional attribute). // Experimental. DeadLetterTopic() awssns.ITopic // The environment this resource belongs to. // // For resources that are created and managed by the CDK // (generally, those created by creating new class instances like Role, Bucket, etc.), // this is always the same as the environment of the stack they belong to; // however, for imported resources // (those obtained from static methods like fromRoleArn, fromBucketName, etc.), // that might be different than the stack they were imported into. // Experimental. Env() *awscdk.ResourceEnvironment // ARN of this function. // Experimental. FunctionArn() *string // Name of this function. // Experimental. FunctionName() *string // The principal this Lambda Function is running as. // Experimental. GrantPrincipal() awsiam.IPrincipal // Whether or not this Lambda function was bound to a VPC. // // If this is is `false`, trying to access the `connections` object will fail. // Experimental. IsBoundToVpc() *bool // The `$LATEST` version of this function. // // Note that this is reference to a non-specific AWS Lambda version, which // means the function this version refers to can return different results in // different invocations. // // To obtain a reference to an explicit version which references the current // function configuration, use `lambdaFunction.currentVersion` instead. // Experimental. LatestVersion() IVersion // The LogGroup where the Lambda function's logs are made available. // // If either `logRetention` is set or this property is called, a CloudFormation custom resource is added to the stack that // pre-creates the log group as part of the stack deployment, if it already doesn't exist, and sets the correct log retention // period (never expire, by default). // // Further, if the log group already exists and the `logRetention` is not set, the custom resource will reset the log retention // to never expire even if it was configured with a different value. // Experimental. LogGroup() awslogs.ILogGroup // The construct tree node associated with this construct. // Experimental. Node() awscdk.ConstructNode // The construct node where permissions are attached. // Experimental. PermissionsNode() awscdk.ConstructNode // Returns a string-encoded token that resolves to the physical name that should be passed to the CloudFormation resource. // // This value will resolve to one of the following: // - a concrete value (e.g. `"my-awesome-bucket"`) // - `undefined`, when a name should be generated by CloudFormation // - a concrete name generated automatically during synthesis, in // cross-environment scenarios. // Experimental. PhysicalName() *string // The ARN(s) to put into the resource field of the generated IAM policy for grantInvoke(). // Experimental. ResourceArnsForGrantInvoke() *[]*string // Execution role associated with this function. // Experimental. Role() awsiam.IRole // The runtime configured for this lambda. // Experimental. Runtime() Runtime // The stack in which this resource is defined. // Experimental. Stack() awscdk.Stack // The timeout configured for this lambda. // Experimental. Timeout() awscdk.Duration // Defines an alias for this function. // // The alias will automatically be updated to point to the latest version of // the function as it is being updated during a deployment. // // “`ts // declare const fn: lambda.Function; // // fn.addAlias('Live'); // // // Is equivalent to // // new lambda.Alias(this, 'AliasLive', { // aliasName: 'Live', // version: fn.currentVersion, // });. // Experimental. AddAlias(aliasName *string, options *AliasOptions) Alias // Adds an environment variable to this Lambda function. // // If this is a ref to a Lambda function, this operation results in a no-op. // Experimental. AddEnvironment(key *string, value *string, options *EnvironmentOptions) Function // Adds an event source to this function. // // Event sources are implemented in the @aws-cdk/aws-lambda-event-sources module. // // The following example adds an SQS Queue as an event source: // “` // import { SqsEventSource } from '@aws-cdk/aws-lambda-event-sources'; // myFunction.addEventSource(new SqsEventSource(myQueue)); // “`. // Experimental. AddEventSource(source IEventSource) // Adds an event source that maps to this AWS Lambda function. // Experimental. AddEventSourceMapping(id *string, options *EventSourceMappingOptions) EventSourceMapping // Adds a url to this lambda function. // Experimental. AddFunctionUrl(options *FunctionUrlOptions) FunctionUrl // Adds one or more Lambda Layers to this Lambda function. // Experimental. AddLayers(layers ...ILayerVersion) // Adds a permission to the Lambda resource policy. // See: Permission for details. // // Experimental. AddPermission(id *string, permission *Permission) // Adds a statement to the IAM role assumed by the instance. // Experimental. AddToRolePolicy(statement awsiam.PolicyStatement) // Add a new version for this Lambda. // // If you want to deploy through CloudFormation and use aliases, you need to // add a new version (with a new name) to your Lambda every time you want to // deploy an update. An alias can then refer to the newly created Version. // // All versions should have distinct names, and you should not delete versions // as long as your Alias needs to refer to them. // // Returns: A new Version object. // Deprecated: This method will create an AWS::Lambda::Version resource which // snapshots the AWS Lambda function *at the time of its creation* and it // won't get updated when the function changes. Instead, use // `this.currentVersion` to obtain a reference to a version resource that gets // automatically recreated when the function configuration (or code) changes. AddVersion(name *string, codeSha256 *string, description *string, provisionedExecutions *float64, asyncInvokeConfig *EventInvokeConfigOptions) Version // Apply the given removal policy to this resource. // // The Removal Policy controls what happens to this resource when it stops // being managed by CloudFormation, either because you've removed it from the // CDK application or because you've made a change that requires the resource // to be replaced. // // The resource can be deleted (`RemovalPolicy.DESTROY`), or left in your AWS // account for data recovery and cleanup later (`RemovalPolicy.RETAIN`). // Experimental. ApplyRemovalPolicy(policy awscdk.RemovalPolicy) // Configures options for asynchronous invocation. // Experimental. ConfigureAsyncInvoke(options *EventInvokeConfigOptions) // A warning will be added to functions under the following conditions: - permissions that include `lambda:InvokeFunction` are added to the unqualified function. // // - function.currentVersion is invoked before or after the permission is created. // // This applies only to permissions on Lambda functions, not versions or aliases. // This function is overridden as a noOp for QualifiedFunctionBase. // Experimental. ConsiderWarningOnInvokeFunctionPermissions(scope awscdk.Construct, action *string) // Experimental. GeneratePhysicalName() *string // Returns an environment-sensitive token that should be used for the resource's "ARN" attribute (e.g. `bucket.bucketArn`). // // Normally, this token will resolve to `arnAttr`, but if the resource is // referenced across environments, `arnComponents` will be used to synthesize // a concrete ARN with the resource's physical name. Make sure to reference // `this.physicalName` in `arnComponents`. // Experimental. GetResourceArnAttribute(arnAttr *string, arnComponents *awscdk.ArnComponents) *string // Returns an environment-sensitive token that should be used for the resource's "name" attribute (e.g. `bucket.bucketName`). // // Normally, this token will resolve to `nameAttr`, but if the resource is // referenced across environments, it will be resolved to `this.physicalName`, // which will be a concrete name. // Experimental. GetResourceNameAttribute(nameAttr *string) *string // Grant the given identity permissions to invoke this Lambda. // Experimental. GrantInvoke(grantee awsiam.IGrantable) awsiam.Grant // Grant the given identity permissions to invoke this Lambda Function URL. // Experimental. GrantInvokeUrl(grantee awsiam.IGrantable) awsiam.Grant // Return the given named metric for this Function. // Experimental. Metric(metricName *string, props *awscloudwatch.MetricOptions) awscloudwatch.Metric // How long execution of this Lambda takes. // // Average over 5 minutes. // Experimental. MetricDuration(props *awscloudwatch.MetricOptions) awscloudwatch.Metric // How many invocations of this Lambda fail. // // Sum over 5 minutes. // Experimental. MetricErrors(props *awscloudwatch.MetricOptions) awscloudwatch.Metric // How often this Lambda is invoked. // // Sum over 5 minutes. // Experimental. MetricInvocations(props *awscloudwatch.MetricOptions) awscloudwatch.Metric // How often this Lambda is throttled. // // Sum over 5 minutes. // Experimental. MetricThrottles(props *awscloudwatch.MetricOptions) awscloudwatch.Metric // Perform final modifications before synthesis. // // This method can be implemented by derived constructs in order to perform // final changes before synthesis. prepare() will be called after child // constructs have been prepared. // // This is an advanced framework feature. Only use this if you // understand the implications. // Experimental. OnPrepare() // Allows this construct to emit artifacts into the cloud assembly during synthesis. // // This method is usually implemented by framework-level constructs such as `Stack` and `Asset` // as they participate in synthesizing the cloud assembly. // Experimental. OnSynthesize(session constructs.ISynthesisSession) // Validate the current construct. // // This method can be implemented by derived constructs in order to perform // validation logic. It is called on all constructs before synthesis. // // Returns: An array of validation error messages, or an empty array if the construct is valid. // Experimental. OnValidate() *[]*string // Perform final modifications before synthesis. // // This method can be implemented by derived constructs in order to perform // final changes before synthesis. prepare() will be called after child // constructs have been prepared. // // This is an advanced framework feature. Only use this if you // understand the implications. // Experimental. Prepare() // Allows this construct to emit artifacts into the cloud assembly during synthesis. // // This method is usually implemented by framework-level constructs such as `Stack` and `Asset` // as they participate in synthesizing the cloud assembly. // Experimental. Synthesize(session awscdk.ISynthesisSession) // Returns a string representation of this construct. // Experimental. ToString() *string // Validate the current construct. // // This method can be implemented by derived constructs in order to perform // validation logic. It is called on all constructs before synthesis. // // Returns: An array of validation error messages, or an empty array if the construct is valid. // Experimental. Validate() *[]*string // Experimental. WarnInvokeFunctionPermissions(scope awscdk.Construct) }
Create a lambda function where the handler is a docker image.
Example:
lambda.NewDockerImageFunction(this, jsii.String("AssetFunction"), &DockerImageFunctionProps{ Code: lambda.DockerImageCode_FromImageAsset(path.join(__dirname, jsii.String("docker-handler"))), })
Experimental.
func NewDockerImageFunction ¶
func NewDockerImageFunction(scope constructs.Construct, id *string, props *DockerImageFunctionProps) DockerImageFunction
Experimental.
type DockerImageFunctionProps ¶
type DockerImageFunctionProps struct { // The maximum age of a request that Lambda sends to a function for processing. // // Minimum: 60 seconds // Maximum: 6 hours. // Experimental. MaxEventAge awscdk.Duration `field:"optional" json:"maxEventAge" yaml:"maxEventAge"` // The destination for failed invocations. // Experimental. OnFailure IDestination `field:"optional" json:"onFailure" yaml:"onFailure"` // The destination for successful invocations. // Experimental. OnSuccess IDestination `field:"optional" json:"onSuccess" yaml:"onSuccess"` // The maximum number of times to retry when the function returns an error. // // Minimum: 0 // Maximum: 2. // Experimental. RetryAttempts *float64 `field:"optional" json:"retryAttempts" yaml:"retryAttempts"` // Whether to allow the Lambda to send all network traffic. // // If set to false, you must individually add traffic rules to allow the // Lambda to connect to network targets. // Experimental. AllowAllOutbound *bool `field:"optional" json:"allowAllOutbound" yaml:"allowAllOutbound"` // Lambda Functions in a public subnet can NOT access the internet. // // Use this property to acknowledge this limitation and still place the function in a public subnet. // See: https://stackoverflow.com/questions/52992085/why-cant-an-aws-lambda-function-inside-a-public-subnet-in-a-vpc-connect-to-the/52994841#52994841 // // Experimental. AllowPublicSubnet *bool `field:"optional" json:"allowPublicSubnet" yaml:"allowPublicSubnet"` // The system architectures compatible with this lambda function. // Experimental. Architecture Architecture `field:"optional" json:"architecture" yaml:"architecture"` // DEPRECATED. // Deprecated: use `architecture`. Architectures *[]Architecture `field:"optional" json:"architectures" yaml:"architectures"` // Code signing config associated with this function. // Experimental. CodeSigningConfig ICodeSigningConfig `field:"optional" json:"codeSigningConfig" yaml:"codeSigningConfig"` // Options for the `lambda.Version` resource automatically created by the `fn.currentVersion` method. // Experimental. CurrentVersionOptions *VersionOptions `field:"optional" json:"currentVersionOptions" yaml:"currentVersionOptions"` // The SQS queue to use if DLQ is enabled. // // If SNS topic is desired, specify `deadLetterTopic` property instead. // Experimental. DeadLetterQueue awssqs.IQueue `field:"optional" json:"deadLetterQueue" yaml:"deadLetterQueue"` // Enabled DLQ. // // If `deadLetterQueue` is undefined, // an SQS queue with default options will be defined for your Function. // Experimental. DeadLetterQueueEnabled *bool `field:"optional" json:"deadLetterQueueEnabled" yaml:"deadLetterQueueEnabled"` // The SNS topic to use as a DLQ. // // Note that if `deadLetterQueueEnabled` is set to `true`, an SQS queue will be created // rather than an SNS topic. Using an SNS topic as a DLQ requires this property to be set explicitly. // Experimental. DeadLetterTopic awssns.ITopic `field:"optional" json:"deadLetterTopic" yaml:"deadLetterTopic"` // A description of the function. // Experimental. Description *string `field:"optional" json:"description" yaml:"description"` // Key-value pairs that Lambda caches and makes available for your Lambda functions. // // Use environment variables to apply configuration changes, such // as test and production environment configurations, without changing your // Lambda function source code. // Experimental. Environment *map[string]*string `field:"optional" json:"environment" yaml:"environment"` // The AWS KMS key that's used to encrypt your function's environment variables. // Experimental. EnvironmentEncryption awskms.IKey `field:"optional" json:"environmentEncryption" yaml:"environmentEncryption"` // The size of the function’s /tmp directory in MiB. // Experimental. EphemeralStorageSize awscdk.Size `field:"optional" json:"ephemeralStorageSize" yaml:"ephemeralStorageSize"` // Event sources for this function. // // You can also add event sources using `addEventSource`. // Experimental. Events *[]IEventSource `field:"optional" json:"events" yaml:"events"` // The filesystem configuration for the lambda function. // Experimental. Filesystem FileSystem `field:"optional" json:"filesystem" yaml:"filesystem"` // A name for the function. // Experimental. FunctionName *string `field:"optional" json:"functionName" yaml:"functionName"` // Initial policy statements to add to the created Lambda Role. // // You can call `addToRolePolicy` to the created lambda to add statements post creation. // Experimental. InitialPolicy *[]awsiam.PolicyStatement `field:"optional" json:"initialPolicy" yaml:"initialPolicy"` // Specify the version of CloudWatch Lambda insights to use for monitoring. // See: https://docs.aws.amazon.com/AmazonCloudWatch/latest/monitoring/Lambda-Insights-Getting-Started-docker.html // // Experimental. InsightsVersion LambdaInsightsVersion `field:"optional" json:"insightsVersion" yaml:"insightsVersion"` // A list of layers to add to the function's execution environment. // // You can configure your Lambda function to pull in // additional code during initialization in the form of layers. Layers are packages of libraries or other dependencies // that can be used by multiple functions. // Experimental. Layers *[]ILayerVersion `field:"optional" json:"layers" yaml:"layers"` // The number of days log events are kept in CloudWatch Logs. // // When updating // this property, unsetting it doesn't remove the log retention policy. To // remove the retention policy, set the value to `INFINITE`. // Experimental. LogRetention awslogs.RetentionDays `field:"optional" json:"logRetention" yaml:"logRetention"` // When log retention is specified, a custom resource attempts to create the CloudWatch log group. // // These options control the retry policy when interacting with CloudWatch APIs. // Experimental. LogRetentionRetryOptions *LogRetentionRetryOptions `field:"optional" json:"logRetentionRetryOptions" yaml:"logRetentionRetryOptions"` // The IAM role for the Lambda function associated with the custom resource that sets the retention policy. // Experimental. LogRetentionRole awsiam.IRole `field:"optional" json:"logRetentionRole" yaml:"logRetentionRole"` // The amount of memory, in MB, that is allocated to your Lambda function. // // Lambda uses this value to proportionally allocate the amount of CPU // power. For more information, see Resource Model in the AWS Lambda // Developer Guide. // Experimental. MemorySize *float64 `field:"optional" json:"memorySize" yaml:"memorySize"` // Enable profiling. // See: https://docs.aws.amazon.com/codeguru/latest/profiler-ug/setting-up-lambda.html // // Experimental. Profiling *bool `field:"optional" json:"profiling" yaml:"profiling"` // Profiling Group. // See: https://docs.aws.amazon.com/codeguru/latest/profiler-ug/setting-up-lambda.html // // Experimental. ProfilingGroup awscodeguruprofiler.IProfilingGroup `field:"optional" json:"profilingGroup" yaml:"profilingGroup"` // The maximum of concurrent executions you want to reserve for the function. // See: https://docs.aws.amazon.com/lambda/latest/dg/concurrent-executions.html // // Experimental. ReservedConcurrentExecutions *float64 `field:"optional" json:"reservedConcurrentExecutions" yaml:"reservedConcurrentExecutions"` // Lambda execution role. // // This is the role that will be assumed by the function upon execution. // It controls the permissions that the function will have. The Role must // be assumable by the 'lambda.amazonaws.com' service principal. // // The default Role automatically has permissions granted for Lambda execution. If you // provide a Role, you must add the relevant AWS managed policies yourself. // // The relevant managed policies are "service-role/AWSLambdaBasicExecutionRole" and // "service-role/AWSLambdaVPCAccessExecutionRole". // Experimental. Role awsiam.IRole `field:"optional" json:"role" yaml:"role"` // What security group to associate with the Lambda's network interfaces. This property is being deprecated, consider using securityGroups instead. // // Only used if 'vpc' is supplied. // // Use securityGroups property instead. // Function constructor will throw an error if both are specified. // Deprecated: - This property is deprecated, use securityGroups instead. SecurityGroup awsec2.ISecurityGroup `field:"optional" json:"securityGroup" yaml:"securityGroup"` // The list of security groups to associate with the Lambda's network interfaces. // // Only used if 'vpc' is supplied. // Experimental. SecurityGroups *[]awsec2.ISecurityGroup `field:"optional" json:"securityGroups" yaml:"securityGroups"` // The function execution time (in seconds) after which Lambda terminates the function. // // Because the execution time affects cost, set this value // based on the function's expected execution time. // Experimental. Timeout awscdk.Duration `field:"optional" json:"timeout" yaml:"timeout"` // Enable AWS X-Ray Tracing for Lambda Function. // Experimental. Tracing Tracing `field:"optional" json:"tracing" yaml:"tracing"` // VPC network to place Lambda network interfaces. // // Specify this if the Lambda function needs to access resources in a VPC. // Experimental. Vpc awsec2.IVpc `field:"optional" json:"vpc" yaml:"vpc"` // Where to place the network interfaces within the VPC. // // Only used if 'vpc' is supplied. Note: internet access for Lambdas // requires a NAT gateway, so picking Public subnets is not allowed. // Experimental. VpcSubnets *awsec2.SubnetSelection `field:"optional" json:"vpcSubnets" yaml:"vpcSubnets"` // The source code of your Lambda function. // // You can point to a file in an // Amazon Simple Storage Service (Amazon S3) bucket or specify your source // code as inline text. // Experimental. Code DockerImageCode `field:"required" json:"code" yaml:"code"` }
Properties to configure a new DockerImageFunction construct.
Example:
lambda.NewDockerImageFunction(this, jsii.String("AssetFunction"), &DockerImageFunctionProps{ Code: lambda.DockerImageCode_FromImageAsset(path.join(__dirname, jsii.String("docker-handler"))), })
Experimental.
type EcrImageCode ¶
type EcrImageCode interface { Code // Determines whether this Code is inline code or not. // Experimental. IsInline() *bool // Called when the lambda or layer is initialized to allow this object to bind to the stack, add resources and have fun. // Experimental. Bind(_arg awscdk.Construct) *CodeConfig // Called after the CFN function resource has been created to allow the code class to bind to it. // // Specifically it's required to allow assets to add // metadata for tooling like SAM CLI to be able to find their origins. // Experimental. BindToResource(_resource awscdk.CfnResource, _options *ResourceBindOptions) }
Represents a Docker image in ECR that can be bound as Lambda Code.
Example:
// The code below shows an example of how to instantiate this type. // The values are placeholders you should change. import "github.com/aws/aws-cdk-go/awscdk" import "github.com/aws/aws-cdk-go/awscdk" var repository repository ecrImageCode := awscdk.Aws_lambda.NewEcrImageCode(repository, &EcrImageCodeProps{ Cmd: []*string{ jsii.String("cmd"), }, Entrypoint: []*string{ jsii.String("entrypoint"), }, Tag: jsii.String("tag"), TagOrDigest: jsii.String("tagOrDigest"), WorkingDirectory: jsii.String("workingDirectory"), })
Experimental.
func AssetCode_FromEcrImage ¶
func AssetCode_FromEcrImage(repository awsecr.IRepository, props *EcrImageCodeProps) EcrImageCode
Use an existing ECR image as the Lambda code. Experimental.
func AssetImageCode_FromEcrImage ¶
func AssetImageCode_FromEcrImage(repository awsecr.IRepository, props *EcrImageCodeProps) EcrImageCode
Use an existing ECR image as the Lambda code. Experimental.
func CfnParametersCode_FromEcrImage ¶
func CfnParametersCode_FromEcrImage(repository awsecr.IRepository, props *EcrImageCodeProps) EcrImageCode
Use an existing ECR image as the Lambda code. Experimental.
func Code_FromEcrImage ¶
func Code_FromEcrImage(repository awsecr.IRepository, props *EcrImageCodeProps) EcrImageCode
Use an existing ECR image as the Lambda code. Experimental.
func EcrImageCode_FromEcrImage ¶
func EcrImageCode_FromEcrImage(repository awsecr.IRepository, props *EcrImageCodeProps) EcrImageCode
Use an existing ECR image as the Lambda code. Experimental.
func InlineCode_FromEcrImage ¶
func InlineCode_FromEcrImage(repository awsecr.IRepository, props *EcrImageCodeProps) EcrImageCode
Use an existing ECR image as the Lambda code. Experimental.
func NewEcrImageCode ¶
func NewEcrImageCode(repository awsecr.IRepository, props *EcrImageCodeProps) EcrImageCode
Experimental.
func S3Code_FromEcrImage ¶
func S3Code_FromEcrImage(repository awsecr.IRepository, props *EcrImageCodeProps) EcrImageCode
Use an existing ECR image as the Lambda code. Experimental.
type EcrImageCodeProps ¶
type EcrImageCodeProps struct { // Specify or override the CMD on the specified Docker image or Dockerfile. // // This needs to be in the 'exec form', viz., `[ 'executable', 'param1', 'param2' ]`. // See: https://docs.docker.com/engine/reference/builder/#cmd // // Experimental. Cmd *[]*string `field:"optional" json:"cmd" yaml:"cmd"` // Specify or override the ENTRYPOINT on the specified Docker image or Dockerfile. // // An ENTRYPOINT allows you to configure a container that will run as an executable. // This needs to be in the 'exec form', viz., `[ 'executable', 'param1', 'param2' ]`. // See: https://docs.docker.com/engine/reference/builder/#entrypoint // // Experimental. Entrypoint *[]*string `field:"optional" json:"entrypoint" yaml:"entrypoint"` // The image tag to use when pulling the image from ECR. // Deprecated: use `tagOrDigest`. Tag *string `field:"optional" json:"tag" yaml:"tag"` // The image tag or digest to use when pulling the image from ECR (digests must start with `sha256:`). // Experimental. TagOrDigest *string `field:"optional" json:"tagOrDigest" yaml:"tagOrDigest"` // Specify or override the WORKDIR on the specified Docker image or Dockerfile. // // A WORKDIR allows you to configure the working directory the container will use. // See: https://docs.docker.com/engine/reference/builder/#workdir // // Experimental. WorkingDirectory *string `field:"optional" json:"workingDirectory" yaml:"workingDirectory"` }
Properties to initialize a new EcrImageCode.
Example:
// The code below shows an example of how to instantiate this type. // The values are placeholders you should change. import "github.com/aws/aws-cdk-go/awscdk" ecrImageCodeProps := &EcrImageCodeProps{ Cmd: []*string{ jsii.String("cmd"), }, Entrypoint: []*string{ jsii.String("entrypoint"), }, Tag: jsii.String("tag"), TagOrDigest: jsii.String("tagOrDigest"), WorkingDirectory: jsii.String("workingDirectory"), }
Experimental.
type EnvironmentOptions ¶
type EnvironmentOptions struct { // When used in Lambda@Edge via edgeArn() API, these environment variables will be removed. // // If not set, an error will be thrown. // See: https://docs.aws.amazon.com/AmazonCloudFront/latest/DeveloperGuide/lambda-requirements-limits.html#lambda-requirements-lambda-function-configuration // // Experimental. RemoveInEdge *bool `field:"optional" json:"removeInEdge" yaml:"removeInEdge"` }
Environment variables options.
Example:
// The code below shows an example of how to instantiate this type. // The values are placeholders you should change. import "github.com/aws/aws-cdk-go/awscdk" environmentOptions := &EnvironmentOptions{ RemoveInEdge: jsii.Boolean(false), }
Experimental.
type EventInvokeConfig ¶
type EventInvokeConfig interface { awscdk.Resource // The environment this resource belongs to. // // For resources that are created and managed by the CDK // (generally, those created by creating new class instances like Role, Bucket, etc.), // this is always the same as the environment of the stack they belong to; // however, for imported resources // (those obtained from static methods like fromRoleArn, fromBucketName, etc.), // that might be different than the stack they were imported into. // Experimental. Env() *awscdk.ResourceEnvironment // The construct tree node associated with this construct. // Experimental. Node() awscdk.ConstructNode // Returns a string-encoded token that resolves to the physical name that should be passed to the CloudFormation resource. // // This value will resolve to one of the following: // - a concrete value (e.g. `"my-awesome-bucket"`) // - `undefined`, when a name should be generated by CloudFormation // - a concrete name generated automatically during synthesis, in // cross-environment scenarios. // Experimental. PhysicalName() *string // The stack in which this resource is defined. // Experimental. Stack() awscdk.Stack // Apply the given removal policy to this resource. // // The Removal Policy controls what happens to this resource when it stops // being managed by CloudFormation, either because you've removed it from the // CDK application or because you've made a change that requires the resource // to be replaced. // // The resource can be deleted (`RemovalPolicy.DESTROY`), or left in your AWS // account for data recovery and cleanup later (`RemovalPolicy.RETAIN`). // Experimental. ApplyRemovalPolicy(policy awscdk.RemovalPolicy) // Experimental. GeneratePhysicalName() *string // Returns an environment-sensitive token that should be used for the resource's "ARN" attribute (e.g. `bucket.bucketArn`). // // Normally, this token will resolve to `arnAttr`, but if the resource is // referenced across environments, `arnComponents` will be used to synthesize // a concrete ARN with the resource's physical name. Make sure to reference // `this.physicalName` in `arnComponents`. // Experimental. GetResourceArnAttribute(arnAttr *string, arnComponents *awscdk.ArnComponents) *string // Returns an environment-sensitive token that should be used for the resource's "name" attribute (e.g. `bucket.bucketName`). // // Normally, this token will resolve to `nameAttr`, but if the resource is // referenced across environments, it will be resolved to `this.physicalName`, // which will be a concrete name. // Experimental. GetResourceNameAttribute(nameAttr *string) *string // Perform final modifications before synthesis. // // This method can be implemented by derived constructs in order to perform // final changes before synthesis. prepare() will be called after child // constructs have been prepared. // // This is an advanced framework feature. Only use this if you // understand the implications. // Experimental. OnPrepare() // Allows this construct to emit artifacts into the cloud assembly during synthesis. // // This method is usually implemented by framework-level constructs such as `Stack` and `Asset` // as they participate in synthesizing the cloud assembly. // Experimental. OnSynthesize(session constructs.ISynthesisSession) // Validate the current construct. // // This method can be implemented by derived constructs in order to perform // validation logic. It is called on all constructs before synthesis. // // Returns: An array of validation error messages, or an empty array if the construct is valid. // Experimental. OnValidate() *[]*string // Perform final modifications before synthesis. // // This method can be implemented by derived constructs in order to perform // final changes before synthesis. prepare() will be called after child // constructs have been prepared. // // This is an advanced framework feature. Only use this if you // understand the implications. // Experimental. Prepare() // Allows this construct to emit artifacts into the cloud assembly during synthesis. // // This method is usually implemented by framework-level constructs such as `Stack` and `Asset` // as they participate in synthesizing the cloud assembly. // Experimental. Synthesize(session awscdk.ISynthesisSession) // Returns a string representation of this construct. // Experimental. ToString() *string // Validate the current construct. // // This method can be implemented by derived constructs in order to perform // validation logic. It is called on all constructs before synthesis. // // Returns: An array of validation error messages, or an empty array if the construct is valid. // Experimental. Validate() *[]*string }
Configure options for asynchronous invocation on a version or an alias.
By default, Lambda retries an asynchronous invocation twice if the function returns an error. It retains events in a queue for up to six hours. When an event fails all processing attempts or stays in the asynchronous invocation queue for too long, Lambda discards it.
Example:
// The code below shows an example of how to instantiate this type. // The values are placeholders you should change. import monocdk "github.com/aws/aws-cdk-go/awscdk" import "github.com/aws/aws-cdk-go/awscdk" var destination iDestination var duration duration var function_ function eventInvokeConfig := awscdk.Aws_lambda.NewEventInvokeConfig(this, jsii.String("MyEventInvokeConfig"), &EventInvokeConfigProps{ Function: function_, // the properties below are optional MaxEventAge: duration, OnFailure: destination, OnSuccess: destination, Qualifier: jsii.String("qualifier"), RetryAttempts: jsii.Number(123), })
Experimental.
func NewEventInvokeConfig ¶
func NewEventInvokeConfig(scope constructs.Construct, id *string, props *EventInvokeConfigProps) EventInvokeConfig
Experimental.
type EventInvokeConfigOptions ¶
type EventInvokeConfigOptions struct { // The maximum age of a request that Lambda sends to a function for processing. // // Minimum: 60 seconds // Maximum: 6 hours. // Experimental. MaxEventAge awscdk.Duration `field:"optional" json:"maxEventAge" yaml:"maxEventAge"` // The destination for failed invocations. // Experimental. OnFailure IDestination `field:"optional" json:"onFailure" yaml:"onFailure"` // The destination for successful invocations. // Experimental. OnSuccess IDestination `field:"optional" json:"onSuccess" yaml:"onSuccess"` // The maximum number of times to retry when the function returns an error. // // Minimum: 0 // Maximum: 2. // Experimental. RetryAttempts *float64 `field:"optional" json:"retryAttempts" yaml:"retryAttempts"` }
Options to add an EventInvokeConfig to a function.
Example:
// The code below shows an example of how to instantiate this type. // The values are placeholders you should change. import monocdk "github.com/aws/aws-cdk-go/awscdk" import "github.com/aws/aws-cdk-go/awscdk" var destination iDestination var duration duration eventInvokeConfigOptions := &EventInvokeConfigOptions{ MaxEventAge: duration, OnFailure: destination, OnSuccess: destination, RetryAttempts: jsii.Number(123), }
Experimental.
type EventInvokeConfigProps ¶
type EventInvokeConfigProps struct { // The maximum age of a request that Lambda sends to a function for processing. // // Minimum: 60 seconds // Maximum: 6 hours. // Experimental. MaxEventAge awscdk.Duration `field:"optional" json:"maxEventAge" yaml:"maxEventAge"` // The destination for failed invocations. // Experimental. OnFailure IDestination `field:"optional" json:"onFailure" yaml:"onFailure"` // The destination for successful invocations. // Experimental. OnSuccess IDestination `field:"optional" json:"onSuccess" yaml:"onSuccess"` // The maximum number of times to retry when the function returns an error. // // Minimum: 0 // Maximum: 2. // Experimental. RetryAttempts *float64 `field:"optional" json:"retryAttempts" yaml:"retryAttempts"` // The Lambda function. // Experimental. Function IFunction `field:"required" json:"function" yaml:"function"` // The qualifier. // Experimental. Qualifier *string `field:"optional" json:"qualifier" yaml:"qualifier"` }
Properties for an EventInvokeConfig.
Example:
// The code below shows an example of how to instantiate this type. // The values are placeholders you should change. import monocdk "github.com/aws/aws-cdk-go/awscdk" import "github.com/aws/aws-cdk-go/awscdk" var destination iDestination var duration duration var function_ function eventInvokeConfigProps := &EventInvokeConfigProps{ Function: function_, // the properties below are optional MaxEventAge: duration, OnFailure: destination, OnSuccess: destination, Qualifier: jsii.String("qualifier"), RetryAttempts: jsii.Number(123), }
Experimental.
type EventSourceMapping ¶
type EventSourceMapping interface { awscdk.Resource IEventSourceMapping // The environment this resource belongs to. // // For resources that are created and managed by the CDK // (generally, those created by creating new class instances like Role, Bucket, etc.), // this is always the same as the environment of the stack they belong to; // however, for imported resources // (those obtained from static methods like fromRoleArn, fromBucketName, etc.), // that might be different than the stack they were imported into. // Experimental. Env() *awscdk.ResourceEnvironment // The identifier for this EventSourceMapping. // Experimental. EventSourceMappingId() *string // The construct tree node associated with this construct. // Experimental. Node() awscdk.ConstructNode // Returns a string-encoded token that resolves to the physical name that should be passed to the CloudFormation resource. // // This value will resolve to one of the following: // - a concrete value (e.g. `"my-awesome-bucket"`) // - `undefined`, when a name should be generated by CloudFormation // - a concrete name generated automatically during synthesis, in // cross-environment scenarios. // Experimental. PhysicalName() *string // The stack in which this resource is defined. // Experimental. Stack() awscdk.Stack // Apply the given removal policy to this resource. // // The Removal Policy controls what happens to this resource when it stops // being managed by CloudFormation, either because you've removed it from the // CDK application or because you've made a change that requires the resource // to be replaced. // // The resource can be deleted (`RemovalPolicy.DESTROY`), or left in your AWS // account for data recovery and cleanup later (`RemovalPolicy.RETAIN`). // Experimental. ApplyRemovalPolicy(policy awscdk.RemovalPolicy) // Experimental. GeneratePhysicalName() *string // Returns an environment-sensitive token that should be used for the resource's "ARN" attribute (e.g. `bucket.bucketArn`). // // Normally, this token will resolve to `arnAttr`, but if the resource is // referenced across environments, `arnComponents` will be used to synthesize // a concrete ARN with the resource's physical name. Make sure to reference // `this.physicalName` in `arnComponents`. // Experimental. GetResourceArnAttribute(arnAttr *string, arnComponents *awscdk.ArnComponents) *string // Returns an environment-sensitive token that should be used for the resource's "name" attribute (e.g. `bucket.bucketName`). // // Normally, this token will resolve to `nameAttr`, but if the resource is // referenced across environments, it will be resolved to `this.physicalName`, // which will be a concrete name. // Experimental. GetResourceNameAttribute(nameAttr *string) *string // Perform final modifications before synthesis. // // This method can be implemented by derived constructs in order to perform // final changes before synthesis. prepare() will be called after child // constructs have been prepared. // // This is an advanced framework feature. Only use this if you // understand the implications. // Experimental. OnPrepare() // Allows this construct to emit artifacts into the cloud assembly during synthesis. // // This method is usually implemented by framework-level constructs such as `Stack` and `Asset` // as they participate in synthesizing the cloud assembly. // Experimental. OnSynthesize(session constructs.ISynthesisSession) // Validate the current construct. // // This method can be implemented by derived constructs in order to perform // validation logic. It is called on all constructs before synthesis. // // Returns: An array of validation error messages, or an empty array if the construct is valid. // Experimental. OnValidate() *[]*string // Perform final modifications before synthesis. // // This method can be implemented by derived constructs in order to perform // final changes before synthesis. prepare() will be called after child // constructs have been prepared. // // This is an advanced framework feature. Only use this if you // understand the implications. // Experimental. Prepare() // Allows this construct to emit artifacts into the cloud assembly during synthesis. // // This method is usually implemented by framework-level constructs such as `Stack` and `Asset` // as they participate in synthesizing the cloud assembly. // Experimental. Synthesize(session awscdk.ISynthesisSession) // Returns a string representation of this construct. // Experimental. ToString() *string // Validate the current construct. // // This method can be implemented by derived constructs in order to perform // validation logic. It is called on all constructs before synthesis. // // Returns: An array of validation error messages, or an empty array if the construct is valid. // Experimental. Validate() *[]*string }
Defines a Lambda EventSourceMapping resource.
Usually, you won't need to define the mapping yourself. This will usually be done by event sources. For example, to add an SQS event source to a function:
import { SqsEventSource } from '@aws-cdk/aws-lambda-event-sources'; lambda.addEventSource(new SqsEventSource(sqs));
The `SqsEventSource` class will automatically create the mapping, and will also modify the Lambda's execution role so it can consume messages from the queue.
Example:
// The code below shows an example of how to instantiate this type. // The values are placeholders you should change. import monocdk "github.com/aws/aws-cdk-go/awscdk" import "github.com/aws/aws-cdk-go/awscdk" var duration duration var eventSourceDlq iEventSourceDlq var function_ function var sourceAccessConfigurationType sourceAccessConfigurationType eventSourceMapping := awscdk.Aws_lambda.NewEventSourceMapping(this, jsii.String("MyEventSourceMapping"), &EventSourceMappingProps{ Target: function_, // the properties below are optional BatchSize: jsii.Number(123), BisectBatchOnError: jsii.Boolean(false), Enabled: jsii.Boolean(false), EventSourceArn: jsii.String("eventSourceArn"), KafkaBootstrapServers: []*string{ jsii.String("kafkaBootstrapServers"), }, KafkaTopic: jsii.String("kafkaTopic"), MaxBatchingWindow: duration, MaxRecordAge: duration, OnFailure: eventSourceDlq, ParallelizationFactor: jsii.Number(123), ReportBatchItemFailures: jsii.Boolean(false), RetryAttempts: jsii.Number(123), SourceAccessConfigurations: []sourceAccessConfiguration{ &sourceAccessConfiguration{ Type: sourceAccessConfigurationType, Uri: jsii.String("uri"), }, }, StartingPosition: awscdk.*Aws_lambda.StartingPosition_TRIM_HORIZON, TumblingWindow: duration, })
Experimental.
func NewEventSourceMapping ¶
func NewEventSourceMapping(scope constructs.Construct, id *string, props *EventSourceMappingProps) EventSourceMapping
Experimental.
type EventSourceMappingOptions ¶
type EventSourceMappingOptions struct { // The largest number of records that AWS Lambda will retrieve from your event source at the time of invoking your function. // // Your function receives an // event with all the retrieved records. // // Valid Range: Minimum value of 1. Maximum value of 10000. // Experimental. BatchSize *float64 `field:"optional" json:"batchSize" yaml:"batchSize"` // If the function returns an error, split the batch in two and retry. // Experimental. BisectBatchOnError *bool `field:"optional" json:"bisectBatchOnError" yaml:"bisectBatchOnError"` // Set to false to disable the event source upon creation. // Experimental. Enabled *bool `field:"optional" json:"enabled" yaml:"enabled"` // The Amazon Resource Name (ARN) of the event source. // // Any record added to // this stream can invoke the Lambda function. // Experimental. EventSourceArn *string `field:"optional" json:"eventSourceArn" yaml:"eventSourceArn"` // A list of host and port pairs that are the addresses of the Kafka brokers in a self managed "bootstrap" Kafka cluster that a Kafka client connects to initially to bootstrap itself. // // They are in the format `abc.example.com:9096`. // Experimental. KafkaBootstrapServers *[]*string `field:"optional" json:"kafkaBootstrapServers" yaml:"kafkaBootstrapServers"` // The name of the Kafka topic. // Experimental. KafkaTopic *string `field:"optional" json:"kafkaTopic" yaml:"kafkaTopic"` // The maximum amount of time to gather records before invoking the function. // // Maximum of Duration.minutes(5) // Experimental. MaxBatchingWindow awscdk.Duration `field:"optional" json:"maxBatchingWindow" yaml:"maxBatchingWindow"` // The maximum age of a record that Lambda sends to a function for processing. // // Valid Range: // * Minimum value of 60 seconds // * Maximum value of 7 days. // Experimental. MaxRecordAge awscdk.Duration `field:"optional" json:"maxRecordAge" yaml:"maxRecordAge"` // An Amazon SQS queue or Amazon SNS topic destination for discarded records. // Experimental. OnFailure IEventSourceDlq `field:"optional" json:"onFailure" yaml:"onFailure"` // The number of batches to process from each shard concurrently. // // Valid Range: // * Minimum value of 1 // * Maximum value of 10. // Experimental. ParallelizationFactor *float64 `field:"optional" json:"parallelizationFactor" yaml:"parallelizationFactor"` // Allow functions to return partially successful responses for a batch of records. // See: https://docs.aws.amazon.com/lambda/latest/dg/with-ddb.html#services-ddb-batchfailurereporting // // Experimental. ReportBatchItemFailures *bool `field:"optional" json:"reportBatchItemFailures" yaml:"reportBatchItemFailures"` // The maximum number of times to retry when the function returns an error. // // Set to `undefined` if you want lambda to keep retrying infinitely or until // the record expires. // // Valid Range: // * Minimum value of 0 // * Maximum value of 10000. // Experimental. RetryAttempts *float64 `field:"optional" json:"retryAttempts" yaml:"retryAttempts"` // Specific settings like the authentication protocol or the VPC components to secure access to your event source. // See: https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-lambda-eventsourcemapping-sourceaccessconfiguration.html // // Experimental. SourceAccessConfigurations *[]*SourceAccessConfiguration `field:"optional" json:"sourceAccessConfigurations" yaml:"sourceAccessConfigurations"` // The position in the DynamoDB, Kinesis or MSK stream where AWS Lambda should start reading. // See: https://docs.aws.amazon.com/kinesis/latest/APIReference/API_GetShardIterator.html#Kinesis-GetShardIterator-request-ShardIteratorType // // Experimental. StartingPosition StartingPosition `field:"optional" json:"startingPosition" yaml:"startingPosition"` // The size of the tumbling windows to group records sent to DynamoDB or Kinesis. // See: https://docs.aws.amazon.com/lambda/latest/dg/with-ddb.html#services-ddb-windows // // Valid Range: 0 - 15 minutes. // // Experimental. TumblingWindow awscdk.Duration `field:"optional" json:"tumblingWindow" yaml:"tumblingWindow"` }
Example:
// The code below shows an example of how to instantiate this type. // The values are placeholders you should change. import monocdk "github.com/aws/aws-cdk-go/awscdk" import "github.com/aws/aws-cdk-go/awscdk" var duration duration var eventSourceDlq iEventSourceDlq var sourceAccessConfigurationType sourceAccessConfigurationType eventSourceMappingOptions := &EventSourceMappingOptions{ BatchSize: jsii.Number(123), BisectBatchOnError: jsii.Boolean(false), Enabled: jsii.Boolean(false), EventSourceArn: jsii.String("eventSourceArn"), KafkaBootstrapServers: []*string{ jsii.String("kafkaBootstrapServers"), }, KafkaTopic: jsii.String("kafkaTopic"), MaxBatchingWindow: duration, MaxRecordAge: duration, OnFailure: eventSourceDlq, ParallelizationFactor: jsii.Number(123), ReportBatchItemFailures: jsii.Boolean(false), RetryAttempts: jsii.Number(123), SourceAccessConfigurations: []sourceAccessConfiguration{ &sourceAccessConfiguration{ Type: sourceAccessConfigurationType, Uri: jsii.String("uri"), }, }, StartingPosition: awscdk.Aws_lambda.StartingPosition_TRIM_HORIZON, TumblingWindow: duration, }
Experimental.
type EventSourceMappingProps ¶
type EventSourceMappingProps struct { // The largest number of records that AWS Lambda will retrieve from your event source at the time of invoking your function. // // Your function receives an // event with all the retrieved records. // // Valid Range: Minimum value of 1. Maximum value of 10000. // Experimental. BatchSize *float64 `field:"optional" json:"batchSize" yaml:"batchSize"` // If the function returns an error, split the batch in two and retry. // Experimental. BisectBatchOnError *bool `field:"optional" json:"bisectBatchOnError" yaml:"bisectBatchOnError"` // Set to false to disable the event source upon creation. // Experimental. Enabled *bool `field:"optional" json:"enabled" yaml:"enabled"` // The Amazon Resource Name (ARN) of the event source. // // Any record added to // this stream can invoke the Lambda function. // Experimental. EventSourceArn *string `field:"optional" json:"eventSourceArn" yaml:"eventSourceArn"` // A list of host and port pairs that are the addresses of the Kafka brokers in a self managed "bootstrap" Kafka cluster that a Kafka client connects to initially to bootstrap itself. // // They are in the format `abc.example.com:9096`. // Experimental. KafkaBootstrapServers *[]*string `field:"optional" json:"kafkaBootstrapServers" yaml:"kafkaBootstrapServers"` // The name of the Kafka topic. // Experimental. KafkaTopic *string `field:"optional" json:"kafkaTopic" yaml:"kafkaTopic"` // The maximum amount of time to gather records before invoking the function. // // Maximum of Duration.minutes(5) // Experimental. MaxBatchingWindow awscdk.Duration `field:"optional" json:"maxBatchingWindow" yaml:"maxBatchingWindow"` // The maximum age of a record that Lambda sends to a function for processing. // // Valid Range: // * Minimum value of 60 seconds // * Maximum value of 7 days. // Experimental. MaxRecordAge awscdk.Duration `field:"optional" json:"maxRecordAge" yaml:"maxRecordAge"` // An Amazon SQS queue or Amazon SNS topic destination for discarded records. // Experimental. OnFailure IEventSourceDlq `field:"optional" json:"onFailure" yaml:"onFailure"` // The number of batches to process from each shard concurrently. // // Valid Range: // * Minimum value of 1 // * Maximum value of 10. // Experimental. ParallelizationFactor *float64 `field:"optional" json:"parallelizationFactor" yaml:"parallelizationFactor"` // Allow functions to return partially successful responses for a batch of records. // See: https://docs.aws.amazon.com/lambda/latest/dg/with-ddb.html#services-ddb-batchfailurereporting // // Experimental. ReportBatchItemFailures *bool `field:"optional" json:"reportBatchItemFailures" yaml:"reportBatchItemFailures"` // The maximum number of times to retry when the function returns an error. // // Set to `undefined` if you want lambda to keep retrying infinitely or until // the record expires. // // Valid Range: // * Minimum value of 0 // * Maximum value of 10000. // Experimental. RetryAttempts *float64 `field:"optional" json:"retryAttempts" yaml:"retryAttempts"` // Specific settings like the authentication protocol or the VPC components to secure access to your event source. // See: https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-lambda-eventsourcemapping-sourceaccessconfiguration.html // // Experimental. SourceAccessConfigurations *[]*SourceAccessConfiguration `field:"optional" json:"sourceAccessConfigurations" yaml:"sourceAccessConfigurations"` // The position in the DynamoDB, Kinesis or MSK stream where AWS Lambda should start reading. // See: https://docs.aws.amazon.com/kinesis/latest/APIReference/API_GetShardIterator.html#Kinesis-GetShardIterator-request-ShardIteratorType // // Experimental. StartingPosition StartingPosition `field:"optional" json:"startingPosition" yaml:"startingPosition"` // The size of the tumbling windows to group records sent to DynamoDB or Kinesis. // See: https://docs.aws.amazon.com/lambda/latest/dg/with-ddb.html#services-ddb-windows // // Valid Range: 0 - 15 minutes. // // Experimental. TumblingWindow awscdk.Duration `field:"optional" json:"tumblingWindow" yaml:"tumblingWindow"` // The target AWS Lambda function. // Experimental. Target IFunction `field:"required" json:"target" yaml:"target"` }
Properties for declaring a new event source mapping.
Example:
// The code below shows an example of how to instantiate this type. // The values are placeholders you should change. import monocdk "github.com/aws/aws-cdk-go/awscdk" import "github.com/aws/aws-cdk-go/awscdk" var duration duration var eventSourceDlq iEventSourceDlq var function_ function var sourceAccessConfigurationType sourceAccessConfigurationType eventSourceMappingProps := &EventSourceMappingProps{ Target: function_, // the properties below are optional BatchSize: jsii.Number(123), BisectBatchOnError: jsii.Boolean(false), Enabled: jsii.Boolean(false), EventSourceArn: jsii.String("eventSourceArn"), KafkaBootstrapServers: []*string{ jsii.String("kafkaBootstrapServers"), }, KafkaTopic: jsii.String("kafkaTopic"), MaxBatchingWindow: duration, MaxRecordAge: duration, OnFailure: eventSourceDlq, ParallelizationFactor: jsii.Number(123), ReportBatchItemFailures: jsii.Boolean(false), RetryAttempts: jsii.Number(123), SourceAccessConfigurations: []sourceAccessConfiguration{ &sourceAccessConfiguration{ Type: sourceAccessConfigurationType, Uri: jsii.String("uri"), }, }, StartingPosition: awscdk.Aws_lambda.StartingPosition_TRIM_HORIZON, TumblingWindow: duration, }
Experimental.
type FileSystem ¶
type FileSystem interface { // the FileSystem configurations for the Lambda function. // Experimental. Config() *FileSystemConfig }
Represents the filesystem for the Lambda function.
Example:
import ec2 "github.com/aws/aws-cdk-go/awscdk" import efs "github.com/aws/aws-cdk-go/awscdk" // create a new VPC vpc := ec2.NewVpc(this, jsii.String("VPC")) // create a new Amazon EFS filesystem fileSystem := efs.NewFileSystem(this, jsii.String("Efs"), &FileSystemProps{ Vpc: Vpc, }) // create a new access point from the filesystem accessPoint := fileSystem.AddAccessPoint(jsii.String("AccessPoint"), &AccessPointOptions{ // set /export/lambda as the root of the access point Path: jsii.String("/export/lambda"), // as /export/lambda does not exist in a new efs filesystem, the efs will create the directory with the following createAcl CreateAcl: &Acl{ OwnerUid: jsii.String("1001"), OwnerGid: jsii.String("1001"), Permissions: jsii.String("750"), }, // enforce the POSIX identity so lambda function will access with this identity PosixUser: &PosixUser{ Uid: jsii.String("1001"), Gid: jsii.String("1001"), }, }) fn := lambda.NewFunction(this, jsii.String("MyLambda"), &FunctionProps{ // mount the access point to /mnt/msg in the lambda runtime environment Filesystem: lambda.FileSystem_FromEfsAccessPoint(accessPoint, jsii.String("/mnt/msg")), Runtime: lambda.Runtime_NODEJS_16_X(), Handler: jsii.String("index.handler"), Code: lambda.Code_FromAsset(path.join(__dirname, jsii.String("lambda-handler"))), Vpc: Vpc, })
Experimental.
func FileSystem_FromEfsAccessPoint ¶
func FileSystem_FromEfsAccessPoint(ap awsefs.IAccessPoint, mountPath *string) FileSystem
mount the filesystem from Amazon EFS. Experimental.
type FileSystemConfig ¶
type FileSystemConfig struct { // ARN of the access point. // Experimental. Arn *string `field:"required" json:"arn" yaml:"arn"` // mount path in the lambda runtime environment. // Experimental. LocalMountPath *string `field:"required" json:"localMountPath" yaml:"localMountPath"` // connections object used to allow ingress traffic from lambda function. // Experimental. Connections awsec2.Connections `field:"optional" json:"connections" yaml:"connections"` // array of IDependable that lambda function depends on. // Experimental. Dependency *[]awscdk.IDependable `field:"optional" json:"dependency" yaml:"dependency"` // additional IAM policies required for the lambda function. // Experimental. Policies *[]awsiam.PolicyStatement `field:"optional" json:"policies" yaml:"policies"` }
FileSystem configurations for the Lambda function.
Example:
// The code below shows an example of how to instantiate this type. // The values are placeholders you should change. import monocdk "github.com/aws/aws-cdk-go/awscdk" import "github.com/aws/aws-cdk-go/awscdk" import "github.com/aws/aws-cdk-go/awscdk" import "github.com/aws/aws-cdk-go/awscdk" var connections connections var dependable iDependable var policyStatement policyStatement fileSystemConfig := &FileSystemConfig{ Arn: jsii.String("arn"), LocalMountPath: jsii.String("localMountPath"), // the properties below are optional Connections: connections, Dependency: []*iDependable{ dependable, }, Policies: []*policyStatement{ policyStatement, }, }
Experimental.
type Function ¶
type Function interface { FunctionBase // The architecture of this Lambda Function (this is an optional attribute and defaults to X86_64). // Experimental. Architecture() Architecture // Whether the addPermission() call adds any permissions. // // True for new Lambdas, false for version $LATEST and imported Lambdas // from different accounts. // Experimental. CanCreatePermissions() *bool // Access the Connections object. // // Will fail if not a VPC-enabled Lambda Function. // Experimental. Connections() awsec2.Connections // Returns a `lambda.Version` which represents the current version of this Lambda function. A new version will be created every time the function's configuration changes. // // You can specify options for this version using the `currentVersionOptions` // prop when initializing the `lambda.Function`. // Experimental. CurrentVersion() Version // The DLQ (as queue) associated with this Lambda Function (this is an optional attribute). // Experimental. DeadLetterQueue() awssqs.IQueue // The DLQ (as topic) associated with this Lambda Function (this is an optional attribute). // Experimental. DeadLetterTopic() awssns.ITopic // The environment this resource belongs to. // // For resources that are created and managed by the CDK // (generally, those created by creating new class instances like Role, Bucket, etc.), // this is always the same as the environment of the stack they belong to; // however, for imported resources // (those obtained from static methods like fromRoleArn, fromBucketName, etc.), // that might be different than the stack they were imported into. // Experimental. Env() *awscdk.ResourceEnvironment // ARN of this function. // Experimental. FunctionArn() *string // Name of this function. // Experimental. FunctionName() *string // The principal this Lambda Function is running as. // Experimental. GrantPrincipal() awsiam.IPrincipal // Whether or not this Lambda function was bound to a VPC. // // If this is is `false`, trying to access the `connections` object will fail. // Experimental. IsBoundToVpc() *bool // The `$LATEST` version of this function. // // Note that this is reference to a non-specific AWS Lambda version, which // means the function this version refers to can return different results in // different invocations. // // To obtain a reference to an explicit version which references the current // function configuration, use `lambdaFunction.currentVersion` instead. // Experimental. LatestVersion() IVersion // The LogGroup where the Lambda function's logs are made available. // // If either `logRetention` is set or this property is called, a CloudFormation custom resource is added to the stack that // pre-creates the log group as part of the stack deployment, if it already doesn't exist, and sets the correct log retention // period (never expire, by default). // // Further, if the log group already exists and the `logRetention` is not set, the custom resource will reset the log retention // to never expire even if it was configured with a different value. // Experimental. LogGroup() awslogs.ILogGroup // The construct tree node associated with this construct. // Experimental. Node() awscdk.ConstructNode // The construct node where permissions are attached. // Experimental. PermissionsNode() awscdk.ConstructNode // Returns a string-encoded token that resolves to the physical name that should be passed to the CloudFormation resource. // // This value will resolve to one of the following: // - a concrete value (e.g. `"my-awesome-bucket"`) // - `undefined`, when a name should be generated by CloudFormation // - a concrete name generated automatically during synthesis, in // cross-environment scenarios. // Experimental. PhysicalName() *string // The ARN(s) to put into the resource field of the generated IAM policy for grantInvoke(). // Experimental. ResourceArnsForGrantInvoke() *[]*string // Execution role associated with this function. // Experimental. Role() awsiam.IRole // The runtime configured for this lambda. // Experimental. Runtime() Runtime // The stack in which this resource is defined. // Experimental. Stack() awscdk.Stack // The timeout configured for this lambda. // Experimental. Timeout() awscdk.Duration // Defines an alias for this function. // // The alias will automatically be updated to point to the latest version of // the function as it is being updated during a deployment. // // “`ts // declare const fn: lambda.Function; // // fn.addAlias('Live'); // // // Is equivalent to // // new lambda.Alias(this, 'AliasLive', { // aliasName: 'Live', // version: fn.currentVersion, // });. // Experimental. AddAlias(aliasName *string, options *AliasOptions) Alias // Adds an environment variable to this Lambda function. // // If this is a ref to a Lambda function, this operation results in a no-op. // Experimental. AddEnvironment(key *string, value *string, options *EnvironmentOptions) Function // Adds an event source to this function. // // Event sources are implemented in the @aws-cdk/aws-lambda-event-sources module. // // The following example adds an SQS Queue as an event source: // “` // import { SqsEventSource } from '@aws-cdk/aws-lambda-event-sources'; // myFunction.addEventSource(new SqsEventSource(myQueue)); // “`. // Experimental. AddEventSource(source IEventSource) // Adds an event source that maps to this AWS Lambda function. // Experimental. AddEventSourceMapping(id *string, options *EventSourceMappingOptions) EventSourceMapping // Adds a url to this lambda function. // Experimental. AddFunctionUrl(options *FunctionUrlOptions) FunctionUrl // Adds one or more Lambda Layers to this Lambda function. // Experimental. AddLayers(layers ...ILayerVersion) // Adds a permission to the Lambda resource policy. // See: Permission for details. // // Experimental. AddPermission(id *string, permission *Permission) // Adds a statement to the IAM role assumed by the instance. // Experimental. AddToRolePolicy(statement awsiam.PolicyStatement) // Add a new version for this Lambda. // // If you want to deploy through CloudFormation and use aliases, you need to // add a new version (with a new name) to your Lambda every time you want to // deploy an update. An alias can then refer to the newly created Version. // // All versions should have distinct names, and you should not delete versions // as long as your Alias needs to refer to them. // // Returns: A new Version object. // Deprecated: This method will create an AWS::Lambda::Version resource which // snapshots the AWS Lambda function *at the time of its creation* and it // won't get updated when the function changes. Instead, use // `this.currentVersion` to obtain a reference to a version resource that gets // automatically recreated when the function configuration (or code) changes. AddVersion(name *string, codeSha256 *string, description *string, provisionedExecutions *float64, asyncInvokeConfig *EventInvokeConfigOptions) Version // Apply the given removal policy to this resource. // // The Removal Policy controls what happens to this resource when it stops // being managed by CloudFormation, either because you've removed it from the // CDK application or because you've made a change that requires the resource // to be replaced. // // The resource can be deleted (`RemovalPolicy.DESTROY`), or left in your AWS // account for data recovery and cleanup later (`RemovalPolicy.RETAIN`). // Experimental. ApplyRemovalPolicy(policy awscdk.RemovalPolicy) // Configures options for asynchronous invocation. // Experimental. ConfigureAsyncInvoke(options *EventInvokeConfigOptions) // A warning will be added to functions under the following conditions: - permissions that include `lambda:InvokeFunction` are added to the unqualified function. // // - function.currentVersion is invoked before or after the permission is created. // // This applies only to permissions on Lambda functions, not versions or aliases. // This function is overridden as a noOp for QualifiedFunctionBase. // Experimental. ConsiderWarningOnInvokeFunctionPermissions(scope awscdk.Construct, action *string) // Experimental. GeneratePhysicalName() *string // Returns an environment-sensitive token that should be used for the resource's "ARN" attribute (e.g. `bucket.bucketArn`). // // Normally, this token will resolve to `arnAttr`, but if the resource is // referenced across environments, `arnComponents` will be used to synthesize // a concrete ARN with the resource's physical name. Make sure to reference // `this.physicalName` in `arnComponents`. // Experimental. GetResourceArnAttribute(arnAttr *string, arnComponents *awscdk.ArnComponents) *string // Returns an environment-sensitive token that should be used for the resource's "name" attribute (e.g. `bucket.bucketName`). // // Normally, this token will resolve to `nameAttr`, but if the resource is // referenced across environments, it will be resolved to `this.physicalName`, // which will be a concrete name. // Experimental. GetResourceNameAttribute(nameAttr *string) *string // Grant the given identity permissions to invoke this Lambda. // Experimental. GrantInvoke(grantee awsiam.IGrantable) awsiam.Grant // Grant the given identity permissions to invoke this Lambda Function URL. // Experimental. GrantInvokeUrl(grantee awsiam.IGrantable) awsiam.Grant // Return the given named metric for this Function. // Experimental. Metric(metricName *string, props *awscloudwatch.MetricOptions) awscloudwatch.Metric // How long execution of this Lambda takes. // // Average over 5 minutes. // Experimental. MetricDuration(props *awscloudwatch.MetricOptions) awscloudwatch.Metric // How many invocations of this Lambda fail. // // Sum over 5 minutes. // Experimental. MetricErrors(props *awscloudwatch.MetricOptions) awscloudwatch.Metric // How often this Lambda is invoked. // // Sum over 5 minutes. // Experimental. MetricInvocations(props *awscloudwatch.MetricOptions) awscloudwatch.Metric // How often this Lambda is throttled. // // Sum over 5 minutes. // Experimental. MetricThrottles(props *awscloudwatch.MetricOptions) awscloudwatch.Metric // Perform final modifications before synthesis. // // This method can be implemented by derived constructs in order to perform // final changes before synthesis. prepare() will be called after child // constructs have been prepared. // // This is an advanced framework feature. Only use this if you // understand the implications. // Experimental. OnPrepare() // Allows this construct to emit artifacts into the cloud assembly during synthesis. // // This method is usually implemented by framework-level constructs such as `Stack` and `Asset` // as they participate in synthesizing the cloud assembly. // Experimental. OnSynthesize(session constructs.ISynthesisSession) // Validate the current construct. // // This method can be implemented by derived constructs in order to perform // validation logic. It is called on all constructs before synthesis. // // Returns: An array of validation error messages, or an empty array if the construct is valid. // Experimental. OnValidate() *[]*string // Perform final modifications before synthesis. // // This method can be implemented by derived constructs in order to perform // final changes before synthesis. prepare() will be called after child // constructs have been prepared. // // This is an advanced framework feature. Only use this if you // understand the implications. // Experimental. Prepare() // Allows this construct to emit artifacts into the cloud assembly during synthesis. // // This method is usually implemented by framework-level constructs such as `Stack` and `Asset` // as they participate in synthesizing the cloud assembly. // Experimental. Synthesize(session awscdk.ISynthesisSession) // Returns a string representation of this construct. // Experimental. ToString() *string // Validate the current construct. // // This method can be implemented by derived constructs in order to perform // validation logic. It is called on all constructs before synthesis. // // Returns: An array of validation error messages, or an empty array if the construct is valid. // Experimental. Validate() *[]*string // Experimental. WarnInvokeFunctionPermissions(scope awscdk.Construct) }
Deploys a file from inside the construct library as a function.
The supplied file is subject to the 4096 bytes limit of being embedded in a CloudFormation template.
The construct includes an associated role with the lambda.
This construct does not yet reproduce all features from the underlying resource library.
Example:
import "github.com/aws/aws-cdk-go/awscdk" signingProfile := signer.NewSigningProfile(this, jsii.String("SigningProfile"), &SigningProfileProps{ Platform: signer.Platform_AWS_LAMBDA_SHA384_ECDSA(), }) codeSigningConfig := lambda.NewCodeSigningConfig(this, jsii.String("CodeSigningConfig"), &CodeSigningConfigProps{ SigningProfiles: []iSigningProfile{ signingProfile, }, }) lambda.NewFunction(this, jsii.String("Function"), &FunctionProps{ CodeSigningConfig: CodeSigningConfig, Runtime: lambda.Runtime_NODEJS_16_X(), Handler: jsii.String("index.handler"), Code: lambda.Code_FromAsset(path.join(__dirname, jsii.String("lambda-handler"))), })
Experimental.
func NewFunction ¶
func NewFunction(scope constructs.Construct, id *string, props *FunctionProps) Function
Experimental.
type FunctionAttributes ¶
type FunctionAttributes struct { // The ARN of the Lambda function. // // Format: arn:<partition>:lambda:<region>:<account-id>:function:<function-name>. // Experimental. FunctionArn *string `field:"required" json:"functionArn" yaml:"functionArn"` // The architecture of this Lambda Function (this is an optional attribute and defaults to X86_64). // Experimental. Architecture Architecture `field:"optional" json:"architecture" yaml:"architecture"` // The IAM execution role associated with this function. // // If the role is not specified, any role-related operations will no-op. // Experimental. Role awsiam.IRole `field:"optional" json:"role" yaml:"role"` // Setting this property informs the CDK that the imported function is in the same environment as the stack. // // This affects certain behaviours such as, whether this function's permission can be modified. // When not configured, the CDK attempts to auto-determine this. For environment agnostic stacks, i.e., stacks // where the account is not specified with the `env` property, this is determined to be false. // // Set this to property *ONLY IF* the imported function is in the same account as the stack // it's imported in. // Experimental. SameEnvironment *bool `field:"optional" json:"sameEnvironment" yaml:"sameEnvironment"` // The security group of this Lambda, if in a VPC. // // This needs to be given in order to support allowing connections // to this Lambda. // Experimental. SecurityGroup awsec2.ISecurityGroup `field:"optional" json:"securityGroup" yaml:"securityGroup"` // Id of the security group of this Lambda, if in a VPC. // // This needs to be given in order to support allowing connections // to this Lambda. // Deprecated: use `securityGroup` instead. SecurityGroupId *string `field:"optional" json:"securityGroupId" yaml:"securityGroupId"` // Setting this property informs the CDK that the imported function ALREADY HAS the necessary permissions for what you are trying to do. // // When not configured, the CDK attempts to auto-determine whether or not // additional permissions are necessary on the function when grant APIs are used. If the CDK tried to add // permissions on an imported lambda, it will fail. // // Set this property *ONLY IF* you are committing to manage the imported function's permissions outside of // CDK. You are acknowledging that your CDK code alone will have insufficient permissions to access the // imported function. // Experimental. SkipPermissions *bool `field:"optional" json:"skipPermissions" yaml:"skipPermissions"` }
Represents a Lambda function defined outside of this stack.
Example:
fn := lambda.Function_FromFunctionAttributes(this, jsii.String("Function"), &FunctionAttributes{ FunctionArn: jsii.String("arn:aws:lambda:us-east-1:123456789012:function:MyFn"), // The following are optional properties for specific use cases and should be used with caution: // Use Case: imported function is in the same account as the stack. This tells the CDK that it // can modify the function's permissions. SameEnvironment: jsii.Boolean(true), // Use Case: imported function is in a different account and user commits to ensuring that the // imported function has the correct permissions outside the CDK. SkipPermissions: jsii.Boolean(true), })
Experimental.
type FunctionBase ¶
type FunctionBase interface { awscdk.Resource awsec2.IClientVpnConnectionHandler IFunction // The architecture of this Lambda Function. // Experimental. Architecture() Architecture // Whether the addPermission() call adds any permissions. // // True for new Lambdas, false for version $LATEST and imported Lambdas // from different accounts. // Experimental. CanCreatePermissions() *bool // Access the Connections object. // // Will fail if not a VPC-enabled Lambda Function. // Experimental. Connections() awsec2.Connections // The environment this resource belongs to. // // For resources that are created and managed by the CDK // (generally, those created by creating new class instances like Role, Bucket, etc.), // this is always the same as the environment of the stack they belong to; // however, for imported resources // (those obtained from static methods like fromRoleArn, fromBucketName, etc.), // that might be different than the stack they were imported into. // Experimental. Env() *awscdk.ResourceEnvironment // The ARN fo the function. // Experimental. FunctionArn() *string // The name of the function. // Experimental. FunctionName() *string // The principal this Lambda Function is running as. // Experimental. GrantPrincipal() awsiam.IPrincipal // Whether or not this Lambda function was bound to a VPC. // // If this is is `false`, trying to access the `connections` object will fail. // Experimental. IsBoundToVpc() *bool // The `$LATEST` version of this function. // // Note that this is reference to a non-specific AWS Lambda version, which // means the function this version refers to can return different results in // different invocations. // // To obtain a reference to an explicit version which references the current // function configuration, use `lambdaFunction.currentVersion` instead. // Experimental. LatestVersion() IVersion // The construct tree node associated with this construct. // Experimental. Node() awscdk.ConstructNode // The construct node where permissions are attached. // Experimental. PermissionsNode() awscdk.ConstructNode // Returns a string-encoded token that resolves to the physical name that should be passed to the CloudFormation resource. // // This value will resolve to one of the following: // - a concrete value (e.g. `"my-awesome-bucket"`) // - `undefined`, when a name should be generated by CloudFormation // - a concrete name generated automatically during synthesis, in // cross-environment scenarios. // Experimental. PhysicalName() *string // The ARN(s) to put into the resource field of the generated IAM policy for grantInvoke(). // Experimental. ResourceArnsForGrantInvoke() *[]*string // The IAM role associated with this function. // // Undefined if the function was imported without a role. // Experimental. Role() awsiam.IRole // The stack in which this resource is defined. // Experimental. Stack() awscdk.Stack // Adds an event source to this function. // // Event sources are implemented in the @aws-cdk/aws-lambda-event-sources module. // // The following example adds an SQS Queue as an event source: // “` // import { SqsEventSource } from '@aws-cdk/aws-lambda-event-sources'; // myFunction.addEventSource(new SqsEventSource(myQueue)); // “`. // Experimental. AddEventSource(source IEventSource) // Adds an event source that maps to this AWS Lambda function. // Experimental. AddEventSourceMapping(id *string, options *EventSourceMappingOptions) EventSourceMapping // Adds a url to this lambda function. // Experimental. AddFunctionUrl(options *FunctionUrlOptions) FunctionUrl // Adds a permission to the Lambda resource policy. // See: Permission for details. // // Experimental. AddPermission(id *string, permission *Permission) // Adds a statement to the IAM role assumed by the instance. // Experimental. AddToRolePolicy(statement awsiam.PolicyStatement) // Apply the given removal policy to this resource. // // The Removal Policy controls what happens to this resource when it stops // being managed by CloudFormation, either because you've removed it from the // CDK application or because you've made a change that requires the resource // to be replaced. // // The resource can be deleted (`RemovalPolicy.DESTROY`), or left in your AWS // account for data recovery and cleanup later (`RemovalPolicy.RETAIN`). // Experimental. ApplyRemovalPolicy(policy awscdk.RemovalPolicy) // Configures options for asynchronous invocation. // Experimental. ConfigureAsyncInvoke(options *EventInvokeConfigOptions) // A warning will be added to functions under the following conditions: - permissions that include `lambda:InvokeFunction` are added to the unqualified function. // // - function.currentVersion is invoked before or after the permission is created. // // This applies only to permissions on Lambda functions, not versions or aliases. // This function is overridden as a noOp for QualifiedFunctionBase. // Experimental. ConsiderWarningOnInvokeFunctionPermissions(scope awscdk.Construct, action *string) // Experimental. GeneratePhysicalName() *string // Returns an environment-sensitive token that should be used for the resource's "ARN" attribute (e.g. `bucket.bucketArn`). // // Normally, this token will resolve to `arnAttr`, but if the resource is // referenced across environments, `arnComponents` will be used to synthesize // a concrete ARN with the resource's physical name. Make sure to reference // `this.physicalName` in `arnComponents`. // Experimental. GetResourceArnAttribute(arnAttr *string, arnComponents *awscdk.ArnComponents) *string // Returns an environment-sensitive token that should be used for the resource's "name" attribute (e.g. `bucket.bucketName`). // // Normally, this token will resolve to `nameAttr`, but if the resource is // referenced across environments, it will be resolved to `this.physicalName`, // which will be a concrete name. // Experimental. GetResourceNameAttribute(nameAttr *string) *string // Grant the given identity permissions to invoke this Lambda. // Experimental. GrantInvoke(grantee awsiam.IGrantable) awsiam.Grant // Grant the given identity permissions to invoke this Lambda Function URL. // Experimental. GrantInvokeUrl(grantee awsiam.IGrantable) awsiam.Grant // Return the given named metric for this Function. // Experimental. Metric(metricName *string, props *awscloudwatch.MetricOptions) awscloudwatch.Metric // How long execution of this Lambda takes. // // Average over 5 minutes. // Experimental. MetricDuration(props *awscloudwatch.MetricOptions) awscloudwatch.Metric // How many invocations of this Lambda fail. // // Sum over 5 minutes. // Experimental. MetricErrors(props *awscloudwatch.MetricOptions) awscloudwatch.Metric // How often this Lambda is invoked. // // Sum over 5 minutes. // Experimental. MetricInvocations(props *awscloudwatch.MetricOptions) awscloudwatch.Metric // How often this Lambda is throttled. // // Sum over 5 minutes. // Experimental. MetricThrottles(props *awscloudwatch.MetricOptions) awscloudwatch.Metric // Perform final modifications before synthesis. // // This method can be implemented by derived constructs in order to perform // final changes before synthesis. prepare() will be called after child // constructs have been prepared. // // This is an advanced framework feature. Only use this if you // understand the implications. // Experimental. OnPrepare() // Allows this construct to emit artifacts into the cloud assembly during synthesis. // // This method is usually implemented by framework-level constructs such as `Stack` and `Asset` // as they participate in synthesizing the cloud assembly. // Experimental. OnSynthesize(session constructs.ISynthesisSession) // Validate the current construct. // // This method can be implemented by derived constructs in order to perform // validation logic. It is called on all constructs before synthesis. // // Returns: An array of validation error messages, or an empty array if the construct is valid. // Experimental. OnValidate() *[]*string // Perform final modifications before synthesis. // // This method can be implemented by derived constructs in order to perform // final changes before synthesis. prepare() will be called after child // constructs have been prepared. // // This is an advanced framework feature. Only use this if you // understand the implications. // Experimental. Prepare() // Allows this construct to emit artifacts into the cloud assembly during synthesis. // // This method is usually implemented by framework-level constructs such as `Stack` and `Asset` // as they participate in synthesizing the cloud assembly. // Experimental. Synthesize(session awscdk.ISynthesisSession) // Returns a string representation of this construct. // Experimental. ToString() *string // Validate the current construct. // // This method can be implemented by derived constructs in order to perform // validation logic. It is called on all constructs before synthesis. // // Returns: An array of validation error messages, or an empty array if the construct is valid. // Experimental. Validate() *[]*string // Experimental. WarnInvokeFunctionPermissions(scope awscdk.Construct) }
Experimental.
type FunctionOptions ¶
type FunctionOptions struct { // The maximum age of a request that Lambda sends to a function for processing. // // Minimum: 60 seconds // Maximum: 6 hours. // Experimental. MaxEventAge awscdk.Duration `field:"optional" json:"maxEventAge" yaml:"maxEventAge"` // The destination for failed invocations. // Experimental. OnFailure IDestination `field:"optional" json:"onFailure" yaml:"onFailure"` // The destination for successful invocations. // Experimental. OnSuccess IDestination `field:"optional" json:"onSuccess" yaml:"onSuccess"` // The maximum number of times to retry when the function returns an error. // // Minimum: 0 // Maximum: 2. // Experimental. RetryAttempts *float64 `field:"optional" json:"retryAttempts" yaml:"retryAttempts"` // Whether to allow the Lambda to send all network traffic. // // If set to false, you must individually add traffic rules to allow the // Lambda to connect to network targets. // Experimental. AllowAllOutbound *bool `field:"optional" json:"allowAllOutbound" yaml:"allowAllOutbound"` // Lambda Functions in a public subnet can NOT access the internet. // // Use this property to acknowledge this limitation and still place the function in a public subnet. // See: https://stackoverflow.com/questions/52992085/why-cant-an-aws-lambda-function-inside-a-public-subnet-in-a-vpc-connect-to-the/52994841#52994841 // // Experimental. AllowPublicSubnet *bool `field:"optional" json:"allowPublicSubnet" yaml:"allowPublicSubnet"` // The system architectures compatible with this lambda function. // Experimental. Architecture Architecture `field:"optional" json:"architecture" yaml:"architecture"` // DEPRECATED. // Deprecated: use `architecture`. Architectures *[]Architecture `field:"optional" json:"architectures" yaml:"architectures"` // Code signing config associated with this function. // Experimental. CodeSigningConfig ICodeSigningConfig `field:"optional" json:"codeSigningConfig" yaml:"codeSigningConfig"` // Options for the `lambda.Version` resource automatically created by the `fn.currentVersion` method. // Experimental. CurrentVersionOptions *VersionOptions `field:"optional" json:"currentVersionOptions" yaml:"currentVersionOptions"` // The SQS queue to use if DLQ is enabled. // // If SNS topic is desired, specify `deadLetterTopic` property instead. // Experimental. DeadLetterQueue awssqs.IQueue `field:"optional" json:"deadLetterQueue" yaml:"deadLetterQueue"` // Enabled DLQ. // // If `deadLetterQueue` is undefined, // an SQS queue with default options will be defined for your Function. // Experimental. DeadLetterQueueEnabled *bool `field:"optional" json:"deadLetterQueueEnabled" yaml:"deadLetterQueueEnabled"` // The SNS topic to use as a DLQ. // // Note that if `deadLetterQueueEnabled` is set to `true`, an SQS queue will be created // rather than an SNS topic. Using an SNS topic as a DLQ requires this property to be set explicitly. // Experimental. DeadLetterTopic awssns.ITopic `field:"optional" json:"deadLetterTopic" yaml:"deadLetterTopic"` // A description of the function. // Experimental. Description *string `field:"optional" json:"description" yaml:"description"` // Key-value pairs that Lambda caches and makes available for your Lambda functions. // // Use environment variables to apply configuration changes, such // as test and production environment configurations, without changing your // Lambda function source code. // Experimental. Environment *map[string]*string `field:"optional" json:"environment" yaml:"environment"` // The AWS KMS key that's used to encrypt your function's environment variables. // Experimental. EnvironmentEncryption awskms.IKey `field:"optional" json:"environmentEncryption" yaml:"environmentEncryption"` // The size of the function’s /tmp directory in MiB. // Experimental. EphemeralStorageSize awscdk.Size `field:"optional" json:"ephemeralStorageSize" yaml:"ephemeralStorageSize"` // Event sources for this function. // // You can also add event sources using `addEventSource`. // Experimental. Events *[]IEventSource `field:"optional" json:"events" yaml:"events"` // The filesystem configuration for the lambda function. // Experimental. Filesystem FileSystem `field:"optional" json:"filesystem" yaml:"filesystem"` // A name for the function. // Experimental. FunctionName *string `field:"optional" json:"functionName" yaml:"functionName"` // Initial policy statements to add to the created Lambda Role. // // You can call `addToRolePolicy` to the created lambda to add statements post creation. // Experimental. InitialPolicy *[]awsiam.PolicyStatement `field:"optional" json:"initialPolicy" yaml:"initialPolicy"` // Specify the version of CloudWatch Lambda insights to use for monitoring. // See: https://docs.aws.amazon.com/AmazonCloudWatch/latest/monitoring/Lambda-Insights-Getting-Started-docker.html // // Experimental. InsightsVersion LambdaInsightsVersion `field:"optional" json:"insightsVersion" yaml:"insightsVersion"` // A list of layers to add to the function's execution environment. // // You can configure your Lambda function to pull in // additional code during initialization in the form of layers. Layers are packages of libraries or other dependencies // that can be used by multiple functions. // Experimental. Layers *[]ILayerVersion `field:"optional" json:"layers" yaml:"layers"` // The number of days log events are kept in CloudWatch Logs. // // When updating // this property, unsetting it doesn't remove the log retention policy. To // remove the retention policy, set the value to `INFINITE`. // Experimental. LogRetention awslogs.RetentionDays `field:"optional" json:"logRetention" yaml:"logRetention"` // When log retention is specified, a custom resource attempts to create the CloudWatch log group. // // These options control the retry policy when interacting with CloudWatch APIs. // Experimental. LogRetentionRetryOptions *LogRetentionRetryOptions `field:"optional" json:"logRetentionRetryOptions" yaml:"logRetentionRetryOptions"` // The IAM role for the Lambda function associated with the custom resource that sets the retention policy. // Experimental. LogRetentionRole awsiam.IRole `field:"optional" json:"logRetentionRole" yaml:"logRetentionRole"` // The amount of memory, in MB, that is allocated to your Lambda function. // // Lambda uses this value to proportionally allocate the amount of CPU // power. For more information, see Resource Model in the AWS Lambda // Developer Guide. // Experimental. MemorySize *float64 `field:"optional" json:"memorySize" yaml:"memorySize"` // Enable profiling. // See: https://docs.aws.amazon.com/codeguru/latest/profiler-ug/setting-up-lambda.html // // Experimental. Profiling *bool `field:"optional" json:"profiling" yaml:"profiling"` // Profiling Group. // See: https://docs.aws.amazon.com/codeguru/latest/profiler-ug/setting-up-lambda.html // // Experimental. ProfilingGroup awscodeguruprofiler.IProfilingGroup `field:"optional" json:"profilingGroup" yaml:"profilingGroup"` // The maximum of concurrent executions you want to reserve for the function. // See: https://docs.aws.amazon.com/lambda/latest/dg/concurrent-executions.html // // Experimental. ReservedConcurrentExecutions *float64 `field:"optional" json:"reservedConcurrentExecutions" yaml:"reservedConcurrentExecutions"` // Lambda execution role. // // This is the role that will be assumed by the function upon execution. // It controls the permissions that the function will have. The Role must // be assumable by the 'lambda.amazonaws.com' service principal. // // The default Role automatically has permissions granted for Lambda execution. If you // provide a Role, you must add the relevant AWS managed policies yourself. // // The relevant managed policies are "service-role/AWSLambdaBasicExecutionRole" and // "service-role/AWSLambdaVPCAccessExecutionRole". // Experimental. Role awsiam.IRole `field:"optional" json:"role" yaml:"role"` // What security group to associate with the Lambda's network interfaces. This property is being deprecated, consider using securityGroups instead. // // Only used if 'vpc' is supplied. // // Use securityGroups property instead. // Function constructor will throw an error if both are specified. // Deprecated: - This property is deprecated, use securityGroups instead. SecurityGroup awsec2.ISecurityGroup `field:"optional" json:"securityGroup" yaml:"securityGroup"` // The list of security groups to associate with the Lambda's network interfaces. // // Only used if 'vpc' is supplied. // Experimental. SecurityGroups *[]awsec2.ISecurityGroup `field:"optional" json:"securityGroups" yaml:"securityGroups"` // The function execution time (in seconds) after which Lambda terminates the function. // // Because the execution time affects cost, set this value // based on the function's expected execution time. // Experimental. Timeout awscdk.Duration `field:"optional" json:"timeout" yaml:"timeout"` // Enable AWS X-Ray Tracing for Lambda Function. // Experimental. Tracing Tracing `field:"optional" json:"tracing" yaml:"tracing"` // VPC network to place Lambda network interfaces. // // Specify this if the Lambda function needs to access resources in a VPC. // Experimental. Vpc awsec2.IVpc `field:"optional" json:"vpc" yaml:"vpc"` // Where to place the network interfaces within the VPC. // // Only used if 'vpc' is supplied. Note: internet access for Lambdas // requires a NAT gateway, so picking Public subnets is not allowed. // Experimental. VpcSubnets *awsec2.SubnetSelection `field:"optional" json:"vpcSubnets" yaml:"vpcSubnets"` }
Non runtime options.
Example:
// The code below shows an example of how to instantiate this type. // The values are placeholders you should change. import monocdk "github.com/aws/aws-cdk-go/awscdk" import "github.com/aws/aws-cdk-go/awscdk" import "github.com/aws/aws-cdk-go/awscdk" import "github.com/aws/aws-cdk-go/awscdk" import "github.com/aws/aws-cdk-go/awscdk" import "github.com/aws/aws-cdk-go/awscdk" import "github.com/aws/aws-cdk-go/awscdk" import "github.com/aws/aws-cdk-go/awscdk" import "github.com/aws/aws-cdk-go/awscdk" var architecture architecture var codeSigningConfig codeSigningConfig var destination iDestination var duration duration var eventSource iEventSource var fileSystem fileSystem var key key var lambdaInsightsVersion lambdaInsightsVersion var layerVersion layerVersion var policyStatement policyStatement var profilingGroup profilingGroup var queue queue var role role var securityGroup securityGroup var size size var subnet subnet var subnetFilter subnetFilter var topic topic var vpc vpc functionOptions := &FunctionOptions{ AllowAllOutbound: jsii.Boolean(false), AllowPublicSubnet: jsii.Boolean(false), Architecture: architecture, Architectures: []*architecture{ architecture, }, CodeSigningConfig: codeSigningConfig, CurrentVersionOptions: &VersionOptions{ CodeSha256: jsii.String("codeSha256"), Description: jsii.String("description"), MaxEventAge: duration, OnFailure: destination, OnSuccess: destination, ProvisionedConcurrentExecutions: jsii.Number(123), RemovalPolicy: monocdk.RemovalPolicy_DESTROY, RetryAttempts: jsii.Number(123), }, DeadLetterQueue: queue, DeadLetterQueueEnabled: jsii.Boolean(false), DeadLetterTopic: topic, Description: jsii.String("description"), Environment: map[string]*string{ "environmentKey": jsii.String("environment"), }, EnvironmentEncryption: key, EphemeralStorageSize: size, Events: []*iEventSource{ eventSource, }, Filesystem: fileSystem, FunctionName: jsii.String("functionName"), InitialPolicy: []*policyStatement{ policyStatement, }, InsightsVersion: lambdaInsightsVersion, Layers: []iLayerVersion{ layerVersion, }, LogRetention: awscdk.Aws_logs.RetentionDays_ONE_DAY, LogRetentionRetryOptions: &LogRetentionRetryOptions{ Base: duration, MaxRetries: jsii.Number(123), }, LogRetentionRole: role, MaxEventAge: duration, MemorySize: jsii.Number(123), OnFailure: destination, OnSuccess: destination, Profiling: jsii.Boolean(false), ProfilingGroup: profilingGroup, ReservedConcurrentExecutions: jsii.Number(123), RetryAttempts: jsii.Number(123), Role: role, SecurityGroup: securityGroup, SecurityGroups: []iSecurityGroup{ securityGroup, }, Timeout: duration, Tracing: awscdk.Aws_lambda.Tracing_ACTIVE, Vpc: vpc, VpcSubnets: &SubnetSelection{ AvailabilityZones: []*string{ jsii.String("availabilityZones"), }, OnePerAz: jsii.Boolean(false), SubnetFilters: []*subnetFilter{ subnetFilter, }, SubnetGroupName: jsii.String("subnetGroupName"), SubnetName: jsii.String("subnetName"), Subnets: []iSubnet{ subnet, }, SubnetType: awscdk.Aws_ec2.SubnetType_ISOLATED, }, }
Experimental.
type FunctionProps ¶
type FunctionProps struct { // The maximum age of a request that Lambda sends to a function for processing. // // Minimum: 60 seconds // Maximum: 6 hours. // Experimental. MaxEventAge awscdk.Duration `field:"optional" json:"maxEventAge" yaml:"maxEventAge"` // The destination for failed invocations. // Experimental. OnFailure IDestination `field:"optional" json:"onFailure" yaml:"onFailure"` // The destination for successful invocations. // Experimental. OnSuccess IDestination `field:"optional" json:"onSuccess" yaml:"onSuccess"` // The maximum number of times to retry when the function returns an error. // // Minimum: 0 // Maximum: 2. // Experimental. RetryAttempts *float64 `field:"optional" json:"retryAttempts" yaml:"retryAttempts"` // Whether to allow the Lambda to send all network traffic. // // If set to false, you must individually add traffic rules to allow the // Lambda to connect to network targets. // Experimental. AllowAllOutbound *bool `field:"optional" json:"allowAllOutbound" yaml:"allowAllOutbound"` // Lambda Functions in a public subnet can NOT access the internet. // // Use this property to acknowledge this limitation and still place the function in a public subnet. // See: https://stackoverflow.com/questions/52992085/why-cant-an-aws-lambda-function-inside-a-public-subnet-in-a-vpc-connect-to-the/52994841#52994841 // // Experimental. AllowPublicSubnet *bool `field:"optional" json:"allowPublicSubnet" yaml:"allowPublicSubnet"` // The system architectures compatible with this lambda function. // Experimental. Architecture Architecture `field:"optional" json:"architecture" yaml:"architecture"` // DEPRECATED. // Deprecated: use `architecture`. Architectures *[]Architecture `field:"optional" json:"architectures" yaml:"architectures"` // Code signing config associated with this function. // Experimental. CodeSigningConfig ICodeSigningConfig `field:"optional" json:"codeSigningConfig" yaml:"codeSigningConfig"` // Options for the `lambda.Version` resource automatically created by the `fn.currentVersion` method. // Experimental. CurrentVersionOptions *VersionOptions `field:"optional" json:"currentVersionOptions" yaml:"currentVersionOptions"` // The SQS queue to use if DLQ is enabled. // // If SNS topic is desired, specify `deadLetterTopic` property instead. // Experimental. DeadLetterQueue awssqs.IQueue `field:"optional" json:"deadLetterQueue" yaml:"deadLetterQueue"` // Enabled DLQ. // // If `deadLetterQueue` is undefined, // an SQS queue with default options will be defined for your Function. // Experimental. DeadLetterQueueEnabled *bool `field:"optional" json:"deadLetterQueueEnabled" yaml:"deadLetterQueueEnabled"` // The SNS topic to use as a DLQ. // // Note that if `deadLetterQueueEnabled` is set to `true`, an SQS queue will be created // rather than an SNS topic. Using an SNS topic as a DLQ requires this property to be set explicitly. // Experimental. DeadLetterTopic awssns.ITopic `field:"optional" json:"deadLetterTopic" yaml:"deadLetterTopic"` // A description of the function. // Experimental. Description *string `field:"optional" json:"description" yaml:"description"` // Key-value pairs that Lambda caches and makes available for your Lambda functions. // // Use environment variables to apply configuration changes, such // as test and production environment configurations, without changing your // Lambda function source code. // Experimental. Environment *map[string]*string `field:"optional" json:"environment" yaml:"environment"` // The AWS KMS key that's used to encrypt your function's environment variables. // Experimental. EnvironmentEncryption awskms.IKey `field:"optional" json:"environmentEncryption" yaml:"environmentEncryption"` // The size of the function’s /tmp directory in MiB. // Experimental. EphemeralStorageSize awscdk.Size `field:"optional" json:"ephemeralStorageSize" yaml:"ephemeralStorageSize"` // Event sources for this function. // // You can also add event sources using `addEventSource`. // Experimental. Events *[]IEventSource `field:"optional" json:"events" yaml:"events"` // The filesystem configuration for the lambda function. // Experimental. Filesystem FileSystem `field:"optional" json:"filesystem" yaml:"filesystem"` // A name for the function. // Experimental. FunctionName *string `field:"optional" json:"functionName" yaml:"functionName"` // Initial policy statements to add to the created Lambda Role. // // You can call `addToRolePolicy` to the created lambda to add statements post creation. // Experimental. InitialPolicy *[]awsiam.PolicyStatement `field:"optional" json:"initialPolicy" yaml:"initialPolicy"` // Specify the version of CloudWatch Lambda insights to use for monitoring. // See: https://docs.aws.amazon.com/AmazonCloudWatch/latest/monitoring/Lambda-Insights-Getting-Started-docker.html // // Experimental. InsightsVersion LambdaInsightsVersion `field:"optional" json:"insightsVersion" yaml:"insightsVersion"` // A list of layers to add to the function's execution environment. // // You can configure your Lambda function to pull in // additional code during initialization in the form of layers. Layers are packages of libraries or other dependencies // that can be used by multiple functions. // Experimental. Layers *[]ILayerVersion `field:"optional" json:"layers" yaml:"layers"` // The number of days log events are kept in CloudWatch Logs. // // When updating // this property, unsetting it doesn't remove the log retention policy. To // remove the retention policy, set the value to `INFINITE`. // Experimental. LogRetention awslogs.RetentionDays `field:"optional" json:"logRetention" yaml:"logRetention"` // When log retention is specified, a custom resource attempts to create the CloudWatch log group. // // These options control the retry policy when interacting with CloudWatch APIs. // Experimental. LogRetentionRetryOptions *LogRetentionRetryOptions `field:"optional" json:"logRetentionRetryOptions" yaml:"logRetentionRetryOptions"` // The IAM role for the Lambda function associated with the custom resource that sets the retention policy. // Experimental. LogRetentionRole awsiam.IRole `field:"optional" json:"logRetentionRole" yaml:"logRetentionRole"` // The amount of memory, in MB, that is allocated to your Lambda function. // // Lambda uses this value to proportionally allocate the amount of CPU // power. For more information, see Resource Model in the AWS Lambda // Developer Guide. // Experimental. MemorySize *float64 `field:"optional" json:"memorySize" yaml:"memorySize"` // Enable profiling. // See: https://docs.aws.amazon.com/codeguru/latest/profiler-ug/setting-up-lambda.html // // Experimental. Profiling *bool `field:"optional" json:"profiling" yaml:"profiling"` // Profiling Group. // See: https://docs.aws.amazon.com/codeguru/latest/profiler-ug/setting-up-lambda.html // // Experimental. ProfilingGroup awscodeguruprofiler.IProfilingGroup `field:"optional" json:"profilingGroup" yaml:"profilingGroup"` // The maximum of concurrent executions you want to reserve for the function. // See: https://docs.aws.amazon.com/lambda/latest/dg/concurrent-executions.html // // Experimental. ReservedConcurrentExecutions *float64 `field:"optional" json:"reservedConcurrentExecutions" yaml:"reservedConcurrentExecutions"` // Lambda execution role. // // This is the role that will be assumed by the function upon execution. // It controls the permissions that the function will have. The Role must // be assumable by the 'lambda.amazonaws.com' service principal. // // The default Role automatically has permissions granted for Lambda execution. If you // provide a Role, you must add the relevant AWS managed policies yourself. // // The relevant managed policies are "service-role/AWSLambdaBasicExecutionRole" and // "service-role/AWSLambdaVPCAccessExecutionRole". // Experimental. Role awsiam.IRole `field:"optional" json:"role" yaml:"role"` // What security group to associate with the Lambda's network interfaces. This property is being deprecated, consider using securityGroups instead. // // Only used if 'vpc' is supplied. // // Use securityGroups property instead. // Function constructor will throw an error if both are specified. // Deprecated: - This property is deprecated, use securityGroups instead. SecurityGroup awsec2.ISecurityGroup `field:"optional" json:"securityGroup" yaml:"securityGroup"` // The list of security groups to associate with the Lambda's network interfaces. // // Only used if 'vpc' is supplied. // Experimental. SecurityGroups *[]awsec2.ISecurityGroup `field:"optional" json:"securityGroups" yaml:"securityGroups"` // The function execution time (in seconds) after which Lambda terminates the function. // // Because the execution time affects cost, set this value // based on the function's expected execution time. // Experimental. Timeout awscdk.Duration `field:"optional" json:"timeout" yaml:"timeout"` // Enable AWS X-Ray Tracing for Lambda Function. // Experimental. Tracing Tracing `field:"optional" json:"tracing" yaml:"tracing"` // VPC network to place Lambda network interfaces. // // Specify this if the Lambda function needs to access resources in a VPC. // Experimental. Vpc awsec2.IVpc `field:"optional" json:"vpc" yaml:"vpc"` // Where to place the network interfaces within the VPC. // // Only used if 'vpc' is supplied. Note: internet access for Lambdas // requires a NAT gateway, so picking Public subnets is not allowed. // Experimental. VpcSubnets *awsec2.SubnetSelection `field:"optional" json:"vpcSubnets" yaml:"vpcSubnets"` // The source code of your Lambda function. // // You can point to a file in an // Amazon Simple Storage Service (Amazon S3) bucket or specify your source // code as inline text. // Experimental. Code Code `field:"required" json:"code" yaml:"code"` // The name of the method within your code that Lambda calls to execute your function. // // The format includes the file name. It can also include // namespaces and other qualifiers, depending on the runtime. // For more information, see https://docs.aws.amazon.com/lambda/latest/dg/gettingstarted-features.html#gettingstarted-features-programmingmodel. // // Use `Handler.FROM_IMAGE` when defining a function from a Docker image. // // NOTE: If you specify your source code as inline text by specifying the // ZipFile property within the Code property, specify index.function_name as // the handler. // Experimental. Handler *string `field:"required" json:"handler" yaml:"handler"` // The runtime environment for the Lambda function that you are uploading. // // For valid values, see the Runtime property in the AWS Lambda Developer // Guide. // // Use `Runtime.FROM_IMAGE` when when defining a function from a Docker image. // Experimental. Runtime Runtime `field:"required" json:"runtime" yaml:"runtime"` }
Example:
import "github.com/aws/aws-cdk-go/awscdk" fn := lambda.NewFunction(this, jsii.String("MyFunc"), &FunctionProps{ Runtime: lambda.Runtime_NODEJS_14_X(), Handler: jsii.String("index.handler"), Code: lambda.Code_FromInline(jsii.String("exports.handler = handler.toString()")), }) rule := events.NewRule(this, jsii.String("rule"), &RuleProps{ EventPattern: &EventPattern{ Source: []*string{ jsii.String("aws.ec2"), }, }, }) queue := sqs.NewQueue(this, jsii.String("Queue")) rule.AddTarget(targets.NewLambdaFunction(fn, &LambdaFunctionProps{ DeadLetterQueue: queue, // Optional: add a dead letter queue MaxEventAge: cdk.Duration_Hours(jsii.Number(2)), // Optional: set the maxEventAge retry policy RetryAttempts: jsii.Number(2), }))
Experimental.
type FunctionUrl ¶
type FunctionUrl interface { awscdk.Resource IFunctionUrl // The environment this resource belongs to. // // For resources that are created and managed by the CDK // (generally, those created by creating new class instances like Role, Bucket, etc.), // this is always the same as the environment of the stack they belong to; // however, for imported resources // (those obtained from static methods like fromRoleArn, fromBucketName, etc.), // that might be different than the stack they were imported into. // Experimental. Env() *awscdk.ResourceEnvironment // The ARN of the function this URL refers to. // Experimental. FunctionArn() *string // The construct tree node associated with this construct. // Experimental. Node() awscdk.ConstructNode // Returns a string-encoded token that resolves to the physical name that should be passed to the CloudFormation resource. // // This value will resolve to one of the following: // - a concrete value (e.g. `"my-awesome-bucket"`) // - `undefined`, when a name should be generated by CloudFormation // - a concrete name generated automatically during synthesis, in // cross-environment scenarios. // Experimental. PhysicalName() *string // The stack in which this resource is defined. // Experimental. Stack() awscdk.Stack // The url of the Lambda function. // Experimental. Url() *string // Apply the given removal policy to this resource. // // The Removal Policy controls what happens to this resource when it stops // being managed by CloudFormation, either because you've removed it from the // CDK application or because you've made a change that requires the resource // to be replaced. // // The resource can be deleted (`RemovalPolicy.DESTROY`), or left in your AWS // account for data recovery and cleanup later (`RemovalPolicy.RETAIN`). // Experimental. ApplyRemovalPolicy(policy awscdk.RemovalPolicy) // Experimental. GeneratePhysicalName() *string // Returns an environment-sensitive token that should be used for the resource's "ARN" attribute (e.g. `bucket.bucketArn`). // // Normally, this token will resolve to `arnAttr`, but if the resource is // referenced across environments, `arnComponents` will be used to synthesize // a concrete ARN with the resource's physical name. Make sure to reference // `this.physicalName` in `arnComponents`. // Experimental. GetResourceArnAttribute(arnAttr *string, arnComponents *awscdk.ArnComponents) *string // Returns an environment-sensitive token that should be used for the resource's "name" attribute (e.g. `bucket.bucketName`). // // Normally, this token will resolve to `nameAttr`, but if the resource is // referenced across environments, it will be resolved to `this.physicalName`, // which will be a concrete name. // Experimental. GetResourceNameAttribute(nameAttr *string) *string // Grant the given identity permissions to invoke this Lambda Function URL. // Experimental. GrantInvokeUrl(grantee awsiam.IGrantable) awsiam.Grant // Perform final modifications before synthesis. // // This method can be implemented by derived constructs in order to perform // final changes before synthesis. prepare() will be called after child // constructs have been prepared. // // This is an advanced framework feature. Only use this if you // understand the implications. // Experimental. OnPrepare() // Allows this construct to emit artifacts into the cloud assembly during synthesis. // // This method is usually implemented by framework-level constructs such as `Stack` and `Asset` // as they participate in synthesizing the cloud assembly. // Experimental. OnSynthesize(session constructs.ISynthesisSession) // Validate the current construct. // // This method can be implemented by derived constructs in order to perform // validation logic. It is called on all constructs before synthesis. // // Returns: An array of validation error messages, or an empty array if the construct is valid. // Experimental. OnValidate() *[]*string // Perform final modifications before synthesis. // // This method can be implemented by derived constructs in order to perform // final changes before synthesis. prepare() will be called after child // constructs have been prepared. // // This is an advanced framework feature. Only use this if you // understand the implications. // Experimental. Prepare() // Allows this construct to emit artifacts into the cloud assembly during synthesis. // // This method is usually implemented by framework-level constructs such as `Stack` and `Asset` // as they participate in synthesizing the cloud assembly. // Experimental. Synthesize(session awscdk.ISynthesisSession) // Returns a string representation of this construct. // Experimental. ToString() *string // Validate the current construct. // // This method can be implemented by derived constructs in order to perform // validation logic. It is called on all constructs before synthesis. // // Returns: An array of validation error messages, or an empty array if the construct is valid. // Experimental. Validate() *[]*string }
Defines a Lambda function url.
Example:
// Can be a Function or an Alias var fn function var myRole role fnUrl := fn.AddFunctionUrl() fnUrl.GrantInvokeUrl(myRole) awscdk.NewCfnOutput(this, jsii.String("TheUrl"), &CfnOutputProps{ // The .url attributes will return the unique Function URL Value: fnUrl.Url, })
Experimental.
func NewFunctionUrl ¶
func NewFunctionUrl(scope constructs.Construct, id *string, props *FunctionUrlProps) FunctionUrl
Experimental.
type FunctionUrlAuthType ¶
type FunctionUrlAuthType string
The auth types for a function url.
Example:
// Can be a Function or an Alias var fn function fnUrl := fn.AddFunctionUrl(&FunctionUrlOptions{ AuthType: lambda.FunctionUrlAuthType_NONE, }) awscdk.NewCfnOutput(this, jsii.String("TheUrl"), &CfnOutputProps{ Value: fnUrl.Url, })
Experimental.
const ( // Restrict access to authenticated IAM users only. // Experimental. FunctionUrlAuthType_AWS_IAM FunctionUrlAuthType = "AWS_IAM" // Bypass IAM authentication to create a public endpoint. // Experimental. FunctionUrlAuthType_NONE FunctionUrlAuthType = "NONE" )
type FunctionUrlCorsOptions ¶
type FunctionUrlCorsOptions struct { // Whether to allow cookies or other credentials in requests to your function URL. // Experimental. AllowCredentials *bool `field:"optional" json:"allowCredentials" yaml:"allowCredentials"` // Headers that are specified in the Access-Control-Request-Headers header. // Experimental. AllowedHeaders *[]*string `field:"optional" json:"allowedHeaders" yaml:"allowedHeaders"` // An HTTP method that you allow the origin to execute. // Experimental. AllowedMethods *[]HttpMethod `field:"optional" json:"allowedMethods" yaml:"allowedMethods"` // One or more origins you want customers to be able to access the bucket from. // Experimental. AllowedOrigins *[]*string `field:"optional" json:"allowedOrigins" yaml:"allowedOrigins"` // One or more headers in the response that you want customers to be able to access from their applications. // Experimental. ExposedHeaders *[]*string `field:"optional" json:"exposedHeaders" yaml:"exposedHeaders"` // The time in seconds that your browser is to cache the preflight response for the specified resource. // Experimental. MaxAge awscdk.Duration `field:"optional" json:"maxAge" yaml:"maxAge"` }
Specifies a cross-origin access property for a function URL.
Example:
var fn function fn.AddFunctionUrl(&FunctionUrlOptions{ AuthType: lambda.FunctionUrlAuthType_NONE, Cors: &FunctionUrlCorsOptions{ // Allow this to be called from websites on https://example.com. // Can also be ['*'] to allow all domain. AllowedOrigins: []*string{ jsii.String("https://example.com"), }, }, })
Experimental.
type FunctionUrlOptions ¶
type FunctionUrlOptions struct { // The type of authentication that your function URL uses. // Experimental. AuthType FunctionUrlAuthType `field:"optional" json:"authType" yaml:"authType"` // The cross-origin resource sharing (CORS) settings for your function URL. // Experimental. Cors *FunctionUrlCorsOptions `field:"optional" json:"cors" yaml:"cors"` }
Options to add a url to a Lambda function.
Example:
// Can be a Function or an Alias var fn function fnUrl := fn.AddFunctionUrl(&FunctionUrlOptions{ AuthType: lambda.FunctionUrlAuthType_NONE, }) awscdk.NewCfnOutput(this, jsii.String("TheUrl"), &CfnOutputProps{ Value: fnUrl.Url, })
Experimental.
type FunctionUrlProps ¶
type FunctionUrlProps struct { // The type of authentication that your function URL uses. // Experimental. AuthType FunctionUrlAuthType `field:"optional" json:"authType" yaml:"authType"` // The cross-origin resource sharing (CORS) settings for your function URL. // Experimental. Cors *FunctionUrlCorsOptions `field:"optional" json:"cors" yaml:"cors"` // The function to which this url refers. // // It can also be an `Alias` but not a `Version`. // Experimental. Function IFunction `field:"required" json:"function" yaml:"function"` }
Properties for a FunctionUrl.
Example:
// The code below shows an example of how to instantiate this type. // The values are placeholders you should change. import monocdk "github.com/aws/aws-cdk-go/awscdk" import "github.com/aws/aws-cdk-go/awscdk" var duration duration var function_ function functionUrlProps := &FunctionUrlProps{ Function: function_, // the properties below are optional AuthType: awscdk.Aws_lambda.FunctionUrlAuthType_AWS_IAM, Cors: &FunctionUrlCorsOptions{ AllowCredentials: jsii.Boolean(false), AllowedHeaders: []*string{ jsii.String("allowedHeaders"), }, AllowedMethods: []httpMethod{ awscdk.*Aws_lambda.*httpMethod_GET, }, AllowedOrigins: []*string{ jsii.String("allowedOrigins"), }, ExposedHeaders: []*string{ jsii.String("exposedHeaders"), }, MaxAge: duration, }, }
Experimental.
type FunctionVersionUpgrade ¶
type FunctionVersionUpgrade interface { awscdk.IAspect // All aspects can visit an IConstruct. // Experimental. Visit(node awscdk.IConstruct) }
Aspect for upgrading function versions when the feature flag provided feature flag present.
This can be necessary when the feature flag changes the function hash, as such changes must be associated with a new version. This aspect will change the function description in these cases, which "validates" the new function hash.
Example:
stack := awscdk.Newstack() awscdk.Aspects_Of(stack).Add(lambda.NewFunctionVersionUpgrade(monocdkcxapi.LAMBDA_RECOGNIZE_VERSION_PROPS))
Experimental.
func NewFunctionVersionUpgrade ¶
func NewFunctionVersionUpgrade(featureFlag *string, enabled *bool) FunctionVersionUpgrade
Experimental.
type HttpMethod ¶
type HttpMethod string
All http request methods. Experimental.
const ( // The GET method requests a representation of the specified resource. // Experimental. HttpMethod_GET HttpMethod = "GET" // The PUT method replaces all current representations of the target resource with the request payload. // Experimental. HttpMethod_PUT HttpMethod = "PUT" // The HEAD method asks for a response identical to that of a GET request, but without the response body. // Experimental. HttpMethod_HEAD HttpMethod = "HEAD" // The POST method is used to submit an entity to the specified resource, often causing a change in state or side effects on the server. // Experimental. HttpMethod_POST HttpMethod = "POST" // The DELETE method deletes the specified resource. // Experimental. HttpMethod_DELETE HttpMethod = "DELETE" // The PATCH method applies partial modifications to a resource. // Experimental. HttpMethod_PATCH HttpMethod = "PATCH" // The OPTIONS method describes the communication options for the target resource. // Experimental. HttpMethod_OPTIONS HttpMethod = "OPTIONS" // The wildcard entry to allow all methods. // Experimental. HttpMethod_ALL HttpMethod = "ALL" )
type IAlias ¶
type IAlias interface { IFunction // Name of this alias. // Experimental. AliasName() *string // The underlying Lambda function version. // Experimental. Version() IVersion }
Experimental.
func Alias_FromAliasAttributes ¶
func Alias_FromAliasAttributes(scope constructs.Construct, id *string, attrs *AliasAttributes) IAlias
Experimental.
type ICodeSigningConfig ¶
type ICodeSigningConfig interface { awscdk.IResource // The ARN of Code Signing Config. // Experimental. CodeSigningConfigArn() *string // The id of Code Signing Config. // Experimental. CodeSigningConfigId() *string }
A Code Signing Config. Experimental.
func CodeSigningConfig_FromCodeSigningConfigArn ¶
func CodeSigningConfig_FromCodeSigningConfigArn(scope constructs.Construct, id *string, codeSigningConfigArn *string) ICodeSigningConfig
Creates a Signing Profile construct that represents an external Signing Profile. Experimental.
type IDestination ¶
type IDestination interface { // Binds this destination to the Lambda function. // Experimental. Bind(scope awscdk.Construct, fn IFunction, options *DestinationOptions) *DestinationConfig }
A Lambda destination. Experimental.
type IEventSource ¶
type IEventSource interface { // Called by `lambda.addEventSource` to allow the event source to bind to this function. // Experimental. Bind(target IFunction) }
An abstract class which represents an AWS Lambda event source. Experimental.
type IEventSourceDlq ¶
type IEventSourceDlq interface { // Returns the DLQ destination config of the DLQ. // Experimental. Bind(target IEventSourceMapping, targetHandler IFunction) *DlqDestinationConfig }
A DLQ for an event source. Experimental.
type IEventSourceMapping ¶
type IEventSourceMapping interface { awscdk.IResource // The identifier for this EventSourceMapping. // Experimental. EventSourceMappingId() *string }
Represents an event source mapping for a lambda function. See: https://docs.aws.amazon.com/lambda/latest/dg/invocation-eventsourcemapping.html
Experimental.
func EventSourceMapping_FromEventSourceMappingId ¶
func EventSourceMapping_FromEventSourceMappingId(scope constructs.Construct, id *string, eventSourceMappingId *string) IEventSourceMapping
Import an event source into this stack from its event source id. Experimental.
type IFunction ¶
type IFunction interface { awsec2.IConnectable awsiam.IGrantable awscdk.IResource // Adds an event source to this function. // // Event sources are implemented in the @aws-cdk/aws-lambda-event-sources module. // // The following example adds an SQS Queue as an event source: // “` // import { SqsEventSource } from '@aws-cdk/aws-lambda-event-sources'; // myFunction.addEventSource(new SqsEventSource(myQueue)); // “`. // Experimental. AddEventSource(source IEventSource) // Adds an event source that maps to this AWS Lambda function. // Experimental. AddEventSourceMapping(id *string, options *EventSourceMappingOptions) EventSourceMapping // Adds a url to this lambda function. // Experimental. AddFunctionUrl(options *FunctionUrlOptions) FunctionUrl // Adds a permission to the Lambda resource policy. // See: Permission for details. // // Experimental. AddPermission(id *string, permission *Permission) // Adds a statement to the IAM role assumed by the instance. // Experimental. AddToRolePolicy(statement awsiam.PolicyStatement) // Configures options for asynchronous invocation. // Experimental. ConfigureAsyncInvoke(options *EventInvokeConfigOptions) // Grant the given identity permissions to invoke this Lambda. // Experimental. GrantInvoke(identity awsiam.IGrantable) awsiam.Grant // Grant the given identity permissions to invoke this Lambda Function URL. // Experimental. GrantInvokeUrl(identity awsiam.IGrantable) awsiam.Grant // Return the given named metric for this Lambda Return the given named metric for this Function. // Experimental. Metric(metricName *string, props *awscloudwatch.MetricOptions) awscloudwatch.Metric // Metric for the Duration of this Lambda How long execution of this Lambda takes. // // Average over 5 minutes. // Experimental. MetricDuration(props *awscloudwatch.MetricOptions) awscloudwatch.Metric // How many invocations of this Lambda fail. // // Sum over 5 minutes. // Experimental. MetricErrors(props *awscloudwatch.MetricOptions) awscloudwatch.Metric // Metric for the number of invocations of this Lambda How often this Lambda is invoked. // // Sum over 5 minutes. // Experimental. MetricInvocations(props *awscloudwatch.MetricOptions) awscloudwatch.Metric // Metric for the number of throttled invocations of this Lambda How often this Lambda is throttled. // // Sum over 5 minutes. // Experimental. MetricThrottles(props *awscloudwatch.MetricOptions) awscloudwatch.Metric // The system architectures compatible with this lambda function. // Experimental. Architecture() Architecture // The ARN of the function. // Experimental. FunctionArn() *string // The name of the function. // Experimental. FunctionName() *string // Whether or not this Lambda function was bound to a VPC. // // If this is is `false`, trying to access the `connections` object will fail. // Experimental. IsBoundToVpc() *bool // The `$LATEST` version of this function. // // Note that this is reference to a non-specific AWS Lambda version, which // means the function this version refers to can return different results in // different invocations. // // To obtain a reference to an explicit version which references the current // function configuration, use `lambdaFunction.currentVersion` instead. // Experimental. LatestVersion() IVersion // The construct node where permissions are attached. // Experimental. PermissionsNode() awscdk.ConstructNode // The ARN(s) to put into the resource field of the generated IAM policy for grantInvoke(). // // This property is for cdk modules to consume only. You should not need to use this property. // Instead, use grantInvoke() directly. // Experimental. ResourceArnsForGrantInvoke() *[]*string // The IAM role associated with this function. // Experimental. Role() awsiam.IRole }
Experimental.
func DockerImageFunction_FromFunctionArn ¶
func DockerImageFunction_FromFunctionArn(scope constructs.Construct, id *string, functionArn *string) IFunction
Import a lambda function into the CDK using its ARN. Experimental.
func DockerImageFunction_FromFunctionAttributes ¶
func DockerImageFunction_FromFunctionAttributes(scope constructs.Construct, id *string, attrs *FunctionAttributes) IFunction
Creates a Lambda function object which represents a function not defined within this stack. Experimental.
func DockerImageFunction_FromFunctionName ¶
func DockerImageFunction_FromFunctionName(scope constructs.Construct, id *string, functionName *string) IFunction
Import a lambda function into the CDK using its name. Experimental.
func Function_FromFunctionArn ¶
func Function_FromFunctionArn(scope constructs.Construct, id *string, functionArn *string) IFunction
Import a lambda function into the CDK using its ARN. Experimental.
func Function_FromFunctionAttributes ¶
func Function_FromFunctionAttributes(scope constructs.Construct, id *string, attrs *FunctionAttributes) IFunction
Creates a Lambda function object which represents a function not defined within this stack. Experimental.
func Function_FromFunctionName ¶
func Function_FromFunctionName(scope constructs.Construct, id *string, functionName *string) IFunction
Import a lambda function into the CDK using its name. Experimental.
type IFunctionUrl ¶
type IFunctionUrl interface { awscdk.IResource // Grant the given identity permissions to invoke this Lambda Function URL. // Experimental. GrantInvokeUrl(identity awsiam.IGrantable) awsiam.Grant // The ARN of the function this URL refers to. // Experimental. FunctionArn() *string // The url of the Lambda function. // Experimental. Url() *string }
A Lambda function Url. Experimental.
type ILayerVersion ¶
type ILayerVersion interface { awscdk.IResource // Add permission for this layer version to specific entities. // // Usage within // the same account where the layer is defined is always allowed and does not // require calling this method. Note that the principal that creates the // Lambda function using the layer (for example, a CloudFormation changeset // execution role) also needs to have the “lambda:GetLayerVersion“ // permission on the layer version. // Experimental. AddPermission(id *string, permission *LayerVersionPermission) // The runtimes compatible with this Layer. // Experimental. CompatibleRuntimes() *[]Runtime // The ARN of the Lambda Layer version that this Layer defines. // Experimental. LayerVersionArn() *string }
Experimental.
func LayerVersion_FromLayerVersionArn ¶
func LayerVersion_FromLayerVersionArn(scope constructs.Construct, id *string, layerVersionArn *string) ILayerVersion
Imports a layer version by ARN.
Assumes it is compatible with all Lambda runtimes. Experimental.
func LayerVersion_FromLayerVersionAttributes ¶
func LayerVersion_FromLayerVersionAttributes(scope constructs.Construct, id *string, attrs *LayerVersionAttributes) ILayerVersion
Imports a Layer that has been defined externally. Experimental.
type IScalableFunctionAttribute ¶
type IScalableFunctionAttribute interface { awscdk.IConstruct // Scale out or in based on schedule. // Experimental. ScaleOnSchedule(id *string, actions *awsapplicationautoscaling.ScalingSchedule) // Scale out or in to keep utilization at a given level. // // The utilization is tracked by the // LambdaProvisionedConcurrencyUtilization metric, emitted by lambda. See: // https://docs.aws.amazon.com/lambda/latest/dg/monitoring-metrics.html#monitoring-metrics-concurrency // Experimental. ScaleOnUtilization(options *UtilizationScalingOptions) }
Interface for scalable attributes. Experimental.
type IVersion ¶
type IVersion interface { IFunction // Defines an alias for this version. // Deprecated: Calling `addAlias` on a `Version` object will cause the Alias to be replaced on every function update. Call `function.addAlias()` or `new Alias()` instead. AddAlias(aliasName *string, options *AliasOptions) Alias // The ARN of the version for Lambda@Edge. // Experimental. EdgeArn() *string // The underlying AWS Lambda function. // Experimental. Lambda() IFunction // The most recently deployed version of this function. // Experimental. Version() *string }
Experimental.
func Version_FromVersionArn ¶
Construct a Version object from a Version ARN. Experimental.
func Version_FromVersionAttributes ¶
func Version_FromVersionAttributes(scope constructs.Construct, id *string, attrs *VersionAttributes) IVersion
Experimental.
type InlineCode ¶
type InlineCode interface { Code // Determines whether this Code is inline code or not. // Experimental. IsInline() *bool // Called when the lambda or layer is initialized to allow this object to bind to the stack, add resources and have fun. // Experimental. Bind(_scope awscdk.Construct) *CodeConfig // Called after the CFN function resource has been created to allow the code class to bind to it. // // Specifically it's required to allow assets to add // metadata for tooling like SAM CLI to be able to find their origins. // Experimental. BindToResource(_resource awscdk.CfnResource, _options *ResourceBindOptions) }
Lambda code from an inline string (limited to 4KiB).
Example:
layer := lambda.NewLayerVersion(stack, jsii.String("MyLayer"), &LayerVersionProps{ Code: lambda.Code_FromAsset(path.join(__dirname, jsii.String("layer-code"))), CompatibleRuntimes: []runtime{ lambda.*runtime_NODEJS_14_X(), }, License: jsii.String("Apache-2.0"), Description: jsii.String("A layer to test the L2 construct"), }) // To grant usage by other AWS accounts layer.addPermission(jsii.String("remote-account-grant"), &LayerVersionPermission{ AccountId: awsAccountId, }) // To grant usage to all accounts in some AWS Ogranization // layer.grantUsage({ accountId: '*', organizationId }); // To grant usage to all accounts in some AWS Ogranization // layer.grantUsage({ accountId: '*', organizationId }); lambda.NewFunction(stack, jsii.String("MyLayeredLambda"), &FunctionProps{ Code: lambda.NewInlineCode(jsii.String("foo")), Handler: jsii.String("index.handler"), Runtime: lambda.*runtime_NODEJS_14_X(), Layers: []iLayerVersion{ layer, }, })
Experimental.
func AssetCode_FromInline ¶
func AssetCode_FromInline(code *string) InlineCode
Inline code for Lambda handler.
Returns: `LambdaInlineCode` with inline code. Experimental.
func AssetCode_Inline ¶
func AssetCode_Inline(code *string) InlineCode
DEPRECATED. Deprecated: use `fromInline`.
func AssetImageCode_FromInline ¶
func AssetImageCode_FromInline(code *string) InlineCode
Inline code for Lambda handler.
Returns: `LambdaInlineCode` with inline code. Experimental.
func AssetImageCode_Inline ¶
func AssetImageCode_Inline(code *string) InlineCode
DEPRECATED. Deprecated: use `fromInline`.
func CfnParametersCode_FromInline ¶
func CfnParametersCode_FromInline(code *string) InlineCode
Inline code for Lambda handler.
Returns: `LambdaInlineCode` with inline code. Experimental.
func CfnParametersCode_Inline ¶
func CfnParametersCode_Inline(code *string) InlineCode
DEPRECATED. Deprecated: use `fromInline`.
func Code_FromInline ¶
func Code_FromInline(code *string) InlineCode
Inline code for Lambda handler.
Returns: `LambdaInlineCode` with inline code. Experimental.
func Code_Inline ¶
func Code_Inline(code *string) InlineCode
DEPRECATED. Deprecated: use `fromInline`.
func EcrImageCode_FromInline ¶
func EcrImageCode_FromInline(code *string) InlineCode
Inline code for Lambda handler.
Returns: `LambdaInlineCode` with inline code. Experimental.
func EcrImageCode_Inline ¶
func EcrImageCode_Inline(code *string) InlineCode
DEPRECATED. Deprecated: use `fromInline`.
func InlineCode_FromInline ¶
func InlineCode_FromInline(code *string) InlineCode
Inline code for Lambda handler.
Returns: `LambdaInlineCode` with inline code. Experimental.
func InlineCode_Inline ¶
func InlineCode_Inline(code *string) InlineCode
DEPRECATED. Deprecated: use `fromInline`.
func S3Code_FromInline ¶
func S3Code_FromInline(code *string) InlineCode
Inline code for Lambda handler.
Returns: `LambdaInlineCode` with inline code. Experimental.
func S3Code_Inline ¶
func S3Code_Inline(code *string) InlineCode
DEPRECATED. Deprecated: use `fromInline`.
type LambdaInsightsVersion ¶
type LambdaInsightsVersion interface { // The arn of the Lambda Insights extension. // Experimental. LayerVersionArn() *string }
Version of CloudWatch Lambda Insights.
Example:
layerArn := "arn:aws:lambda:us-east-1:580247275435:layer:LambdaInsightsExtension:14" lambda.NewFunction(this, jsii.String("MyFunction"), &FunctionProps{ Runtime: lambda.Runtime_NODEJS_16_X(), Handler: jsii.String("index.handler"), Code: lambda.Code_FromAsset(path.join(__dirname, jsii.String("lambda-handler"))), InsightsVersion: lambda.LambdaInsightsVersion_FromInsightVersionArn(layerArn), })
Experimental.
func LambdaInsightsVersion_FromInsightVersionArn ¶
func LambdaInsightsVersion_FromInsightVersionArn(arn *string) LambdaInsightsVersion
Use the insights extension associated with the provided ARN.
Make sure the ARN is associated with same region as your function. See: https://docs.aws.amazon.com/AmazonCloudWatch/latest/monitoring/Lambda-Insights-extension-versions.html
Experimental.
func LambdaInsightsVersion_VERSION_1_0_119_0 ¶
func LambdaInsightsVersion_VERSION_1_0_119_0() LambdaInsightsVersion
func LambdaInsightsVersion_VERSION_1_0_135_0 ¶
func LambdaInsightsVersion_VERSION_1_0_135_0() LambdaInsightsVersion
func LambdaInsightsVersion_VERSION_1_0_54_0 ¶
func LambdaInsightsVersion_VERSION_1_0_54_0() LambdaInsightsVersion
func LambdaInsightsVersion_VERSION_1_0_86_0 ¶
func LambdaInsightsVersion_VERSION_1_0_86_0() LambdaInsightsVersion
func LambdaInsightsVersion_VERSION_1_0_89_0 ¶
func LambdaInsightsVersion_VERSION_1_0_89_0() LambdaInsightsVersion
func LambdaInsightsVersion_VERSION_1_0_98_0 ¶
func LambdaInsightsVersion_VERSION_1_0_98_0() LambdaInsightsVersion
type LambdaRuntimeProps ¶
type LambdaRuntimeProps struct { // The Docker image name to be used for bundling in this runtime. // Experimental. BundlingDockerImage *string `field:"optional" json:"bundlingDockerImage" yaml:"bundlingDockerImage"` // Whether this runtime is integrated with and supported for profiling using Amazon CodeGuru Profiler. // Experimental. SupportsCodeGuruProfiling *bool `field:"optional" json:"supportsCodeGuruProfiling" yaml:"supportsCodeGuruProfiling"` // Whether the “ZipFile“ (aka inline code) property can be used with this runtime. // Experimental. SupportsInlineCode *bool `field:"optional" json:"supportsInlineCode" yaml:"supportsInlineCode"` }
Example:
// The code below shows an example of how to instantiate this type. // The values are placeholders you should change. import "github.com/aws/aws-cdk-go/awscdk" lambdaRuntimeProps := &LambdaRuntimeProps{ BundlingDockerImage: jsii.String("bundlingDockerImage"), SupportsCodeGuruProfiling: jsii.Boolean(false), SupportsInlineCode: jsii.Boolean(false), }
Experimental.
type LayerVersion ¶
type LayerVersion interface { awscdk.Resource ILayerVersion // The runtimes compatible with this Layer. // Experimental. CompatibleRuntimes() *[]Runtime // The environment this resource belongs to. // // For resources that are created and managed by the CDK // (generally, those created by creating new class instances like Role, Bucket, etc.), // this is always the same as the environment of the stack they belong to; // however, for imported resources // (those obtained from static methods like fromRoleArn, fromBucketName, etc.), // that might be different than the stack they were imported into. // Experimental. Env() *awscdk.ResourceEnvironment // The ARN of the Lambda Layer version that this Layer defines. // Experimental. LayerVersionArn() *string // The construct tree node associated with this construct. // Experimental. Node() awscdk.ConstructNode // Returns a string-encoded token that resolves to the physical name that should be passed to the CloudFormation resource. // // This value will resolve to one of the following: // - a concrete value (e.g. `"my-awesome-bucket"`) // - `undefined`, when a name should be generated by CloudFormation // - a concrete name generated automatically during synthesis, in // cross-environment scenarios. // Experimental. PhysicalName() *string // The stack in which this resource is defined. // Experimental. Stack() awscdk.Stack // Add permission for this layer version to specific entities. // // Usage within // the same account where the layer is defined is always allowed and does not // require calling this method. Note that the principal that creates the // Lambda function using the layer (for example, a CloudFormation changeset // execution role) also needs to have the “lambda:GetLayerVersion“ // permission on the layer version. // Experimental. AddPermission(id *string, permission *LayerVersionPermission) // Apply the given removal policy to this resource. // // The Removal Policy controls what happens to this resource when it stops // being managed by CloudFormation, either because you've removed it from the // CDK application or because you've made a change that requires the resource // to be replaced. // // The resource can be deleted (`RemovalPolicy.DESTROY`), or left in your AWS // account for data recovery and cleanup later (`RemovalPolicy.RETAIN`). // Experimental. ApplyRemovalPolicy(policy awscdk.RemovalPolicy) // Experimental. GeneratePhysicalName() *string // Returns an environment-sensitive token that should be used for the resource's "ARN" attribute (e.g. `bucket.bucketArn`). // // Normally, this token will resolve to `arnAttr`, but if the resource is // referenced across environments, `arnComponents` will be used to synthesize // a concrete ARN with the resource's physical name. Make sure to reference // `this.physicalName` in `arnComponents`. // Experimental. GetResourceArnAttribute(arnAttr *string, arnComponents *awscdk.ArnComponents) *string // Returns an environment-sensitive token that should be used for the resource's "name" attribute (e.g. `bucket.bucketName`). // // Normally, this token will resolve to `nameAttr`, but if the resource is // referenced across environments, it will be resolved to `this.physicalName`, // which will be a concrete name. // Experimental. GetResourceNameAttribute(nameAttr *string) *string // Perform final modifications before synthesis. // // This method can be implemented by derived constructs in order to perform // final changes before synthesis. prepare() will be called after child // constructs have been prepared. // // This is an advanced framework feature. Only use this if you // understand the implications. // Experimental. OnPrepare() // Allows this construct to emit artifacts into the cloud assembly during synthesis. // // This method is usually implemented by framework-level constructs such as `Stack` and `Asset` // as they participate in synthesizing the cloud assembly. // Experimental. OnSynthesize(session constructs.ISynthesisSession) // Validate the current construct. // // This method can be implemented by derived constructs in order to perform // validation logic. It is called on all constructs before synthesis. // // Returns: An array of validation error messages, or an empty array if the construct is valid. // Experimental. OnValidate() *[]*string // Perform final modifications before synthesis. // // This method can be implemented by derived constructs in order to perform // final changes before synthesis. prepare() will be called after child // constructs have been prepared. // // This is an advanced framework feature. Only use this if you // understand the implications. // Experimental. Prepare() // Allows this construct to emit artifacts into the cloud assembly during synthesis. // // This method is usually implemented by framework-level constructs such as `Stack` and `Asset` // as they participate in synthesizing the cloud assembly. // Experimental. Synthesize(session awscdk.ISynthesisSession) // Returns a string representation of this construct. // Experimental. ToString() *string // Validate the current construct. // // This method can be implemented by derived constructs in order to perform // validation logic. It is called on all constructs before synthesis. // // Returns: An array of validation error messages, or an empty array if the construct is valid. // Experimental. Validate() *[]*string }
Defines a new Lambda Layer version.
Example:
lambda.NewLayerVersion(this, jsii.String("MyLayer"), &LayerVersionProps{ RemovalPolicy: awscdk.RemovalPolicy_RETAIN, Code: lambda.Code_FromAsset(path.join(__dirname, jsii.String("lambda-handler"))), CompatibleArchitectures: []architecture{ lambda.*architecture_X86_64(), lambda.*architecture_ARM_64(), }, })
Experimental.
func NewLayerVersion ¶
func NewLayerVersion(scope constructs.Construct, id *string, props *LayerVersionProps) LayerVersion
Experimental.
type LayerVersionAttributes ¶
type LayerVersionAttributes struct { // The ARN of the LayerVersion. // Experimental. LayerVersionArn *string `field:"required" json:"layerVersionArn" yaml:"layerVersionArn"` // The list of compatible runtimes with this Layer. // Experimental. CompatibleRuntimes *[]Runtime `field:"optional" json:"compatibleRuntimes" yaml:"compatibleRuntimes"` }
Properties necessary to import a LayerVersion.
Example:
// The code below shows an example of how to instantiate this type. // The values are placeholders you should change. import "github.com/aws/aws-cdk-go/awscdk" var runtime runtime layerVersionAttributes := &LayerVersionAttributes{ LayerVersionArn: jsii.String("layerVersionArn"), // the properties below are optional CompatibleRuntimes: []*runtime{ runtime, }, }
Experimental.
type LayerVersionOptions ¶
type LayerVersionOptions struct { // The description the this Lambda Layer. // Experimental. Description *string `field:"optional" json:"description" yaml:"description"` // The name of the layer. // Experimental. LayerVersionName *string `field:"optional" json:"layerVersionName" yaml:"layerVersionName"` // The SPDX licence identifier or URL to the license file for this layer. // Experimental. License *string `field:"optional" json:"license" yaml:"license"` // Whether to retain this version of the layer when a new version is added or when the stack is deleted. // Experimental. RemovalPolicy awscdk.RemovalPolicy `field:"optional" json:"removalPolicy" yaml:"removalPolicy"` }
Non runtime options.
Example:
// The code below shows an example of how to instantiate this type. // The values are placeholders you should change. import monocdk "github.com/aws/aws-cdk-go/awscdk" import "github.com/aws/aws-cdk-go/awscdk" layerVersionOptions := &LayerVersionOptions{ Description: jsii.String("description"), LayerVersionName: jsii.String("layerVersionName"), License: jsii.String("license"), RemovalPolicy: monocdk.RemovalPolicy_DESTROY, }
Experimental.
type LayerVersionPermission ¶
type LayerVersionPermission struct { // The AWS Account id of the account that is authorized to use a Lambda Layer Version. // // The wild-card “'*'“ can be // used to grant access to "any" account (or any account in an organization when “organizationId“ is specified). // Experimental. AccountId *string `field:"required" json:"accountId" yaml:"accountId"` // The ID of the AWS Organization to which the grant is restricted. // // Can only be specified if “accountId“ is “'*'“. // Experimental. OrganizationId *string `field:"optional" json:"organizationId" yaml:"organizationId"` }
Identification of an account (or organization) that is allowed to access a Lambda Layer Version.
Example:
layer := lambda.NewLayerVersion(stack, jsii.String("MyLayer"), &LayerVersionProps{ Code: lambda.Code_FromAsset(path.join(__dirname, jsii.String("layer-code"))), CompatibleRuntimes: []runtime{ lambda.*runtime_NODEJS_14_X(), }, License: jsii.String("Apache-2.0"), Description: jsii.String("A layer to test the L2 construct"), }) // To grant usage by other AWS accounts layer.addPermission(jsii.String("remote-account-grant"), &LayerVersionPermission{ AccountId: awsAccountId, }) // To grant usage to all accounts in some AWS Ogranization // layer.grantUsage({ accountId: '*', organizationId }); // To grant usage to all accounts in some AWS Ogranization // layer.grantUsage({ accountId: '*', organizationId }); lambda.NewFunction(stack, jsii.String("MyLayeredLambda"), &FunctionProps{ Code: lambda.NewInlineCode(jsii.String("foo")), Handler: jsii.String("index.handler"), Runtime: lambda.*runtime_NODEJS_14_X(), Layers: []iLayerVersion{ layer, }, })
Experimental.
type LayerVersionProps ¶
type LayerVersionProps struct { // The description the this Lambda Layer. // Experimental. Description *string `field:"optional" json:"description" yaml:"description"` // The name of the layer. // Experimental. LayerVersionName *string `field:"optional" json:"layerVersionName" yaml:"layerVersionName"` // The SPDX licence identifier or URL to the license file for this layer. // Experimental. License *string `field:"optional" json:"license" yaml:"license"` // Whether to retain this version of the layer when a new version is added or when the stack is deleted. // Experimental. RemovalPolicy awscdk.RemovalPolicy `field:"optional" json:"removalPolicy" yaml:"removalPolicy"` // The content of this Layer. // // Using `Code.fromInline` is not supported. // Experimental. Code Code `field:"required" json:"code" yaml:"code"` // The system architectures compatible with this layer. // Experimental. CompatibleArchitectures *[]Architecture `field:"optional" json:"compatibleArchitectures" yaml:"compatibleArchitectures"` // The runtimes compatible with this Layer. // Experimental. CompatibleRuntimes *[]Runtime `field:"optional" json:"compatibleRuntimes" yaml:"compatibleRuntimes"` }
Example:
lambda.NewLayerVersion(this, jsii.String("MyLayer"), &LayerVersionProps{ RemovalPolicy: awscdk.RemovalPolicy_RETAIN, Code: lambda.Code_FromAsset(path.join(__dirname, jsii.String("lambda-handler"))), CompatibleArchitectures: []architecture{ lambda.*architecture_X86_64(), lambda.*architecture_ARM_64(), }, })
Experimental.
type LogRetention
deprecated
type LogRetention interface { awslogs.LogRetention // The ARN of the LogGroup. // Deprecated: use `LogRetention` from '. LogGroupArn() *string // The construct tree node associated with this construct. // Deprecated: use `LogRetention` from '. Node() awscdk.ConstructNode // Perform final modifications before synthesis. // // This method can be implemented by derived constructs in order to perform // final changes before synthesis. prepare() will be called after child // constructs have been prepared. // // This is an advanced framework feature. Only use this if you // understand the implications. // Deprecated: use `LogRetention` from '. OnPrepare() // Allows this construct to emit artifacts into the cloud assembly during synthesis. // // This method is usually implemented by framework-level constructs such as `Stack` and `Asset` // as they participate in synthesizing the cloud assembly. // Deprecated: use `LogRetention` from '. OnSynthesize(session constructs.ISynthesisSession) // Validate the current construct. // // This method can be implemented by derived constructs in order to perform // validation logic. It is called on all constructs before synthesis. // // Returns: An array of validation error messages, or an empty array if the construct is valid. // Deprecated: use `LogRetention` from '. OnValidate() *[]*string // Perform final modifications before synthesis. // // This method can be implemented by derived constructs in order to perform // final changes before synthesis. prepare() will be called after child // constructs have been prepared. // // This is an advanced framework feature. Only use this if you // understand the implications. // Deprecated: use `LogRetention` from '. Prepare() // Allows this construct to emit artifacts into the cloud assembly during synthesis. // // This method is usually implemented by framework-level constructs such as `Stack` and `Asset` // as they participate in synthesizing the cloud assembly. // Deprecated: use `LogRetention` from '. Synthesize(session awscdk.ISynthesisSession) // Returns a string representation of this construct. // Deprecated: use `LogRetention` from '. ToString() *string // Validate the current construct. // // This method can be implemented by derived constructs in order to perform // validation logic. It is called on all constructs before synthesis. // // Returns: An array of validation error messages, or an empty array if the construct is valid. // Deprecated: use `LogRetention` from '. Validate() *[]*string }
Creates a custom resource to control the retention policy of a CloudWatch Logs log group.
The log group is created if it doesn't already exist. The policy is removed when `retentionDays` is `undefined` or equal to `Infinity`.
Example:
// The code below shows an example of how to instantiate this type. // The values are placeholders you should change. import monocdk "github.com/aws/aws-cdk-go/awscdk" import "github.com/aws/aws-cdk-go/awscdk" import "github.com/aws/aws-cdk-go/awscdk" import "github.com/aws/aws-cdk-go/awscdk" var duration duration var role role logRetention := awscdk.Aws_lambda.NewLogRetention(this, jsii.String("MyLogRetention"), &LogRetentionProps{ LogGroupName: jsii.String("logGroupName"), Retention: awscdk.Aws_logs.RetentionDays_ONE_DAY, // the properties below are optional LogGroupRegion: jsii.String("logGroupRegion"), LogRetentionRetryOptions: &LogRetentionRetryOptions{ Base: duration, MaxRetries: jsii.Number(123), }, Role: role, })
Deprecated: use `LogRetention` from '.
func NewLogRetention
deprecated
func NewLogRetention(scope constructs.Construct, id *string, props *LogRetentionProps) LogRetention
Deprecated: use `LogRetention` from '.
type LogRetentionProps
deprecated
type LogRetentionProps struct { // The log group name. // Deprecated: use `LogRetentionProps` from '. LogGroupName *string `field:"required" json:"logGroupName" yaml:"logGroupName"` // The number of days log events are kept in CloudWatch Logs. // Deprecated: use `LogRetentionProps` from '. Retention awslogs.RetentionDays `field:"required" json:"retention" yaml:"retention"` // The region where the log group should be created. // Deprecated: use `LogRetentionProps` from '. LogGroupRegion *string `field:"optional" json:"logGroupRegion" yaml:"logGroupRegion"` // Retry options for all AWS API calls. // Deprecated: use `LogRetentionProps` from '. LogRetentionRetryOptions *awslogs.LogRetentionRetryOptions `field:"optional" json:"logRetentionRetryOptions" yaml:"logRetentionRetryOptions"` // The IAM role for the Lambda function associated with the custom resource. // Deprecated: use `LogRetentionProps` from '. Role awsiam.IRole `field:"optional" json:"role" yaml:"role"` }
Construction properties for a LogRetention.
Example:
// The code below shows an example of how to instantiate this type. // The values are placeholders you should change. import monocdk "github.com/aws/aws-cdk-go/awscdk" import "github.com/aws/aws-cdk-go/awscdk" import "github.com/aws/aws-cdk-go/awscdk" import "github.com/aws/aws-cdk-go/awscdk" var duration duration var role role logRetentionProps := &LogRetentionProps{ LogGroupName: jsii.String("logGroupName"), Retention: awscdk.Aws_logs.RetentionDays_ONE_DAY, // the properties below are optional LogGroupRegion: jsii.String("logGroupRegion"), LogRetentionRetryOptions: &LogRetentionRetryOptions{ Base: duration, MaxRetries: jsii.Number(123), }, Role: role, }
Deprecated: use `LogRetentionProps` from '.
type LogRetentionRetryOptions ¶
type LogRetentionRetryOptions struct { // The base duration to use in the exponential backoff for operation retries. // Experimental. Base awscdk.Duration `field:"optional" json:"base" yaml:"base"` // The maximum amount of retries. // Experimental. MaxRetries *float64 `field:"optional" json:"maxRetries" yaml:"maxRetries"` }
Retry options for all AWS API calls.
Example:
// The code below shows an example of how to instantiate this type. // The values are placeholders you should change. import monocdk "github.com/aws/aws-cdk-go/awscdk" import "github.com/aws/aws-cdk-go/awscdk" var duration duration logRetentionRetryOptions := &LogRetentionRetryOptions{ Base: duration, MaxRetries: jsii.Number(123), }
Experimental.
type Permission ¶
type Permission struct { // The entity for which you are granting permission to invoke the Lambda function. // // This entity can be any valid AWS service principal, such as // s3.amazonaws.com or sns.amazonaws.com, or, if you are granting // cross-account permission, an AWS account ID. For example, you might want // to allow a custom application in another AWS account to push events to // Lambda by invoking your function. // // The principal can be either an AccountPrincipal or a ServicePrincipal. // Experimental. Principal awsiam.IPrincipal `field:"required" json:"principal" yaml:"principal"` // The Lambda actions that you want to allow in this statement. // // For example, // you can specify lambda:CreateFunction to specify a certain action, or use // a wildcard (“lambda:*“) to grant permission to all Lambda actions. For a // list of actions, see Actions and Condition Context Keys for AWS Lambda in // the IAM User Guide. // Experimental. Action *string `field:"optional" json:"action" yaml:"action"` // A unique token that must be supplied by the principal invoking the function. // Experimental. EventSourceToken *string `field:"optional" json:"eventSourceToken" yaml:"eventSourceToken"` // The authType for the function URL that you are granting permissions for. // Experimental. FunctionUrlAuthType FunctionUrlAuthType `field:"optional" json:"functionUrlAuthType" yaml:"functionUrlAuthType"` // The scope to which the permission constructs be attached. // // The default is // the Lambda function construct itself, but this would need to be different // in cases such as cross-stack references where the Permissions would need // to sit closer to the consumer of this permission (i.e., the caller). // Experimental. Scope awscdk.Construct `field:"optional" json:"scope" yaml:"scope"` // The AWS account ID (without hyphens) of the source owner. // // For example, if // you specify an S3 bucket in the SourceArn property, this value is the // bucket owner's account ID. You can use this property to ensure that all // source principals are owned by a specific account. // Experimental. SourceAccount *string `field:"optional" json:"sourceAccount" yaml:"sourceAccount"` // The ARN of a resource that is invoking your function. // // When granting // Amazon Simple Storage Service (Amazon S3) permission to invoke your // function, specify this property with the bucket ARN as its value. This // ensures that events generated only from the specified bucket, not just // any bucket from any AWS account that creates a mapping to your function, // can invoke the function. // Experimental. SourceArn *string `field:"optional" json:"sourceArn" yaml:"sourceArn"` }
Represents a permission statement that can be added to a Lambda function's resource policy via the `addPermission()` method.
Example:
var fn function principal := iam.NewServicePrincipal(jsii.String("my-service")) fn.GrantInvoke(principal) // Equivalent to: fn.AddPermission(jsii.String("my-service Invocation"), &Permission{ Principal: principal, })
Experimental.
type QualifiedFunctionBase ¶
type QualifiedFunctionBase interface { FunctionBase // The architecture of this Lambda Function. // Experimental. Architecture() Architecture // Whether the addPermission() call adds any permissions. // // True for new Lambdas, false for version $LATEST and imported Lambdas // from different accounts. // Experimental. CanCreatePermissions() *bool // Access the Connections object. // // Will fail if not a VPC-enabled Lambda Function. // Experimental. Connections() awsec2.Connections // The environment this resource belongs to. // // For resources that are created and managed by the CDK // (generally, those created by creating new class instances like Role, Bucket, etc.), // this is always the same as the environment of the stack they belong to; // however, for imported resources // (those obtained from static methods like fromRoleArn, fromBucketName, etc.), // that might be different than the stack they were imported into. // Experimental. Env() *awscdk.ResourceEnvironment // The ARN fo the function. // Experimental. FunctionArn() *string // The name of the function. // Experimental. FunctionName() *string // The principal this Lambda Function is running as. // Experimental. GrantPrincipal() awsiam.IPrincipal // Whether or not this Lambda function was bound to a VPC. // // If this is is `false`, trying to access the `connections` object will fail. // Experimental. IsBoundToVpc() *bool // Experimental. Lambda() IFunction // The `$LATEST` version of this function. // // Note that this is reference to a non-specific AWS Lambda version, which // means the function this version refers to can return different results in // different invocations. // // To obtain a reference to an explicit version which references the current // function configuration, use `lambdaFunction.currentVersion` instead. // Experimental. LatestVersion() IVersion // The construct tree node associated with this construct. // Experimental. Node() awscdk.ConstructNode // The construct node where permissions are attached. // Experimental. PermissionsNode() awscdk.ConstructNode // Returns a string-encoded token that resolves to the physical name that should be passed to the CloudFormation resource. // // This value will resolve to one of the following: // - a concrete value (e.g. `"my-awesome-bucket"`) // - `undefined`, when a name should be generated by CloudFormation // - a concrete name generated automatically during synthesis, in // cross-environment scenarios. // Experimental. PhysicalName() *string // The qualifier of the version or alias of this function. // // A qualifier is the identifier that's appended to a version or alias ARN. // See: https://docs.aws.amazon.com/lambda/latest/dg/API_GetFunctionConfiguration.html#API_GetFunctionConfiguration_RequestParameters // // Experimental. Qualifier() *string // The ARN(s) to put into the resource field of the generated IAM policy for grantInvoke(). // Experimental. ResourceArnsForGrantInvoke() *[]*string // The IAM role associated with this function. // // Undefined if the function was imported without a role. // Experimental. Role() awsiam.IRole // The stack in which this resource is defined. // Experimental. Stack() awscdk.Stack // Adds an event source to this function. // // Event sources are implemented in the @aws-cdk/aws-lambda-event-sources module. // // The following example adds an SQS Queue as an event source: // “` // import { SqsEventSource } from '@aws-cdk/aws-lambda-event-sources'; // myFunction.addEventSource(new SqsEventSource(myQueue)); // “`. // Experimental. AddEventSource(source IEventSource) // Adds an event source that maps to this AWS Lambda function. // Experimental. AddEventSourceMapping(id *string, options *EventSourceMappingOptions) EventSourceMapping // Adds a url to this lambda function. // Experimental. AddFunctionUrl(options *FunctionUrlOptions) FunctionUrl // Adds a permission to the Lambda resource policy. // See: Permission for details. // // Experimental. AddPermission(id *string, permission *Permission) // Adds a statement to the IAM role assumed by the instance. // Experimental. AddToRolePolicy(statement awsiam.PolicyStatement) // Apply the given removal policy to this resource. // // The Removal Policy controls what happens to this resource when it stops // being managed by CloudFormation, either because you've removed it from the // CDK application or because you've made a change that requires the resource // to be replaced. // // The resource can be deleted (`RemovalPolicy.DESTROY`), or left in your AWS // account for data recovery and cleanup later (`RemovalPolicy.RETAIN`). // Experimental. ApplyRemovalPolicy(policy awscdk.RemovalPolicy) // Configures options for asynchronous invocation. // Experimental. ConfigureAsyncInvoke(options *EventInvokeConfigOptions) // A warning will be added to functions under the following conditions: - permissions that include `lambda:InvokeFunction` are added to the unqualified function. // // - function.currentVersion is invoked before or after the permission is created. // // This applies only to permissions on Lambda functions, not versions or aliases. // This function is overridden as a noOp for QualifiedFunctionBase. // Experimental. ConsiderWarningOnInvokeFunctionPermissions(_scope awscdk.Construct, _action *string) // Experimental. GeneratePhysicalName() *string // Returns an environment-sensitive token that should be used for the resource's "ARN" attribute (e.g. `bucket.bucketArn`). // // Normally, this token will resolve to `arnAttr`, but if the resource is // referenced across environments, `arnComponents` will be used to synthesize // a concrete ARN with the resource's physical name. Make sure to reference // `this.physicalName` in `arnComponents`. // Experimental. GetResourceArnAttribute(arnAttr *string, arnComponents *awscdk.ArnComponents) *string // Returns an environment-sensitive token that should be used for the resource's "name" attribute (e.g. `bucket.bucketName`). // // Normally, this token will resolve to `nameAttr`, but if the resource is // referenced across environments, it will be resolved to `this.physicalName`, // which will be a concrete name. // Experimental. GetResourceNameAttribute(nameAttr *string) *string // Grant the given identity permissions to invoke this Lambda. // Experimental. GrantInvoke(grantee awsiam.IGrantable) awsiam.Grant // Grant the given identity permissions to invoke this Lambda Function URL. // Experimental. GrantInvokeUrl(grantee awsiam.IGrantable) awsiam.Grant // Return the given named metric for this Function. // Experimental. Metric(metricName *string, props *awscloudwatch.MetricOptions) awscloudwatch.Metric // How long execution of this Lambda takes. // // Average over 5 minutes. // Experimental. MetricDuration(props *awscloudwatch.MetricOptions) awscloudwatch.Metric // How many invocations of this Lambda fail. // // Sum over 5 minutes. // Experimental. MetricErrors(props *awscloudwatch.MetricOptions) awscloudwatch.Metric // How often this Lambda is invoked. // // Sum over 5 minutes. // Experimental. MetricInvocations(props *awscloudwatch.MetricOptions) awscloudwatch.Metric // How often this Lambda is throttled. // // Sum over 5 minutes. // Experimental. MetricThrottles(props *awscloudwatch.MetricOptions) awscloudwatch.Metric // Perform final modifications before synthesis. // // This method can be implemented by derived constructs in order to perform // final changes before synthesis. prepare() will be called after child // constructs have been prepared. // // This is an advanced framework feature. Only use this if you // understand the implications. // Experimental. OnPrepare() // Allows this construct to emit artifacts into the cloud assembly during synthesis. // // This method is usually implemented by framework-level constructs such as `Stack` and `Asset` // as they participate in synthesizing the cloud assembly. // Experimental. OnSynthesize(session constructs.ISynthesisSession) // Validate the current construct. // // This method can be implemented by derived constructs in order to perform // validation logic. It is called on all constructs before synthesis. // // Returns: An array of validation error messages, or an empty array if the construct is valid. // Experimental. OnValidate() *[]*string // Perform final modifications before synthesis. // // This method can be implemented by derived constructs in order to perform // final changes before synthesis. prepare() will be called after child // constructs have been prepared. // // This is an advanced framework feature. Only use this if you // understand the implications. // Experimental. Prepare() // Allows this construct to emit artifacts into the cloud assembly during synthesis. // // This method is usually implemented by framework-level constructs such as `Stack` and `Asset` // as they participate in synthesizing the cloud assembly. // Experimental. Synthesize(session awscdk.ISynthesisSession) // Returns a string representation of this construct. // Experimental. ToString() *string // Validate the current construct. // // This method can be implemented by derived constructs in order to perform // validation logic. It is called on all constructs before synthesis. // // Returns: An array of validation error messages, or an empty array if the construct is valid. // Experimental. Validate() *[]*string // Experimental. WarnInvokeFunctionPermissions(scope awscdk.Construct) }
Experimental.
type ResourceBindOptions ¶
type ResourceBindOptions struct { // The name of the CloudFormation property to annotate with asset metadata. // See: https://github.com/aws/aws-cdk/issues/1432 // // Experimental. ResourceProperty *string `field:"optional" json:"resourceProperty" yaml:"resourceProperty"` }
Example:
// The code below shows an example of how to instantiate this type. // The values are placeholders you should change. import "github.com/aws/aws-cdk-go/awscdk" resourceBindOptions := &ResourceBindOptions{ ResourceProperty: jsii.String("resourceProperty"), }
Experimental.
type Runtime ¶
type Runtime interface { // DEPRECATED. // Deprecated: use `bundlingImage`. BundlingDockerImage() awscdk.BundlingDockerImage // The bundling Docker image for this runtime. // Experimental. BundlingImage() awscdk.DockerImage // The runtime family. // Experimental. Family() RuntimeFamily // The name of this runtime, as expected by the Lambda resource. // Experimental. Name() *string // Whether this runtime is integrated with and supported for profiling using Amazon CodeGuru Profiler. // Experimental. SupportsCodeGuruProfiling() *bool // Whether the “ZipFile“ (aka inline code) property can be used with this runtime. // Experimental. SupportsInlineCode() *bool // Experimental. RuntimeEquals(other Runtime) *bool // Experimental. ToString() *string }
Lambda function runtime environment.
If you need to use a runtime name that doesn't exist as a static member, you can instantiate a `Runtime` object, e.g: `new Runtime('nodejs99.99')`.
Example:
import "github.com/aws/aws-cdk-go/awscdk" signingProfile := signer.NewSigningProfile(this, jsii.String("SigningProfile"), &SigningProfileProps{ Platform: signer.Platform_AWS_LAMBDA_SHA384_ECDSA(), }) codeSigningConfig := lambda.NewCodeSigningConfig(this, jsii.String("CodeSigningConfig"), &CodeSigningConfigProps{ SigningProfiles: []iSigningProfile{ signingProfile, }, }) lambda.NewFunction(this, jsii.String("Function"), &FunctionProps{ CodeSigningConfig: CodeSigningConfig, Runtime: lambda.Runtime_NODEJS_16_X(), Handler: jsii.String("index.handler"), Code: lambda.Code_FromAsset(path.join(__dirname, jsii.String("lambda-handler"))), })
Experimental.
func NewRuntime ¶
func NewRuntime(name *string, family RuntimeFamily, props *LambdaRuntimeProps) Runtime
Experimental.
func Runtime_DOTNET_6 ¶
func Runtime_DOTNET_6() Runtime
func Runtime_DOTNET_CORE_1 ¶
func Runtime_DOTNET_CORE_1() Runtime
func Runtime_DOTNET_CORE_2 ¶
func Runtime_DOTNET_CORE_2() Runtime
func Runtime_DOTNET_CORE_2_1 ¶
func Runtime_DOTNET_CORE_2_1() Runtime
func Runtime_DOTNET_CORE_3_1 ¶
func Runtime_DOTNET_CORE_3_1() Runtime
func Runtime_FROM_IMAGE ¶
func Runtime_FROM_IMAGE() Runtime
func Runtime_GO_1_X ¶
func Runtime_GO_1_X() Runtime
func Runtime_JAVA_11 ¶
func Runtime_JAVA_11() Runtime
func Runtime_JAVA_8 ¶
func Runtime_JAVA_8() Runtime
func Runtime_JAVA_8_CORRETTO ¶
func Runtime_JAVA_8_CORRETTO() Runtime
func Runtime_NODEJS ¶
func Runtime_NODEJS() Runtime
func Runtime_NODEJS_10_X ¶
func Runtime_NODEJS_10_X() Runtime
func Runtime_NODEJS_12_X ¶
func Runtime_NODEJS_12_X() Runtime
func Runtime_NODEJS_14_X ¶
func Runtime_NODEJS_14_X() Runtime
func Runtime_NODEJS_16_X ¶
func Runtime_NODEJS_16_X() Runtime
func Runtime_NODEJS_4_3 ¶
func Runtime_NODEJS_4_3() Runtime
func Runtime_NODEJS_6_10 ¶
func Runtime_NODEJS_6_10() Runtime
func Runtime_NODEJS_8_10 ¶
func Runtime_NODEJS_8_10() Runtime
func Runtime_PROVIDED ¶
func Runtime_PROVIDED() Runtime
func Runtime_PROVIDED_AL2 ¶
func Runtime_PROVIDED_AL2() Runtime
func Runtime_PYTHON_2_7 ¶
func Runtime_PYTHON_2_7() Runtime
func Runtime_PYTHON_3_6 ¶
func Runtime_PYTHON_3_6() Runtime
func Runtime_PYTHON_3_7 ¶
func Runtime_PYTHON_3_7() Runtime
func Runtime_PYTHON_3_8 ¶
func Runtime_PYTHON_3_8() Runtime
func Runtime_PYTHON_3_9 ¶
func Runtime_PYTHON_3_9() Runtime
func Runtime_RUBY_2_5 ¶
func Runtime_RUBY_2_5() Runtime
func Runtime_RUBY_2_7 ¶
func Runtime_RUBY_2_7() Runtime
type RuntimeFamily ¶
type RuntimeFamily string
Experimental.
const ( // Experimental. RuntimeFamily_NODEJS RuntimeFamily = "NODEJS" // Experimental. RuntimeFamily_JAVA RuntimeFamily = "JAVA" // Experimental. RuntimeFamily_PYTHON RuntimeFamily = "PYTHON" // Experimental. RuntimeFamily_DOTNET_CORE RuntimeFamily = "DOTNET_CORE" // Experimental. RuntimeFamily_GO RuntimeFamily = "GO" // Experimental. RuntimeFamily_RUBY RuntimeFamily = "RUBY" // Experimental. RuntimeFamily_OTHER RuntimeFamily = "OTHER" )
type S3Code ¶
type S3Code interface { Code // Determines whether this Code is inline code or not. // Experimental. IsInline() *bool // Called when the lambda or layer is initialized to allow this object to bind to the stack, add resources and have fun. // Experimental. Bind(_scope awscdk.Construct) *CodeConfig // Called after the CFN function resource has been created to allow the code class to bind to it. // // Specifically it's required to allow assets to add // metadata for tooling like SAM CLI to be able to find their origins. // Experimental. BindToResource(_resource awscdk.CfnResource, _options *ResourceBindOptions) }
Lambda code from an S3 archive.
Example:
// The code below shows an example of how to instantiate this type. // The values are placeholders you should change. import "github.com/aws/aws-cdk-go/awscdk" import "github.com/aws/aws-cdk-go/awscdk" var bucket bucket s3Code := awscdk.Aws_lambda.NewS3Code(bucket, jsii.String("key"), jsii.String("objectVersion"))
Experimental.
func AssetCode_Bucket ¶
DEPRECATED. Deprecated: use `fromBucket`.
func AssetCode_FromBucket ¶
Lambda handler code as an S3 object. Experimental.
func AssetImageCode_Bucket ¶
DEPRECATED. Deprecated: use `fromBucket`.
func AssetImageCode_FromBucket ¶
Lambda handler code as an S3 object. Experimental.
func CfnParametersCode_Bucket ¶
DEPRECATED. Deprecated: use `fromBucket`.
func CfnParametersCode_FromBucket ¶
Lambda handler code as an S3 object. Experimental.
func Code_Bucket ¶
DEPRECATED. Deprecated: use `fromBucket`.
func Code_FromBucket ¶
Lambda handler code as an S3 object. Experimental.
func EcrImageCode_Bucket ¶
DEPRECATED. Deprecated: use `fromBucket`.
func EcrImageCode_FromBucket ¶
Lambda handler code as an S3 object. Experimental.
func InlineCode_Bucket ¶
DEPRECATED. Deprecated: use `fromBucket`.
func InlineCode_FromBucket ¶
Lambda handler code as an S3 object. Experimental.
func S3Code_Bucket ¶
DEPRECATED. Deprecated: use `fromBucket`.
type SingletonFunction ¶
type SingletonFunction interface { FunctionBase // The architecture of this Lambda Function. // Experimental. Architecture() Architecture // Whether the addPermission() call adds any permissions. // // True for new Lambdas, false for version $LATEST and imported Lambdas // from different accounts. // Experimental. CanCreatePermissions() *bool // Access the Connections object. // // Will fail if not a VPC-enabled Lambda Function. // Experimental. Connections() awsec2.Connections // Returns a `lambda.Version` which represents the current version of this singleton Lambda function. A new version will be created every time the function's configuration changes. // // You can specify options for this version using the `currentVersionOptions` // prop when initializing the `lambda.SingletonFunction`. // Experimental. CurrentVersion() Version // The environment this resource belongs to. // // For resources that are created and managed by the CDK // (generally, those created by creating new class instances like Role, Bucket, etc.), // this is always the same as the environment of the stack they belong to; // however, for imported resources // (those obtained from static methods like fromRoleArn, fromBucketName, etc.), // that might be different than the stack they were imported into. // Experimental. Env() *awscdk.ResourceEnvironment // The ARN fo the function. // Experimental. FunctionArn() *string // The name of the function. // Experimental. FunctionName() *string // The principal this Lambda Function is running as. // Experimental. GrantPrincipal() awsiam.IPrincipal // Whether or not this Lambda function was bound to a VPC. // // If this is is `false`, trying to access the `connections` object will fail. // Experimental. IsBoundToVpc() *bool // The `$LATEST` version of this function. // // Note that this is reference to a non-specific AWS Lambda version, which // means the function this version refers to can return different results in // different invocations. // // To obtain a reference to an explicit version which references the current // function configuration, use `lambdaFunction.currentVersion` instead. // Experimental. LatestVersion() IVersion // The LogGroup where the Lambda function's logs are made available. // // If either `logRetention` is set or this property is called, a CloudFormation custom resource is added to the stack that // pre-creates the log group as part of the stack deployment, if it already doesn't exist, and sets the correct log retention // period (never expire, by default). // // Further, if the log group already exists and the `logRetention` is not set, the custom resource will reset the log retention // to never expire even if it was configured with a different value. // Experimental. LogGroup() awslogs.ILogGroup // The construct tree node associated with this construct. // Experimental. Node() awscdk.ConstructNode // The construct node where permissions are attached. // Experimental. PermissionsNode() awscdk.ConstructNode // Returns a string-encoded token that resolves to the physical name that should be passed to the CloudFormation resource. // // This value will resolve to one of the following: // - a concrete value (e.g. `"my-awesome-bucket"`) // - `undefined`, when a name should be generated by CloudFormation // - a concrete name generated automatically during synthesis, in // cross-environment scenarios. // Experimental. PhysicalName() *string // The ARN(s) to put into the resource field of the generated IAM policy for grantInvoke(). // Experimental. ResourceArnsForGrantInvoke() *[]*string // The IAM role associated with this function. // // Undefined if the function was imported without a role. // Experimental. Role() awsiam.IRole // The runtime environment for the Lambda function. // Experimental. Runtime() Runtime // The stack in which this resource is defined. // Experimental. Stack() awscdk.Stack // Using node.addDependency() does not work on this method as the underlying lambda function is modeled as a singleton across the stack. Use this method instead to declare dependencies. // Experimental. AddDependency(up ...awscdk.IDependable) // Adds an environment variable to this Lambda function. // // If this is a ref to a Lambda function, this operation results in a no-op. // Experimental. AddEnvironment(key *string, value *string, options *EnvironmentOptions) Function // Adds an event source to this function. // // Event sources are implemented in the @aws-cdk/aws-lambda-event-sources module. // // The following example adds an SQS Queue as an event source: // “` // import { SqsEventSource } from '@aws-cdk/aws-lambda-event-sources'; // myFunction.addEventSource(new SqsEventSource(myQueue)); // “`. // Experimental. AddEventSource(source IEventSource) // Adds an event source that maps to this AWS Lambda function. // Experimental. AddEventSourceMapping(id *string, options *EventSourceMappingOptions) EventSourceMapping // Adds a url to this lambda function. // Experimental. AddFunctionUrl(options *FunctionUrlOptions) FunctionUrl // Adds one or more Lambda Layers to this Lambda function. // Experimental. AddLayers(layers ...ILayerVersion) // Adds a permission to the Lambda resource policy. // Experimental. AddPermission(name *string, permission *Permission) // Adds a statement to the IAM role assumed by the instance. // Experimental. AddToRolePolicy(statement awsiam.PolicyStatement) // Apply the given removal policy to this resource. // // The Removal Policy controls what happens to this resource when it stops // being managed by CloudFormation, either because you've removed it from the // CDK application or because you've made a change that requires the resource // to be replaced. // // The resource can be deleted (`RemovalPolicy.DESTROY`), or left in your AWS // account for data recovery and cleanup later (`RemovalPolicy.RETAIN`). // Experimental. ApplyRemovalPolicy(policy awscdk.RemovalPolicy) // Configures options for asynchronous invocation. // Experimental. ConfigureAsyncInvoke(options *EventInvokeConfigOptions) // A warning will be added to functions under the following conditions: - permissions that include `lambda:InvokeFunction` are added to the unqualified function. // // - function.currentVersion is invoked before or after the permission is created. // // This applies only to permissions on Lambda functions, not versions or aliases. // This function is overridden as a noOp for QualifiedFunctionBase. // Experimental. ConsiderWarningOnInvokeFunctionPermissions(scope awscdk.Construct, action *string) // The SingletonFunction construct cannot be added as a dependency of another construct using node.addDependency(). Use this method instead to declare this as a dependency of another construct. // Experimental. DependOn(down awscdk.IConstruct) // Experimental. GeneratePhysicalName() *string // Returns an environment-sensitive token that should be used for the resource's "ARN" attribute (e.g. `bucket.bucketArn`). // // Normally, this token will resolve to `arnAttr`, but if the resource is // referenced across environments, `arnComponents` will be used to synthesize // a concrete ARN with the resource's physical name. Make sure to reference // `this.physicalName` in `arnComponents`. // Experimental. GetResourceArnAttribute(arnAttr *string, arnComponents *awscdk.ArnComponents) *string // Returns an environment-sensitive token that should be used for the resource's "name" attribute (e.g. `bucket.bucketName`). // // Normally, this token will resolve to `nameAttr`, but if the resource is // referenced across environments, it will be resolved to `this.physicalName`, // which will be a concrete name. // Experimental. GetResourceNameAttribute(nameAttr *string) *string // Grant the given identity permissions to invoke this Lambda. // Experimental. GrantInvoke(grantee awsiam.IGrantable) awsiam.Grant // Grant the given identity permissions to invoke this Lambda Function URL. // Experimental. GrantInvokeUrl(grantee awsiam.IGrantable) awsiam.Grant // Return the given named metric for this Function. // Experimental. Metric(metricName *string, props *awscloudwatch.MetricOptions) awscloudwatch.Metric // How long execution of this Lambda takes. // // Average over 5 minutes. // Experimental. MetricDuration(props *awscloudwatch.MetricOptions) awscloudwatch.Metric // How many invocations of this Lambda fail. // // Sum over 5 minutes. // Experimental. MetricErrors(props *awscloudwatch.MetricOptions) awscloudwatch.Metric // How often this Lambda is invoked. // // Sum over 5 minutes. // Experimental. MetricInvocations(props *awscloudwatch.MetricOptions) awscloudwatch.Metric // How often this Lambda is throttled. // // Sum over 5 minutes. // Experimental. MetricThrottles(props *awscloudwatch.MetricOptions) awscloudwatch.Metric // Perform final modifications before synthesis. // // This method can be implemented by derived constructs in order to perform // final changes before synthesis. prepare() will be called after child // constructs have been prepared. // // This is an advanced framework feature. Only use this if you // understand the implications. // Experimental. OnPrepare() // Allows this construct to emit artifacts into the cloud assembly during synthesis. // // This method is usually implemented by framework-level constructs such as `Stack` and `Asset` // as they participate in synthesizing the cloud assembly. // Experimental. OnSynthesize(session constructs.ISynthesisSession) // Validate the current construct. // // This method can be implemented by derived constructs in order to perform // validation logic. It is called on all constructs before synthesis. // // Returns: An array of validation error messages, or an empty array if the construct is valid. // Experimental. OnValidate() *[]*string // Perform final modifications before synthesis. // // This method can be implemented by derived constructs in order to perform // final changes before synthesis. prepare() will be called after child // constructs have been prepared. // // This is an advanced framework feature. Only use this if you // understand the implications. // Experimental. Prepare() // Allows this construct to emit artifacts into the cloud assembly during synthesis. // // This method is usually implemented by framework-level constructs such as `Stack` and `Asset` // as they participate in synthesizing the cloud assembly. // Experimental. Synthesize(session awscdk.ISynthesisSession) // Returns a string representation of this construct. // Experimental. ToString() *string // Validate the current construct. // // This method can be implemented by derived constructs in order to perform // validation logic. It is called on all constructs before synthesis. // // Returns: An array of validation error messages, or an empty array if the construct is valid. // Experimental. Validate() *[]*string // Experimental. WarnInvokeFunctionPermissions(scope awscdk.Construct) }
A Lambda that will only ever be added to a stack once.
This construct is a way to guarantee that the lambda function will be guaranteed to be part of the stack, once and only once, irrespective of how many times the construct is declared to be part of the stack. This is guaranteed as long as the `uuid` property and the optional `lambdaPurpose` property stay the same whenever they're declared into the stack.
Example:
// The code below shows an example of how to instantiate this type. // The values are placeholders you should change. import monocdk "github.com/aws/aws-cdk-go/awscdk" import "github.com/aws/aws-cdk-go/awscdk" import "github.com/aws/aws-cdk-go/awscdk" import "github.com/aws/aws-cdk-go/awscdk" import "github.com/aws/aws-cdk-go/awscdk" import "github.com/aws/aws-cdk-go/awscdk" import "github.com/aws/aws-cdk-go/awscdk" import "github.com/aws/aws-cdk-go/awscdk" import "github.com/aws/aws-cdk-go/awscdk" var architecture architecture var code code var codeSigningConfig codeSigningConfig var destination iDestination var duration duration var eventSource iEventSource var fileSystem fileSystem var key key var lambdaInsightsVersion lambdaInsightsVersion var layerVersion layerVersion var policyStatement policyStatement var profilingGroup profilingGroup var queue queue var role role var runtime runtime var securityGroup securityGroup var size size var subnet subnet var subnetFilter subnetFilter var topic topic var vpc vpc singletonFunction := awscdk.Aws_lambda.NewSingletonFunction(this, jsii.String("MySingletonFunction"), &SingletonFunctionProps{ Code: code, Handler: jsii.String("handler"), Runtime: runtime, Uuid: jsii.String("uuid"), // the properties below are optional AllowAllOutbound: jsii.Boolean(false), AllowPublicSubnet: jsii.Boolean(false), Architecture: architecture, Architectures: []*architecture{ architecture, }, CodeSigningConfig: codeSigningConfig, CurrentVersionOptions: &VersionOptions{ CodeSha256: jsii.String("codeSha256"), Description: jsii.String("description"), MaxEventAge: duration, OnFailure: destination, OnSuccess: destination, ProvisionedConcurrentExecutions: jsii.Number(123), RemovalPolicy: monocdk.RemovalPolicy_DESTROY, RetryAttempts: jsii.Number(123), }, DeadLetterQueue: queue, DeadLetterQueueEnabled: jsii.Boolean(false), DeadLetterTopic: topic, Description: jsii.String("description"), Environment: map[string]*string{ "environmentKey": jsii.String("environment"), }, EnvironmentEncryption: key, EphemeralStorageSize: size, Events: []*iEventSource{ eventSource, }, Filesystem: fileSystem, FunctionName: jsii.String("functionName"), InitialPolicy: []*policyStatement{ policyStatement, }, InsightsVersion: lambdaInsightsVersion, LambdaPurpose: jsii.String("lambdaPurpose"), Layers: []iLayerVersion{ layerVersion, }, LogRetention: awscdk.Aws_logs.RetentionDays_ONE_DAY, LogRetentionRetryOptions: &LogRetentionRetryOptions{ Base: duration, MaxRetries: jsii.Number(123), }, LogRetentionRole: role, MaxEventAge: duration, MemorySize: jsii.Number(123), OnFailure: destination, OnSuccess: destination, Profiling: jsii.Boolean(false), ProfilingGroup: profilingGroup, ReservedConcurrentExecutions: jsii.Number(123), RetryAttempts: jsii.Number(123), Role: role, SecurityGroup: securityGroup, SecurityGroups: []iSecurityGroup{ securityGroup, }, Timeout: duration, Tracing: awscdk.*Aws_lambda.Tracing_ACTIVE, Vpc: vpc, VpcSubnets: &SubnetSelection{ AvailabilityZones: []*string{ jsii.String("availabilityZones"), }, OnePerAz: jsii.Boolean(false), SubnetFilters: []*subnetFilter{ subnetFilter, }, SubnetGroupName: jsii.String("subnetGroupName"), SubnetName: jsii.String("subnetName"), Subnets: []iSubnet{ subnet, }, SubnetType: awscdk.Aws_ec2.SubnetType_ISOLATED, }, })
Experimental.
func NewSingletonFunction ¶
func NewSingletonFunction(scope constructs.Construct, id *string, props *SingletonFunctionProps) SingletonFunction
Experimental.
type SingletonFunctionProps ¶
type SingletonFunctionProps struct { // The maximum age of a request that Lambda sends to a function for processing. // // Minimum: 60 seconds // Maximum: 6 hours. // Experimental. MaxEventAge awscdk.Duration `field:"optional" json:"maxEventAge" yaml:"maxEventAge"` // The destination for failed invocations. // Experimental. OnFailure IDestination `field:"optional" json:"onFailure" yaml:"onFailure"` // The destination for successful invocations. // Experimental. OnSuccess IDestination `field:"optional" json:"onSuccess" yaml:"onSuccess"` // The maximum number of times to retry when the function returns an error. // // Minimum: 0 // Maximum: 2. // Experimental. RetryAttempts *float64 `field:"optional" json:"retryAttempts" yaml:"retryAttempts"` // Whether to allow the Lambda to send all network traffic. // // If set to false, you must individually add traffic rules to allow the // Lambda to connect to network targets. // Experimental. AllowAllOutbound *bool `field:"optional" json:"allowAllOutbound" yaml:"allowAllOutbound"` // Lambda Functions in a public subnet can NOT access the internet. // // Use this property to acknowledge this limitation and still place the function in a public subnet. // See: https://stackoverflow.com/questions/52992085/why-cant-an-aws-lambda-function-inside-a-public-subnet-in-a-vpc-connect-to-the/52994841#52994841 // // Experimental. AllowPublicSubnet *bool `field:"optional" json:"allowPublicSubnet" yaml:"allowPublicSubnet"` // The system architectures compatible with this lambda function. // Experimental. Architecture Architecture `field:"optional" json:"architecture" yaml:"architecture"` // DEPRECATED. // Deprecated: use `architecture`. Architectures *[]Architecture `field:"optional" json:"architectures" yaml:"architectures"` // Code signing config associated with this function. // Experimental. CodeSigningConfig ICodeSigningConfig `field:"optional" json:"codeSigningConfig" yaml:"codeSigningConfig"` // Options for the `lambda.Version` resource automatically created by the `fn.currentVersion` method. // Experimental. CurrentVersionOptions *VersionOptions `field:"optional" json:"currentVersionOptions" yaml:"currentVersionOptions"` // The SQS queue to use if DLQ is enabled. // // If SNS topic is desired, specify `deadLetterTopic` property instead. // Experimental. DeadLetterQueue awssqs.IQueue `field:"optional" json:"deadLetterQueue" yaml:"deadLetterQueue"` // Enabled DLQ. // // If `deadLetterQueue` is undefined, // an SQS queue with default options will be defined for your Function. // Experimental. DeadLetterQueueEnabled *bool `field:"optional" json:"deadLetterQueueEnabled" yaml:"deadLetterQueueEnabled"` // The SNS topic to use as a DLQ. // // Note that if `deadLetterQueueEnabled` is set to `true`, an SQS queue will be created // rather than an SNS topic. Using an SNS topic as a DLQ requires this property to be set explicitly. // Experimental. DeadLetterTopic awssns.ITopic `field:"optional" json:"deadLetterTopic" yaml:"deadLetterTopic"` // A description of the function. // Experimental. Description *string `field:"optional" json:"description" yaml:"description"` // Key-value pairs that Lambda caches and makes available for your Lambda functions. // // Use environment variables to apply configuration changes, such // as test and production environment configurations, without changing your // Lambda function source code. // Experimental. Environment *map[string]*string `field:"optional" json:"environment" yaml:"environment"` // The AWS KMS key that's used to encrypt your function's environment variables. // Experimental. EnvironmentEncryption awskms.IKey `field:"optional" json:"environmentEncryption" yaml:"environmentEncryption"` // The size of the function’s /tmp directory in MiB. // Experimental. EphemeralStorageSize awscdk.Size `field:"optional" json:"ephemeralStorageSize" yaml:"ephemeralStorageSize"` // Event sources for this function. // // You can also add event sources using `addEventSource`. // Experimental. Events *[]IEventSource `field:"optional" json:"events" yaml:"events"` // The filesystem configuration for the lambda function. // Experimental. Filesystem FileSystem `field:"optional" json:"filesystem" yaml:"filesystem"` // A name for the function. // Experimental. FunctionName *string `field:"optional" json:"functionName" yaml:"functionName"` // Initial policy statements to add to the created Lambda Role. // // You can call `addToRolePolicy` to the created lambda to add statements post creation. // Experimental. InitialPolicy *[]awsiam.PolicyStatement `field:"optional" json:"initialPolicy" yaml:"initialPolicy"` // Specify the version of CloudWatch Lambda insights to use for monitoring. // See: https://docs.aws.amazon.com/AmazonCloudWatch/latest/monitoring/Lambda-Insights-Getting-Started-docker.html // // Experimental. InsightsVersion LambdaInsightsVersion `field:"optional" json:"insightsVersion" yaml:"insightsVersion"` // A list of layers to add to the function's execution environment. // // You can configure your Lambda function to pull in // additional code during initialization in the form of layers. Layers are packages of libraries or other dependencies // that can be used by multiple functions. // Experimental. Layers *[]ILayerVersion `field:"optional" json:"layers" yaml:"layers"` // The number of days log events are kept in CloudWatch Logs. // // When updating // this property, unsetting it doesn't remove the log retention policy. To // remove the retention policy, set the value to `INFINITE`. // Experimental. LogRetention awslogs.RetentionDays `field:"optional" json:"logRetention" yaml:"logRetention"` // When log retention is specified, a custom resource attempts to create the CloudWatch log group. // // These options control the retry policy when interacting with CloudWatch APIs. // Experimental. LogRetentionRetryOptions *LogRetentionRetryOptions `field:"optional" json:"logRetentionRetryOptions" yaml:"logRetentionRetryOptions"` // The IAM role for the Lambda function associated with the custom resource that sets the retention policy. // Experimental. LogRetentionRole awsiam.IRole `field:"optional" json:"logRetentionRole" yaml:"logRetentionRole"` // The amount of memory, in MB, that is allocated to your Lambda function. // // Lambda uses this value to proportionally allocate the amount of CPU // power. For more information, see Resource Model in the AWS Lambda // Developer Guide. // Experimental. MemorySize *float64 `field:"optional" json:"memorySize" yaml:"memorySize"` // Enable profiling. // See: https://docs.aws.amazon.com/codeguru/latest/profiler-ug/setting-up-lambda.html // // Experimental. Profiling *bool `field:"optional" json:"profiling" yaml:"profiling"` // Profiling Group. // See: https://docs.aws.amazon.com/codeguru/latest/profiler-ug/setting-up-lambda.html // // Experimental. ProfilingGroup awscodeguruprofiler.IProfilingGroup `field:"optional" json:"profilingGroup" yaml:"profilingGroup"` // The maximum of concurrent executions you want to reserve for the function. // See: https://docs.aws.amazon.com/lambda/latest/dg/concurrent-executions.html // // Experimental. ReservedConcurrentExecutions *float64 `field:"optional" json:"reservedConcurrentExecutions" yaml:"reservedConcurrentExecutions"` // Lambda execution role. // // This is the role that will be assumed by the function upon execution. // It controls the permissions that the function will have. The Role must // be assumable by the 'lambda.amazonaws.com' service principal. // // The default Role automatically has permissions granted for Lambda execution. If you // provide a Role, you must add the relevant AWS managed policies yourself. // // The relevant managed policies are "service-role/AWSLambdaBasicExecutionRole" and // "service-role/AWSLambdaVPCAccessExecutionRole". // Experimental. Role awsiam.IRole `field:"optional" json:"role" yaml:"role"` // What security group to associate with the Lambda's network interfaces. This property is being deprecated, consider using securityGroups instead. // // Only used if 'vpc' is supplied. // // Use securityGroups property instead. // Function constructor will throw an error if both are specified. // Deprecated: - This property is deprecated, use securityGroups instead. SecurityGroup awsec2.ISecurityGroup `field:"optional" json:"securityGroup" yaml:"securityGroup"` // The list of security groups to associate with the Lambda's network interfaces. // // Only used if 'vpc' is supplied. // Experimental. SecurityGroups *[]awsec2.ISecurityGroup `field:"optional" json:"securityGroups" yaml:"securityGroups"` // The function execution time (in seconds) after which Lambda terminates the function. // // Because the execution time affects cost, set this value // based on the function's expected execution time. // Experimental. Timeout awscdk.Duration `field:"optional" json:"timeout" yaml:"timeout"` // Enable AWS X-Ray Tracing for Lambda Function. // Experimental. Tracing Tracing `field:"optional" json:"tracing" yaml:"tracing"` // VPC network to place Lambda network interfaces. // // Specify this if the Lambda function needs to access resources in a VPC. // Experimental. Vpc awsec2.IVpc `field:"optional" json:"vpc" yaml:"vpc"` // Where to place the network interfaces within the VPC. // // Only used if 'vpc' is supplied. Note: internet access for Lambdas // requires a NAT gateway, so picking Public subnets is not allowed. // Experimental. VpcSubnets *awsec2.SubnetSelection `field:"optional" json:"vpcSubnets" yaml:"vpcSubnets"` // The source code of your Lambda function. // // You can point to a file in an // Amazon Simple Storage Service (Amazon S3) bucket or specify your source // code as inline text. // Experimental. Code Code `field:"required" json:"code" yaml:"code"` // The name of the method within your code that Lambda calls to execute your function. // // The format includes the file name. It can also include // namespaces and other qualifiers, depending on the runtime. // For more information, see https://docs.aws.amazon.com/lambda/latest/dg/gettingstarted-features.html#gettingstarted-features-programmingmodel. // // Use `Handler.FROM_IMAGE` when defining a function from a Docker image. // // NOTE: If you specify your source code as inline text by specifying the // ZipFile property within the Code property, specify index.function_name as // the handler. // Experimental. Handler *string `field:"required" json:"handler" yaml:"handler"` // The runtime environment for the Lambda function that you are uploading. // // For valid values, see the Runtime property in the AWS Lambda Developer // Guide. // // Use `Runtime.FROM_IMAGE` when when defining a function from a Docker image. // Experimental. Runtime Runtime `field:"required" json:"runtime" yaml:"runtime"` // A unique identifier to identify this lambda. // // The identifier should be unique across all custom resource providers. // We recommend generating a UUID per provider. // Experimental. Uuid *string `field:"required" json:"uuid" yaml:"uuid"` // A descriptive name for the purpose of this Lambda. // // If the Lambda does not have a physical name, this string will be // reflected its generated name. The combination of lambdaPurpose // and uuid must be unique. // Experimental. LambdaPurpose *string `field:"optional" json:"lambdaPurpose" yaml:"lambdaPurpose"` }
Properties for a newly created singleton Lambda.
Example:
// The code below shows an example of how to instantiate this type. // The values are placeholders you should change. import monocdk "github.com/aws/aws-cdk-go/awscdk" import "github.com/aws/aws-cdk-go/awscdk" import "github.com/aws/aws-cdk-go/awscdk" import "github.com/aws/aws-cdk-go/awscdk" import "github.com/aws/aws-cdk-go/awscdk" import "github.com/aws/aws-cdk-go/awscdk" import "github.com/aws/aws-cdk-go/awscdk" import "github.com/aws/aws-cdk-go/awscdk" import "github.com/aws/aws-cdk-go/awscdk" var architecture architecture var code code var codeSigningConfig codeSigningConfig var destination iDestination var duration duration var eventSource iEventSource var fileSystem fileSystem var key key var lambdaInsightsVersion lambdaInsightsVersion var layerVersion layerVersion var policyStatement policyStatement var profilingGroup profilingGroup var queue queue var role role var runtime runtime var securityGroup securityGroup var size size var subnet subnet var subnetFilter subnetFilter var topic topic var vpc vpc singletonFunctionProps := &SingletonFunctionProps{ Code: code, Handler: jsii.String("handler"), Runtime: runtime, Uuid: jsii.String("uuid"), // the properties below are optional AllowAllOutbound: jsii.Boolean(false), AllowPublicSubnet: jsii.Boolean(false), Architecture: architecture, Architectures: []*architecture{ architecture, }, CodeSigningConfig: codeSigningConfig, CurrentVersionOptions: &VersionOptions{ CodeSha256: jsii.String("codeSha256"), Description: jsii.String("description"), MaxEventAge: duration, OnFailure: destination, OnSuccess: destination, ProvisionedConcurrentExecutions: jsii.Number(123), RemovalPolicy: monocdk.RemovalPolicy_DESTROY, RetryAttempts: jsii.Number(123), }, DeadLetterQueue: queue, DeadLetterQueueEnabled: jsii.Boolean(false), DeadLetterTopic: topic, Description: jsii.String("description"), Environment: map[string]*string{ "environmentKey": jsii.String("environment"), }, EnvironmentEncryption: key, EphemeralStorageSize: size, Events: []*iEventSource{ eventSource, }, Filesystem: fileSystem, FunctionName: jsii.String("functionName"), InitialPolicy: []*policyStatement{ policyStatement, }, InsightsVersion: lambdaInsightsVersion, LambdaPurpose: jsii.String("lambdaPurpose"), Layers: []iLayerVersion{ layerVersion, }, LogRetention: awscdk.Aws_logs.RetentionDays_ONE_DAY, LogRetentionRetryOptions: &LogRetentionRetryOptions{ Base: duration, MaxRetries: jsii.Number(123), }, LogRetentionRole: role, MaxEventAge: duration, MemorySize: jsii.Number(123), OnFailure: destination, OnSuccess: destination, Profiling: jsii.Boolean(false), ProfilingGroup: profilingGroup, ReservedConcurrentExecutions: jsii.Number(123), RetryAttempts: jsii.Number(123), Role: role, SecurityGroup: securityGroup, SecurityGroups: []iSecurityGroup{ securityGroup, }, Timeout: duration, Tracing: awscdk.Aws_lambda.Tracing_ACTIVE, Vpc: vpc, VpcSubnets: &SubnetSelection{ AvailabilityZones: []*string{ jsii.String("availabilityZones"), }, OnePerAz: jsii.Boolean(false), SubnetFilters: []*subnetFilter{ subnetFilter, }, SubnetGroupName: jsii.String("subnetGroupName"), SubnetName: jsii.String("subnetName"), Subnets: []iSubnet{ subnet, }, SubnetType: awscdk.Aws_ec2.SubnetType_ISOLATED, }, }
Experimental.
type SourceAccessConfiguration ¶
type SourceAccessConfiguration struct { // The type of authentication protocol or the VPC components for your event source. // // For example: "SASL_SCRAM_512_AUTH". // Experimental. Type SourceAccessConfigurationType `field:"required" json:"type" yaml:"type"` // The value for your chosen configuration in type. // // For example: "URI": "arn:aws:secretsmanager:us-east-1:01234567890:secret:MyBrokerSecretName". // The exact string depends on the type. // See: SourceAccessConfigurationType. // // Experimental. Uri *string `field:"required" json:"uri" yaml:"uri"` }
Specific settings like the authentication protocol or the VPC components to secure access to your event source.
Example:
// The code below shows an example of how to instantiate this type. // The values are placeholders you should change. import "github.com/aws/aws-cdk-go/awscdk" var sourceAccessConfigurationType sourceAccessConfigurationType sourceAccessConfiguration := &SourceAccessConfiguration{ Type: sourceAccessConfigurationType, Uri: jsii.String("uri"), }
Experimental.
type SourceAccessConfigurationType ¶
type SourceAccessConfigurationType interface { // The key to use in `SourceAccessConfigurationProperty.Type` property in CloudFormation. // See: https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-lambda-eventsourcemapping-sourceaccessconfiguration.html#cfn-lambda-eventsourcemapping-sourceaccessconfiguration-type // // Experimental. Type() *string }
The type of authentication protocol or the VPC components for your event source's SourceAccessConfiguration.
Example:
// The code below shows an example of how to instantiate this type. // The values are placeholders you should change. import "github.com/aws/aws-cdk-go/awscdk" sourceAccessConfigurationType := awscdk.Aws_lambda.SourceAccessConfigurationType_BASIC_AUTH()
Experimental.
func SourceAccessConfigurationType_BASIC_AUTH ¶
func SourceAccessConfigurationType_BASIC_AUTH() SourceAccessConfigurationType
func SourceAccessConfigurationType_CLIENT_CERTIFICATE_TLS_AUTH ¶
func SourceAccessConfigurationType_CLIENT_CERTIFICATE_TLS_AUTH() SourceAccessConfigurationType
func SourceAccessConfigurationType_Of ¶
func SourceAccessConfigurationType_Of(name *string) SourceAccessConfigurationType
A custom source access configuration property. Experimental.
func SourceAccessConfigurationType_SASL_SCRAM_256_AUTH ¶
func SourceAccessConfigurationType_SASL_SCRAM_256_AUTH() SourceAccessConfigurationType
func SourceAccessConfigurationType_SASL_SCRAM_512_AUTH ¶
func SourceAccessConfigurationType_SASL_SCRAM_512_AUTH() SourceAccessConfigurationType
func SourceAccessConfigurationType_VPC_SECURITY_GROUP ¶
func SourceAccessConfigurationType_VPC_SECURITY_GROUP() SourceAccessConfigurationType
func SourceAccessConfigurationType_VPC_SUBNET ¶
func SourceAccessConfigurationType_VPC_SUBNET() SourceAccessConfigurationType
type StartingPosition ¶
type StartingPosition string
The position in the DynamoDB, Kinesis or MSK stream where AWS Lambda should start reading.
Example:
import "github.com/aws/aws-cdk-go/awscdk" import "github.com/aws/aws-cdk-go/awscdk" // The secret that allows access to your self hosted Kafka cluster var secret secret var myFunction function // The list of Kafka brokers bootstrapServers := []*string{ "kafka-broker:9092", } // The Kafka topic you want to subscribe to topic := "some-cool-topic" myFunction.AddEventSource(awscdk.NewSelfManagedKafkaEventSource(&SelfManagedKafkaEventSourceProps{ BootstrapServers: bootstrapServers, Topic: topic, Secret: secret, BatchSize: jsii.Number(100), // default StartingPosition: lambda.StartingPosition_TRIM_HORIZON, }))
Experimental.
const ( // Start reading at the last untrimmed record in the shard in the system, which is the oldest data record in the shard. // Experimental. StartingPosition_TRIM_HORIZON StartingPosition = "TRIM_HORIZON" // Start reading just after the most recent record in the shard, so that you always read the most recent data in the shard. // Experimental. StartingPosition_LATEST StartingPosition = "LATEST" )
type Tracing ¶
type Tracing string
X-Ray Tracing Modes (https://docs.aws.amazon.com/lambda/latest/dg/API_TracingConfig.html).
Example:
fn := lambda.NewFunction(this, jsii.String("MyFunction"), &FunctionProps{ Runtime: lambda.Runtime_NODEJS_16_X(), Handler: jsii.String("index.handler"), Code: lambda.Code_FromInline(jsii.String("exports.handler = function(event, ctx, cb) { return cb(null, \"hi\"); }")), Tracing: lambda.Tracing_ACTIVE, })
Experimental.
const ( // Lambda will respect any tracing header it receives from an upstream service. // // If no tracing header is received, Lambda will call X-Ray for a tracing decision. // Experimental. Tracing_ACTIVE Tracing = "ACTIVE" // Lambda will only trace the request from an upstream service if it contains a tracing header with "sampled=1". // Experimental. Tracing_PASS_THROUGH Tracing = "PASS_THROUGH" // Lambda will not trace any request. // Experimental. Tracing_DISABLED Tracing = "DISABLED" )
type UntrustedArtifactOnDeployment ¶
type UntrustedArtifactOnDeployment string
Code signing configuration policy for deployment validation failure. Experimental.
const ( // Lambda blocks the deployment request if signature validation checks fail. // Experimental. UntrustedArtifactOnDeployment_ENFORCE UntrustedArtifactOnDeployment = "ENFORCE" // Lambda allows the deployment of the code package, but issues a warning. // // Lambda issues a new Amazon CloudWatch metric, called a signature validation error and also stores the warning in CloudTrail. // Experimental. UntrustedArtifactOnDeployment_WARN UntrustedArtifactOnDeployment = "WARN" )
type UtilizationScalingOptions ¶
type UtilizationScalingOptions struct { // Indicates whether scale in by the target tracking policy is disabled. // // If the value is true, scale in is disabled and the target tracking policy // won't remove capacity from the scalable resource. Otherwise, scale in is // enabled and the target tracking policy can remove capacity from the // scalable resource. // Experimental. DisableScaleIn *bool `field:"optional" json:"disableScaleIn" yaml:"disableScaleIn"` // A name for the scaling policy. // Experimental. PolicyName *string `field:"optional" json:"policyName" yaml:"policyName"` // Period after a scale in activity completes before another scale in activity can start. // Experimental. ScaleInCooldown awscdk.Duration `field:"optional" json:"scaleInCooldown" yaml:"scaleInCooldown"` // Period after a scale out activity completes before another scale out activity can start. // Experimental. ScaleOutCooldown awscdk.Duration `field:"optional" json:"scaleOutCooldown" yaml:"scaleOutCooldown"` // Utilization target for the attribute. // // For example, .5 indicates that 50 percent of allocated provisioned concurrency is in use. // Experimental. UtilizationTarget *float64 `field:"required" json:"utilizationTarget" yaml:"utilizationTarget"` }
Options for enabling Lambda utilization tracking.
Example:
import autoscaling "github.com/aws/aws-cdk-go/awscdk" var fn function alias := fn.AddAlias(jsii.String("prod")) // Create AutoScaling target as := alias.AddAutoScaling(&AutoScalingOptions{ MaxCapacity: jsii.Number(50), }) // Configure Target Tracking as.ScaleOnUtilization(&UtilizationScalingOptions{ UtilizationTarget: jsii.Number(0.5), }) // Configure Scheduled Scaling as.ScaleOnSchedule(jsii.String("ScaleUpInTheMorning"), &ScalingSchedule{ Schedule: autoscaling.Schedule_Cron(&CronOptions{ Hour: jsii.String("8"), Minute: jsii.String("0"), }), MinCapacity: jsii.Number(20), })
Experimental.
type Version ¶
type Version interface { QualifiedFunctionBase IVersion // The architecture of this Lambda Function. // Experimental. Architecture() Architecture // Whether the addPermission() call adds any permissions. // // True for new Lambdas, false for version $LATEST and imported Lambdas // from different accounts. // Experimental. CanCreatePermissions() *bool // Access the Connections object. // // Will fail if not a VPC-enabled Lambda Function. // Experimental. Connections() awsec2.Connections // The ARN of the version for Lambda@Edge. // Experimental. EdgeArn() *string // The environment this resource belongs to. // // For resources that are created and managed by the CDK // (generally, those created by creating new class instances like Role, Bucket, etc.), // this is always the same as the environment of the stack they belong to; // however, for imported resources // (those obtained from static methods like fromRoleArn, fromBucketName, etc.), // that might be different than the stack they were imported into. // Experimental. Env() *awscdk.ResourceEnvironment // The ARN fo the function. // Experimental. FunctionArn() *string // The name of the function. // Experimental. FunctionName() *string // The principal this Lambda Function is running as. // Experimental. GrantPrincipal() awsiam.IPrincipal // Whether or not this Lambda function was bound to a VPC. // // If this is is `false`, trying to access the `connections` object will fail. // Experimental. IsBoundToVpc() *bool // The underlying AWS Lambda function. // Experimental. Lambda() IFunction // The `$LATEST` version of this function. // // Note that this is reference to a non-specific AWS Lambda version, which // means the function this version refers to can return different results in // different invocations. // // To obtain a reference to an explicit version which references the current // function configuration, use `lambdaFunction.currentVersion` instead. // Experimental. LatestVersion() IVersion // The construct tree node associated with this construct. // Experimental. Node() awscdk.ConstructNode // The construct node where permissions are attached. // Experimental. PermissionsNode() awscdk.ConstructNode // Returns a string-encoded token that resolves to the physical name that should be passed to the CloudFormation resource. // // This value will resolve to one of the following: // - a concrete value (e.g. `"my-awesome-bucket"`) // - `undefined`, when a name should be generated by CloudFormation // - a concrete name generated automatically during synthesis, in // cross-environment scenarios. // Experimental. PhysicalName() *string // The qualifier of the version or alias of this function. // // A qualifier is the identifier that's appended to a version or alias ARN. // Experimental. Qualifier() *string // The ARN(s) to put into the resource field of the generated IAM policy for grantInvoke(). // Experimental. ResourceArnsForGrantInvoke() *[]*string // The IAM role associated with this function. // // Undefined if the function was imported without a role. // Experimental. Role() awsiam.IRole // The stack in which this resource is defined. // Experimental. Stack() awscdk.Stack // The most recently deployed version of this function. // Experimental. Version() *string // Defines an alias for this version. // Deprecated: Calling `addAlias` on a `Version` object will cause the Alias to be replaced on every function update. Call `function.addAlias()` or `new Alias()` instead. AddAlias(aliasName *string, options *AliasOptions) Alias // Adds an event source to this function. // // Event sources are implemented in the @aws-cdk/aws-lambda-event-sources module. // // The following example adds an SQS Queue as an event source: // “` // import { SqsEventSource } from '@aws-cdk/aws-lambda-event-sources'; // myFunction.addEventSource(new SqsEventSource(myQueue)); // “`. // Experimental. AddEventSource(source IEventSource) // Adds an event source that maps to this AWS Lambda function. // Experimental. AddEventSourceMapping(id *string, options *EventSourceMappingOptions) EventSourceMapping // Adds a url to this lambda function. // Experimental. AddFunctionUrl(options *FunctionUrlOptions) FunctionUrl // Adds a permission to the Lambda resource policy. // See: Permission for details. // // Experimental. AddPermission(id *string, permission *Permission) // Adds a statement to the IAM role assumed by the instance. // Experimental. AddToRolePolicy(statement awsiam.PolicyStatement) // Apply the given removal policy to this resource. // // The Removal Policy controls what happens to this resource when it stops // being managed by CloudFormation, either because you've removed it from the // CDK application or because you've made a change that requires the resource // to be replaced. // // The resource can be deleted (`RemovalPolicy.DESTROY`), or left in your AWS // account for data recovery and cleanup later (`RemovalPolicy.RETAIN`). // Experimental. ApplyRemovalPolicy(policy awscdk.RemovalPolicy) // Configures options for asynchronous invocation. // Experimental. ConfigureAsyncInvoke(options *EventInvokeConfigOptions) // A warning will be added to functions under the following conditions: - permissions that include `lambda:InvokeFunction` are added to the unqualified function. // // - function.currentVersion is invoked before or after the permission is created. // // This applies only to permissions on Lambda functions, not versions or aliases. // This function is overridden as a noOp for QualifiedFunctionBase. // Experimental. ConsiderWarningOnInvokeFunctionPermissions(_scope awscdk.Construct, _action *string) // Experimental. GeneratePhysicalName() *string // Returns an environment-sensitive token that should be used for the resource's "ARN" attribute (e.g. `bucket.bucketArn`). // // Normally, this token will resolve to `arnAttr`, but if the resource is // referenced across environments, `arnComponents` will be used to synthesize // a concrete ARN with the resource's physical name. Make sure to reference // `this.physicalName` in `arnComponents`. // Experimental. GetResourceArnAttribute(arnAttr *string, arnComponents *awscdk.ArnComponents) *string // Returns an environment-sensitive token that should be used for the resource's "name" attribute (e.g. `bucket.bucketName`). // // Normally, this token will resolve to `nameAttr`, but if the resource is // referenced across environments, it will be resolved to `this.physicalName`, // which will be a concrete name. // Experimental. GetResourceNameAttribute(nameAttr *string) *string // Grant the given identity permissions to invoke this Lambda. // Experimental. GrantInvoke(grantee awsiam.IGrantable) awsiam.Grant // Grant the given identity permissions to invoke this Lambda Function URL. // Experimental. GrantInvokeUrl(grantee awsiam.IGrantable) awsiam.Grant // Return the given named metric for this Function. // Experimental. Metric(metricName *string, props *awscloudwatch.MetricOptions) awscloudwatch.Metric // How long execution of this Lambda takes. // // Average over 5 minutes. // Experimental. MetricDuration(props *awscloudwatch.MetricOptions) awscloudwatch.Metric // How many invocations of this Lambda fail. // // Sum over 5 minutes. // Experimental. MetricErrors(props *awscloudwatch.MetricOptions) awscloudwatch.Metric // How often this Lambda is invoked. // // Sum over 5 minutes. // Experimental. MetricInvocations(props *awscloudwatch.MetricOptions) awscloudwatch.Metric // How often this Lambda is throttled. // // Sum over 5 minutes. // Experimental. MetricThrottles(props *awscloudwatch.MetricOptions) awscloudwatch.Metric // Perform final modifications before synthesis. // // This method can be implemented by derived constructs in order to perform // final changes before synthesis. prepare() will be called after child // constructs have been prepared. // // This is an advanced framework feature. Only use this if you // understand the implications. // Experimental. OnPrepare() // Allows this construct to emit artifacts into the cloud assembly during synthesis. // // This method is usually implemented by framework-level constructs such as `Stack` and `Asset` // as they participate in synthesizing the cloud assembly. // Experimental. OnSynthesize(session constructs.ISynthesisSession) // Validate the current construct. // // This method can be implemented by derived constructs in order to perform // validation logic. It is called on all constructs before synthesis. // // Returns: An array of validation error messages, or an empty array if the construct is valid. // Experimental. OnValidate() *[]*string // Perform final modifications before synthesis. // // This method can be implemented by derived constructs in order to perform // final changes before synthesis. prepare() will be called after child // constructs have been prepared. // // This is an advanced framework feature. Only use this if you // understand the implications. // Experimental. Prepare() // Allows this construct to emit artifacts into the cloud assembly during synthesis. // // This method is usually implemented by framework-level constructs such as `Stack` and `Asset` // as they participate in synthesizing the cloud assembly. // Experimental. Synthesize(session awscdk.ISynthesisSession) // Returns a string representation of this construct. // Experimental. ToString() *string // Validate the current construct. // // This method can be implemented by derived constructs in order to perform // validation logic. It is called on all constructs before synthesis. // // Returns: An array of validation error messages, or an empty array if the construct is valid. // Experimental. Validate() *[]*string // Experimental. WarnInvokeFunctionPermissions(scope awscdk.Construct) }
Tag the current state of a Function with a Version number.
Avoid using this resource directly. If you need a Version object, use `function.currentVersion` instead. That will add a Version object to your template, and make sure the Version is invalidated whenever the Function object changes. If you use the `Version` resource directly, you are responsible for making sure it is invalidated (by changing its logical ID) whenever necessary.
Version resources can then be used in `Alias` resources to refer to a particular deployment of a Lambda.
If you want to ensure that you're associating the right version with the right deployment, specify the `codeSha256` property while creating the `Version.
Example:
lambdaCode := lambda.Code_FromCfnParameters() func := lambda.NewFunction(this, jsii.String("Lambda"), &FunctionProps{ Code: lambdaCode, Handler: jsii.String("index.handler"), Runtime: lambda.Runtime_NODEJS_14_X(), }) // used to make sure each CDK synthesis produces a different Version version := func.currentVersion alias := lambda.NewAlias(this, jsii.String("LambdaAlias"), &AliasProps{ AliasName: jsii.String("Prod"), Version: Version, }) codedeploy.NewLambdaDeploymentGroup(this, jsii.String("DeploymentGroup"), &LambdaDeploymentGroupProps{ Alias: Alias, DeploymentConfig: codedeploy.LambdaDeploymentConfig_LINEAR_10PERCENT_EVERY_1MINUTE(), })
Experimental.
func NewVersion ¶
func NewVersion(scope constructs.Construct, id *string, props *VersionProps) Version
Experimental.
type VersionAttributes ¶
type VersionAttributes struct { // The lambda function. // Experimental. Lambda IFunction `field:"required" json:"lambda" yaml:"lambda"` // The version. // Experimental. Version *string `field:"required" json:"version" yaml:"version"` }
Example:
// The code below shows an example of how to instantiate this type. // The values are placeholders you should change. import "github.com/aws/aws-cdk-go/awscdk" var function_ function versionAttributes := &VersionAttributes{ Lambda: function_, Version: jsii.String("version"), }
Experimental.
type VersionOptions ¶
type VersionOptions struct { // The maximum age of a request that Lambda sends to a function for processing. // // Minimum: 60 seconds // Maximum: 6 hours. // Experimental. MaxEventAge awscdk.Duration `field:"optional" json:"maxEventAge" yaml:"maxEventAge"` // The destination for failed invocations. // Experimental. OnFailure IDestination `field:"optional" json:"onFailure" yaml:"onFailure"` // The destination for successful invocations. // Experimental. OnSuccess IDestination `field:"optional" json:"onSuccess" yaml:"onSuccess"` // The maximum number of times to retry when the function returns an error. // // Minimum: 0 // Maximum: 2. // Experimental. RetryAttempts *float64 `field:"optional" json:"retryAttempts" yaml:"retryAttempts"` // SHA256 of the version of the Lambda source code. // // Specify to validate that you're deploying the right version. // Experimental. CodeSha256 *string `field:"optional" json:"codeSha256" yaml:"codeSha256"` // Description of the version. // Experimental. Description *string `field:"optional" json:"description" yaml:"description"` // Specifies a provisioned concurrency configuration for a function's version. // Experimental. ProvisionedConcurrentExecutions *float64 `field:"optional" json:"provisionedConcurrentExecutions" yaml:"provisionedConcurrentExecutions"` // Whether to retain old versions of this function when a new version is created. // Experimental. RemovalPolicy awscdk.RemovalPolicy `field:"optional" json:"removalPolicy" yaml:"removalPolicy"` }
Options for `lambda.Version`.
Example:
fn := lambda.NewFunction(this, jsii.String("MyFunction"), &FunctionProps{ CurrentVersionOptions: &VersionOptions{ RemovalPolicy: awscdk.RemovalPolicy_RETAIN, // retain old versions RetryAttempts: jsii.Number(1), }, Runtime: lambda.Runtime_NODEJS_16_X(), Handler: jsii.String("index.handler"), Code: lambda.Code_FromAsset(path.join(__dirname, jsii.String("lambda-handler"))), }) fn.AddAlias(jsii.String("live"))
Experimental.
type VersionProps ¶
type VersionProps struct { // The maximum age of a request that Lambda sends to a function for processing. // // Minimum: 60 seconds // Maximum: 6 hours. // Experimental. MaxEventAge awscdk.Duration `field:"optional" json:"maxEventAge" yaml:"maxEventAge"` // The destination for failed invocations. // Experimental. OnFailure IDestination `field:"optional" json:"onFailure" yaml:"onFailure"` // The destination for successful invocations. // Experimental. OnSuccess IDestination `field:"optional" json:"onSuccess" yaml:"onSuccess"` // The maximum number of times to retry when the function returns an error. // // Minimum: 0 // Maximum: 2. // Experimental. RetryAttempts *float64 `field:"optional" json:"retryAttempts" yaml:"retryAttempts"` // SHA256 of the version of the Lambda source code. // // Specify to validate that you're deploying the right version. // Experimental. CodeSha256 *string `field:"optional" json:"codeSha256" yaml:"codeSha256"` // Description of the version. // Experimental. Description *string `field:"optional" json:"description" yaml:"description"` // Specifies a provisioned concurrency configuration for a function's version. // Experimental. ProvisionedConcurrentExecutions *float64 `field:"optional" json:"provisionedConcurrentExecutions" yaml:"provisionedConcurrentExecutions"` // Whether to retain old versions of this function when a new version is created. // Experimental. RemovalPolicy awscdk.RemovalPolicy `field:"optional" json:"removalPolicy" yaml:"removalPolicy"` // Function to get the value of. // Experimental. Lambda IFunction `field:"required" json:"lambda" yaml:"lambda"` }
Properties for a new Lambda version.
Example:
var fn function version := lambda.NewVersion(this, jsii.String("MyVersion"), &VersionProps{ Lambda: fn, })
Experimental.
type VersionWeight ¶
type VersionWeight struct { // The version to route traffic to. // Experimental. Version IVersion `field:"required" json:"version" yaml:"version"` // How much weight to assign to this version (0..1). // Experimental. Weight *float64 `field:"required" json:"weight" yaml:"weight"` }
A version/weight pair for routing traffic to Lambda functions.
Example:
// The code below shows an example of how to instantiate this type. // The values are placeholders you should change. import "github.com/aws/aws-cdk-go/awscdk" var version version versionWeight := &VersionWeight{ Version: version, Weight: jsii.Number(123), }
Experimental.
Source Files ¶
- Alias.go
- AliasAttributes.go
- AliasOptions.go
- AliasProps.go
- Alias__checks.go
- Architecture.go
- Architecture__checks.go
- AssetCode.go
- AssetCode__checks.go
- AssetImageCode.go
- AssetImageCodeProps.go
- AssetImageCode__checks.go
- AutoScalingOptions.go
- CfnAlias.go
- CfnAliasProps.go
- CfnAlias_AliasRoutingConfigurationProperty.go
- CfnAlias_ProvisionedConcurrencyConfigurationProperty.go
- CfnAlias_VersionWeightProperty.go
- CfnAlias__checks.go
- CfnCodeSigningConfig.go
- CfnCodeSigningConfigProps.go
- CfnCodeSigningConfig_AllowedPublishersProperty.go
- CfnCodeSigningConfig_CodeSigningPoliciesProperty.go
- CfnCodeSigningConfig__checks.go
- CfnEventInvokeConfig.go
- CfnEventInvokeConfigProps.go
- CfnEventInvokeConfig_DestinationConfigProperty.go
- CfnEventInvokeConfig_OnFailureProperty.go
- CfnEventInvokeConfig_OnSuccessProperty.go
- CfnEventInvokeConfig__checks.go
- CfnEventSourceMapping.go
- CfnEventSourceMappingProps.go
- CfnEventSourceMapping_AmazonManagedKafkaEventSourceConfigProperty.go
- CfnEventSourceMapping_DestinationConfigProperty.go
- CfnEventSourceMapping_DocumentDBEventSourceConfigProperty.go
- CfnEventSourceMapping_EndpointsProperty.go
- CfnEventSourceMapping_FilterCriteriaProperty.go
- CfnEventSourceMapping_FilterProperty.go
- CfnEventSourceMapping_OnFailureProperty.go
- CfnEventSourceMapping_ScalingConfigProperty.go
- CfnEventSourceMapping_SelfManagedEventSourceProperty.go
- CfnEventSourceMapping_SelfManagedKafkaEventSourceConfigProperty.go
- CfnEventSourceMapping_SourceAccessConfigurationProperty.go
- CfnEventSourceMapping__checks.go
- CfnFunction.go
- CfnFunctionProps.go
- CfnFunction_CodeProperty.go
- CfnFunction_DeadLetterConfigProperty.go
- CfnFunction_EnvironmentProperty.go
- CfnFunction_EphemeralStorageProperty.go
- CfnFunction_FileSystemConfigProperty.go
- CfnFunction_ImageConfigProperty.go
- CfnFunction_RuntimeManagementConfigProperty.go
- CfnFunction_SnapStartProperty.go
- CfnFunction_SnapStartResponseProperty.go
- CfnFunction_TracingConfigProperty.go
- CfnFunction_VpcConfigProperty.go
- CfnFunction__checks.go
- CfnLayerVersion.go
- CfnLayerVersionPermission.go
- CfnLayerVersionPermissionProps.go
- CfnLayerVersionPermission__checks.go
- CfnLayerVersionProps.go
- CfnLayerVersion_ContentProperty.go
- CfnLayerVersion__checks.go
- CfnParametersCode.go
- CfnParametersCodeProps.go
- CfnParametersCode__checks.go
- CfnPermission.go
- CfnPermissionProps.go
- CfnPermission__checks.go
- CfnUrl.go
- CfnUrlProps.go
- CfnUrl_CorsProperty.go
- CfnUrl__checks.go
- CfnVersion.go
- CfnVersionProps.go
- CfnVersion_ProvisionedConcurrencyConfigurationProperty.go
- CfnVersion__checks.go
- Code.go
- CodeConfig.go
- CodeImageConfig.go
- CodeSigningConfig.go
- CodeSigningConfigProps.go
- CodeSigningConfig__checks.go
- Code__checks.go
- DestinationConfig.go
- DestinationOptions.go
- DestinationType.go
- DlqDestinationConfig.go
- DockerBuildAssetOptions.go
- DockerImageCode.go
- DockerImageCode__checks.go
- DockerImageFunction.go
- DockerImageFunctionProps.go
- DockerImageFunction__checks.go
- EcrImageCode.go
- EcrImageCodeProps.go
- EcrImageCode__checks.go
- EnvironmentOptions.go
- EventInvokeConfig.go
- EventInvokeConfigOptions.go
- EventInvokeConfigProps.go
- EventInvokeConfig__checks.go
- EventSourceMapping.go
- EventSourceMappingOptions.go
- EventSourceMappingProps.go
- EventSourceMapping__checks.go
- FileSystem.go
- FileSystemConfig.go
- FileSystem__checks.go
- Function.go
- FunctionAttributes.go
- FunctionBase.go
- FunctionBase__checks.go
- FunctionOptions.go
- FunctionProps.go
- FunctionUrl.go
- FunctionUrlAuthType.go
- FunctionUrlCorsOptions.go
- FunctionUrlOptions.go
- FunctionUrlProps.go
- FunctionUrl__checks.go
- FunctionVersionUpgrade.go
- FunctionVersionUpgrade__checks.go
- Function__checks.go
- Handler.go
- HttpMethod.go
- IAlias.go
- ICodeSigningConfig.go
- IDestination.go
- IDestination__checks.go
- IEventSource.go
- IEventSourceDlq.go
- IEventSourceDlq__checks.go
- IEventSourceMapping.go
- IEventSource__checks.go
- IFunction.go
- IFunctionUrl.go
- IFunctionUrl__checks.go
- IFunction__checks.go
- ILayerVersion.go
- ILayerVersion__checks.go
- IScalableFunctionAttribute.go
- IScalableFunctionAttribute__checks.go
- IVersion.go
- IVersion__checks.go
- InlineCode.go
- InlineCode__checks.go
- LambdaInsightsVersion.go
- LambdaInsightsVersion__checks.go
- LambdaRuntimeProps.go
- LayerVersion.go
- LayerVersionAttributes.go
- LayerVersionOptions.go
- LayerVersionPermission.go
- LayerVersionProps.go
- LayerVersion__checks.go
- LogRetention.go
- LogRetentionProps.go
- LogRetentionRetryOptions.go
- LogRetention__checks.go
- Permission.go
- QualifiedFunctionBase.go
- QualifiedFunctionBase__checks.go
- ResourceBindOptions.go
- Runtime.go
- RuntimeFamily.go
- Runtime__checks.go
- S3Code.go
- S3Code__checks.go
- SingletonFunction.go
- SingletonFunctionProps.go
- SingletonFunction__checks.go
- SourceAccessConfiguration.go
- SourceAccessConfigurationType.go
- SourceAccessConfigurationType__checks.go
- StartingPosition.go
- Tracing.go
- UntrustedArtifactOnDeployment.go
- UtilizationScalingOptions.go
- Version.go
- VersionAttributes.go
- VersionOptions.go
- VersionProps.go
- VersionWeight.go
- Version__checks.go
- main.go