github.com/pulumi/pulumi-aws/sdk/v6@v6.32.0/go/aws/licensemanager/getReceivedLicenses.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 licensemanager 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 // This resource can be used to get a set of license ARNs matching a filter. 15 // 16 // ## Example Usage 17 // 18 // The following shows getting all license ARNs issued from the AWS marketplace. Providing no filter, would provide all license ARNs for the entire account. 19 // 20 // <!--Start PulumiCodeChooser --> 21 // ```go 22 // package main 23 // 24 // import ( 25 // 26 // "github.com/pulumi/pulumi-aws/sdk/v6/go/aws/licensemanager" 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 := licensemanager.GetReceivedLicenses(ctx, &licensemanager.GetReceivedLicensesArgs{ 34 // Filters: []licensemanager.GetReceivedLicensesFilter{ 35 // { 36 // Name: "IssuerName", 37 // Values: []string{ 38 // "AWS/Marketplace", 39 // }, 40 // }, 41 // }, 42 // }, nil) 43 // if err != nil { 44 // return err 45 // } 46 // return nil 47 // }) 48 // } 49 // 50 // ``` 51 // <!--End PulumiCodeChooser --> 52 func GetReceivedLicenses(ctx *pulumi.Context, args *GetReceivedLicensesArgs, opts ...pulumi.InvokeOption) (*GetReceivedLicensesResult, error) { 53 opts = internal.PkgInvokeDefaultOpts(opts) 54 var rv GetReceivedLicensesResult 55 err := ctx.Invoke("aws:licensemanager/getReceivedLicenses:getReceivedLicenses", args, &rv, opts...) 56 if err != nil { 57 return nil, err 58 } 59 return &rv, nil 60 } 61 62 // A collection of arguments for invoking getReceivedLicenses. 63 type GetReceivedLicensesArgs struct { 64 // Custom filter block as described below. 65 // 66 // More complex filters can be expressed using one or more `filter` sub-blocks, 67 // which take the following arguments: 68 Filters []GetReceivedLicensesFilter `pulumi:"filters"` 69 } 70 71 // A collection of values returned by getReceivedLicenses. 72 type GetReceivedLicensesResult struct { 73 // List of all the license ARNs found. 74 Arns []string `pulumi:"arns"` 75 Filters []GetReceivedLicensesFilter `pulumi:"filters"` 76 // The provider-assigned unique ID for this managed resource. 77 Id string `pulumi:"id"` 78 } 79 80 func GetReceivedLicensesOutput(ctx *pulumi.Context, args GetReceivedLicensesOutputArgs, opts ...pulumi.InvokeOption) GetReceivedLicensesResultOutput { 81 return pulumi.ToOutputWithContext(context.Background(), args). 82 ApplyT(func(v interface{}) (GetReceivedLicensesResult, error) { 83 args := v.(GetReceivedLicensesArgs) 84 r, err := GetReceivedLicenses(ctx, &args, opts...) 85 var s GetReceivedLicensesResult 86 if r != nil { 87 s = *r 88 } 89 return s, err 90 }).(GetReceivedLicensesResultOutput) 91 } 92 93 // A collection of arguments for invoking getReceivedLicenses. 94 type GetReceivedLicensesOutputArgs struct { 95 // Custom filter block as described below. 96 // 97 // More complex filters can be expressed using one or more `filter` sub-blocks, 98 // which take the following arguments: 99 Filters GetReceivedLicensesFilterArrayInput `pulumi:"filters"` 100 } 101 102 func (GetReceivedLicensesOutputArgs) ElementType() reflect.Type { 103 return reflect.TypeOf((*GetReceivedLicensesArgs)(nil)).Elem() 104 } 105 106 // A collection of values returned by getReceivedLicenses. 107 type GetReceivedLicensesResultOutput struct{ *pulumi.OutputState } 108 109 func (GetReceivedLicensesResultOutput) ElementType() reflect.Type { 110 return reflect.TypeOf((*GetReceivedLicensesResult)(nil)).Elem() 111 } 112 113 func (o GetReceivedLicensesResultOutput) ToGetReceivedLicensesResultOutput() GetReceivedLicensesResultOutput { 114 return o 115 } 116 117 func (o GetReceivedLicensesResultOutput) ToGetReceivedLicensesResultOutputWithContext(ctx context.Context) GetReceivedLicensesResultOutput { 118 return o 119 } 120 121 // List of all the license ARNs found. 122 func (o GetReceivedLicensesResultOutput) Arns() pulumi.StringArrayOutput { 123 return o.ApplyT(func(v GetReceivedLicensesResult) []string { return v.Arns }).(pulumi.StringArrayOutput) 124 } 125 126 func (o GetReceivedLicensesResultOutput) Filters() GetReceivedLicensesFilterArrayOutput { 127 return o.ApplyT(func(v GetReceivedLicensesResult) []GetReceivedLicensesFilter { return v.Filters }).(GetReceivedLicensesFilterArrayOutput) 128 } 129 130 // The provider-assigned unique ID for this managed resource. 131 func (o GetReceivedLicensesResultOutput) Id() pulumi.StringOutput { 132 return o.ApplyT(func(v GetReceivedLicensesResult) string { return v.Id }).(pulumi.StringOutput) 133 } 134 135 func init() { 136 pulumi.RegisterOutputType(GetReceivedLicensesResultOutput{}) 137 }