github.com/myhau/pulumi/pkg/v3@v3.70.2-0.20221116134521-f2775972e587/codegen/testing/test/testdata/output-funcs-tfbridge20/go/mypkg/getAmiIds.go (about)

     1  // Code generated by test DO NOT EDIT.
     2  // *** WARNING: Do not edit by hand unless you're certain you know what you are doing! ***
     3  
     4  package mypkg
     5  
     6  import (
     7  	"context"
     8  	"reflect"
     9  
    10  	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
    11  )
    12  
    13  // Taken from pulumi-AWS to regress an issue
    14  //
    15  // Deprecated: aws.getAmiIds has been deprecated in favor of aws.ec2.getAmiIds
    16  func GetAmiIds(ctx *pulumi.Context, args *GetAmiIdsArgs, opts ...pulumi.InvokeOption) (*GetAmiIdsResult, error) {
    17  	var rv GetAmiIdsResult
    18  	err := ctx.Invoke("mypkg::getAmiIds", args, &rv, opts...)
    19  	if err != nil {
    20  		return nil, err
    21  	}
    22  	return &rv, nil
    23  }
    24  
    25  // A collection of arguments for invoking getAmiIds.
    26  type GetAmiIdsArgs struct {
    27  	// Limit search to users with *explicit* launch
    28  	// permission on  the image. Valid items are the numeric account ID or `self`.
    29  	ExecutableUsers []string `pulumi:"executableUsers"`
    30  	// One or more name/value pairs to filter off of. There
    31  	// are several valid keys, for a full reference, check out
    32  	// [describe-images in the AWS CLI reference][1].
    33  	Filters []GetAmiIdsFilter `pulumi:"filters"`
    34  	// A regex string to apply to the AMI list returned
    35  	// by AWS. This allows more advanced filtering not supported from the AWS API.
    36  	// This filtering is done locally on what AWS returns, and could have a performance
    37  	// impact if the result is large. It is recommended to combine this with other
    38  	// options to narrow down the list AWS returns.
    39  	NameRegex *string `pulumi:"nameRegex"`
    40  	// List of AMI owners to limit search. At least 1 value must be specified. Valid values: an AWS account ID, `self` (the current account), or an AWS owner alias (e.g. `amazon`, `aws-marketplace`, `microsoft`).
    41  	Owners []string `pulumi:"owners"`
    42  	// Used to sort AMIs by creation time.
    43  	SortAscending *bool `pulumi:"sortAscending"`
    44  }
    45  
    46  // A collection of values returned by getAmiIds.
    47  type GetAmiIdsResult struct {
    48  	ExecutableUsers []string          `pulumi:"executableUsers"`
    49  	Filters         []GetAmiIdsFilter `pulumi:"filters"`
    50  	// The provider-assigned unique ID for this managed resource.
    51  	Id            string   `pulumi:"id"`
    52  	Ids           []string `pulumi:"ids"`
    53  	NameRegex     *string  `pulumi:"nameRegex"`
    54  	Owners        []string `pulumi:"owners"`
    55  	SortAscending *bool    `pulumi:"sortAscending"`
    56  }
    57  
    58  func GetAmiIdsOutput(ctx *pulumi.Context, args GetAmiIdsOutputArgs, opts ...pulumi.InvokeOption) GetAmiIdsResultOutput {
    59  	return pulumi.ToOutputWithContext(context.Background(), args).
    60  		ApplyT(func(v interface{}) (GetAmiIdsResult, error) {
    61  			args := v.(GetAmiIdsArgs)
    62  			r, err := GetAmiIds(ctx, &args, opts...)
    63  			var s GetAmiIdsResult
    64  			if r != nil {
    65  				s = *r
    66  			}
    67  			return s, err
    68  		}).(GetAmiIdsResultOutput)
    69  }
    70  
    71  // A collection of arguments for invoking getAmiIds.
    72  type GetAmiIdsOutputArgs struct {
    73  	// Limit search to users with *explicit* launch
    74  	// permission on  the image. Valid items are the numeric account ID or `self`.
    75  	ExecutableUsers pulumi.StringArrayInput `pulumi:"executableUsers"`
    76  	// One or more name/value pairs to filter off of. There
    77  	// are several valid keys, for a full reference, check out
    78  	// [describe-images in the AWS CLI reference][1].
    79  	Filters GetAmiIdsFilterArrayInput `pulumi:"filters"`
    80  	// A regex string to apply to the AMI list returned
    81  	// by AWS. This allows more advanced filtering not supported from the AWS API.
    82  	// This filtering is done locally on what AWS returns, and could have a performance
    83  	// impact if the result is large. It is recommended to combine this with other
    84  	// options to narrow down the list AWS returns.
    85  	NameRegex pulumi.StringPtrInput `pulumi:"nameRegex"`
    86  	// List of AMI owners to limit search. At least 1 value must be specified. Valid values: an AWS account ID, `self` (the current account), or an AWS owner alias (e.g. `amazon`, `aws-marketplace`, `microsoft`).
    87  	Owners pulumi.StringArrayInput `pulumi:"owners"`
    88  	// Used to sort AMIs by creation time.
    89  	SortAscending pulumi.BoolPtrInput `pulumi:"sortAscending"`
    90  }
    91  
    92  func (GetAmiIdsOutputArgs) ElementType() reflect.Type {
    93  	return reflect.TypeOf((*GetAmiIdsArgs)(nil)).Elem()
    94  }
    95  
    96  // A collection of values returned by getAmiIds.
    97  type GetAmiIdsResultOutput struct{ *pulumi.OutputState }
    98  
    99  func (GetAmiIdsResultOutput) ElementType() reflect.Type {
   100  	return reflect.TypeOf((*GetAmiIdsResult)(nil)).Elem()
   101  }
   102  
   103  func (o GetAmiIdsResultOutput) ToGetAmiIdsResultOutput() GetAmiIdsResultOutput {
   104  	return o
   105  }
   106  
   107  func (o GetAmiIdsResultOutput) ToGetAmiIdsResultOutputWithContext(ctx context.Context) GetAmiIdsResultOutput {
   108  	return o
   109  }
   110  
   111  func (o GetAmiIdsResultOutput) ExecutableUsers() pulumi.StringArrayOutput {
   112  	return o.ApplyT(func(v GetAmiIdsResult) []string { return v.ExecutableUsers }).(pulumi.StringArrayOutput)
   113  }
   114  
   115  func (o GetAmiIdsResultOutput) Filters() GetAmiIdsFilterArrayOutput {
   116  	return o.ApplyT(func(v GetAmiIdsResult) []GetAmiIdsFilter { return v.Filters }).(GetAmiIdsFilterArrayOutput)
   117  }
   118  
   119  // The provider-assigned unique ID for this managed resource.
   120  func (o GetAmiIdsResultOutput) Id() pulumi.StringOutput {
   121  	return o.ApplyT(func(v GetAmiIdsResult) string { return v.Id }).(pulumi.StringOutput)
   122  }
   123  
   124  func (o GetAmiIdsResultOutput) Ids() pulumi.StringArrayOutput {
   125  	return o.ApplyT(func(v GetAmiIdsResult) []string { return v.Ids }).(pulumi.StringArrayOutput)
   126  }
   127  
   128  func (o GetAmiIdsResultOutput) NameRegex() pulumi.StringPtrOutput {
   129  	return o.ApplyT(func(v GetAmiIdsResult) *string { return v.NameRegex }).(pulumi.StringPtrOutput)
   130  }
   131  
   132  func (o GetAmiIdsResultOutput) Owners() pulumi.StringArrayOutput {
   133  	return o.ApplyT(func(v GetAmiIdsResult) []string { return v.Owners }).(pulumi.StringArrayOutput)
   134  }
   135  
   136  func (o GetAmiIdsResultOutput) SortAscending() pulumi.BoolPtrOutput {
   137  	return o.ApplyT(func(v GetAmiIdsResult) *bool { return v.SortAscending }).(pulumi.BoolPtrOutput)
   138  }
   139  
   140  func init() {
   141  	pulumi.RegisterOutputType(GetAmiIdsResultOutput{})
   142  }