alicloud.fnf.Execution
Explore with Pulumi AI
Provides a Serverless Workflow Execution resource.
For information about Serverless Workflow Execution and how to use it, see What is Execution.
NOTE: Available since v1.149.0+.
Example Usage
Basic Usage
import * as pulumi from "@pulumi/pulumi";
import * as alicloud from "@pulumi/alicloud";
const config = new pulumi.Config();
const name = config.get("name") || "tf-example-fnfflow";
const _default = new alicloud.ram.Role("default", {
name: name,
document: ` {
"Statement": [
{
"Action": "sts:AssumeRole",
"Effect": "Allow",
"Principal": {
"Service": [
"fnf.aliyuncs.com"
]
}
}
],
"Version": "1"
}
`,
});
const defaultFlow = new alicloud.fnf.Flow("default", {
definition: ` version: v1beta1
type: flow
steps:
- type: wait
name: custom_wait
duration: .wait
`,
roleArn: _default.arn,
description: "Test for terraform fnf_flow.",
name: name,
type: "FDL",
});
const defaultExecution = new alicloud.fnf.Execution("default", {
executionName: name,
flowName: defaultFlow.name,
input: "{\"wait\": 600}",
});
import pulumi
import pulumi_alicloud as alicloud
config = pulumi.Config()
name = config.get("name")
if name is None:
name = "tf-example-fnfflow"
default = alicloud.ram.Role("default",
name=name,
document=""" {
"Statement": [
{
"Action": "sts:AssumeRole",
"Effect": "Allow",
"Principal": {
"Service": [
"fnf.aliyuncs.com"
]
}
}
],
"Version": "1"
}
""")
default_flow = alicloud.fnf.Flow("default",
definition=""" version: v1beta1
type: flow
steps:
- type: wait
name: custom_wait
duration: $.wait
""",
role_arn=default.arn,
description="Test for terraform fnf_flow.",
name=name,
type="FDL")
default_execution = alicloud.fnf.Execution("default",
execution_name=name,
flow_name=default_flow.name,
input="{\"wait\": 600}")
package main
import (
"github.com/pulumi/pulumi-alicloud/sdk/v3/go/alicloud/fnf"
"github.com/pulumi/pulumi-alicloud/sdk/v3/go/alicloud/ram"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi/config"
)
func main() {
pulumi.Run(func(ctx *pulumi.Context) error {
cfg := config.New(ctx, "")
name := "tf-example-fnfflow"
if param := cfg.Get("name"); param != "" {
name = param
}
_, err := ram.NewRole(ctx, "default", &ram.RoleArgs{
Name: pulumi.String(name),
Document: pulumi.String(` {
"Statement": [
{
"Action": "sts:AssumeRole",
"Effect": "Allow",
"Principal": {
"Service": [
"fnf.aliyuncs.com"
]
}
}
],
"Version": "1"
}
`),
})
if err != nil {
return err
}
defaultFlow, err := fnf.NewFlow(ctx, "default", &fnf.FlowArgs{
Definition: pulumi.String(` version: v1beta1
type: flow
steps:
- type: wait
name: custom_wait
duration: $.wait
`),
RoleArn: _default.Arn,
Description: pulumi.String("Test for terraform fnf_flow."),
Name: pulumi.String(name),
Type: pulumi.String("FDL"),
})
if err != nil {
return err
}
_, err = fnf.NewExecution(ctx, "default", &fnf.ExecutionArgs{
ExecutionName: pulumi.String(name),
FlowName: defaultFlow.Name,
Input: pulumi.String("{\"wait\": 600}"),
})
if err != nil {
return err
}
return nil
})
}
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using AliCloud = Pulumi.AliCloud;
return await Deployment.RunAsync(() =>
{
var config = new Config();
var name = config.Get("name") ?? "tf-example-fnfflow";
var @default = new AliCloud.Ram.Role("default", new()
{
Name = name,
Document = @" {
""Statement"": [
{
""Action"": ""sts:AssumeRole"",
""Effect"": ""Allow"",
""Principal"": {
""Service"": [
""fnf.aliyuncs.com""
]
}
}
],
""Version"": ""1""
}
",
});
var defaultFlow = new AliCloud.FNF.Flow("default", new()
{
Definition = @" version: v1beta1
type: flow
steps:
- type: wait
name: custom_wait
duration: $.wait
",
RoleArn = @default.Arn,
Description = "Test for terraform fnf_flow.",
Name = name,
Type = "FDL",
});
var defaultExecution = new AliCloud.FNF.Execution("default", new()
{
ExecutionName = name,
FlowName = defaultFlow.Name,
Input = "{\"wait\": 600}",
});
});
package generated_program;
import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.alicloud.ram.Role;
import com.pulumi.alicloud.ram.RoleArgs;
import com.pulumi.alicloud.fnf.Flow;
import com.pulumi.alicloud.fnf.FlowArgs;
import com.pulumi.alicloud.fnf.Execution;
import com.pulumi.alicloud.fnf.ExecutionArgs;
import java.util.List;
import java.util.ArrayList;
import java.util.Map;
import java.io.File;
import java.nio.file.Files;
import java.nio.file.Paths;
public class App {
public static void main(String[] args) {
Pulumi.run(App::stack);
}
public static void stack(Context ctx) {
final var config = ctx.config();
final var name = config.get("name").orElse("tf-example-fnfflow");
var default_ = new Role("default", RoleArgs.builder()
.name(name)
.document("""
{
"Statement": [
{
"Action": "sts:AssumeRole",
"Effect": "Allow",
"Principal": {
"Service": [
"fnf.aliyuncs.com"
]
}
}
],
"Version": "1"
}
""")
.build());
var defaultFlow = new Flow("defaultFlow", FlowArgs.builder()
.definition("""
version: v1beta1
type: flow
steps:
- type: wait
name: custom_wait
duration: $.wait
""")
.roleArn(default_.arn())
.description("Test for terraform fnf_flow.")
.name(name)
.type("FDL")
.build());
var defaultExecution = new Execution("defaultExecution", ExecutionArgs.builder()
.executionName(name)
.flowName(defaultFlow.name())
.input("{\"wait\": 600}")
.build());
}
}
configuration:
name:
type: string
default: tf-example-fnfflow
resources:
default:
type: alicloud:ram:Role
properties:
name: ${name}
document: |2
{
"Statement": [
{
"Action": "sts:AssumeRole",
"Effect": "Allow",
"Principal": {
"Service": [
"fnf.aliyuncs.com"
]
}
}
],
"Version": "1"
}
defaultFlow:
type: alicloud:fnf:Flow
name: default
properties:
definition: |2
version: v1beta1
type: flow
steps:
- type: wait
name: custom_wait
duration: $.wait
roleArn: ${default.arn}
description: Test for terraform fnf_flow.
name: ${name}
type: FDL
defaultExecution:
type: alicloud:fnf:Execution
name: default
properties:
executionName: ${name}
flowName: ${defaultFlow.name}
input: '{"wait": 600}'
Create Execution Resource
Resources are created with functions called constructors. To learn more about declaring and configuring resources, see Resources.
Constructor syntax
new Execution(name: string, args: ExecutionArgs, opts?: CustomResourceOptions);
@overload
def Execution(resource_name: str,
args: ExecutionArgs,
opts: Optional[ResourceOptions] = None)
@overload
def Execution(resource_name: str,
opts: Optional[ResourceOptions] = None,
execution_name: Optional[str] = None,
flow_name: Optional[str] = None,
input: Optional[str] = None,
status: Optional[str] = None)
func NewExecution(ctx *Context, name string, args ExecutionArgs, opts ...ResourceOption) (*Execution, error)
public Execution(string name, ExecutionArgs args, CustomResourceOptions? opts = null)
public Execution(String name, ExecutionArgs args)
public Execution(String name, ExecutionArgs args, CustomResourceOptions options)
type: alicloud:fnf:Execution
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 ExecutionArgs
- 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 ExecutionArgs
- 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 ExecutionArgs
- The arguments to resource properties.
- opts ResourceOption
- Bag of options to control resource's behavior.
- name string
- The unique name of the resource.
- args ExecutionArgs
- The arguments to resource properties.
- opts CustomResourceOptions
- Bag of options to control resource's behavior.
- name String
- The unique name of the resource.
- args ExecutionArgs
- 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 executionResource = new AliCloud.FNF.Execution("executionResource", new()
{
ExecutionName = "string",
FlowName = "string",
Input = "string",
Status = "string",
});
example, err := fnf.NewExecution(ctx, "executionResource", &fnf.ExecutionArgs{
ExecutionName: pulumi.String("string"),
FlowName: pulumi.String("string"),
Input: pulumi.String("string"),
Status: pulumi.String("string"),
})
var executionResource = new Execution("executionResource", ExecutionArgs.builder()
.executionName("string")
.flowName("string")
.input("string")
.status("string")
.build());
execution_resource = alicloud.fnf.Execution("executionResource",
execution_name="string",
flow_name="string",
input="string",
status="string")
const executionResource = new alicloud.fnf.Execution("executionResource", {
executionName: "string",
flowName: "string",
input: "string",
status: "string",
});
type: alicloud:fnf:Execution
properties:
executionName: string
flowName: string
input: string
status: string
Execution Resource Properties
To learn more about resource properties and how to use them, see Inputs and Outputs in the Architecture and Concepts docs.
Inputs
The Execution resource accepts the following input properties:
- Execution
Name string - The name of the execution.
- Flow
Name string - The name of the flow.
- Input string
- The Input information for this execution.
- Status string
- The status of the resource. Valid values:
Stopped
.
- Execution
Name string - The name of the execution.
- Flow
Name string - The name of the flow.
- Input string
- The Input information for this execution.
- Status string
- The status of the resource. Valid values:
Stopped
.
- execution
Name String - The name of the execution.
- flow
Name String - The name of the flow.
- input String
- The Input information for this execution.
- status String
- The status of the resource. Valid values:
Stopped
.
- execution
Name string - The name of the execution.
- flow
Name string - The name of the flow.
- input string
- The Input information for this execution.
- status string
- The status of the resource. Valid values:
Stopped
.
- execution_
name str - The name of the execution.
- flow_
name str - The name of the flow.
- input str
- The Input information for this execution.
- status str
- The status of the resource. Valid values:
Stopped
.
- execution
Name String - The name of the execution.
- flow
Name String - The name of the flow.
- input String
- The Input information for this execution.
- status String
- The status of the resource. Valid values:
Stopped
.
Outputs
All input properties are implicitly available as output properties. Additionally, the Execution resource produces the following output properties:
- Id string
- The provider-assigned unique ID for this managed resource.
- Id string
- The provider-assigned unique ID for this managed resource.
- id String
- The provider-assigned unique ID for this managed resource.
- id string
- The provider-assigned unique ID for this managed resource.
- id str
- The provider-assigned unique ID for this managed resource.
- id String
- The provider-assigned unique ID for this managed resource.
Look up Existing Execution Resource
Get an existing Execution 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?: ExecutionState, opts?: CustomResourceOptions): Execution
@staticmethod
def get(resource_name: str,
id: str,
opts: Optional[ResourceOptions] = None,
execution_name: Optional[str] = None,
flow_name: Optional[str] = None,
input: Optional[str] = None,
status: Optional[str] = None) -> Execution
func GetExecution(ctx *Context, name string, id IDInput, state *ExecutionState, opts ...ResourceOption) (*Execution, error)
public static Execution Get(string name, Input<string> id, ExecutionState? state, CustomResourceOptions? opts = null)
public static Execution get(String name, Output<String> id, ExecutionState state, CustomResourceOptions options)
Resource lookup is not supported in YAML
- 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.
- Execution
Name string - The name of the execution.
- Flow
Name string - The name of the flow.
- Input string
- The Input information for this execution.
- Status string
- The status of the resource. Valid values:
Stopped
.
- Execution
Name string - The name of the execution.
- Flow
Name string - The name of the flow.
- Input string
- The Input information for this execution.
- Status string
- The status of the resource. Valid values:
Stopped
.
- execution
Name String - The name of the execution.
- flow
Name String - The name of the flow.
- input String
- The Input information for this execution.
- status String
- The status of the resource. Valid values:
Stopped
.
- execution
Name string - The name of the execution.
- flow
Name string - The name of the flow.
- input string
- The Input information for this execution.
- status string
- The status of the resource. Valid values:
Stopped
.
- execution_
name str - The name of the execution.
- flow_
name str - The name of the flow.
- input str
- The Input information for this execution.
- status str
- The status of the resource. Valid values:
Stopped
.
- execution
Name String - The name of the execution.
- flow
Name String - The name of the flow.
- input String
- The Input information for this execution.
- status String
- The status of the resource. Valid values:
Stopped
.
Import
Serverless Workflow Execution can be imported using the id, e.g.
$ pulumi import alicloud:fnf/execution:Execution example <flow_name>:<execution_name>
To learn more about importing existing cloud resources, see Importing resources.
Package Details
- Repository
- Alibaba Cloud pulumi/pulumi-alicloud
- License
- Apache-2.0
- Notes
- This Pulumi package is based on the
alicloud
Terraform Provider.