1. Packages
  2. StrongDM
  3. API Docs
  4. Workflow
StrongDM v1.12.0 published on Sunday, Apr 28, 2024 by Piers Karsenbarg

sdm.Workflow

Explore with Pulumi AI

sdm logo
StrongDM v1.12.0 published on Sunday, Apr 28, 2024 by Piers Karsenbarg

    Workflows are the collection of rules that define the resources to which access can be requested, the users that can request that access, and the mechanism for approving those requests which can either but automatic approval or a set of users authorized to approve the requests.

    Example Usage

    import * as pulumi from "@pulumi/pulumi";
    import * as sdm from "@pierskarsenbarg/sdm";
    
    const autoGrantWorkflow = new sdm.Workflow("autoGrantWorkflow", {
        autoGrant: true,
        enabled: true,
        accessRules: JSON.stringify([{
            type: "redis",
            tags: {
                region: "us-east",
            },
        }]),
    });
    const manualApprovalWorkflow = new sdm.Workflow("manualApprovalWorkflow", {
        autoGrant: false,
        accessRules: JSON.stringify([{
            type: "redis",
            tags: {
                region: "us-east",
            },
        }]),
    });
    
    import pulumi
    import json
    import pierskarsenbarg_pulumi_sdm as sdm
    
    auto_grant_workflow = sdm.Workflow("autoGrantWorkflow",
        auto_grant=True,
        enabled=True,
        access_rules=json.dumps([{
            "type": "redis",
            "tags": {
                "region": "us-east",
            },
        }]))
    manual_approval_workflow = sdm.Workflow("manualApprovalWorkflow",
        auto_grant=False,
        access_rules=json.dumps([{
            "type": "redis",
            "tags": {
                "region": "us-east",
            },
        }]))
    
    package main
    
    import (
    	"encoding/json"
    
    	"github.com/pierskarsenbarg/pulumi-sdm/sdk/go/sdm"
    	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
    )
    
    func main() {
    	pulumi.Run(func(ctx *pulumi.Context) error {
    		tmpJSON0, err := json.Marshal([]map[string]interface{}{
    			map[string]interface{}{
    				"type": "redis",
    				"tags": map[string]interface{}{
    					"region": "us-east",
    				},
    			},
    		})
    		if err != nil {
    			return err
    		}
    		json0 := string(tmpJSON0)
    		_, err = sdm.NewWorkflow(ctx, "autoGrantWorkflow", &sdm.WorkflowArgs{
    			AutoGrant:   pulumi.Bool(true),
    			Enabled:     pulumi.Bool(true),
    			AccessRules: pulumi.String(json0),
    		})
    		if err != nil {
    			return err
    		}
    		tmpJSON1, err := json.Marshal([]map[string]interface{}{
    			map[string]interface{}{
    				"type": "redis",
    				"tags": map[string]interface{}{
    					"region": "us-east",
    				},
    			},
    		})
    		if err != nil {
    			return err
    		}
    		json1 := string(tmpJSON1)
    		_, err = sdm.NewWorkflow(ctx, "manualApprovalWorkflow", &sdm.WorkflowArgs{
    			AutoGrant:   pulumi.Bool(false),
    			AccessRules: pulumi.String(json1),
    		})
    		if err != nil {
    			return err
    		}
    		return nil
    	})
    }
    
    using System.Collections.Generic;
    using System.Linq;
    using System.Text.Json;
    using Pulumi;
    using Sdm = PiersKarsenbarg.Sdm;
    
    return await Deployment.RunAsync(() => 
    {
        var autoGrantWorkflow = new Sdm.Workflow("autoGrantWorkflow", new()
        {
            AutoGrant = true,
            Enabled = true,
            AccessRules = JsonSerializer.Serialize(new[]
            {
                new Dictionary<string, object?>
                {
                    ["type"] = "redis",
                    ["tags"] = new Dictionary<string, object?>
                    {
                        ["region"] = "us-east",
                    },
                },
            }),
        });
    
        var manualApprovalWorkflow = new Sdm.Workflow("manualApprovalWorkflow", new()
        {
            AutoGrant = false,
            AccessRules = JsonSerializer.Serialize(new[]
            {
                new Dictionary<string, object?>
                {
                    ["type"] = "redis",
                    ["tags"] = new Dictionary<string, object?>
                    {
                        ["region"] = "us-east",
                    },
                },
            }),
        });
    
    });
    
    package generated_program;
    
    import com.pulumi.Context;
    import com.pulumi.Pulumi;
    import com.pulumi.core.Output;
    import com.pulumi.sdm.Workflow;
    import com.pulumi.sdm.WorkflowArgs;
    import static com.pulumi.codegen.internal.Serialization.*;
    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) {
            var autoGrantWorkflow = new Workflow("autoGrantWorkflow", WorkflowArgs.builder()        
                .autoGrant(true)
                .enabled(true)
                .accessRules(serializeJson(
                    jsonArray(jsonObject(
                        jsonProperty("type", "redis"),
                        jsonProperty("tags", jsonObject(
                            jsonProperty("region", "us-east")
                        ))
                    ))))
                .build());
    
            var manualApprovalWorkflow = new Workflow("manualApprovalWorkflow", WorkflowArgs.builder()        
                .autoGrant(false)
                .accessRules(serializeJson(
                    jsonArray(jsonObject(
                        jsonProperty("type", "redis"),
                        jsonProperty("tags", jsonObject(
                            jsonProperty("region", "us-east")
                        ))
                    ))))
                .build());
    
        }
    }
    
    resources:
      autoGrantWorkflow:
        type: sdm:Workflow
        properties:
          autoGrant: true
          enabled: true
          accessRules:
            fn::toJSON:
              - type: redis
                tags:
                  region: us-east
      manualApprovalWorkflow:
        type: sdm:Workflow
        properties:
          autoGrant: false
          accessRules:
            fn::toJSON:
              - type: redis
                tags:
                  region: us-east
    

    This resource can be imported using the import command.

    Create Workflow Resource

    Resources are created with functions called constructors. To learn more about declaring and configuring resources, see Resources.

    Constructor syntax

    new Workflow(name: string, args?: WorkflowArgs, opts?: CustomResourceOptions);
    @overload
    def Workflow(resource_name: str,
                 args: Optional[WorkflowArgs] = None,
                 opts: Optional[ResourceOptions] = None)
    
    @overload
    def Workflow(resource_name: str,
                 opts: Optional[ResourceOptions] = None,
                 access_rules: Optional[str] = None,
                 approval_flow_id: Optional[str] = None,
                 auto_grant: Optional[bool] = None,
                 description: Optional[str] = None,
                 enabled: Optional[bool] = None,
                 name: Optional[str] = None,
                 weight: Optional[int] = None)
    func NewWorkflow(ctx *Context, name string, args *WorkflowArgs, opts ...ResourceOption) (*Workflow, error)
    public Workflow(string name, WorkflowArgs? args = null, CustomResourceOptions? opts = null)
    public Workflow(String name, WorkflowArgs args)
    public Workflow(String name, WorkflowArgs args, CustomResourceOptions options)
    
    type: sdm:Workflow
    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 WorkflowArgs
    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 WorkflowArgs
    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 WorkflowArgs
    The arguments to resource properties.
    opts ResourceOption
    Bag of options to control resource's behavior.
    name string
    The unique name of the resource.
    args WorkflowArgs
    The arguments to resource properties.
    opts CustomResourceOptions
    Bag of options to control resource's behavior.
    name String
    The unique name of the resource.
    args WorkflowArgs
    The arguments to resource properties.
    options CustomResourceOptions
    Bag of options to control resource's behavior.

    Example

    The following reference example uses placeholder values for all input properties.

    var workflowResource = new Sdm.Workflow("workflowResource", new()
    {
        AccessRules = "string",
        ApprovalFlowId = "string",
        AutoGrant = false,
        Description = "string",
        Enabled = false,
        Name = "string",
        Weight = 0,
    });
    
    example, err := sdm.NewWorkflow(ctx, "workflowResource", &sdm.WorkflowArgs{
    	AccessRules:    pulumi.String("string"),
    	ApprovalFlowId: pulumi.String("string"),
    	AutoGrant:      pulumi.Bool(false),
    	Description:    pulumi.String("string"),
    	Enabled:        pulumi.Bool(false),
    	Name:           pulumi.String("string"),
    	Weight:         pulumi.Int(0),
    })
    
    var workflowResource = new Workflow("workflowResource", WorkflowArgs.builder()        
        .accessRules("string")
        .approvalFlowId("string")
        .autoGrant(false)
        .description("string")
        .enabled(false)
        .name("string")
        .weight(0)
        .build());
    
    workflow_resource = sdm.Workflow("workflowResource",
        access_rules="string",
        approval_flow_id="string",
        auto_grant=False,
        description="string",
        enabled=False,
        name="string",
        weight=0)
    
    const workflowResource = new sdm.Workflow("workflowResource", {
        accessRules: "string",
        approvalFlowId: "string",
        autoGrant: false,
        description: "string",
        enabled: false,
        name: "string",
        weight: 0,
    });
    
    type: sdm:Workflow
    properties:
        accessRules: string
        approvalFlowId: string
        autoGrant: false
        description: string
        enabled: false
        name: string
        weight: 0
    

    Workflow 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 Workflow resource accepts the following input properties:

    AccessRules string
    AccessRules is a list of access rules defining the resources this Workflow provides access to.
    ApprovalFlowId string
    Optional approval flow ID identifies an approval flow that linked to the workflow
    AutoGrant bool
    Optional auto grant setting to automatically approve requests or not, defaults to false.
    Description string
    Optional description of the Workflow.
    Enabled bool
    Optional enabled state for workflow. This setting may be overridden by the system if the workflow doesn't meet the requirements to be enabled or if other conditions prevent enabling the workflow. The requirements to enable a workflow are that the workflow must be either set up for with auto grant enabled or have one or more WorkflowApprovers created for the workflow.
    Name string
    Unique human-readable name of the Workflow.
    Weight int
    Optional weight for workflow to specify it's priority in matching a request.
    AccessRules string
    AccessRules is a list of access rules defining the resources this Workflow provides access to.
    ApprovalFlowId string
    Optional approval flow ID identifies an approval flow that linked to the workflow
    AutoGrant bool
    Optional auto grant setting to automatically approve requests or not, defaults to false.
    Description string
    Optional description of the Workflow.
    Enabled bool
    Optional enabled state for workflow. This setting may be overridden by the system if the workflow doesn't meet the requirements to be enabled or if other conditions prevent enabling the workflow. The requirements to enable a workflow are that the workflow must be either set up for with auto grant enabled or have one or more WorkflowApprovers created for the workflow.
    Name string
    Unique human-readable name of the Workflow.
    Weight int
    Optional weight for workflow to specify it's priority in matching a request.
    accessRules String
    AccessRules is a list of access rules defining the resources this Workflow provides access to.
    approvalFlowId String
    Optional approval flow ID identifies an approval flow that linked to the workflow
    autoGrant Boolean
    Optional auto grant setting to automatically approve requests or not, defaults to false.
    description String
    Optional description of the Workflow.
    enabled Boolean
    Optional enabled state for workflow. This setting may be overridden by the system if the workflow doesn't meet the requirements to be enabled or if other conditions prevent enabling the workflow. The requirements to enable a workflow are that the workflow must be either set up for with auto grant enabled or have one or more WorkflowApprovers created for the workflow.
    name String
    Unique human-readable name of the Workflow.
    weight Integer
    Optional weight for workflow to specify it's priority in matching a request.
    accessRules string
    AccessRules is a list of access rules defining the resources this Workflow provides access to.
    approvalFlowId string
    Optional approval flow ID identifies an approval flow that linked to the workflow
    autoGrant boolean
    Optional auto grant setting to automatically approve requests or not, defaults to false.
    description string
    Optional description of the Workflow.
    enabled boolean
    Optional enabled state for workflow. This setting may be overridden by the system if the workflow doesn't meet the requirements to be enabled or if other conditions prevent enabling the workflow. The requirements to enable a workflow are that the workflow must be either set up for with auto grant enabled or have one or more WorkflowApprovers created for the workflow.
    name string
    Unique human-readable name of the Workflow.
    weight number
    Optional weight for workflow to specify it's priority in matching a request.
    access_rules str
    AccessRules is a list of access rules defining the resources this Workflow provides access to.
    approval_flow_id str
    Optional approval flow ID identifies an approval flow that linked to the workflow
    auto_grant bool
    Optional auto grant setting to automatically approve requests or not, defaults to false.
    description str
    Optional description of the Workflow.
    enabled bool
    Optional enabled state for workflow. This setting may be overridden by the system if the workflow doesn't meet the requirements to be enabled or if other conditions prevent enabling the workflow. The requirements to enable a workflow are that the workflow must be either set up for with auto grant enabled or have one or more WorkflowApprovers created for the workflow.
    name str
    Unique human-readable name of the Workflow.
    weight int
    Optional weight for workflow to specify it's priority in matching a request.
    accessRules String
    AccessRules is a list of access rules defining the resources this Workflow provides access to.
    approvalFlowId String
    Optional approval flow ID identifies an approval flow that linked to the workflow
    autoGrant Boolean
    Optional auto grant setting to automatically approve requests or not, defaults to false.
    description String
    Optional description of the Workflow.
    enabled Boolean
    Optional enabled state for workflow. This setting may be overridden by the system if the workflow doesn't meet the requirements to be enabled or if other conditions prevent enabling the workflow. The requirements to enable a workflow are that the workflow must be either set up for with auto grant enabled or have one or more WorkflowApprovers created for the workflow.
    name String
    Unique human-readable name of the Workflow.
    weight Number
    Optional weight for workflow to specify it's priority in matching a request.

    Outputs

    All input properties are implicitly available as output properties. Additionally, the Workflow 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 Workflow Resource

    Get an existing Workflow 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?: WorkflowState, opts?: CustomResourceOptions): Workflow
    @staticmethod
    def get(resource_name: str,
            id: str,
            opts: Optional[ResourceOptions] = None,
            access_rules: Optional[str] = None,
            approval_flow_id: Optional[str] = None,
            auto_grant: Optional[bool] = None,
            description: Optional[str] = None,
            enabled: Optional[bool] = None,
            name: Optional[str] = None,
            weight: Optional[int] = None) -> Workflow
    func GetWorkflow(ctx *Context, name string, id IDInput, state *WorkflowState, opts ...ResourceOption) (*Workflow, error)
    public static Workflow Get(string name, Input<string> id, WorkflowState? state, CustomResourceOptions? opts = null)
    public static Workflow get(String name, Output<String> id, WorkflowState 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:
    AccessRules string
    AccessRules is a list of access rules defining the resources this Workflow provides access to.
    ApprovalFlowId string
    Optional approval flow ID identifies an approval flow that linked to the workflow
    AutoGrant bool
    Optional auto grant setting to automatically approve requests or not, defaults to false.
    Description string
    Optional description of the Workflow.
    Enabled bool
    Optional enabled state for workflow. This setting may be overridden by the system if the workflow doesn't meet the requirements to be enabled or if other conditions prevent enabling the workflow. The requirements to enable a workflow are that the workflow must be either set up for with auto grant enabled or have one or more WorkflowApprovers created for the workflow.
    Name string
    Unique human-readable name of the Workflow.
    Weight int
    Optional weight for workflow to specify it's priority in matching a request.
    AccessRules string
    AccessRules is a list of access rules defining the resources this Workflow provides access to.
    ApprovalFlowId string
    Optional approval flow ID identifies an approval flow that linked to the workflow
    AutoGrant bool
    Optional auto grant setting to automatically approve requests or not, defaults to false.
    Description string
    Optional description of the Workflow.
    Enabled bool
    Optional enabled state for workflow. This setting may be overridden by the system if the workflow doesn't meet the requirements to be enabled or if other conditions prevent enabling the workflow. The requirements to enable a workflow are that the workflow must be either set up for with auto grant enabled or have one or more WorkflowApprovers created for the workflow.
    Name string
    Unique human-readable name of the Workflow.
    Weight int
    Optional weight for workflow to specify it's priority in matching a request.
    accessRules String
    AccessRules is a list of access rules defining the resources this Workflow provides access to.
    approvalFlowId String
    Optional approval flow ID identifies an approval flow that linked to the workflow
    autoGrant Boolean
    Optional auto grant setting to automatically approve requests or not, defaults to false.
    description String
    Optional description of the Workflow.
    enabled Boolean
    Optional enabled state for workflow. This setting may be overridden by the system if the workflow doesn't meet the requirements to be enabled or if other conditions prevent enabling the workflow. The requirements to enable a workflow are that the workflow must be either set up for with auto grant enabled or have one or more WorkflowApprovers created for the workflow.
    name String
    Unique human-readable name of the Workflow.
    weight Integer
    Optional weight for workflow to specify it's priority in matching a request.
    accessRules string
    AccessRules is a list of access rules defining the resources this Workflow provides access to.
    approvalFlowId string
    Optional approval flow ID identifies an approval flow that linked to the workflow
    autoGrant boolean
    Optional auto grant setting to automatically approve requests or not, defaults to false.
    description string
    Optional description of the Workflow.
    enabled boolean
    Optional enabled state for workflow. This setting may be overridden by the system if the workflow doesn't meet the requirements to be enabled or if other conditions prevent enabling the workflow. The requirements to enable a workflow are that the workflow must be either set up for with auto grant enabled or have one or more WorkflowApprovers created for the workflow.
    name string
    Unique human-readable name of the Workflow.
    weight number
    Optional weight for workflow to specify it's priority in matching a request.
    access_rules str
    AccessRules is a list of access rules defining the resources this Workflow provides access to.
    approval_flow_id str
    Optional approval flow ID identifies an approval flow that linked to the workflow
    auto_grant bool
    Optional auto grant setting to automatically approve requests or not, defaults to false.
    description str
    Optional description of the Workflow.
    enabled bool
    Optional enabled state for workflow. This setting may be overridden by the system if the workflow doesn't meet the requirements to be enabled or if other conditions prevent enabling the workflow. The requirements to enable a workflow are that the workflow must be either set up for with auto grant enabled or have one or more WorkflowApprovers created for the workflow.
    name str
    Unique human-readable name of the Workflow.
    weight int
    Optional weight for workflow to specify it's priority in matching a request.
    accessRules String
    AccessRules is a list of access rules defining the resources this Workflow provides access to.
    approvalFlowId String
    Optional approval flow ID identifies an approval flow that linked to the workflow
    autoGrant Boolean
    Optional auto grant setting to automatically approve requests or not, defaults to false.
    description String
    Optional description of the Workflow.
    enabled Boolean
    Optional enabled state for workflow. This setting may be overridden by the system if the workflow doesn't meet the requirements to be enabled or if other conditions prevent enabling the workflow. The requirements to enable a workflow are that the workflow must be either set up for with auto grant enabled or have one or more WorkflowApprovers created for the workflow.
    name String
    Unique human-readable name of the Workflow.
    weight Number
    Optional weight for workflow to specify it's priority in matching a request.

    Import

    A Workflow can be imported using the id, e.g.,

    $ pulumi import sdm:index/workflow:Workflow example aw-12345678
    

    To learn more about importing existing cloud resources, see Importing resources.

    Package Details

    Repository
    sdm pierskarsenbarg/pulumi-sdm
    License
    Apache-2.0
    Notes
    This Pulumi package is based on the sdm Terraform Provider.
    sdm logo
    StrongDM v1.12.0 published on Sunday, Apr 28, 2024 by Piers Karsenbarg