cloudenv / server /providers /aws /lambda_api.md
Vishvam10
initial space commit
b404de3
|
Raw History Blame Contribute Delete
12.9 kB

Lambda Service API

Requests use CloudEnvAction: service, operation, and payload (boto3 parameters for the operation).

Operations are enforced by IAM as lambda:<OperationName> (see adapter).

Operations

CreateFunction

Boto3 client method: create_function

Other boto3 parameters (optional): Architectures, CapacityProviderConfig, CodeSigningConfigArn, DeadLetterConfig, Description, DurableConfig, Environment, EphemeralStorage, FileSystemConfigs, Handler, ImageConfig, KMSKeyArn, Layers, LoggingConfig, MemorySize, PackageType, Publish, PublishTo, Runtime, SnapStart, Tags, TenancyConfig, Timeout, TracingConfig, VpcConfig

curl -X POST http://localhost:8000/step \
  -H "Content-Type: application/json" \
  -d @- <<'EOF'
{
  "service": "lambda",
  "operation": "CreateFunction",
  "payload": {
    "FunctionName": "example-functionname",
    "Role": "example-rolearn",
    "Code": {}
  }
}

DeleteFunction

Boto3 client method: delete_function

Other boto3 parameters (optional): Qualifier

curl -X POST http://localhost:8000/step \
  -H "Content-Type: application/json" \
  -d @- <<'EOF'
{
  "service": "lambda",
  "operation": "DeleteFunction",
  "payload": {
    "FunctionName": "example-namespacedfunctionname"
  }
}

GetFunction

Boto3 client method: get_function

Other boto3 parameters (optional): Qualifier

curl -X POST http://localhost:8000/step \
  -H "Content-Type: application/json" \
  -d @- <<'EOF'
{
  "service": "lambda",
  "operation": "GetFunction",
  "payload": {
    "FunctionName": "example-namespacedfunctionname"
  }
}

ListFunctions

Boto3 client method: list_functions

Other boto3 parameters (optional): FunctionVersion, Marker, MasterRegion, MaxItems

curl -X POST http://localhost:8000/step \
  -H "Content-Type: application/json" \
  -d @- <<'EOF'
{
  "service": "lambda",
  "operation": "ListFunctions",
  "payload": {}
}

Invoke

Boto3 client method: invoke

Other boto3 parameters (optional): ClientContext, DurableExecutionName, InvocationType, LogType, Payload, Qualifier, TenantId

curl -X POST http://localhost:8000/step \
  -H "Content-Type: application/json" \
  -d @- <<'EOF'
{
  "service": "lambda",
  "operation": "Invoke",
  "payload": {
    "FunctionName": "example-namespacedfunctionname"
  }
}

UpdateFunctionCode

Boto3 client method: update_function_code

Other boto3 parameters (optional): Architectures, DryRun, ImageUri, Publish, PublishTo, RevisionId, S3Bucket, S3Key, S3ObjectVersion, SourceKMSKeyArn, ZipFile

curl -X POST http://localhost:8000/step \
  -H "Content-Type: application/json" \
  -d @- <<'EOF'
{
  "service": "lambda",
  "operation": "UpdateFunctionCode",
  "payload": {
    "FunctionName": "example-functionname"
  }
}

UpdateFunctionConfiguration

Boto3 client method: update_function_configuration

Other boto3 parameters (optional): CapacityProviderConfig, DeadLetterConfig, Description, DurableConfig, Environment, EphemeralStorage, FileSystemConfigs, Handler, ImageConfig, KMSKeyArn, Layers, LoggingConfig, MemorySize, RevisionId, Role, Runtime, SnapStart, Timeout, TracingConfig, VpcConfig

curl -X POST http://localhost:8000/step \
  -H "Content-Type: application/json" \
  -d @- <<'EOF'
{
  "service": "lambda",
  "operation": "UpdateFunctionConfiguration",
  "payload": {
    "FunctionName": "example-functionname"
  }
}

AddPermission

Boto3 client method: add_permission

Other boto3 parameters (optional): EventSourceToken, FunctionUrlAuthType, InvokedViaFunctionUrl, PrincipalOrgID, Qualifier, RevisionId, SourceAccount, SourceArn

curl -X POST http://localhost:8000/step \
  -H "Content-Type: application/json" \
  -d @- <<'EOF'
{
  "service": "lambda",
  "operation": "AddPermission",
  "payload": {
    "FunctionName": "example-namespacedfunctionname",
    "StatementId": "example-statementid",
    "Action": "example-action",
    "Principal": "example-principal"
  }
}

RemovePermission

Boto3 client method: remove_permission

Other boto3 parameters (optional): Qualifier, RevisionId

curl -X POST http://localhost:8000/step \
  -H "Content-Type: application/json" \
  -d @- <<'EOF'
{
  "service": "lambda",
  "operation": "RemovePermission",
  "payload": {
    "FunctionName": "example-namespacedfunctionname",
    "StatementId": "example-namespacedstatementid"
  }
}

ListVersionsByFunction

Boto3 client method: list_versions_by_function

Other boto3 parameters (optional): Marker, MaxItems

curl -X POST http://localhost:8000/step \
  -H "Content-Type: application/json" \
  -d @- <<'EOF'
{
  "service": "lambda",
  "operation": "ListVersionsByFunction",
  "payload": {
    "FunctionName": "example-namespacedfunctionname"
  }
}

PublishVersion

Boto3 client method: publish_version

Other boto3 parameters (optional): CodeSha256, Description, PublishTo, RevisionId

curl -X POST http://localhost:8000/step \
  -H "Content-Type: application/json" \
  -d @- <<'EOF'
{
  "service": "lambda",
  "operation": "PublishVersion",
  "payload": {
    "FunctionName": "example-functionname"
  }
}

TagResource

Boto3 client method: tag_resource

curl -X POST http://localhost:8000/step \
  -H "Content-Type: application/json" \
  -d @- <<'EOF'
{
  "service": "lambda",
  "operation": "TagResource",
  "payload": {
    "Resource": "example-taggableresource",
    "Tags": {
      "exampleKey": "example-tagvalue"
    }
  }
}

UntagResource

Boto3 client method: untag_resource

curl -X POST http://localhost:8000/step \
  -H "Content-Type: application/json" \
  -d @- <<'EOF'
{
  "service": "lambda",
  "operation": "UntagResource",
  "payload": {
    "Resource": "example-taggableresource",
    "TagKeys": [
      "example-tagkey"
    ]
  }
}

ListTags

Boto3 client method: list_tags

curl -X POST http://localhost:8000/step \
  -H "Content-Type: application/json" \
  -d @- <<'EOF'
{
  "service": "lambda",
  "operation": "ListTags",
  "payload": {
    "Resource": "example-taggableresource"
  }
}

CreateEventSourceMapping

Boto3 client method: create_event_source_mapping

Other boto3 parameters (optional): AmazonManagedKafkaEventSourceConfig, BatchSize, BisectBatchOnFunctionError, DestinationConfig, DocumentDBEventSourceConfig, Enabled, EventSourceArn, FilterCriteria, FunctionResponseTypes, KMSKeyArn, LoggingConfig, MaximumBatchingWindowInSeconds, MaximumRecordAgeInSeconds, MaximumRetryAttempts, MetricsConfig, ParallelizationFactor, ProvisionedPollerConfig, Queues, ScalingConfig, SelfManagedEventSource, SelfManagedKafkaEventSourceConfig, SourceAccessConfigurations, StartingPosition, StartingPositionTimestamp, Tags (+2 more)

curl -X POST http://localhost:8000/step \
  -H "Content-Type: application/json" \
  -d @- <<'EOF'
{
  "service": "lambda",
  "operation": "CreateEventSourceMapping",
  "payload": {
    "FunctionName": "example-namespacedfunctionname"
  }
}

DeleteEventSourceMapping

Boto3 client method: delete_event_source_mapping

curl -X POST http://localhost:8000/step \
  -H "Content-Type: application/json" \
  -d @- <<'EOF'
{
  "service": "lambda",
  "operation": "DeleteEventSourceMapping",
  "payload": {
    "UUID": "example-string"
  }
}

GetEventSourceMapping

Boto3 client method: get_event_source_mapping

curl -X POST http://localhost:8000/step \
  -H "Content-Type: application/json" \
  -d @- <<'EOF'
{
  "service": "lambda",
  "operation": "GetEventSourceMapping",
  "payload": {
    "UUID": "example-string"
  }
}

ListEventSourceMappings

Boto3 client method: list_event_source_mappings

Other boto3 parameters (optional): EventSourceArn, FunctionName, Marker, MaxItems

curl -X POST http://localhost:8000/step \
  -H "Content-Type: application/json" \
  -d @- <<'EOF'
{
  "service": "lambda",
  "operation": "ListEventSourceMappings",
  "payload": {}
}

UpdateEventSourceMapping

Boto3 client method: update_event_source_mapping

Other boto3 parameters (optional): AmazonManagedKafkaEventSourceConfig, BatchSize, BisectBatchOnFunctionError, DestinationConfig, DocumentDBEventSourceConfig, Enabled, FilterCriteria, FunctionName, FunctionResponseTypes, KMSKeyArn, LoggingConfig, MaximumBatchingWindowInSeconds, MaximumRecordAgeInSeconds, MaximumRetryAttempts, MetricsConfig, ParallelizationFactor, ProvisionedPollerConfig, ScalingConfig, SelfManagedKafkaEventSourceConfig, SourceAccessConfigurations, TumblingWindowInSeconds

curl -X POST http://localhost:8000/step \
  -H "Content-Type: application/json" \
  -d @- <<'EOF'
{
  "service": "lambda",
  "operation": "UpdateEventSourceMapping",
  "payload": {
    "UUID": "example-string"
  }
}

CreateFunctionUrlConfig

Boto3 client method: create_function_url_config

Other boto3 parameters (optional): Cors, InvokeMode, Qualifier

curl -X POST http://localhost:8000/step \
  -H "Content-Type: application/json" \
  -d @- <<'EOF'
{
  "service": "lambda",
  "operation": "CreateFunctionUrlConfig",
  "payload": {
    "FunctionName": "example-functionname",
    "AuthType": "NONE"
  }
}

GetFunctionUrlConfig

Boto3 client method: get_function_url_config

Other boto3 parameters (optional): Qualifier

curl -X POST http://localhost:8000/step \
  -H "Content-Type: application/json" \
  -d @- <<'EOF'
{
  "service": "lambda",
  "operation": "GetFunctionUrlConfig",
  "payload": {
    "FunctionName": "example-functionname"
  }
}

UpdateFunctionUrlConfig

Boto3 client method: update_function_url_config

Other boto3 parameters (optional): AuthType, Cors, InvokeMode, Qualifier

curl -X POST http://localhost:8000/step \
  -H "Content-Type: application/json" \
  -d @- <<'EOF'
{
  "service": "lambda",
  "operation": "UpdateFunctionUrlConfig",
  "payload": {
    "FunctionName": "example-functionname"
  }
}

DeleteFunctionUrlConfig

Boto3 client method: delete_function_url_config

Other boto3 parameters (optional): Qualifier

curl -X POST http://localhost:8000/step \
  -H "Content-Type: application/json" \
  -d @- <<'EOF'
{
  "service": "lambda",
  "operation": "DeleteFunctionUrlConfig",
  "payload": {
    "FunctionName": "example-functionname"
  }
}

ListFunctionUrlConfigs

Boto3 client method: list_function_url_configs

Other boto3 parameters (optional): Marker, MaxItems

curl -X POST http://localhost:8000/step \
  -H "Content-Type: application/json" \
  -d @- <<'EOF'
{
  "service": "lambda",
  "operation": "ListFunctionUrlConfigs",
  "payload": {
    "FunctionName": "example-functionname"
  }
}

PublishLayerVersion

Boto3 client method: publish_layer_version

Other boto3 parameters (optional): CompatibleArchitectures, CompatibleRuntimes, Description, LicenseInfo

curl -X POST http://localhost:8000/step \
  -H "Content-Type: application/json" \
  -d @- <<'EOF'
{
  "service": "lambda",
  "operation": "PublishLayerVersion",
  "payload": {
    "LayerName": "example-layername",
    "Content": {}
  }
}

GetLayerVersion

Boto3 client method: get_layer_version

curl -X POST http://localhost:8000/step \
  -H "Content-Type: application/json" \
  -d @- <<'EOF'
{
  "service": "lambda",
  "operation": "GetLayerVersion",
  "payload": {
    "LayerName": "example-layername",
    "VersionNumber": 0
  }
}

ListLayerVersions

Boto3 client method: list_layer_versions

Other boto3 parameters (optional): CompatibleArchitecture, CompatibleRuntime, Marker, MaxItems

curl -X POST http://localhost:8000/step \
  -H "Content-Type: application/json" \
  -d @- <<'EOF'
{
  "service": "lambda",
  "operation": "ListLayerVersions",
  "payload": {
    "LayerName": "example-layername"
  }
}

DeleteLayerVersion

Boto3 client method: delete_layer_version

curl -X POST http://localhost:8000/step \
  -H "Content-Type: application/json" \
  -d @- <<'EOF'
{
  "service": "lambda",
  "operation": "DeleteLayerVersion",
  "payload": {
    "LayerName": "example-layername",
    "VersionNumber": 0
  }
}

ListLayers

Boto3 client method: list_layers

Other boto3 parameters (optional): CompatibleArchitecture, CompatibleRuntime, Marker, MaxItems

curl -X POST http://localhost:8000/step \
  -H "Content-Type: application/json" \
  -d @- <<'EOF'
{
  "service": "lambda",
  "operation": "ListLayers",
  "payload": {}
}