Class CfnFunction
java.lang.Object
software.amazon.jsii.JsiiObject
software.constructs.Construct
software.amazon.awscdk.CfnElement
software.amazon.awscdk.CfnRefElement
software.amazon.awscdk.CfnResource
software.amazon.awscdk.services.sam.CfnFunction
- All Implemented Interfaces:
IInspectable,ITaggable,software.amazon.jsii.JsiiSerializable,software.constructs.IConstruct,software.constructs.IDependable
@Generated(value="jsii-pacmak/1.110.0 (build 336b265)",
date="2025-04-22T23:08:20.430Z")
@Stability(Stable)
public class CfnFunction
extends CfnResource
implements IInspectable, ITaggable
https://github.com/awslabs/serverless-application-model/blob/master/versions/2016-10-31.md#awsserverlessfunction.
Example:
// The code below shows an example of how to instantiate this type.
// The values are placeholders you should change.
import software.amazon.awscdk.services.sam.*;
Object assumeRolePolicyDocument;
CfnFunction cfnFunction = CfnFunction.Builder.create(this, "MyCfnFunction")
.architectures(List.of("architectures"))
.assumeRolePolicyDocument(assumeRolePolicyDocument)
.autoPublishAlias("autoPublishAlias")
.autoPublishCodeSha256("autoPublishCodeSha256")
.codeSigningConfigArn("codeSigningConfigArn")
.codeUri("codeUri")
.deadLetterQueue(DeadLetterQueueProperty.builder()
.targetArn("targetArn")
.type("type")
.build())
.deploymentPreference(DeploymentPreferenceProperty.builder()
.alarms(List.of("alarms"))
.enabled(false)
.hooks(HooksProperty.builder()
.postTraffic("postTraffic")
.preTraffic("preTraffic")
.build())
.role("role")
.type("type")
.build())
.description("description")
.environment(FunctionEnvironmentProperty.builder()
.variables(Map.of(
"variablesKey", "variables"))
.build())
.ephemeralStorage(EphemeralStorageProperty.builder()
.size(123)
.build())
.eventInvokeConfig(EventInvokeConfigProperty.builder()
.destinationConfig(EventInvokeDestinationConfigProperty.builder()
.onFailure(DestinationProperty.builder()
.destination("destination")
// the properties below are optional
.type("type")
.build())
.onSuccess(DestinationProperty.builder()
.destination("destination")
// the properties below are optional
.type("type")
.build())
.build())
.maximumEventAgeInSeconds(123)
.maximumRetryAttempts(123)
.build())
.events(Map.of(
"eventsKey", EventSourceProperty.builder()
.properties(AlexaSkillEventProperty.builder()
.skillId("skillId")
.build())
.type("type")
.build()))
.fileSystemConfigs(List.of(FileSystemConfigProperty.builder()
.arn("arn")
.localMountPath("localMountPath")
.build()))
.functionName("functionName")
.functionUrlConfig(FunctionUrlConfigProperty.builder()
.authType("authType")
// the properties below are optional
.cors("cors")
.invokeMode("invokeMode")
.build())
.handler("handler")
.imageConfig(ImageConfigProperty.builder()
.command(List.of("command"))
.entryPoint(List.of("entryPoint"))
.workingDirectory("workingDirectory")
.build())
.imageUri("imageUri")
.inlineCode("inlineCode")
.kmsKeyArn("kmsKeyArn")
.layers(List.of("layers"))
.memorySize(123)
.packageType("packageType")
.permissionsBoundary("permissionsBoundary")
.policies("policies")
.provisionedConcurrencyConfig(ProvisionedConcurrencyConfigProperty.builder()
.provisionedConcurrentExecutions("provisionedConcurrentExecutions")
.build())
.reservedConcurrentExecutions(123)
.role("role")
.runtime("runtime")
.tags(Map.of(
"tagsKey", "tags"))
.timeout(123)
.tracing("tracing")
.versionDescription("versionDescription")
.vpcConfig(VpcConfigProperty.builder()
.securityGroupIds(List.of("securityGroupIds"))
.subnetIds(List.of("subnetIds"))
.build())
.build();
- See Also:
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic interfaceExample:static interfaceExample:static interfaceExample:static interfaceExample:static interfaceExample:static final classA fluent builder forCfnFunction.static interfaceExample:static interfaceExample:static interfaceExample:static interfaceExample:static interfaceExample:static interfaceExample:static interfaceExample:static interfaceExample:static interfaceExample:static interfaceExample:static interfaceExample:static interfaceExample:static interfaceExample:static interfaceExample:static interfaceExample:static interfaceExample:static interfaceExample:static interfaceExample:static interfaceExample:static interfaceExample:static interfaceExample:static interfaceExample:static interfaceExample:static interfaceExample:static interfaceExample:static interfaceExample:static interfaceExample:static interfaceExample:static interfaceExample:static interfaceExample:static interfaceExample:static interfaceExample:static interfaceExample:static interfaceExample:static interfaceExample:static interfaceExample:static interfaceExample:static interfaceExample:static interfaceExample:static interfaceExample:static interfaceExample:static interfaceExample:static interfaceExample:static interfaceExample:static interfaceExample:static interfaceExample:static interfaceExample:static interfaceExample:static interfaceExample:static interfaceExample:static interfaceExample:static interfaceExample:static interfaceExample:Nested classes/interfaces inherited from class software.amazon.jsii.JsiiObject
software.amazon.jsii.JsiiObject.InitializationModeNested classes/interfaces inherited from interface software.constructs.IConstruct
software.constructs.IConstruct.Jsii$DefaultNested classes/interfaces inherited from interface software.amazon.awscdk.IInspectable
IInspectable.Jsii$Default, IInspectable.Jsii$ProxyNested classes/interfaces inherited from interface software.amazon.awscdk.ITaggable
ITaggable.Jsii$Default, ITaggable.Jsii$Proxy -
Field Summary
Fields -
Constructor Summary
ConstructorsModifierConstructorDescriptionprotectedCfnFunction(software.amazon.jsii.JsiiObject.InitializationMode initializationMode) protectedCfnFunction(software.amazon.jsii.JsiiObjectRef objRef) CfnFunction(software.constructs.Construct scope, String id) CfnFunction(software.constructs.Construct scope, String id, CfnFunctionProps props) -
Method Summary
Modifier and TypeMethodDescriptiongetRole()getTags()Tag Manager which manages the tags for this resource.voidinspect(TreeInspector inspector) Examines the CloudFormation resource and discloses attributes.renderProperties(Map<String, Object> props) voidsetArchitectures(List<String> value) voidvoidsetAutoPublishAlias(String value) voidsetAutoPublishCodeSha256(String value) voidsetCodeSigningConfigArn(String value) voidsetCodeUri(String value) voidsetCodeUri(IResolvable value) voidvoidsetDeadLetterQueue(IResolvable value) voidvoidvoidvoidsetDescription(String value) voidsetEnvironment(IResolvable value) voidvoidsetEphemeralStorage(IResolvable value) voidvoidsetEventInvokeConfig(IResolvable value) voidvoidvoidsetEvents(IResolvable value) voidsetFileSystemConfigs(List<Object> value) voidsetFileSystemConfigs(IResolvable value) voidsetFunctionName(String value) voidsetFunctionUrlConfig(IResolvable value) voidvoidsetHandler(String value) voidsetImageConfig(IResolvable value) voidvoidsetImageUri(String value) voidsetInlineCode(String value) voidsetKmsKeyArn(String value) voidvoidsetMemorySize(Number value) voidsetPackageType(String value) voidsetPermissionsBoundary(String value) voidsetPolicies(String value) voidsetPolicies(List<Object> value) voidsetPolicies(IResolvable value) voidvoidvoidvoidvoidvoidsetRuntime(String value) voidsetTagsRaw(Map<String, String> value) voidsetTimeout(Number value) voidsetTracing(String value) voidsetVersionDescription(String value) voidsetVpcConfig(IResolvable value) voidMethods inherited from class software.amazon.awscdk.CfnResource
addDeletionOverride, addDependency, addDependsOn, addMetadata, addOverride, addPropertyDeletionOverride, addPropertyOverride, applyRemovalPolicy, applyRemovalPolicy, applyRemovalPolicy, getAtt, getAtt, getCfnOptions, getCfnResourceType, getMetadata, getUpdatedProperites, getUpdatedProperties, isCfnResource, obtainDependencies, obtainResourceDependencies, removeDependency, replaceDependency, shouldSynthesize, toString, validatePropertiesMethods inherited from class software.amazon.awscdk.CfnRefElement
getRefMethods inherited from class software.amazon.awscdk.CfnElement
getCreationStack, getLogicalId, getStack, isCfnElement, overrideLogicalIdMethods inherited from class software.constructs.Construct
getNode, isConstructMethods inherited from class software.amazon.jsii.JsiiObject
jsiiAsyncCall, jsiiAsyncCall, jsiiCall, jsiiCall, jsiiGet, jsiiGet, jsiiSet, jsiiStaticCall, jsiiStaticCall, jsiiStaticGet, jsiiStaticGet, jsiiStaticSet, jsiiStaticSetMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitMethods inherited from interface software.amazon.jsii.JsiiSerializable
$jsii$toJson
-
Field Details
-
CFN_RESOURCE_TYPE_NAME
The CloudFormation resource type name for this resource class. -
REQUIRED_TRANSFORM
TheTransforma template must use in order to use this resource.
-
-
Constructor Details
-
CfnFunction
protected CfnFunction(software.amazon.jsii.JsiiObjectRef objRef) -
CfnFunction
protected CfnFunction(software.amazon.jsii.JsiiObject.InitializationMode initializationMode) -
CfnFunction
@Stability(Stable) public CfnFunction(@NotNull software.constructs.Construct scope, @NotNull String id, @Nullable CfnFunctionProps props) - Parameters:
scope- Scope in which this resource is defined. This parameter is required.id- Construct identifier for this resource (unique in its scope). This parameter is required.props- Resource properties.
-
CfnFunction
@Stability(Stable) public CfnFunction(@NotNull software.constructs.Construct scope, @NotNull String id) - Parameters:
scope- Scope in which this resource is defined. This parameter is required.id- Construct identifier for this resource (unique in its scope). This parameter is required.
-
-
Method Details
-
inspect
Examines the CloudFormation resource and discloses attributes.- Specified by:
inspectin interfaceIInspectable- Parameters:
inspector- tree inspector to collect and process attributes. This parameter is required.
-
renderProperties
@Stability(Stable) @NotNull protected Map<String,Object> renderProperties(@NotNull Map<String, Object> props) - Overrides:
renderPropertiesin classCfnResource- Parameters:
props- This parameter is required.
-
getCfnProperties
- Overrides:
getCfnPropertiesin classCfnResource
-
getTags
Tag Manager which manages the tags for this resource. -
getArchitectures
-
setArchitectures
-
getAssumeRolePolicyDocument
-
setAssumeRolePolicyDocument
-
getAutoPublishAlias
-
setAutoPublishAlias
-
getAutoPublishCodeSha256
-
setAutoPublishCodeSha256
-
getCodeSigningConfigArn
-
setCodeSigningConfigArn
-
getCodeUri
-
setCodeUri
-
setCodeUri
-
setCodeUri
-
getDeadLetterQueue
-
setDeadLetterQueue
-
setDeadLetterQueue
@Stability(Stable) public void setDeadLetterQueue(@Nullable CfnFunction.DeadLetterQueueProperty value) -
getDeploymentPreference
-
setDeploymentPreference
-
setDeploymentPreference
@Stability(Stable) public void setDeploymentPreference(@Nullable CfnFunction.DeploymentPreferenceProperty value) -
getDescription
-
setDescription
-
getEnvironment
-
setEnvironment
-
setEnvironment
@Stability(Stable) public void setEnvironment(@Nullable CfnFunction.FunctionEnvironmentProperty value) -
getEphemeralStorage
-
setEphemeralStorage
-
setEphemeralStorage
@Stability(Stable) public void setEphemeralStorage(@Nullable CfnFunction.EphemeralStorageProperty value) -
getEventInvokeConfig
-
setEventInvokeConfig
-
setEventInvokeConfig
@Stability(Stable) public void setEventInvokeConfig(@Nullable CfnFunction.EventInvokeConfigProperty value) -
getEvents
-
setEvents
-
setEvents
-
getFileSystemConfigs
-
setFileSystemConfigs
-
setFileSystemConfigs
-
getFunctionName
-
setFunctionName
-
getFunctionUrlConfig
-
setFunctionUrlConfig
-
setFunctionUrlConfig
@Stability(Stable) public void setFunctionUrlConfig(@Nullable CfnFunction.FunctionUrlConfigProperty value) -
getHandler
-
setHandler
-
getImageConfig
-
setImageConfig
-
setImageConfig
-
getImageUri
-
setImageUri
-
getInlineCode
-
setInlineCode
-
getKmsKeyArn
-
setKmsKeyArn
-
getLayers
-
setLayers
-
getMemorySize
-
setMemorySize
-
getPackageType
-
setPackageType
-
getPermissionsBoundary
-
setPermissionsBoundary
-
getPolicies
-
setPolicies
-
setPolicies
-
setPolicies
-
setPolicies
-
getProvisionedConcurrencyConfig
-
setProvisionedConcurrencyConfig
-
setProvisionedConcurrencyConfig
@Stability(Stable) public void setProvisionedConcurrencyConfig(@Nullable CfnFunction.ProvisionedConcurrencyConfigProperty value) -
getReservedConcurrentExecutions
-
setReservedConcurrentExecutions
-
getRole
-
setRole
-
getRuntime
-
setRuntime
-
getTagsRaw
-
setTagsRaw
-
getTimeout
-
setTimeout
-
getTracing
-
setTracing
-
getVersionDescription
-
setVersionDescription
-
getVpcConfig
-
setVpcConfig
-
setVpcConfig
-