Class CfnFunction

java.lang.Object
software.amazon.jsii.JsiiObject
software.constructs.Construct
All Implemented Interfaces:
IInspectable, ITaggable, software.amazon.jsii.JsiiSerializable, software.constructs.IConstruct, software.constructs.IDependable

@Generated(value="jsii-pacmak/1.101.0 (build b95fe5d)", date="2024-07-12T19:34:09.563Z") @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:
  • Field Details

    • CFN_RESOURCE_TYPE_NAME

      @Stability(Stable) public static final String CFN_RESOURCE_TYPE_NAME
      The CloudFormation resource type name for this resource class.
    • REQUIRED_TRANSFORM

      @Stability(Stable) public static final String REQUIRED_TRANSFORM
      The Transform a 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

      @Stability(Stable) public void inspect(@NotNull TreeInspector inspector)
      Examines the CloudFormation resource and discloses attributes.

      Specified by:
      inspect in interface IInspectable
      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:
      renderProperties in class CfnResource
      Parameters:
      props - This parameter is required.
    • getCfnProperties

      @Stability(Stable) @NotNull protected Map<String,Object> getCfnProperties()
      Overrides:
      getCfnProperties in class CfnResource
    • getTags

      @Stability(Stable) @NotNull public TagManager getTags()
      Tag Manager which manages the tags for this resource.
      Specified by:
      getTags in interface ITaggable
    • getArchitectures

      @Stability(Stable) @Nullable public List<String> getArchitectures()
    • setArchitectures

      @Stability(Stable) public void setArchitectures(@Nullable List<String> value)
    • getAssumeRolePolicyDocument

      @Stability(Stable) @Nullable public Object getAssumeRolePolicyDocument()
    • setAssumeRolePolicyDocument

      @Stability(Stable) public void setAssumeRolePolicyDocument(@Nullable Object value)
    • getAutoPublishAlias

      @Stability(Stable) @Nullable public String getAutoPublishAlias()
    • setAutoPublishAlias

      @Stability(Stable) public void setAutoPublishAlias(@Nullable String value)
    • getAutoPublishCodeSha256

      @Stability(Stable) @Nullable public String getAutoPublishCodeSha256()
    • setAutoPublishCodeSha256

      @Stability(Stable) public void setAutoPublishCodeSha256(@Nullable String value)
    • getCodeSigningConfigArn

      @Stability(Stable) @Nullable public String getCodeSigningConfigArn()
    • setCodeSigningConfigArn

      @Stability(Stable) public void setCodeSigningConfigArn(@Nullable String value)
    • getCodeUri

      @Stability(Stable) @Nullable public Object getCodeUri()
    • setCodeUri

      @Stability(Stable) public void setCodeUri(@Nullable String value)
    • setCodeUri

      @Stability(Stable) public void setCodeUri(@Nullable IResolvable value)
    • setCodeUri

      @Stability(Stable) public void setCodeUri(@Nullable CfnFunction.S3LocationProperty value)
    • getDeadLetterQueue

      @Stability(Stable) @Nullable public Object getDeadLetterQueue()
    • setDeadLetterQueue

      @Stability(Stable) public void setDeadLetterQueue(@Nullable IResolvable value)
    • setDeadLetterQueue

      @Stability(Stable) public void setDeadLetterQueue(@Nullable CfnFunction.DeadLetterQueueProperty value)
    • getDeploymentPreference

      @Stability(Stable) @Nullable public Object getDeploymentPreference()
    • setDeploymentPreference

      @Stability(Stable) public void setDeploymentPreference(@Nullable IResolvable value)
    • setDeploymentPreference

      @Stability(Stable) public void setDeploymentPreference(@Nullable CfnFunction.DeploymentPreferenceProperty value)
    • getDescription

      @Stability(Stable) @Nullable public String getDescription()
    • setDescription

      @Stability(Stable) public void setDescription(@Nullable String value)
    • getEnvironment

      @Stability(Stable) @Nullable public Object getEnvironment()
    • setEnvironment

      @Stability(Stable) public void setEnvironment(@Nullable IResolvable value)
    • setEnvironment

      @Stability(Stable) public void setEnvironment(@Nullable CfnFunction.FunctionEnvironmentProperty value)
    • getEphemeralStorage

      @Stability(Stable) @Nullable public Object getEphemeralStorage()
    • setEphemeralStorage

      @Stability(Stable) public void setEphemeralStorage(@Nullable IResolvable value)
    • setEphemeralStorage

      @Stability(Stable) public void setEphemeralStorage(@Nullable CfnFunction.EphemeralStorageProperty value)
    • getEventInvokeConfig

      @Stability(Stable) @Nullable public Object getEventInvokeConfig()
    • setEventInvokeConfig

      @Stability(Stable) public void setEventInvokeConfig(@Nullable IResolvable value)
    • setEventInvokeConfig

      @Stability(Stable) public void setEventInvokeConfig(@Nullable CfnFunction.EventInvokeConfigProperty value)
    • getEvents

      @Stability(Stable) @Nullable public Object getEvents()
    • setEvents

      @Stability(Stable) public void setEvents(@Nullable IResolvable value)
    • setEvents

      @Stability(Stable) public void setEvents(@Nullable Map<String,Object> value)
    • getFileSystemConfigs

      @Stability(Stable) @Nullable public Object getFileSystemConfigs()
    • setFileSystemConfigs

      @Stability(Stable) public void setFileSystemConfigs(@Nullable IResolvable value)
    • setFileSystemConfigs

      @Stability(Stable) public void setFileSystemConfigs(@Nullable List<Object> value)
    • getFunctionName

      @Stability(Stable) @Nullable public String getFunctionName()
    • setFunctionName

      @Stability(Stable) public void setFunctionName(@Nullable String value)
    • getFunctionUrlConfig

      @Stability(Stable) @Nullable public Object getFunctionUrlConfig()
    • setFunctionUrlConfig

      @Stability(Stable) public void setFunctionUrlConfig(@Nullable IResolvable value)
    • setFunctionUrlConfig

      @Stability(Stable) public void setFunctionUrlConfig(@Nullable CfnFunction.FunctionUrlConfigProperty value)
    • getHandler

      @Stability(Stable) @Nullable public String getHandler()
    • setHandler

      @Stability(Stable) public void setHandler(@Nullable String value)
    • getImageConfig

      @Stability(Stable) @Nullable public Object getImageConfig()
    • setImageConfig

      @Stability(Stable) public void setImageConfig(@Nullable IResolvable value)
    • setImageConfig

      @Stability(Stable) public void setImageConfig(@Nullable CfnFunction.ImageConfigProperty value)
    • getImageUri

      @Stability(Stable) @Nullable public String getImageUri()
    • setImageUri

      @Stability(Stable) public void setImageUri(@Nullable String value)
    • getInlineCode

      @Stability(Stable) @Nullable public String getInlineCode()
    • setInlineCode

      @Stability(Stable) public void setInlineCode(@Nullable String value)
    • getKmsKeyArn

      @Stability(Stable) @Nullable public String getKmsKeyArn()
    • setKmsKeyArn

      @Stability(Stable) public void setKmsKeyArn(@Nullable String value)
    • getLayers

      @Stability(Stable) @Nullable public List<String> getLayers()
    • setLayers

      @Stability(Stable) public void setLayers(@Nullable List<String> value)
    • getMemorySize

      @Stability(Stable) @Nullable public Number getMemorySize()
    • setMemorySize

      @Stability(Stable) public void setMemorySize(@Nullable Number value)
    • getPackageType

      @Stability(Stable) @Nullable public String getPackageType()
    • setPackageType

      @Stability(Stable) public void setPackageType(@Nullable String value)
    • getPermissionsBoundary

      @Stability(Stable) @Nullable public String getPermissionsBoundary()
    • setPermissionsBoundary

      @Stability(Stable) public void setPermissionsBoundary(@Nullable String value)
    • getPolicies

      @Stability(Stable) @Nullable public Object getPolicies()
    • setPolicies

      @Stability(Stable) public void setPolicies(@Nullable String value)
    • setPolicies

      @Stability(Stable) public void setPolicies(@Nullable IResolvable value)
    • setPolicies

      @Stability(Stable) public void setPolicies(@Nullable CfnFunction.IAMPolicyDocumentProperty value)
    • setPolicies

      @Stability(Stable) public void setPolicies(@Nullable List<Object> value)
    • getProvisionedConcurrencyConfig

      @Stability(Stable) @Nullable public Object getProvisionedConcurrencyConfig()
    • setProvisionedConcurrencyConfig

      @Stability(Stable) public void setProvisionedConcurrencyConfig(@Nullable IResolvable value)
    • setProvisionedConcurrencyConfig

      @Stability(Stable) public void setProvisionedConcurrencyConfig(@Nullable CfnFunction.ProvisionedConcurrencyConfigProperty value)
    • getReservedConcurrentExecutions

      @Stability(Stable) @Nullable public Number getReservedConcurrentExecutions()
    • setReservedConcurrentExecutions

      @Stability(Stable) public void setReservedConcurrentExecutions(@Nullable Number value)
    • getRole

      @Stability(Stable) @Nullable public String getRole()
    • setRole

      @Stability(Stable) public void setRole(@Nullable String value)
    • getRuntime

      @Stability(Stable) @Nullable public String getRuntime()
    • setRuntime

      @Stability(Stable) public void setRuntime(@Nullable String value)
    • getTagsRaw

      @Stability(Stable) @Nullable public Map<String,String> getTagsRaw()
    • setTagsRaw

      @Stability(Stable) public void setTagsRaw(@Nullable Map<String,String> value)
    • getTimeout

      @Stability(Stable) @Nullable public Number getTimeout()
    • setTimeout

      @Stability(Stable) public void setTimeout(@Nullable Number value)
    • getTracing

      @Stability(Stable) @Nullable public String getTracing()
    • setTracing

      @Stability(Stable) public void setTracing(@Nullable String value)
    • getVersionDescription

      @Stability(Stable) @Nullable public String getVersionDescription()
    • setVersionDescription

      @Stability(Stable) public void setVersionDescription(@Nullable String value)
    • getVpcConfig

      @Stability(Stable) @Nullable public Object getVpcConfig()
    • setVpcConfig

      @Stability(Stable) public void setVpcConfig(@Nullable IResolvable value)
    • setVpcConfig

      @Stability(Stable) public void setVpcConfig(@Nullable CfnFunction.VpcConfigProperty value)