github.com/pulumi/pulumi-aws/sdk/v6@v6.32.0/go/aws/elasticbeanstalk/getSolutionStack.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 elasticbeanstalk 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 name of a elastic beanstalk solution stack. 15 // 16 // ## Example Usage 17 // 18 // <!--Start PulumiCodeChooser --> 19 // ```go 20 // package main 21 // 22 // import ( 23 // 24 // "github.com/pulumi/pulumi-aws/sdk/v6/go/aws/elasticbeanstalk" 25 // "github.com/pulumi/pulumi/sdk/v3/go/pulumi" 26 // 27 // ) 28 // 29 // func main() { 30 // pulumi.Run(func(ctx *pulumi.Context) error { 31 // _, err := elasticbeanstalk.GetSolutionStack(ctx, &elasticbeanstalk.GetSolutionStackArgs{ 32 // MostRecent: pulumi.BoolRef(true), 33 // NameRegex: "^64bit Amazon Linux (.*) Multi-container Docker (.*)$", 34 // }, nil) 35 // if err != nil { 36 // return err 37 // } 38 // return nil 39 // }) 40 // } 41 // 42 // ``` 43 // <!--End PulumiCodeChooser --> 44 func GetSolutionStack(ctx *pulumi.Context, args *GetSolutionStackArgs, opts ...pulumi.InvokeOption) (*GetSolutionStackResult, error) { 45 opts = internal.PkgInvokeDefaultOpts(opts) 46 var rv GetSolutionStackResult 47 err := ctx.Invoke("aws:elasticbeanstalk/getSolutionStack:getSolutionStack", args, &rv, opts...) 48 if err != nil { 49 return nil, err 50 } 51 return &rv, nil 52 } 53 54 // A collection of arguments for invoking getSolutionStack. 55 type GetSolutionStackArgs struct { 56 // If more than one result is returned, use the most 57 // recent solution stack. 58 MostRecent *bool `pulumi:"mostRecent"` 59 // Regex string to apply to the solution stack list returned 60 // by AWS. See [Elastic Beanstalk Supported Platforms][beanstalk-platforms] from 61 // AWS documentation for reference solution stack names. 62 // 63 // > **NOTE:** If more or less than a single match is returned by the search, 64 // this call will fail. Ensure that your search is specific enough to return 65 // a single solution stack, or use `mostRecent` to choose the most recent one. 66 NameRegex string `pulumi:"nameRegex"` 67 } 68 69 // A collection of values returned by getSolutionStack. 70 type GetSolutionStackResult struct { 71 // The provider-assigned unique ID for this managed resource. 72 Id string `pulumi:"id"` 73 MostRecent *bool `pulumi:"mostRecent"` 74 // Name of the solution stack. 75 Name string `pulumi:"name"` 76 NameRegex string `pulumi:"nameRegex"` 77 } 78 79 func GetSolutionStackOutput(ctx *pulumi.Context, args GetSolutionStackOutputArgs, opts ...pulumi.InvokeOption) GetSolutionStackResultOutput { 80 return pulumi.ToOutputWithContext(context.Background(), args). 81 ApplyT(func(v interface{}) (GetSolutionStackResult, error) { 82 args := v.(GetSolutionStackArgs) 83 r, err := GetSolutionStack(ctx, &args, opts...) 84 var s GetSolutionStackResult 85 if r != nil { 86 s = *r 87 } 88 return s, err 89 }).(GetSolutionStackResultOutput) 90 } 91 92 // A collection of arguments for invoking getSolutionStack. 93 type GetSolutionStackOutputArgs struct { 94 // If more than one result is returned, use the most 95 // recent solution stack. 96 MostRecent pulumi.BoolPtrInput `pulumi:"mostRecent"` 97 // Regex string to apply to the solution stack list returned 98 // by AWS. See [Elastic Beanstalk Supported Platforms][beanstalk-platforms] from 99 // AWS documentation for reference solution stack names. 100 // 101 // > **NOTE:** If more or less than a single match is returned by the search, 102 // this call will fail. Ensure that your search is specific enough to return 103 // a single solution stack, or use `mostRecent` to choose the most recent one. 104 NameRegex pulumi.StringInput `pulumi:"nameRegex"` 105 } 106 107 func (GetSolutionStackOutputArgs) ElementType() reflect.Type { 108 return reflect.TypeOf((*GetSolutionStackArgs)(nil)).Elem() 109 } 110 111 // A collection of values returned by getSolutionStack. 112 type GetSolutionStackResultOutput struct{ *pulumi.OutputState } 113 114 func (GetSolutionStackResultOutput) ElementType() reflect.Type { 115 return reflect.TypeOf((*GetSolutionStackResult)(nil)).Elem() 116 } 117 118 func (o GetSolutionStackResultOutput) ToGetSolutionStackResultOutput() GetSolutionStackResultOutput { 119 return o 120 } 121 122 func (o GetSolutionStackResultOutput) ToGetSolutionStackResultOutputWithContext(ctx context.Context) GetSolutionStackResultOutput { 123 return o 124 } 125 126 // The provider-assigned unique ID for this managed resource. 127 func (o GetSolutionStackResultOutput) Id() pulumi.StringOutput { 128 return o.ApplyT(func(v GetSolutionStackResult) string { return v.Id }).(pulumi.StringOutput) 129 } 130 131 func (o GetSolutionStackResultOutput) MostRecent() pulumi.BoolPtrOutput { 132 return o.ApplyT(func(v GetSolutionStackResult) *bool { return v.MostRecent }).(pulumi.BoolPtrOutput) 133 } 134 135 // Name of the solution stack. 136 func (o GetSolutionStackResultOutput) Name() pulumi.StringOutput { 137 return o.ApplyT(func(v GetSolutionStackResult) string { return v.Name }).(pulumi.StringOutput) 138 } 139 140 func (o GetSolutionStackResultOutput) NameRegex() pulumi.StringOutput { 141 return o.ApplyT(func(v GetSolutionStackResult) string { return v.NameRegex }).(pulumi.StringOutput) 142 } 143 144 func init() { 145 pulumi.RegisterOutputType(GetSolutionStackResultOutput{}) 146 }