github.com/pulumi/pulumi-aws/sdk/v6@v6.32.0/go/aws/sfn/getAlias.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  // Data source for managing an AWS SFN (Step Functions) State Machine Alias.
    15  //
    16  // ## Example Usage
    17  //
    18  // ### Basic 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.LookupAlias(ctx, &sfn.LookupAliasArgs{
    34  //				Name:            "my_sfn_alias",
    35  //				StatemachineArn: sfnTest.Arn,
    36  //			}, nil)
    37  //			if err != nil {
    38  //				return err
    39  //			}
    40  //			return nil
    41  //		})
    42  //	}
    43  //
    44  // ```
    45  // <!--End PulumiCodeChooser -->
    46  func LookupAlias(ctx *pulumi.Context, args *LookupAliasArgs, opts ...pulumi.InvokeOption) (*LookupAliasResult, error) {
    47  	opts = internal.PkgInvokeDefaultOpts(opts)
    48  	var rv LookupAliasResult
    49  	err := ctx.Invoke("aws:sfn/getAlias:getAlias", args, &rv, opts...)
    50  	if err != nil {
    51  		return nil, err
    52  	}
    53  	return &rv, nil
    54  }
    55  
    56  // A collection of arguments for invoking getAlias.
    57  type LookupAliasArgs struct {
    58  	// Description of state machine alias.
    59  	Description *string `pulumi:"description"`
    60  	// Name of the State Machine alias.
    61  	Name string `pulumi:"name"`
    62  	// ARN of the State Machine.
    63  	StatemachineArn string `pulumi:"statemachineArn"`
    64  }
    65  
    66  // A collection of values returned by getAlias.
    67  type LookupAliasResult struct {
    68  	// ARN identifying the State Machine alias.
    69  	Arn string `pulumi:"arn"`
    70  	// Date the state machine Alias was created.
    71  	CreationDate string `pulumi:"creationDate"`
    72  	// Description of state machine alias.
    73  	Description *string `pulumi:"description"`
    74  	// The provider-assigned unique ID for this managed resource.
    75  	Id   string `pulumi:"id"`
    76  	Name string `pulumi:"name"`
    77  	// Routing Configuration of state machine alias
    78  	RoutingConfigurations []GetAliasRoutingConfiguration `pulumi:"routingConfigurations"`
    79  	StatemachineArn       string                         `pulumi:"statemachineArn"`
    80  }
    81  
    82  func LookupAliasOutput(ctx *pulumi.Context, args LookupAliasOutputArgs, opts ...pulumi.InvokeOption) LookupAliasResultOutput {
    83  	return pulumi.ToOutputWithContext(context.Background(), args).
    84  		ApplyT(func(v interface{}) (LookupAliasResult, error) {
    85  			args := v.(LookupAliasArgs)
    86  			r, err := LookupAlias(ctx, &args, opts...)
    87  			var s LookupAliasResult
    88  			if r != nil {
    89  				s = *r
    90  			}
    91  			return s, err
    92  		}).(LookupAliasResultOutput)
    93  }
    94  
    95  // A collection of arguments for invoking getAlias.
    96  type LookupAliasOutputArgs struct {
    97  	// Description of state machine alias.
    98  	Description pulumi.StringPtrInput `pulumi:"description"`
    99  	// Name of the State Machine alias.
   100  	Name pulumi.StringInput `pulumi:"name"`
   101  	// ARN of the State Machine.
   102  	StatemachineArn pulumi.StringInput `pulumi:"statemachineArn"`
   103  }
   104  
   105  func (LookupAliasOutputArgs) ElementType() reflect.Type {
   106  	return reflect.TypeOf((*LookupAliasArgs)(nil)).Elem()
   107  }
   108  
   109  // A collection of values returned by getAlias.
   110  type LookupAliasResultOutput struct{ *pulumi.OutputState }
   111  
   112  func (LookupAliasResultOutput) ElementType() reflect.Type {
   113  	return reflect.TypeOf((*LookupAliasResult)(nil)).Elem()
   114  }
   115  
   116  func (o LookupAliasResultOutput) ToLookupAliasResultOutput() LookupAliasResultOutput {
   117  	return o
   118  }
   119  
   120  func (o LookupAliasResultOutput) ToLookupAliasResultOutputWithContext(ctx context.Context) LookupAliasResultOutput {
   121  	return o
   122  }
   123  
   124  // ARN identifying the State Machine alias.
   125  func (o LookupAliasResultOutput) Arn() pulumi.StringOutput {
   126  	return o.ApplyT(func(v LookupAliasResult) string { return v.Arn }).(pulumi.StringOutput)
   127  }
   128  
   129  // Date the state machine Alias was created.
   130  func (o LookupAliasResultOutput) CreationDate() pulumi.StringOutput {
   131  	return o.ApplyT(func(v LookupAliasResult) string { return v.CreationDate }).(pulumi.StringOutput)
   132  }
   133  
   134  // Description of state machine alias.
   135  func (o LookupAliasResultOutput) Description() pulumi.StringPtrOutput {
   136  	return o.ApplyT(func(v LookupAliasResult) *string { return v.Description }).(pulumi.StringPtrOutput)
   137  }
   138  
   139  // The provider-assigned unique ID for this managed resource.
   140  func (o LookupAliasResultOutput) Id() pulumi.StringOutput {
   141  	return o.ApplyT(func(v LookupAliasResult) string { return v.Id }).(pulumi.StringOutput)
   142  }
   143  
   144  func (o LookupAliasResultOutput) Name() pulumi.StringOutput {
   145  	return o.ApplyT(func(v LookupAliasResult) string { return v.Name }).(pulumi.StringOutput)
   146  }
   147  
   148  // Routing Configuration of state machine alias
   149  func (o LookupAliasResultOutput) RoutingConfigurations() GetAliasRoutingConfigurationArrayOutput {
   150  	return o.ApplyT(func(v LookupAliasResult) []GetAliasRoutingConfiguration { return v.RoutingConfigurations }).(GetAliasRoutingConfigurationArrayOutput)
   151  }
   152  
   153  func (o LookupAliasResultOutput) StatemachineArn() pulumi.StringOutput {
   154  	return o.ApplyT(func(v LookupAliasResult) string { return v.StatemachineArn }).(pulumi.StringOutput)
   155  }
   156  
   157  func init() {
   158  	pulumi.RegisterOutputType(LookupAliasResultOutput{})
   159  }