ACS::FC::ExecuteScript

更新时间:
复制 MD 格式

Description

Runs a Python script in Function Compute.

Syntax

Action: ACS::FC::ExecuteScript
Properties:
 runtime: String
 handler: String
 inputPayload: Json
 script: String
 role: String

Attributes

Attribute

Description

Type

Required

Default value

Limit

runtime

The runtime environment for the function.

String

No

python3.10

handler

The name of the function.

String

No

index.handler

inputPayload

The input parameters passed to the function.

Json

No

""

script

The Python script code to run.

String

No

import datetime
import os
import sys
def _now(format="%Y-%m-%d %H:%M:%S"):
return datetime.datetime.now().strftime(format)
def job_start():
return ("[%s][%s] job_start" % (_now(), os.getpid()))
def handler(event, context):
return job_start()

role

The Alibaba Cloud Resource Name (ARN) of the RAM role used to grant permissions to Function Compute.

String

No

""

Output

Output item

Description

Type

Result

String

References

For the source template, see ACS::FC::ExecuteScript.yml on GitHub.