github.com/pulumi/pulumi-aws/sdk/v6@v6.32.0/go/aws/imagebuilder/getContainerRecipes.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 imagebuilder
     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 ARNs and names of Image Builder Container Recipes matching the specified criteria.
    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/imagebuilder"
    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 := imagebuilder.GetContainerRecipes(ctx, &imagebuilder.GetContainerRecipesArgs{
    32  //				Owner: pulumi.StringRef("Self"),
    33  //				Filters: []imagebuilder.GetContainerRecipesFilter{
    34  //					{
    35  //						Name: "platform",
    36  //						Values: []string{
    37  //							"Linux",
    38  //						},
    39  //					},
    40  //				},
    41  //			}, nil)
    42  //			if err != nil {
    43  //				return err
    44  //			}
    45  //			return nil
    46  //		})
    47  //	}
    48  //
    49  // ```
    50  // <!--End PulumiCodeChooser -->
    51  func GetContainerRecipes(ctx *pulumi.Context, args *GetContainerRecipesArgs, opts ...pulumi.InvokeOption) (*GetContainerRecipesResult, error) {
    52  	opts = internal.PkgInvokeDefaultOpts(opts)
    53  	var rv GetContainerRecipesResult
    54  	err := ctx.Invoke("aws:imagebuilder/getContainerRecipes:getContainerRecipes", args, &rv, opts...)
    55  	if err != nil {
    56  		return nil, err
    57  	}
    58  	return &rv, nil
    59  }
    60  
    61  // A collection of arguments for invoking getContainerRecipes.
    62  type GetContainerRecipesArgs struct {
    63  	// Configuration block(s) for filtering. Detailed below.
    64  	Filters []GetContainerRecipesFilter `pulumi:"filters"`
    65  	// Owner of the container recipes. Valid values are `Self`, `Shared`, `Amazon` and `ThirdParty`. Defaults to `Self`.
    66  	Owner *string `pulumi:"owner"`
    67  }
    68  
    69  // A collection of values returned by getContainerRecipes.
    70  type GetContainerRecipesResult struct {
    71  	// Set of ARNs of the matched Image Builder Container Recipes.
    72  	Arns    []string                    `pulumi:"arns"`
    73  	Filters []GetContainerRecipesFilter `pulumi:"filters"`
    74  	// The provider-assigned unique ID for this managed resource.
    75  	Id string `pulumi:"id"`
    76  	// Set of names of the matched Image Builder Container Recipes.
    77  	Names []string `pulumi:"names"`
    78  	Owner *string  `pulumi:"owner"`
    79  }
    80  
    81  func GetContainerRecipesOutput(ctx *pulumi.Context, args GetContainerRecipesOutputArgs, opts ...pulumi.InvokeOption) GetContainerRecipesResultOutput {
    82  	return pulumi.ToOutputWithContext(context.Background(), args).
    83  		ApplyT(func(v interface{}) (GetContainerRecipesResult, error) {
    84  			args := v.(GetContainerRecipesArgs)
    85  			r, err := GetContainerRecipes(ctx, &args, opts...)
    86  			var s GetContainerRecipesResult
    87  			if r != nil {
    88  				s = *r
    89  			}
    90  			return s, err
    91  		}).(GetContainerRecipesResultOutput)
    92  }
    93  
    94  // A collection of arguments for invoking getContainerRecipes.
    95  type GetContainerRecipesOutputArgs struct {
    96  	// Configuration block(s) for filtering. Detailed below.
    97  	Filters GetContainerRecipesFilterArrayInput `pulumi:"filters"`
    98  	// Owner of the container recipes. Valid values are `Self`, `Shared`, `Amazon` and `ThirdParty`. Defaults to `Self`.
    99  	Owner pulumi.StringPtrInput `pulumi:"owner"`
   100  }
   101  
   102  func (GetContainerRecipesOutputArgs) ElementType() reflect.Type {
   103  	return reflect.TypeOf((*GetContainerRecipesArgs)(nil)).Elem()
   104  }
   105  
   106  // A collection of values returned by getContainerRecipes.
   107  type GetContainerRecipesResultOutput struct{ *pulumi.OutputState }
   108  
   109  func (GetContainerRecipesResultOutput) ElementType() reflect.Type {
   110  	return reflect.TypeOf((*GetContainerRecipesResult)(nil)).Elem()
   111  }
   112  
   113  func (o GetContainerRecipesResultOutput) ToGetContainerRecipesResultOutput() GetContainerRecipesResultOutput {
   114  	return o
   115  }
   116  
   117  func (o GetContainerRecipesResultOutput) ToGetContainerRecipesResultOutputWithContext(ctx context.Context) GetContainerRecipesResultOutput {
   118  	return o
   119  }
   120  
   121  // Set of ARNs of the matched Image Builder Container Recipes.
   122  func (o GetContainerRecipesResultOutput) Arns() pulumi.StringArrayOutput {
   123  	return o.ApplyT(func(v GetContainerRecipesResult) []string { return v.Arns }).(pulumi.StringArrayOutput)
   124  }
   125  
   126  func (o GetContainerRecipesResultOutput) Filters() GetContainerRecipesFilterArrayOutput {
   127  	return o.ApplyT(func(v GetContainerRecipesResult) []GetContainerRecipesFilter { return v.Filters }).(GetContainerRecipesFilterArrayOutput)
   128  }
   129  
   130  // The provider-assigned unique ID for this managed resource.
   131  func (o GetContainerRecipesResultOutput) Id() pulumi.StringOutput {
   132  	return o.ApplyT(func(v GetContainerRecipesResult) string { return v.Id }).(pulumi.StringOutput)
   133  }
   134  
   135  // Set of names of the matched Image Builder Container Recipes.
   136  func (o GetContainerRecipesResultOutput) Names() pulumi.StringArrayOutput {
   137  	return o.ApplyT(func(v GetContainerRecipesResult) []string { return v.Names }).(pulumi.StringArrayOutput)
   138  }
   139  
   140  func (o GetContainerRecipesResultOutput) Owner() pulumi.StringPtrOutput {
   141  	return o.ApplyT(func(v GetContainerRecipesResult) *string { return v.Owner }).(pulumi.StringPtrOutput)
   142  }
   143  
   144  func init() {
   145  	pulumi.RegisterOutputType(GetContainerRecipesResultOutput{})
   146  }