Class CfnFunction

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

@Generated(value="jsii-pacmak/1.84.0 (build 5404dcf)", date="2023-06-19T16:30:35.593Z") @Stability(Stable) public class CfnFunction extends CfnResource implements IInspectable
A CloudFormation AWS::Serverless::Function.

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()
                 .enabled(false)
                 .type("type")
                 // the properties below are optional
                 .alarms(List.of("alarms"))
                 .hooks(HooksProperty.builder()
                         .postTraffic("postTraffic")
                         .preTraffic("preTraffic")
                         .build())
                 .build())
         .description("description")
         .environment(FunctionEnvironmentProperty.builder()
                 .variables(Map.of(
                         "variablesKey", "variables"))
                 .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(S3EventProperty.builder()
                                 .variables(Map.of(
                                         "variablesKey", "variables"))
                                 .build())
                         .type("type")
                         .build()))
         .fileSystemConfigs(List.of(FileSystemConfigProperty.builder()
                 .arn("arn")
                 .localMountPath("localMountPath")
                 .build()))
         .functionName("functionName")
         .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();
 
  • 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 Construct scope, @NotNull String id, @Nullable CfnFunctionProps props)
      Create a new AWS::Serverless::Function.

      Parameters:
      scope -
      • scope in which this resource is defined.
      This parameter is required.
      id -
      • scoped id of the resource.
      This parameter is required.
      props -
      • resource properties.
    • CfnFunction

      @Stability(Stable) public CfnFunction(@NotNull Construct scope, @NotNull String id)
      Create a new AWS::Serverless::Function.

      Parameters:
      scope -
      • scope in which this resource is defined.
      This parameter is required.
      id -
      • scoped id of the resource.
      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()
      AWS::Serverless::Function.Tags.
    • getAssumeRolePolicyDocument

      @Stability(Stable) @NotNull public Object getAssumeRolePolicyDocument()
      AWS::Serverless::Function.AssumeRolePolicyDocument.
    • setAssumeRolePolicyDocument

      @Stability(Stable) public void setAssumeRolePolicyDocument(@NotNull Object value)
      AWS::Serverless::Function.AssumeRolePolicyDocument.
    • getArchitectures

      @Stability(Stable) @Nullable public List<String> getArchitectures()
      AWS::Serverless::Function.Architectures.
    • setArchitectures

      @Stability(Stable) public void setArchitectures(@Nullable List<String> value)
      AWS::Serverless::Function.Architectures.
    • getAutoPublishAlias

      @Stability(Stable) @Nullable public String getAutoPublishAlias()
      AWS::Serverless::Function.AutoPublishAlias.
    • setAutoPublishAlias

      @Stability(Stable) public void setAutoPublishAlias(@Nullable String value)
      AWS::Serverless::Function.AutoPublishAlias.
    • getAutoPublishCodeSha256

      @Stability(Stable) @Nullable public String getAutoPublishCodeSha256()
      AWS::Serverless::Function.AutoPublishCodeSha256.
    • setAutoPublishCodeSha256

      @Stability(Stable) public void setAutoPublishCodeSha256(@Nullable String value)
      AWS::Serverless::Function.AutoPublishCodeSha256.
    • getCodeSigningConfigArn

      @Stability(Stable) @Nullable public String getCodeSigningConfigArn()
      AWS::Serverless::Function.CodeSigningConfigArn.
    • setCodeSigningConfigArn

      @Stability(Stable) public void setCodeSigningConfigArn(@Nullable String value)
      AWS::Serverless::Function.CodeSigningConfigArn.
    • getCodeUri

      @Stability(Stable) @Nullable public Object getCodeUri()
      AWS::Serverless::Function.CodeUri.
    • setCodeUri

      @Stability(Stable) public void setCodeUri(@Nullable String value)
      AWS::Serverless::Function.CodeUri.
    • setCodeUri

      @Stability(Stable) public void setCodeUri(@Nullable IResolvable value)
      AWS::Serverless::Function.CodeUri.
    • setCodeUri

      @Stability(Stable) public void setCodeUri(@Nullable CfnFunction.S3LocationProperty value)
      AWS::Serverless::Function.CodeUri.
    • getDeadLetterQueue

      @Stability(Stable) @Nullable public Object getDeadLetterQueue()
      AWS::Serverless::Function.DeadLetterQueue.
    • setDeadLetterQueue

      @Stability(Stable) public void setDeadLetterQueue(@Nullable IResolvable value)
      AWS::Serverless::Function.DeadLetterQueue.
    • setDeadLetterQueue

      @Stability(Stable) public void setDeadLetterQueue(@Nullable CfnFunction.DeadLetterQueueProperty value)
      AWS::Serverless::Function.DeadLetterQueue.
    • getDeploymentPreference

      @Stability(Stable) @Nullable public Object getDeploymentPreference()
      AWS::Serverless::Function.DeploymentPreference.
    • setDeploymentPreference

      @Stability(Stable) public void setDeploymentPreference(@Nullable IResolvable value)
      AWS::Serverless::Function.DeploymentPreference.
    • setDeploymentPreference

      @Stability(Stable) public void setDeploymentPreference(@Nullable CfnFunction.DeploymentPreferenceProperty value)
      AWS::Serverless::Function.DeploymentPreference.
    • getDescription

      @Stability(Stable) @Nullable public String getDescription()
      AWS::Serverless::Function.Description.
    • setDescription

      @Stability(Stable) public void setDescription(@Nullable String value)
      AWS::Serverless::Function.Description.
    • getEnvironment

      @Stability(Stable) @Nullable public Object getEnvironment()
      AWS::Serverless::Function.Environment.
    • setEnvironment

      @Stability(Stable) public void setEnvironment(@Nullable IResolvable value)
      AWS::Serverless::Function.Environment.
    • setEnvironment

      @Stability(Stable) public void setEnvironment(@Nullable CfnFunction.FunctionEnvironmentProperty value)
      AWS::Serverless::Function.Environment.
    • getEventInvokeConfig

      @Stability(Stable) @Nullable public Object getEventInvokeConfig()
      AWS::Serverless::Function.EventInvokeConfig.
    • setEventInvokeConfig

      @Stability(Stable) public void setEventInvokeConfig(@Nullable IResolvable value)
      AWS::Serverless::Function.EventInvokeConfig.
    • setEventInvokeConfig

      @Stability(Stable) public void setEventInvokeConfig(@Nullable CfnFunction.EventInvokeConfigProperty value)
      AWS::Serverless::Function.EventInvokeConfig.
    • getEvents

      @Stability(Stable) @Nullable public Object getEvents()
      AWS::Serverless::Function.Events.
    • setEvents

      @Stability(Stable) public void setEvents(@Nullable IResolvable value)
      AWS::Serverless::Function.Events.
    • setEvents

      @Stability(Stable) public void setEvents(@Nullable Map<String,Object> value)
      AWS::Serverless::Function.Events.
    • getFileSystemConfigs

      @Stability(Stable) @Nullable public Object getFileSystemConfigs()
      AWS::Serverless::Function.FileSystemConfigs.
    • setFileSystemConfigs

      @Stability(Stable) public void setFileSystemConfigs(@Nullable IResolvable value)
      AWS::Serverless::Function.FileSystemConfigs.
    • setFileSystemConfigs

      @Stability(Stable) public void setFileSystemConfigs(@Nullable List<Object> value)
      AWS::Serverless::Function.FileSystemConfigs.
    • getFunctionName

      @Stability(Stable) @Nullable public String getFunctionName()
      AWS::Serverless::Function.FunctionName.
    • setFunctionName

      @Stability(Stable) public void setFunctionName(@Nullable String value)
      AWS::Serverless::Function.FunctionName.
    • getHandler

      @Stability(Stable) @Nullable public String getHandler()
      AWS::Serverless::Function.Handler.
    • setHandler

      @Stability(Stable) public void setHandler(@Nullable String value)
      AWS::Serverless::Function.Handler.
    • getImageConfig

      @Stability(Stable) @Nullable public Object getImageConfig()
      AWS::Serverless::Function.ImageConfig.
    • setImageConfig

      @Stability(Stable) public void setImageConfig(@Nullable IResolvable value)
      AWS::Serverless::Function.ImageConfig.
    • setImageConfig

      @Stability(Stable) public void setImageConfig(@Nullable CfnFunction.ImageConfigProperty value)
      AWS::Serverless::Function.ImageConfig.
    • getImageUri

      @Stability(Stable) @Nullable public String getImageUri()
      AWS::Serverless::Function.ImageUri.
    • setImageUri

      @Stability(Stable) public void setImageUri(@Nullable String value)
      AWS::Serverless::Function.ImageUri.
    • getInlineCode

      @Stability(Stable) @Nullable public String getInlineCode()
      AWS::Serverless::Function.InlineCode.
    • setInlineCode

      @Stability(Stable) public void setInlineCode(@Nullable String value)
      AWS::Serverless::Function.InlineCode.
    • getKmsKeyArn

      @Stability(Stable) @Nullable public String getKmsKeyArn()
      AWS::Serverless::Function.KmsKeyArn.
    • setKmsKeyArn

      @Stability(Stable) public void setKmsKeyArn(@Nullable String value)
      AWS::Serverless::Function.KmsKeyArn.
    • getLayers

      @Stability(Stable) @Nullable public List<String> getLayers()
      AWS::Serverless::Function.Layers.
    • setLayers

      @Stability(Stable) public void setLayers(@Nullable List<String> value)
      AWS::Serverless::Function.Layers.
    • getMemorySize

      @Stability(Stable) @Nullable public Number getMemorySize()
      AWS::Serverless::Function.MemorySize.
    • setMemorySize

      @Stability(Stable) public void setMemorySize(@Nullable Number value)
      AWS::Serverless::Function.MemorySize.
    • getPackageType

      @Stability(Stable) @Nullable public String getPackageType()
      AWS::Serverless::Function.PackageType.
    • setPackageType

      @Stability(Stable) public void setPackageType(@Nullable String value)
      AWS::Serverless::Function.PackageType.
    • getPermissionsBoundary

      @Stability(Stable) @Nullable public String getPermissionsBoundary()
      AWS::Serverless::Function.PermissionsBoundary.
    • setPermissionsBoundary

      @Stability(Stable) public void setPermissionsBoundary(@Nullable String value)
      AWS::Serverless::Function.PermissionsBoundary.
    • getPolicies

      @Stability(Stable) @Nullable public Object getPolicies()
      AWS::Serverless::Function.Policies.
    • setPolicies

      @Stability(Stable) public void setPolicies(@Nullable String value)
      AWS::Serverless::Function.Policies.
    • setPolicies

      @Stability(Stable) public void setPolicies(@Nullable IResolvable value)
      AWS::Serverless::Function.Policies.
    • setPolicies

      @Stability(Stable) public void setPolicies(@Nullable CfnFunction.IAMPolicyDocumentProperty value)
      AWS::Serverless::Function.Policies.
    • setPolicies

      @Stability(Stable) public void setPolicies(@Nullable List<Object> value)
      AWS::Serverless::Function.Policies.
    • getProvisionedConcurrencyConfig

      @Stability(Stable) @Nullable public Object getProvisionedConcurrencyConfig()
      AWS::Serverless::Function.ProvisionedConcurrencyConfig.
    • setProvisionedConcurrencyConfig

      @Stability(Stable) public void setProvisionedConcurrencyConfig(@Nullable IResolvable value)
      AWS::Serverless::Function.ProvisionedConcurrencyConfig.
    • setProvisionedConcurrencyConfig

      @Stability(Stable) public void setProvisionedConcurrencyConfig(@Nullable CfnFunction.ProvisionedConcurrencyConfigProperty value)
      AWS::Serverless::Function.ProvisionedConcurrencyConfig.
    • getReservedConcurrentExecutions

      @Stability(Stable) @Nullable public Number getReservedConcurrentExecutions()
      AWS::Serverless::Function.ReservedConcurrentExecutions.
    • setReservedConcurrentExecutions

      @Stability(Stable) public void setReservedConcurrentExecutions(@Nullable Number value)
      AWS::Serverless::Function.ReservedConcurrentExecutions.
    • getRole

      @Stability(Stable) @Nullable public String getRole()
      AWS::Serverless::Function.Role.
    • setRole

      @Stability(Stable) public void setRole(@Nullable String value)
      AWS::Serverless::Function.Role.
    • getRuntime

      @Stability(Stable) @Nullable public String getRuntime()
      AWS::Serverless::Function.Runtime.
    • setRuntime

      @Stability(Stable) public void setRuntime(@Nullable String value)
      AWS::Serverless::Function.Runtime.
    • getTimeout

      @Stability(Stable) @Nullable public Number getTimeout()
      AWS::Serverless::Function.Timeout.
    • setTimeout

      @Stability(Stable) public void setTimeout(@Nullable Number value)
      AWS::Serverless::Function.Timeout.
    • getTracing

      @Stability(Stable) @Nullable public String getTracing()
      AWS::Serverless::Function.Tracing.
    • setTracing

      @Stability(Stable) public void setTracing(@Nullable String value)
      AWS::Serverless::Function.Tracing.
    • getVersionDescription

      @Stability(Stable) @Nullable public String getVersionDescription()
      AWS::Serverless::Function.VersionDescription.
    • setVersionDescription

      @Stability(Stable) public void setVersionDescription(@Nullable String value)
      AWS::Serverless::Function.VersionDescription.
    • getVpcConfig

      @Stability(Stable) @Nullable public Object getVpcConfig()
      AWS::Serverless::Function.VpcConfig.
    • setVpcConfig

      @Stability(Stable) public void setVpcConfig(@Nullable IResolvable value)
      AWS::Serverless::Function.VpcConfig.
    • setVpcConfig

      @Stability(Stable) public void setVpcConfig(@Nullable CfnFunction.VpcConfigProperty value)
      AWS::Serverless::Function.VpcConfig.