github.com/pulumi/pulumi-aws/sdk/v6@v6.32.0/go/aws/licensemanager/getReceivedLicense.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 data on a received license using an ARN. This can be helpful for pulling in data on a license from the AWS marketplace and sharing that license with another account.
    15  //
    16  // ## Example Usage
    17  //
    18  // The following shows getting the received license data using and ARN.
    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.GetReceivedLicense(ctx, &licensemanager.GetReceivedLicenseArgs{
    34  //				LicenseArn: "arn:aws:license-manager::111111111111:license:l-ecbaa94eb71a4830b6d7e49268fecaa0",
    35  //			}, nil)
    36  //			if err != nil {
    37  //				return err
    38  //			}
    39  //			return nil
    40  //		})
    41  //	}
    42  //
    43  // ```
    44  // <!--End PulumiCodeChooser -->
    45  func GetReceivedLicense(ctx *pulumi.Context, args *GetReceivedLicenseArgs, opts ...pulumi.InvokeOption) (*GetReceivedLicenseResult, error) {
    46  	opts = internal.PkgInvokeDefaultOpts(opts)
    47  	var rv GetReceivedLicenseResult
    48  	err := ctx.Invoke("aws:licensemanager/getReceivedLicense:getReceivedLicense", args, &rv, opts...)
    49  	if err != nil {
    50  		return nil, err
    51  	}
    52  	return &rv, nil
    53  }
    54  
    55  // A collection of arguments for invoking getReceivedLicense.
    56  type GetReceivedLicenseArgs struct {
    57  	// The ARN of the received license you want data for.
    58  	LicenseArn string `pulumi:"licenseArn"`
    59  }
    60  
    61  // A collection of values returned by getReceivedLicense.
    62  type GetReceivedLicenseResult struct {
    63  	// Granted license beneficiary. This is in the form of the ARN of the root user of the account.
    64  	Beneficiary string `pulumi:"beneficiary"`
    65  	// Configuration for consumption of the license. Detailed below
    66  	ConsumptionConfigurations []GetReceivedLicenseConsumptionConfiguration `pulumi:"consumptionConfigurations"`
    67  	// Creation time of the granted license in RFC 3339 format.
    68  	CreateTime string `pulumi:"createTime"`
    69  	// License entitlements. Detailed below
    70  	Entitlements []GetReceivedLicenseEntitlement `pulumi:"entitlements"`
    71  	// Home Region of the granted license.
    72  	HomeRegion string `pulumi:"homeRegion"`
    73  	// The provider-assigned unique ID for this managed resource.
    74  	Id string `pulumi:"id"`
    75  	// Granted license issuer. Detailed below
    76  	Issuers []GetReceivedLicenseIssuer `pulumi:"issuers"`
    77  	// Amazon Resource Name (ARN) of the license.
    78  	LicenseArn string `pulumi:"licenseArn"`
    79  	// Granted license metadata. This is in the form of a set of all meta data. Detailed below
    80  	LicenseMetadatas []GetReceivedLicenseLicenseMetadata `pulumi:"licenseMetadatas"`
    81  	// License name.
    82  	LicenseName string `pulumi:"licenseName"`
    83  	// Product name.
    84  	// * ` productSku  ` - Product SKU.
    85  	ProductName string `pulumi:"productName"`
    86  	ProductSku  string `pulumi:"productSku"`
    87  	// Granted license received metadata. Detailed below
    88  	ReceivedMetadatas []GetReceivedLicenseReceivedMetadata `pulumi:"receivedMetadatas"`
    89  	// Granted license status.
    90  	Status string `pulumi:"status"`
    91  	// Date and time range during which the granted license is valid, in ISO8601-UTC format. Detailed below
    92  	Validities []GetReceivedLicenseValidity `pulumi:"validities"`
    93  	// Version of the granted license.
    94  	Version string `pulumi:"version"`
    95  }
    96  
    97  func GetReceivedLicenseOutput(ctx *pulumi.Context, args GetReceivedLicenseOutputArgs, opts ...pulumi.InvokeOption) GetReceivedLicenseResultOutput {
    98  	return pulumi.ToOutputWithContext(context.Background(), args).
    99  		ApplyT(func(v interface{}) (GetReceivedLicenseResult, error) {
   100  			args := v.(GetReceivedLicenseArgs)
   101  			r, err := GetReceivedLicense(ctx, &args, opts...)
   102  			var s GetReceivedLicenseResult
   103  			if r != nil {
   104  				s = *r
   105  			}
   106  			return s, err
   107  		}).(GetReceivedLicenseResultOutput)
   108  }
   109  
   110  // A collection of arguments for invoking getReceivedLicense.
   111  type GetReceivedLicenseOutputArgs struct {
   112  	// The ARN of the received license you want data for.
   113  	LicenseArn pulumi.StringInput `pulumi:"licenseArn"`
   114  }
   115  
   116  func (GetReceivedLicenseOutputArgs) ElementType() reflect.Type {
   117  	return reflect.TypeOf((*GetReceivedLicenseArgs)(nil)).Elem()
   118  }
   119  
   120  // A collection of values returned by getReceivedLicense.
   121  type GetReceivedLicenseResultOutput struct{ *pulumi.OutputState }
   122  
   123  func (GetReceivedLicenseResultOutput) ElementType() reflect.Type {
   124  	return reflect.TypeOf((*GetReceivedLicenseResult)(nil)).Elem()
   125  }
   126  
   127  func (o GetReceivedLicenseResultOutput) ToGetReceivedLicenseResultOutput() GetReceivedLicenseResultOutput {
   128  	return o
   129  }
   130  
   131  func (o GetReceivedLicenseResultOutput) ToGetReceivedLicenseResultOutputWithContext(ctx context.Context) GetReceivedLicenseResultOutput {
   132  	return o
   133  }
   134  
   135  // Granted license beneficiary. This is in the form of the ARN of the root user of the account.
   136  func (o GetReceivedLicenseResultOutput) Beneficiary() pulumi.StringOutput {
   137  	return o.ApplyT(func(v GetReceivedLicenseResult) string { return v.Beneficiary }).(pulumi.StringOutput)
   138  }
   139  
   140  // Configuration for consumption of the license. Detailed below
   141  func (o GetReceivedLicenseResultOutput) ConsumptionConfigurations() GetReceivedLicenseConsumptionConfigurationArrayOutput {
   142  	return o.ApplyT(func(v GetReceivedLicenseResult) []GetReceivedLicenseConsumptionConfiguration {
   143  		return v.ConsumptionConfigurations
   144  	}).(GetReceivedLicenseConsumptionConfigurationArrayOutput)
   145  }
   146  
   147  // Creation time of the granted license in RFC 3339 format.
   148  func (o GetReceivedLicenseResultOutput) CreateTime() pulumi.StringOutput {
   149  	return o.ApplyT(func(v GetReceivedLicenseResult) string { return v.CreateTime }).(pulumi.StringOutput)
   150  }
   151  
   152  // License entitlements. Detailed below
   153  func (o GetReceivedLicenseResultOutput) Entitlements() GetReceivedLicenseEntitlementArrayOutput {
   154  	return o.ApplyT(func(v GetReceivedLicenseResult) []GetReceivedLicenseEntitlement { return v.Entitlements }).(GetReceivedLicenseEntitlementArrayOutput)
   155  }
   156  
   157  // Home Region of the granted license.
   158  func (o GetReceivedLicenseResultOutput) HomeRegion() pulumi.StringOutput {
   159  	return o.ApplyT(func(v GetReceivedLicenseResult) string { return v.HomeRegion }).(pulumi.StringOutput)
   160  }
   161  
   162  // The provider-assigned unique ID for this managed resource.
   163  func (o GetReceivedLicenseResultOutput) Id() pulumi.StringOutput {
   164  	return o.ApplyT(func(v GetReceivedLicenseResult) string { return v.Id }).(pulumi.StringOutput)
   165  }
   166  
   167  // Granted license issuer. Detailed below
   168  func (o GetReceivedLicenseResultOutput) Issuers() GetReceivedLicenseIssuerArrayOutput {
   169  	return o.ApplyT(func(v GetReceivedLicenseResult) []GetReceivedLicenseIssuer { return v.Issuers }).(GetReceivedLicenseIssuerArrayOutput)
   170  }
   171  
   172  // Amazon Resource Name (ARN) of the license.
   173  func (o GetReceivedLicenseResultOutput) LicenseArn() pulumi.StringOutput {
   174  	return o.ApplyT(func(v GetReceivedLicenseResult) string { return v.LicenseArn }).(pulumi.StringOutput)
   175  }
   176  
   177  // Granted license metadata. This is in the form of a set of all meta data. Detailed below
   178  func (o GetReceivedLicenseResultOutput) LicenseMetadatas() GetReceivedLicenseLicenseMetadataArrayOutput {
   179  	return o.ApplyT(func(v GetReceivedLicenseResult) []GetReceivedLicenseLicenseMetadata { return v.LicenseMetadatas }).(GetReceivedLicenseLicenseMetadataArrayOutput)
   180  }
   181  
   182  // License name.
   183  func (o GetReceivedLicenseResultOutput) LicenseName() pulumi.StringOutput {
   184  	return o.ApplyT(func(v GetReceivedLicenseResult) string { return v.LicenseName }).(pulumi.StringOutput)
   185  }
   186  
   187  // Product name.
   188  // * ` productSku  ` - Product SKU.
   189  func (o GetReceivedLicenseResultOutput) ProductName() pulumi.StringOutput {
   190  	return o.ApplyT(func(v GetReceivedLicenseResult) string { return v.ProductName }).(pulumi.StringOutput)
   191  }
   192  
   193  func (o GetReceivedLicenseResultOutput) ProductSku() pulumi.StringOutput {
   194  	return o.ApplyT(func(v GetReceivedLicenseResult) string { return v.ProductSku }).(pulumi.StringOutput)
   195  }
   196  
   197  // Granted license received metadata. Detailed below
   198  func (o GetReceivedLicenseResultOutput) ReceivedMetadatas() GetReceivedLicenseReceivedMetadataArrayOutput {
   199  	return o.ApplyT(func(v GetReceivedLicenseResult) []GetReceivedLicenseReceivedMetadata { return v.ReceivedMetadatas }).(GetReceivedLicenseReceivedMetadataArrayOutput)
   200  }
   201  
   202  // Granted license status.
   203  func (o GetReceivedLicenseResultOutput) Status() pulumi.StringOutput {
   204  	return o.ApplyT(func(v GetReceivedLicenseResult) string { return v.Status }).(pulumi.StringOutput)
   205  }
   206  
   207  // Date and time range during which the granted license is valid, in ISO8601-UTC format. Detailed below
   208  func (o GetReceivedLicenseResultOutput) Validities() GetReceivedLicenseValidityArrayOutput {
   209  	return o.ApplyT(func(v GetReceivedLicenseResult) []GetReceivedLicenseValidity { return v.Validities }).(GetReceivedLicenseValidityArrayOutput)
   210  }
   211  
   212  // Version of the granted license.
   213  func (o GetReceivedLicenseResultOutput) Version() pulumi.StringOutput {
   214  	return o.ApplyT(func(v GetReceivedLicenseResult) string { return v.Version }).(pulumi.StringOutput)
   215  }
   216  
   217  func init() {
   218  	pulumi.RegisterOutputType(GetReceivedLicenseResultOutput{})
   219  }