Alibaba Cloud

Pulumi Official
Package maintained by Pulumi
v3.28.0 published on Tuesday, Aug 16, 2022 by Pulumi

Execution

Provides a Serverless Workflow Execution resource.

For information about Serverless Workflow Execution and how to use it, see What is Execution.

NOTE: Available in v1.149.0+.

Example Usage

using Pulumi;
using AliCloud = Pulumi.AliCloud;

class MyStack : Stack
{
    public MyStack()
    {
        var config = new Config();
        var name = config.Get("name") ?? "tf-testacc-fnfflow";
        var defaultRole = new AliCloud.Ram.Role("defaultRole", new AliCloud.Ram.RoleArgs
        {
            Document = @"  {
    ""Statement"": [
      {
        ""Action"": ""sts:AssumeRole"",
        ""Effect"": ""Allow"",
        ""Principal"": {
          ""Service"": [
            ""fnf.aliyuncs.com""
          ]
        }
      }
    ],
    ""Version"": ""1""
  }
",
        });
        var defaultFlow = new AliCloud.FNF.Flow("defaultFlow", new AliCloud.FNF.FlowArgs
        {
            Definition = @"  version: v1beta1
  type: flow
  steps:
    - type: wait
      name: custom_wait
      duration: $.wait
",
            RoleArn = defaultRole.Arn,
            Description = "Test for terraform fnf_flow.",
            Type = "FDL",
        });
        var defaultExecution = new AliCloud.FNF.Execution("defaultExecution", new AliCloud.FNF.ExecutionArgs
        {
            ExecutionName = name,
            FlowName = defaultFlow.Name,
            Input = "{\"wait\": 600}",
        });
    }

}
package main

import (
	"fmt"

	"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-testacc-fnfflow"
		if param := cfg.Get("name"); param != "" {
			name = param
		}
		defaultRole, err := ram.NewRole(ctx, "defaultRole", &ram.RoleArgs{
			Document: pulumi.String(fmt.Sprintf(`  {
    "Statement": [
      {
        "Action": "sts:AssumeRole",
        "Effect": "Allow",
        "Principal": {
          "Service": [
            "fnf.aliyuncs.com"
          ]
        }
      }
    ],
    "Version": "1"
  }
`)),
		})
		if err != nil {
			return err
		}
		defaultFlow, err := fnf.NewFlow(ctx, "defaultFlow", &fnf.FlowArgs{
			Definition: pulumi.String(fmt.Sprintf(`  version: v1beta1
  type: flow
  steps:
    - type: wait
      name: custom_wait
      duration: $.wait
`)),
			RoleArn:     defaultRole.Arn,
			Description: pulumi.String("Test for terraform fnf_flow."),
			Type:        pulumi.String("FDL"),
		})
		if err != nil {
			return err
		}
		_, err = fnf.NewExecution(ctx, "defaultExecution", &fnf.ExecutionArgs{
			ExecutionName: pulumi.String(name),
			FlowName:      defaultFlow.Name,
			Input:         pulumi.String("{\"wait\": 600}"),
		})
		if err != nil {
			return err
		}
		return nil
	})
}
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-testacc-fnfflow");
        var defaultRole = new Role("defaultRole", RoleArgs.builder()        
            .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(defaultRole.arn())
            .description("Test for terraform fnf_flow.")
            .type("FDL")
            .build());

        var defaultExecution = new Execution("defaultExecution", ExecutionArgs.builder()        
            .executionName(name)
            .flowName(defaultFlow.name())
            .input("{\"wait\": 600}")
            .build());

    }
}
import pulumi
import pulumi_alicloud as alicloud

config = pulumi.Config()
name = config.get("name")
if name is None:
    name = "tf-testacc-fnfflow"
default_role = alicloud.ram.Role("defaultRole", document="""  {
    "Statement": [
      {
        "Action": "sts:AssumeRole",
        "Effect": "Allow",
        "Principal": {
          "Service": [
            "fnf.aliyuncs.com"
          ]
        }
      }
    ],
    "Version": "1"
  }
""")
default_flow = alicloud.fnf.Flow("defaultFlow",
    definition="""  version: v1beta1
  type: flow
  steps:
    - type: wait
      name: custom_wait
      duration: $.wait
""",
    role_arn=default_role.arn,
    description="Test for terraform fnf_flow.",
    type="FDL")
default_execution = alicloud.fnf.Execution("defaultExecution",
    execution_name=name,
    flow_name=default_flow.name,
    input="{\"wait\": 600}")
import * as pulumi from "@pulumi/pulumi";
import * as alicloud from "@pulumi/alicloud";

const config = new pulumi.Config();
const name = config.get("name") || "tf-testacc-fnfflow";
const defaultRole = new alicloud.ram.Role("defaultRole", {document: `  {
    "Statement": [
      {
        "Action": "sts:AssumeRole",
        "Effect": "Allow",
        "Principal": {
          "Service": [
            "fnf.aliyuncs.com"
          ]
        }
      }
    ],
    "Version": "1"
  }
`});
const defaultFlow = new alicloud.fnf.Flow("defaultFlow", {
    definition: `  version: v1beta1
  type: flow
  steps:
    - type: wait
      name: custom_wait
      duration: $.wait
`,
    roleArn: defaultRole.arn,
    description: "Test for terraform fnf_flow.",
    type: "FDL",
});
const defaultExecution = new alicloud.fnf.Execution("defaultExecution", {
    executionName: name,
    flowName: defaultFlow.name,
    input: "{\"wait\": 600}",
});
configuration:
  name:
    type: string
    default: tf-testacc-fnfflow
resources:
  defaultRole:
    type: alicloud:ram:Role
    properties:
      document: |2
          {
            "Statement": [
              {
                "Action": "sts:AssumeRole",
                "Effect": "Allow",
                "Principal": {
                  "Service": [
                    "fnf.aliyuncs.com"
                  ]
                }
              }
            ],
            "Version": "1"
          }
  defaultFlow:
    type: alicloud:fnf:Flow
    properties:
      definition: |2
          version: v1beta1
          type: flow
          steps:
            - type: wait
              name: custom_wait
              duration: $.wait
      roleArn: ${defaultRole.arn}
      description: Test for terraform fnf_flow.
      type: FDL
  defaultExecution:
    type: alicloud:fnf:Execution
    properties:
      executionName: ${name}
      flowName: ${defaultFlow.name}
      input: '{"wait": 600}'

Create a Execution Resource

new Execution(name: string, args: ExecutionArgs, opts?: CustomResourceOptions);
@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)
@overload
def Execution(resource_name: str,
              args: ExecutionArgs,
              opts: Optional[ResourceOptions] = 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.

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.

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:

ExecutionName string

The name of the execution.

FlowName string

The name of the flow.

Input string

The Input information for this execution.

Status string

The status of the resource. Valid values: Stopped.

ExecutionName string

The name of the execution.

FlowName string

The name of the flow.

Input string

The Input information for this execution.

Status string

The status of the resource. Valid values: Stopped.

executionName String

The name of the execution.

flowName String

The name of the flow.

input String

The Input information for this execution.

status String

The status of the resource. Valid values: Stopped.

executionName string

The name of the execution.

flowName 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.

executionName String

The name of the execution.

flowName 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 an 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.
The following state arguments are supported:
ExecutionName string

The name of the execution.

FlowName string

The name of the flow.

Input string

The Input information for this execution.

Status string

The status of the resource. Valid values: Stopped.

ExecutionName string

The name of the execution.

FlowName string

The name of the flow.

Input string

The Input information for this execution.

Status string

The status of the resource. Valid values: Stopped.

executionName String

The name of the execution.

flowName String

The name of the flow.

input String

The Input information for this execution.

status String

The status of the resource. Valid values: Stopped.

executionName string

The name of the execution.

flowName 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.

executionName String

The name of the execution.

flowName 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>

Package Details

Repository
https://github.com/pulumi/pulumi-alicloud
License
Apache-2.0
Notes

This Pulumi package is based on the alicloud Terraform Provider.