Create, update, or delete an IBM Cloud Functions action. Actions are stateless code snippets that run on the Cloud Functions platform. An action can be written as a JavaScript, Swift, or Python function, a Java method, or a custom executable program packaged in a Docker container. To bundle and share related actions, use the function_package resource.
Example Usage
The sample provides the usage of JavaScript, Node.js, Docker, action sequences, by using ibm.FunctionAction resources.
Create FunctionAction Resource
Resources are created with functions called constructors. To learn more about declaring and configuring resources, see Resources.
Constructor syntax
new FunctionAction(name: string, args: FunctionActionArgs, opts?: CustomResourceOptions);@overload
def FunctionAction(resource_name: str,
args: FunctionActionArgs,
opts: Optional[ResourceOptions] = None)
@overload
def FunctionAction(resource_name: str,
opts: Optional[ResourceOptions] = None,
exec_: Optional[FunctionActionExecArgs] = None,
namespace: Optional[str] = None,
function_action_id: Optional[str] = None,
limits: Optional[FunctionActionLimitsArgs] = None,
name: Optional[str] = None,
publish: Optional[bool] = None,
user_defined_annotations: Optional[str] = None,
user_defined_parameters: Optional[str] = None)func NewFunctionAction(ctx *Context, name string, args FunctionActionArgs, opts ...ResourceOption) (*FunctionAction, error)public FunctionAction(string name, FunctionActionArgs args, CustomResourceOptions? opts = null)
public FunctionAction(String name, FunctionActionArgs args)
public FunctionAction(String name, FunctionActionArgs args, CustomResourceOptions options)
type: ibm:FunctionAction
properties: # The arguments to resource properties.
options: # Bag of options to control resource's behavior.
Parameters
- name string
- The unique name of the resource.
- args FunctionActionArgs
- The arguments to resource properties.
- opts CustomResourceOptions
- Bag of options to control resource's behavior.
- resource_name str
- The unique name of the resource.
- args FunctionActionArgs
- The arguments to resource properties.
- opts ResourceOptions
- Bag of options to control resource's behavior.
- ctx Context
- Context object for the current deployment.
- name string
- The unique name of the resource.
- args FunctionActionArgs
- The arguments to resource properties.
- opts ResourceOption
- Bag of options to control resource's behavior.
- name string
- The unique name of the resource.
- args FunctionActionArgs
- The arguments to resource properties.
- opts CustomResourceOptions
- Bag of options to control resource's behavior.
- name String
- The unique name of the resource.
- args FunctionActionArgs
- The arguments to resource properties.
- options CustomResourceOptions
- Bag of options to control resource's behavior.
Constructor example
The following reference example uses placeholder values for all input properties.
var functionActionResource = new Ibm.FunctionAction("functionActionResource", new()
{
Exec = new Ibm.Inputs.FunctionActionExecArgs
{
Kind = "string",
Code = "string",
CodePath = "string",
Components = new[]
{
"string",
},
Image = "string",
Init = "string",
Main = "string",
},
Namespace = "string",
FunctionActionId = "string",
Limits = new Ibm.Inputs.FunctionActionLimitsArgs
{
LogSize = 0,
Memory = 0,
Timeout = 0,
},
Name = "string",
Publish = false,
UserDefinedAnnotations = "string",
UserDefinedParameters = "string",
});
example, err := ibm.NewFunctionAction(ctx, "functionActionResource", &ibm.FunctionActionArgs{
Exec: &ibm.FunctionActionExecArgs{
Kind: pulumi.String("string"),
Code: pulumi.String("string"),
CodePath: pulumi.String("string"),
Components: pulumi.StringArray{
pulumi.String("string"),
},
Image: pulumi.String("string"),
Init: pulumi.String("string"),
Main: pulumi.String("string"),
},
Namespace: pulumi.String("string"),
FunctionActionId: pulumi.String("string"),
Limits: &ibm.FunctionActionLimitsArgs{
LogSize: pulumi.Float64(0),
Memory: pulumi.Float64(0),
Timeout: pulumi.Float64(0),
},
Name: pulumi.String("string"),
Publish: pulumi.Bool(false),
UserDefinedAnnotations: pulumi.String("string"),
UserDefinedParameters: pulumi.String("string"),
})
var functionActionResource = new FunctionAction("functionActionResource", FunctionActionArgs.builder()
.exec(FunctionActionExecArgs.builder()
.kind("string")
.code("string")
.codePath("string")
.components("string")
.image("string")
.init("string")
.main("string")
.build())
.namespace("string")
.functionActionId("string")
.limits(FunctionActionLimitsArgs.builder()
.logSize(0.0)
.memory(0.0)
.timeout(0.0)
.build())
.name("string")
.publish(false)
.userDefinedAnnotations("string")
.userDefinedParameters("string")
.build());
function_action_resource = ibm.FunctionAction("functionActionResource",
exec_={
"kind": "string",
"code": "string",
"code_path": "string",
"components": ["string"],
"image": "string",
"init": "string",
"main": "string",
},
namespace="string",
function_action_id="string",
limits={
"log_size": 0,
"memory": 0,
"timeout": 0,
},
name="string",
publish=False,
user_defined_annotations="string",
user_defined_parameters="string")
const functionActionResource = new ibm.FunctionAction("functionActionResource", {
exec: {
kind: "string",
code: "string",
codePath: "string",
components: ["string"],
image: "string",
init: "string",
main: "string",
},
namespace: "string",
functionActionId: "string",
limits: {
logSize: 0,
memory: 0,
timeout: 0,
},
name: "string",
publish: false,
userDefinedAnnotations: "string",
userDefinedParameters: "string",
});
type: ibm:FunctionAction
properties:
exec:
code: string
codePath: string
components:
- string
image: string
init: string
kind: string
main: string
functionActionId: string
limits:
logSize: 0
memory: 0
timeout: 0
name: string
namespace: string
publish: false
userDefinedAnnotations: string
userDefinedParameters: string
FunctionAction Resource Properties
To learn more about resource properties and how to use them, see Inputs and Outputs in the Architecture and Concepts docs.
Inputs
In Python, inputs that are objects can be passed either as argument classes or as dictionary literals.
The FunctionAction resource accepts the following input properties:
- Exec
Function
Action Exec A nested block to describe executable binaries.
Nested scheme for
exec:- Namespace string
- The name of the function namespace.
- Function
Action stringId - (String) The ID of the new action.
- Limits
Function
Action Limits A nested block to describe assigned limits.
Nested scheme for
limits:- Name string
- The name of the action.
- Publish bool
- Action visibility.
- User
Defined stringAnnotations - Annotations defined in key value format.
- User
Defined stringParameters - Parameters defined in key value format. Parameter bindings included in the context passed to the action. Cloud Function backend/API.
- Exec
Function
Action Exec Args A nested block to describe executable binaries.
Nested scheme for
exec:- Namespace string
- The name of the function namespace.
- Function
Action stringId - (String) The ID of the new action.
- Limits
Function
Action Limits Args A nested block to describe assigned limits.
Nested scheme for
limits:- Name string
- The name of the action.
- Publish bool
- Action visibility.
- User
Defined stringAnnotations - Annotations defined in key value format.
- User
Defined stringParameters - Parameters defined in key value format. Parameter bindings included in the context passed to the action. Cloud Function backend/API.
- exec
Function
Action Exec A nested block to describe executable binaries.
Nested scheme for
exec:- namespace String
- The name of the function namespace.
- function
Action StringId - (String) The ID of the new action.
- limits
Function
Action Limits A nested block to describe assigned limits.
Nested scheme for
limits:- name String
- The name of the action.
- publish Boolean
- Action visibility.
- user
Defined StringAnnotations - Annotations defined in key value format.
- user
Defined StringParameters - Parameters defined in key value format. Parameter bindings included in the context passed to the action. Cloud Function backend/API.
- exec
Function
Action Exec A nested block to describe executable binaries.
Nested scheme for
exec:- namespace string
- The name of the function namespace.
- function
Action stringId - (String) The ID of the new action.
- limits
Function
Action Limits A nested block to describe assigned limits.
Nested scheme for
limits:- name string
- The name of the action.
- publish boolean
- Action visibility.
- user
Defined stringAnnotations - Annotations defined in key value format.
- user
Defined stringParameters - Parameters defined in key value format. Parameter bindings included in the context passed to the action. Cloud Function backend/API.
- exec_
Function
Action Exec Args A nested block to describe executable binaries.
Nested scheme for
exec:- namespace str
- The name of the function namespace.
- function_
action_ strid - (String) The ID of the new action.
- limits
Function
Action Limits Args A nested block to describe assigned limits.
Nested scheme for
limits:- name str
- The name of the action.
- publish bool
- Action visibility.
- user_
defined_ strannotations - Annotations defined in key value format.
- user_
defined_ strparameters - Parameters defined in key value format. Parameter bindings included in the context passed to the action. Cloud Function backend/API.
- exec Property Map
A nested block to describe executable binaries.
Nested scheme for
exec:- namespace String
- The name of the function namespace.
- function
Action StringId - (String) The ID of the new action.
- limits Property Map
A nested block to describe assigned limits.
Nested scheme for
limits:- name String
- The name of the action.
- publish Boolean
- Action visibility.
- user
Defined StringAnnotations - Annotations defined in key value format.
- user
Defined StringParameters - Parameters defined in key value format. Parameter bindings included in the context passed to the action. Cloud Function backend/API.
Outputs
All input properties are implicitly available as output properties. Additionally, the FunctionAction resource produces the following output properties:
- Action
Id string - (String) The action ID.
- Annotations string
- (List) All annotations to describe the action, including those set by you or by IBM Cloud Functions.
- Id string
- The provider-assigned unique ID for this managed resource.
- Parameters string
- (List) All parameters passed to the action when the action is invoked, including those set by you or by the IBM Cloud Functions.
- Target
Endpoint stringUrl - (String) The target endpoint URL of the action.
- Version string
- (String) Semantic version of the item.
- Action
Id string - (String) The action ID.
- Annotations string
- (List) All annotations to describe the action, including those set by you or by IBM Cloud Functions.
- Id string
- The provider-assigned unique ID for this managed resource.
- Parameters string
- (List) All parameters passed to the action when the action is invoked, including those set by you or by the IBM Cloud Functions.
- Target
Endpoint stringUrl - (String) The target endpoint URL of the action.
- Version string
- (String) Semantic version of the item.
- action
Id String - (String) The action ID.
- annotations String
- (List) All annotations to describe the action, including those set by you or by IBM Cloud Functions.
- id String
- The provider-assigned unique ID for this managed resource.
- parameters String
- (List) All parameters passed to the action when the action is invoked, including those set by you or by the IBM Cloud Functions.
- target
Endpoint StringUrl - (String) The target endpoint URL of the action.
- version String
- (String) Semantic version of the item.
- action
Id string - (String) The action ID.
- annotations string
- (List) All annotations to describe the action, including those set by you or by IBM Cloud Functions.
- id string
- The provider-assigned unique ID for this managed resource.
- parameters string
- (List) All parameters passed to the action when the action is invoked, including those set by you or by the IBM Cloud Functions.
- target
Endpoint stringUrl - (String) The target endpoint URL of the action.
- version string
- (String) Semantic version of the item.
- action_
id str - (String) The action ID.
- annotations str
- (List) All annotations to describe the action, including those set by you or by IBM Cloud Functions.
- id str
- The provider-assigned unique ID for this managed resource.
- parameters str
- (List) All parameters passed to the action when the action is invoked, including those set by you or by the IBM Cloud Functions.
- target_
endpoint_ strurl - (String) The target endpoint URL of the action.
- version str
- (String) Semantic version of the item.
- action
Id String - (String) The action ID.
- annotations String
- (List) All annotations to describe the action, including those set by you or by IBM Cloud Functions.
- id String
- The provider-assigned unique ID for this managed resource.
- parameters String
- (List) All parameters passed to the action when the action is invoked, including those set by you or by the IBM Cloud Functions.
- target
Endpoint StringUrl - (String) The target endpoint URL of the action.
- version String
- (String) Semantic version of the item.
Look up Existing FunctionAction Resource
Get an existing FunctionAction resource’s state with the given name, ID, and optional extra properties used to qualify the lookup.
public static get(name: string, id: Input<ID>, state?: FunctionActionState, opts?: CustomResourceOptions): FunctionAction@staticmethod
def get(resource_name: str,
id: str,
opts: Optional[ResourceOptions] = None,
action_id: Optional[str] = None,
annotations: Optional[str] = None,
exec_: Optional[FunctionActionExecArgs] = None,
function_action_id: Optional[str] = None,
limits: Optional[FunctionActionLimitsArgs] = None,
name: Optional[str] = None,
namespace: Optional[str] = None,
parameters: Optional[str] = None,
publish: Optional[bool] = None,
target_endpoint_url: Optional[str] = None,
user_defined_annotations: Optional[str] = None,
user_defined_parameters: Optional[str] = None,
version: Optional[str] = None) -> FunctionActionfunc GetFunctionAction(ctx *Context, name string, id IDInput, state *FunctionActionState, opts ...ResourceOption) (*FunctionAction, error)public static FunctionAction Get(string name, Input<string> id, FunctionActionState? state, CustomResourceOptions? opts = null)public static FunctionAction get(String name, Output<String> id, FunctionActionState state, CustomResourceOptions options)resources: _: type: ibm:FunctionAction get: id: ${id}- name
- The unique name of the resulting resource.
- id
- The unique provider ID of the resource to lookup.
- state
- Any extra arguments used during the lookup.
- opts
- A bag of options that control this resource's behavior.
- resource_name
- The unique name of the resulting resource.
- id
- The unique provider ID of the resource to lookup.
- name
- The unique name of the resulting resource.
- id
- The unique provider ID of the resource to lookup.
- state
- Any extra arguments used during the lookup.
- opts
- A bag of options that control this resource's behavior.
- name
- The unique name of the resulting resource.
- id
- The unique provider ID of the resource to lookup.
- state
- Any extra arguments used during the lookup.
- opts
- A bag of options that control this resource's behavior.
- name
- The unique name of the resulting resource.
- id
- The unique provider ID of the resource to lookup.
- state
- Any extra arguments used during the lookup.
- opts
- A bag of options that control this resource's behavior.
- Action
Id string - (String) The action ID.
- Annotations string
- (List) All annotations to describe the action, including those set by you or by IBM Cloud Functions.
- Exec
Function
Action Exec A nested block to describe executable binaries.
Nested scheme for
exec:- Function
Action stringId - (String) The ID of the new action.
- Limits
Function
Action Limits A nested block to describe assigned limits.
Nested scheme for
limits:- Name string
- The name of the action.
- Namespace string
- The name of the function namespace.
- Parameters string
- (List) All parameters passed to the action when the action is invoked, including those set by you or by the IBM Cloud Functions.
- Publish bool
- Action visibility.
- Target
Endpoint stringUrl - (String) The target endpoint URL of the action.
- User
Defined stringAnnotations - Annotations defined in key value format.
- User
Defined stringParameters - Parameters defined in key value format. Parameter bindings included in the context passed to the action. Cloud Function backend/API.
- Version string
- (String) Semantic version of the item.
- Action
Id string - (String) The action ID.
- Annotations string
- (List) All annotations to describe the action, including those set by you or by IBM Cloud Functions.
- Exec
Function
Action Exec Args A nested block to describe executable binaries.
Nested scheme for
exec:- Function
Action stringId - (String) The ID of the new action.
- Limits
Function
Action Limits Args A nested block to describe assigned limits.
Nested scheme for
limits:- Name string
- The name of the action.
- Namespace string
- The name of the function namespace.
- Parameters string
- (List) All parameters passed to the action when the action is invoked, including those set by you or by the IBM Cloud Functions.
- Publish bool
- Action visibility.
- Target
Endpoint stringUrl - (String) The target endpoint URL of the action.
- User
Defined stringAnnotations - Annotations defined in key value format.
- User
Defined stringParameters - Parameters defined in key value format. Parameter bindings included in the context passed to the action. Cloud Function backend/API.
- Version string
- (String) Semantic version of the item.
- action
Id String - (String) The action ID.
- annotations String
- (List) All annotations to describe the action, including those set by you or by IBM Cloud Functions.
- exec
Function
Action Exec A nested block to describe executable binaries.
Nested scheme for
exec:- function
Action StringId - (String) The ID of the new action.
- limits
Function
Action Limits A nested block to describe assigned limits.
Nested scheme for
limits:- name String
- The name of the action.
- namespace String
- The name of the function namespace.
- parameters String
- (List) All parameters passed to the action when the action is invoked, including those set by you or by the IBM Cloud Functions.
- publish Boolean
- Action visibility.
- target
Endpoint StringUrl - (String) The target endpoint URL of the action.
- user
Defined StringAnnotations - Annotations defined in key value format.
- user
Defined StringParameters - Parameters defined in key value format. Parameter bindings included in the context passed to the action. Cloud Function backend/API.
- version String
- (String) Semantic version of the item.
- action
Id string - (String) The action ID.
- annotations string
- (List) All annotations to describe the action, including those set by you or by IBM Cloud Functions.
- exec
Function
Action Exec A nested block to describe executable binaries.
Nested scheme for
exec:- function
Action stringId - (String) The ID of the new action.
- limits
Function
Action Limits A nested block to describe assigned limits.
Nested scheme for
limits:- name string
- The name of the action.
- namespace string
- The name of the function namespace.
- parameters string
- (List) All parameters passed to the action when the action is invoked, including those set by you or by the IBM Cloud Functions.
- publish boolean
- Action visibility.
- target
Endpoint stringUrl - (String) The target endpoint URL of the action.
- user
Defined stringAnnotations - Annotations defined in key value format.
- user
Defined stringParameters - Parameters defined in key value format. Parameter bindings included in the context passed to the action. Cloud Function backend/API.
- version string
- (String) Semantic version of the item.
- action_
id str - (String) The action ID.
- annotations str
- (List) All annotations to describe the action, including those set by you or by IBM Cloud Functions.
- exec_
Function
Action Exec Args A nested block to describe executable binaries.
Nested scheme for
exec:- function_
action_ strid - (String) The ID of the new action.
- limits
Function
Action Limits Args A nested block to describe assigned limits.
Nested scheme for
limits:- name str
- The name of the action.
- namespace str
- The name of the function namespace.
- parameters str
- (List) All parameters passed to the action when the action is invoked, including those set by you or by the IBM Cloud Functions.
- publish bool
- Action visibility.
- target_
endpoint_ strurl - (String) The target endpoint URL of the action.
- user_
defined_ strannotations - Annotations defined in key value format.
- user_
defined_ strparameters - Parameters defined in key value format. Parameter bindings included in the context passed to the action. Cloud Function backend/API.
- version str
- (String) Semantic version of the item.
- action
Id String - (String) The action ID.
- annotations String
- (List) All annotations to describe the action, including those set by you or by IBM Cloud Functions.
- exec Property Map
A nested block to describe executable binaries.
Nested scheme for
exec:- function
Action StringId - (String) The ID of the new action.
- limits Property Map
A nested block to describe assigned limits.
Nested scheme for
limits:- name String
- The name of the action.
- namespace String
- The name of the function namespace.
- parameters String
- (List) All parameters passed to the action when the action is invoked, including those set by you or by the IBM Cloud Functions.
- publish Boolean
- Action visibility.
- target
Endpoint StringUrl - (String) The target endpoint URL of the action.
- user
Defined StringAnnotations - Annotations defined in key value format.
- user
Defined StringParameters - Parameters defined in key value format. Parameter bindings included in the context passed to the action. Cloud Function backend/API.
- version String
- (String) Semantic version of the item.
Supporting Types
FunctionActionExec, FunctionActionExecArgs
- Kind string
- The type of action. You can find supported kinds in the IBM Cloud Functions Docs.
- Code string
- The code to execute, when not using the
blackboxexecutable. Note Conflicts withexec.components,exec.code_path. - Code
Path string - When not using the
blackboxexecutable, the file path of code to execute and supports only.zipextension to create the action. Note Conflicts withexec.components,exec.code. - Components List<string>
- The list of fully qualified actions.
Note Conflicts with
exec.code,exec.image,exec.code.path. - Image string
- When using the
blackboxexecutable, the name of the container image name. Note Conflicts withexec.components. - Init string
- When using
nodejs, the optional archive reference. Note Conflicts withexec.components,exec.image. - Main string
- The name of the action entry point (function or fully-qualified method name, when applicable).
Note Conflicts with
exec.components,exec.image.
- Kind string
- The type of action. You can find supported kinds in the IBM Cloud Functions Docs.
- Code string
- The code to execute, when not using the
blackboxexecutable. Note Conflicts withexec.components,exec.code_path. - Code
Path string - When not using the
blackboxexecutable, the file path of code to execute and supports only.zipextension to create the action. Note Conflicts withexec.components,exec.code. - Components []string
- The list of fully qualified actions.
Note Conflicts with
exec.code,exec.image,exec.code.path. - Image string
- When using the
blackboxexecutable, the name of the container image name. Note Conflicts withexec.components. - Init string
- When using
nodejs, the optional archive reference. Note Conflicts withexec.components,exec.image. - Main string
- The name of the action entry point (function or fully-qualified method name, when applicable).
Note Conflicts with
exec.components,exec.image.
- kind String
- The type of action. You can find supported kinds in the IBM Cloud Functions Docs.
- code String
- The code to execute, when not using the
blackboxexecutable. Note Conflicts withexec.components,exec.code_path. - code
Path String - When not using the
blackboxexecutable, the file path of code to execute and supports only.zipextension to create the action. Note Conflicts withexec.components,exec.code. - components List<String>
- The list of fully qualified actions.
Note Conflicts with
exec.code,exec.image,exec.code.path. - image String
- When using the
blackboxexecutable, the name of the container image name. Note Conflicts withexec.components. - init String
- When using
nodejs, the optional archive reference. Note Conflicts withexec.components,exec.image. - main String
- The name of the action entry point (function or fully-qualified method name, when applicable).
Note Conflicts with
exec.components,exec.image.
- kind string
- The type of action. You can find supported kinds in the IBM Cloud Functions Docs.
- code string
- The code to execute, when not using the
blackboxexecutable. Note Conflicts withexec.components,exec.code_path. - code
Path string - When not using the
blackboxexecutable, the file path of code to execute and supports only.zipextension to create the action. Note Conflicts withexec.components,exec.code. - components string[]
- The list of fully qualified actions.
Note Conflicts with
exec.code,exec.image,exec.code.path. - image string
- When using the
blackboxexecutable, the name of the container image name. Note Conflicts withexec.components. - init string
- When using
nodejs, the optional archive reference. Note Conflicts withexec.components,exec.image. - main string
- The name of the action entry point (function or fully-qualified method name, when applicable).
Note Conflicts with
exec.components,exec.image.
- kind str
- The type of action. You can find supported kinds in the IBM Cloud Functions Docs.
- code str
- The code to execute, when not using the
blackboxexecutable. Note Conflicts withexec.components,exec.code_path. - code_
path str - When not using the
blackboxexecutable, the file path of code to execute and supports only.zipextension to create the action. Note Conflicts withexec.components,exec.code. - components Sequence[str]
- The list of fully qualified actions.
Note Conflicts with
exec.code,exec.image,exec.code.path. - image str
- When using the
blackboxexecutable, the name of the container image name. Note Conflicts withexec.components. - init str
- When using
nodejs, the optional archive reference. Note Conflicts withexec.components,exec.image. - main str
- The name of the action entry point (function or fully-qualified method name, when applicable).
Note Conflicts with
exec.components,exec.image.
- kind String
- The type of action. You can find supported kinds in the IBM Cloud Functions Docs.
- code String
- The code to execute, when not using the
blackboxexecutable. Note Conflicts withexec.components,exec.code_path. - code
Path String - When not using the
blackboxexecutable, the file path of code to execute and supports only.zipextension to create the action. Note Conflicts withexec.components,exec.code. - components List<String>
- The list of fully qualified actions.
Note Conflicts with
exec.code,exec.image,exec.code.path. - image String
- When using the
blackboxexecutable, the name of the container image name. Note Conflicts withexec.components. - init String
- When using
nodejs, the optional archive reference. Note Conflicts withexec.components,exec.image. - main String
- The name of the action entry point (function or fully-qualified method name, when applicable).
Note Conflicts with
exec.components,exec.image.
FunctionActionLimits, FunctionActionLimitsArgs
Import
The ibm_function_action resource can be imported by using the namespace and action ID.
Syntax
$ pulumi import ibm:index/functionAction:FunctionAction nodeAction <namespace>:<action_id>
Example
$ pulumi import ibm:index/functionAction:FunctionAction nodeAction Namespace-01:nodezip
To learn more about importing existing cloud resources, see Importing resources.
Package Details
- Repository
- ibm ibm-cloud/terraform-provider-ibm
- License
- Notes
- This Pulumi package is based on the
ibmTerraform Provider.
