github.com/pulumi/pulumi-aws/sdk/v6@v6.32.0/go/aws/sfn/getStateMachine.go (about)

     1  // Code generated by the Pulumi Terraform Bridge (tfgen) Tool DO NOT EDIT.
     2  // *** WARNING: Do not edit by hand unless you're certain you know what you are doing! ***
     3  
     4  package sfn
     5  
     6  import (
     7  	"context"
     8  	"reflect"
     9  
    10  	"github.com/pulumi/pulumi-aws/sdk/v6/go/aws/internal"
    11  	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
    12  )
    13  
    14  // Use this data source to get the ARN of a State Machine in AWS Step
    15  // Function (SFN). By using this data source, you can reference a
    16  // state machine without having to hard code the ARNs as input.
    17  //
    18  // ## Example Usage
    19  //
    20  // <!--Start PulumiCodeChooser -->
    21  // ```go
    22  // package main
    23  //
    24  // import (
    25  //
    26  //	"github.com/pulumi/pulumi-aws/sdk/v6/go/aws/sfn"
    27  //	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
    28  //
    29  // )
    30  //
    31  //	func main() {
    32  //		pulumi.Run(func(ctx *pulumi.Context) error {
    33  //			_, err := sfn.LookupStateMachine(ctx, &sfn.LookupStateMachineArgs{
    34  //				Name: "an_example_sfn_name",
    35  //			}, nil)
    36  //			if err != nil {
    37  //				return err
    38  //			}
    39  //			return nil
    40  //		})
    41  //	}
    42  //
    43  // ```
    44  // <!--End PulumiCodeChooser -->
    45  func LookupStateMachine(ctx *pulumi.Context, args *LookupStateMachineArgs, opts ...pulumi.InvokeOption) (*LookupStateMachineResult, error) {
    46  	opts = internal.PkgInvokeDefaultOpts(opts)
    47  	var rv LookupStateMachineResult
    48  	err := ctx.Invoke("aws:sfn/getStateMachine:getStateMachine", args, &rv, opts...)
    49  	if err != nil {
    50  		return nil, err
    51  	}
    52  	return &rv, nil
    53  }
    54  
    55  // A collection of arguments for invoking getStateMachine.
    56  type LookupStateMachineArgs struct {
    57  	// Friendly name of the state machine to match.
    58  	Name string `pulumi:"name"`
    59  }
    60  
    61  // A collection of values returned by getStateMachine.
    62  type LookupStateMachineResult struct {
    63  	// Set to the arn of the state function.
    64  	Arn string `pulumi:"arn"`
    65  	// Date the state machine was created.
    66  	CreationDate string `pulumi:"creationDate"`
    67  	// Set to the state machine definition.
    68  	Definition  string `pulumi:"definition"`
    69  	Description string `pulumi:"description"`
    70  	// The provider-assigned unique ID for this managed resource.
    71  	Id   string `pulumi:"id"`
    72  	Name string `pulumi:"name"`
    73  	// The revision identifier for the state machine.
    74  	RevisionId string `pulumi:"revisionId"`
    75  	// Set to the roleArn used by the state function.
    76  	RoleArn string `pulumi:"roleArn"`
    77  	// Set to the current status of the state machine.
    78  	Status string `pulumi:"status"`
    79  }
    80  
    81  func LookupStateMachineOutput(ctx *pulumi.Context, args LookupStateMachineOutputArgs, opts ...pulumi.InvokeOption) LookupStateMachineResultOutput {
    82  	return pulumi.ToOutputWithContext(context.Background(), args).
    83  		ApplyT(func(v interface{}) (LookupStateMachineResult, error) {
    84  			args := v.(LookupStateMachineArgs)
    85  			r, err := LookupStateMachine(ctx, &args, opts...)
    86  			var s LookupStateMachineResult
    87  			if r != nil {
    88  				s = *r
    89  			}
    90  			return s, err
    91  		}).(LookupStateMachineResultOutput)
    92  }
    93  
    94  // A collection of arguments for invoking getStateMachine.
    95  type LookupStateMachineOutputArgs struct {
    96  	// Friendly name of the state machine to match.
    97  	Name pulumi.StringInput `pulumi:"name"`
    98  }
    99  
   100  func (LookupStateMachineOutputArgs) ElementType() reflect.Type {
   101  	return reflect.TypeOf((*LookupStateMachineArgs)(nil)).Elem()
   102  }
   103  
   104  // A collection of values returned by getStateMachine.
   105  type LookupStateMachineResultOutput struct{ *pulumi.OutputState }
   106  
   107  func (LookupStateMachineResultOutput) ElementType() reflect.Type {
   108  	return reflect.TypeOf((*LookupStateMachineResult)(nil)).Elem()
   109  }
   110  
   111  func (o LookupStateMachineResultOutput) ToLookupStateMachineResultOutput() LookupStateMachineResultOutput {
   112  	return o
   113  }
   114  
   115  func (o LookupStateMachineResultOutput) ToLookupStateMachineResultOutputWithContext(ctx context.Context) LookupStateMachineResultOutput {
   116  	return o
   117  }
   118  
   119  // Set to the arn of the state function.
   120  func (o LookupStateMachineResultOutput) Arn() pulumi.StringOutput {
   121  	return o.ApplyT(func(v LookupStateMachineResult) string { return v.Arn }).(pulumi.StringOutput)
   122  }
   123  
   124  // Date the state machine was created.
   125  func (o LookupStateMachineResultOutput) CreationDate() pulumi.StringOutput {
   126  	return o.ApplyT(func(v LookupStateMachineResult) string { return v.CreationDate }).(pulumi.StringOutput)
   127  }
   128  
   129  // Set to the state machine definition.
   130  func (o LookupStateMachineResultOutput) Definition() pulumi.StringOutput {
   131  	return o.ApplyT(func(v LookupStateMachineResult) string { return v.Definition }).(pulumi.StringOutput)
   132  }
   133  
   134  func (o LookupStateMachineResultOutput) Description() pulumi.StringOutput {
   135  	return o.ApplyT(func(v LookupStateMachineResult) string { return v.Description }).(pulumi.StringOutput)
   136  }
   137  
   138  // The provider-assigned unique ID for this managed resource.
   139  func (o LookupStateMachineResultOutput) Id() pulumi.StringOutput {
   140  	return o.ApplyT(func(v LookupStateMachineResult) string { return v.Id }).(pulumi.StringOutput)
   141  }
   142  
   143  func (o LookupStateMachineResultOutput) Name() pulumi.StringOutput {
   144  	return o.ApplyT(func(v LookupStateMachineResult) string { return v.Name }).(pulumi.StringOutput)
   145  }
   146  
   147  // The revision identifier for the state machine.
   148  func (o LookupStateMachineResultOutput) RevisionId() pulumi.StringOutput {
   149  	return o.ApplyT(func(v LookupStateMachineResult) string { return v.RevisionId }).(pulumi.StringOutput)
   150  }
   151  
   152  // Set to the roleArn used by the state function.
   153  func (o LookupStateMachineResultOutput) RoleArn() pulumi.StringOutput {
   154  	return o.ApplyT(func(v LookupStateMachineResult) string { return v.RoleArn }).(pulumi.StringOutput)
   155  }
   156  
   157  // Set to the current status of the state machine.
   158  func (o LookupStateMachineResultOutput) Status() pulumi.StringOutput {
   159  	return o.ApplyT(func(v LookupStateMachineResult) string { return v.Status }).(pulumi.StringOutput)
   160  }
   161  
   162  func init() {
   163  	pulumi.RegisterOutputType(LookupStateMachineResultOutput{})
   164  }