github.com/pulumi/pulumi-aws/sdk/v6@v6.32.0/go/aws/licensemanager/licenseGrantAccepter.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  	"errors"
    11  	"github.com/pulumi/pulumi-aws/sdk/v6/go/aws/internal"
    12  	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
    13  )
    14  
    15  // Accepts a License Manager grant. This allows for sharing licenses with other aws accounts.
    16  //
    17  // ## Example Usage
    18  //
    19  // <!--Start PulumiCodeChooser -->
    20  // ```go
    21  // package main
    22  //
    23  // import (
    24  //
    25  //	"github.com/pulumi/pulumi-aws/sdk/v6/go/aws/licensemanager"
    26  //	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
    27  //
    28  // )
    29  //
    30  //	func main() {
    31  //		pulumi.Run(func(ctx *pulumi.Context) error {
    32  //			_, err := licensemanager.NewLicenseGrantAccepter(ctx, "test", &licensemanager.LicenseGrantAccepterArgs{
    33  //				GrantArn: pulumi.String("arn:aws:license-manager::123456789012:grant:g-1cf9fba4ba2f42dcab11c686c4b4d329"),
    34  //			})
    35  //			if err != nil {
    36  //				return err
    37  //			}
    38  //			return nil
    39  //		})
    40  //	}
    41  //
    42  // ```
    43  // <!--End PulumiCodeChooser -->
    44  //
    45  // ## Import
    46  //
    47  // Using `pulumi import`, import `aws_licensemanager_grant_accepter` using the grant arn. For example:
    48  //
    49  // ```sh
    50  // $ pulumi import aws:licensemanager/licenseGrantAccepter:LicenseGrantAccepter test arn:aws:license-manager::123456789012:grant:g-1cf9fba4ba2f42dcab11c686c4b4d329
    51  // ```
    52  type LicenseGrantAccepter struct {
    53  	pulumi.CustomResourceState
    54  
    55  	// A list of the allowed operations for the grant.
    56  	AllowedOperations pulumi.StringArrayOutput `pulumi:"allowedOperations"`
    57  	// The ARN of the grant to accept.
    58  	GrantArn pulumi.StringOutput `pulumi:"grantArn"`
    59  	// The home region for the license.
    60  	HomeRegion pulumi.StringOutput `pulumi:"homeRegion"`
    61  	// The ARN of the license for the grant.
    62  	LicenseArn pulumi.StringOutput `pulumi:"licenseArn"`
    63  	// The Name of the grant.
    64  	Name pulumi.StringOutput `pulumi:"name"`
    65  	// The parent ARN.
    66  	ParentArn pulumi.StringOutput `pulumi:"parentArn"`
    67  	// The target account for the grant.
    68  	Principal pulumi.StringOutput `pulumi:"principal"`
    69  	// The grant status.
    70  	Status pulumi.StringOutput `pulumi:"status"`
    71  	// The grant version.
    72  	Version pulumi.StringOutput `pulumi:"version"`
    73  }
    74  
    75  // NewLicenseGrantAccepter registers a new resource with the given unique name, arguments, and options.
    76  func NewLicenseGrantAccepter(ctx *pulumi.Context,
    77  	name string, args *LicenseGrantAccepterArgs, opts ...pulumi.ResourceOption) (*LicenseGrantAccepter, error) {
    78  	if args == nil {
    79  		return nil, errors.New("missing one or more required arguments")
    80  	}
    81  
    82  	if args.GrantArn == nil {
    83  		return nil, errors.New("invalid value for required argument 'GrantArn'")
    84  	}
    85  	opts = internal.PkgResourceDefaultOpts(opts)
    86  	var resource LicenseGrantAccepter
    87  	err := ctx.RegisterResource("aws:licensemanager/licenseGrantAccepter:LicenseGrantAccepter", name, args, &resource, opts...)
    88  	if err != nil {
    89  		return nil, err
    90  	}
    91  	return &resource, nil
    92  }
    93  
    94  // GetLicenseGrantAccepter gets an existing LicenseGrantAccepter resource's state with the given name, ID, and optional
    95  // state properties that are used to uniquely qualify the lookup (nil if not required).
    96  func GetLicenseGrantAccepter(ctx *pulumi.Context,
    97  	name string, id pulumi.IDInput, state *LicenseGrantAccepterState, opts ...pulumi.ResourceOption) (*LicenseGrantAccepter, error) {
    98  	var resource LicenseGrantAccepter
    99  	err := ctx.ReadResource("aws:licensemanager/licenseGrantAccepter:LicenseGrantAccepter", name, id, state, &resource, opts...)
   100  	if err != nil {
   101  		return nil, err
   102  	}
   103  	return &resource, nil
   104  }
   105  
   106  // Input properties used for looking up and filtering LicenseGrantAccepter resources.
   107  type licenseGrantAccepterState struct {
   108  	// A list of the allowed operations for the grant.
   109  	AllowedOperations []string `pulumi:"allowedOperations"`
   110  	// The ARN of the grant to accept.
   111  	GrantArn *string `pulumi:"grantArn"`
   112  	// The home region for the license.
   113  	HomeRegion *string `pulumi:"homeRegion"`
   114  	// The ARN of the license for the grant.
   115  	LicenseArn *string `pulumi:"licenseArn"`
   116  	// The Name of the grant.
   117  	Name *string `pulumi:"name"`
   118  	// The parent ARN.
   119  	ParentArn *string `pulumi:"parentArn"`
   120  	// The target account for the grant.
   121  	Principal *string `pulumi:"principal"`
   122  	// The grant status.
   123  	Status *string `pulumi:"status"`
   124  	// The grant version.
   125  	Version *string `pulumi:"version"`
   126  }
   127  
   128  type LicenseGrantAccepterState struct {
   129  	// A list of the allowed operations for the grant.
   130  	AllowedOperations pulumi.StringArrayInput
   131  	// The ARN of the grant to accept.
   132  	GrantArn pulumi.StringPtrInput
   133  	// The home region for the license.
   134  	HomeRegion pulumi.StringPtrInput
   135  	// The ARN of the license for the grant.
   136  	LicenseArn pulumi.StringPtrInput
   137  	// The Name of the grant.
   138  	Name pulumi.StringPtrInput
   139  	// The parent ARN.
   140  	ParentArn pulumi.StringPtrInput
   141  	// The target account for the grant.
   142  	Principal pulumi.StringPtrInput
   143  	// The grant status.
   144  	Status pulumi.StringPtrInput
   145  	// The grant version.
   146  	Version pulumi.StringPtrInput
   147  }
   148  
   149  func (LicenseGrantAccepterState) ElementType() reflect.Type {
   150  	return reflect.TypeOf((*licenseGrantAccepterState)(nil)).Elem()
   151  }
   152  
   153  type licenseGrantAccepterArgs struct {
   154  	// The ARN of the grant to accept.
   155  	GrantArn string `pulumi:"grantArn"`
   156  }
   157  
   158  // The set of arguments for constructing a LicenseGrantAccepter resource.
   159  type LicenseGrantAccepterArgs struct {
   160  	// The ARN of the grant to accept.
   161  	GrantArn pulumi.StringInput
   162  }
   163  
   164  func (LicenseGrantAccepterArgs) ElementType() reflect.Type {
   165  	return reflect.TypeOf((*licenseGrantAccepterArgs)(nil)).Elem()
   166  }
   167  
   168  type LicenseGrantAccepterInput interface {
   169  	pulumi.Input
   170  
   171  	ToLicenseGrantAccepterOutput() LicenseGrantAccepterOutput
   172  	ToLicenseGrantAccepterOutputWithContext(ctx context.Context) LicenseGrantAccepterOutput
   173  }
   174  
   175  func (*LicenseGrantAccepter) ElementType() reflect.Type {
   176  	return reflect.TypeOf((**LicenseGrantAccepter)(nil)).Elem()
   177  }
   178  
   179  func (i *LicenseGrantAccepter) ToLicenseGrantAccepterOutput() LicenseGrantAccepterOutput {
   180  	return i.ToLicenseGrantAccepterOutputWithContext(context.Background())
   181  }
   182  
   183  func (i *LicenseGrantAccepter) ToLicenseGrantAccepterOutputWithContext(ctx context.Context) LicenseGrantAccepterOutput {
   184  	return pulumi.ToOutputWithContext(ctx, i).(LicenseGrantAccepterOutput)
   185  }
   186  
   187  // LicenseGrantAccepterArrayInput is an input type that accepts LicenseGrantAccepterArray and LicenseGrantAccepterArrayOutput values.
   188  // You can construct a concrete instance of `LicenseGrantAccepterArrayInput` via:
   189  //
   190  //	LicenseGrantAccepterArray{ LicenseGrantAccepterArgs{...} }
   191  type LicenseGrantAccepterArrayInput interface {
   192  	pulumi.Input
   193  
   194  	ToLicenseGrantAccepterArrayOutput() LicenseGrantAccepterArrayOutput
   195  	ToLicenseGrantAccepterArrayOutputWithContext(context.Context) LicenseGrantAccepterArrayOutput
   196  }
   197  
   198  type LicenseGrantAccepterArray []LicenseGrantAccepterInput
   199  
   200  func (LicenseGrantAccepterArray) ElementType() reflect.Type {
   201  	return reflect.TypeOf((*[]*LicenseGrantAccepter)(nil)).Elem()
   202  }
   203  
   204  func (i LicenseGrantAccepterArray) ToLicenseGrantAccepterArrayOutput() LicenseGrantAccepterArrayOutput {
   205  	return i.ToLicenseGrantAccepterArrayOutputWithContext(context.Background())
   206  }
   207  
   208  func (i LicenseGrantAccepterArray) ToLicenseGrantAccepterArrayOutputWithContext(ctx context.Context) LicenseGrantAccepterArrayOutput {
   209  	return pulumi.ToOutputWithContext(ctx, i).(LicenseGrantAccepterArrayOutput)
   210  }
   211  
   212  // LicenseGrantAccepterMapInput is an input type that accepts LicenseGrantAccepterMap and LicenseGrantAccepterMapOutput values.
   213  // You can construct a concrete instance of `LicenseGrantAccepterMapInput` via:
   214  //
   215  //	LicenseGrantAccepterMap{ "key": LicenseGrantAccepterArgs{...} }
   216  type LicenseGrantAccepterMapInput interface {
   217  	pulumi.Input
   218  
   219  	ToLicenseGrantAccepterMapOutput() LicenseGrantAccepterMapOutput
   220  	ToLicenseGrantAccepterMapOutputWithContext(context.Context) LicenseGrantAccepterMapOutput
   221  }
   222  
   223  type LicenseGrantAccepterMap map[string]LicenseGrantAccepterInput
   224  
   225  func (LicenseGrantAccepterMap) ElementType() reflect.Type {
   226  	return reflect.TypeOf((*map[string]*LicenseGrantAccepter)(nil)).Elem()
   227  }
   228  
   229  func (i LicenseGrantAccepterMap) ToLicenseGrantAccepterMapOutput() LicenseGrantAccepterMapOutput {
   230  	return i.ToLicenseGrantAccepterMapOutputWithContext(context.Background())
   231  }
   232  
   233  func (i LicenseGrantAccepterMap) ToLicenseGrantAccepterMapOutputWithContext(ctx context.Context) LicenseGrantAccepterMapOutput {
   234  	return pulumi.ToOutputWithContext(ctx, i).(LicenseGrantAccepterMapOutput)
   235  }
   236  
   237  type LicenseGrantAccepterOutput struct{ *pulumi.OutputState }
   238  
   239  func (LicenseGrantAccepterOutput) ElementType() reflect.Type {
   240  	return reflect.TypeOf((**LicenseGrantAccepter)(nil)).Elem()
   241  }
   242  
   243  func (o LicenseGrantAccepterOutput) ToLicenseGrantAccepterOutput() LicenseGrantAccepterOutput {
   244  	return o
   245  }
   246  
   247  func (o LicenseGrantAccepterOutput) ToLicenseGrantAccepterOutputWithContext(ctx context.Context) LicenseGrantAccepterOutput {
   248  	return o
   249  }
   250  
   251  // A list of the allowed operations for the grant.
   252  func (o LicenseGrantAccepterOutput) AllowedOperations() pulumi.StringArrayOutput {
   253  	return o.ApplyT(func(v *LicenseGrantAccepter) pulumi.StringArrayOutput { return v.AllowedOperations }).(pulumi.StringArrayOutput)
   254  }
   255  
   256  // The ARN of the grant to accept.
   257  func (o LicenseGrantAccepterOutput) GrantArn() pulumi.StringOutput {
   258  	return o.ApplyT(func(v *LicenseGrantAccepter) pulumi.StringOutput { return v.GrantArn }).(pulumi.StringOutput)
   259  }
   260  
   261  // The home region for the license.
   262  func (o LicenseGrantAccepterOutput) HomeRegion() pulumi.StringOutput {
   263  	return o.ApplyT(func(v *LicenseGrantAccepter) pulumi.StringOutput { return v.HomeRegion }).(pulumi.StringOutput)
   264  }
   265  
   266  // The ARN of the license for the grant.
   267  func (o LicenseGrantAccepterOutput) LicenseArn() pulumi.StringOutput {
   268  	return o.ApplyT(func(v *LicenseGrantAccepter) pulumi.StringOutput { return v.LicenseArn }).(pulumi.StringOutput)
   269  }
   270  
   271  // The Name of the grant.
   272  func (o LicenseGrantAccepterOutput) Name() pulumi.StringOutput {
   273  	return o.ApplyT(func(v *LicenseGrantAccepter) pulumi.StringOutput { return v.Name }).(pulumi.StringOutput)
   274  }
   275  
   276  // The parent ARN.
   277  func (o LicenseGrantAccepterOutput) ParentArn() pulumi.StringOutput {
   278  	return o.ApplyT(func(v *LicenseGrantAccepter) pulumi.StringOutput { return v.ParentArn }).(pulumi.StringOutput)
   279  }
   280  
   281  // The target account for the grant.
   282  func (o LicenseGrantAccepterOutput) Principal() pulumi.StringOutput {
   283  	return o.ApplyT(func(v *LicenseGrantAccepter) pulumi.StringOutput { return v.Principal }).(pulumi.StringOutput)
   284  }
   285  
   286  // The grant status.
   287  func (o LicenseGrantAccepterOutput) Status() pulumi.StringOutput {
   288  	return o.ApplyT(func(v *LicenseGrantAccepter) pulumi.StringOutput { return v.Status }).(pulumi.StringOutput)
   289  }
   290  
   291  // The grant version.
   292  func (o LicenseGrantAccepterOutput) Version() pulumi.StringOutput {
   293  	return o.ApplyT(func(v *LicenseGrantAccepter) pulumi.StringOutput { return v.Version }).(pulumi.StringOutput)
   294  }
   295  
   296  type LicenseGrantAccepterArrayOutput struct{ *pulumi.OutputState }
   297  
   298  func (LicenseGrantAccepterArrayOutput) ElementType() reflect.Type {
   299  	return reflect.TypeOf((*[]*LicenseGrantAccepter)(nil)).Elem()
   300  }
   301  
   302  func (o LicenseGrantAccepterArrayOutput) ToLicenseGrantAccepterArrayOutput() LicenseGrantAccepterArrayOutput {
   303  	return o
   304  }
   305  
   306  func (o LicenseGrantAccepterArrayOutput) ToLicenseGrantAccepterArrayOutputWithContext(ctx context.Context) LicenseGrantAccepterArrayOutput {
   307  	return o
   308  }
   309  
   310  func (o LicenseGrantAccepterArrayOutput) Index(i pulumi.IntInput) LicenseGrantAccepterOutput {
   311  	return pulumi.All(o, i).ApplyT(func(vs []interface{}) *LicenseGrantAccepter {
   312  		return vs[0].([]*LicenseGrantAccepter)[vs[1].(int)]
   313  	}).(LicenseGrantAccepterOutput)
   314  }
   315  
   316  type LicenseGrantAccepterMapOutput struct{ *pulumi.OutputState }
   317  
   318  func (LicenseGrantAccepterMapOutput) ElementType() reflect.Type {
   319  	return reflect.TypeOf((*map[string]*LicenseGrantAccepter)(nil)).Elem()
   320  }
   321  
   322  func (o LicenseGrantAccepterMapOutput) ToLicenseGrantAccepterMapOutput() LicenseGrantAccepterMapOutput {
   323  	return o
   324  }
   325  
   326  func (o LicenseGrantAccepterMapOutput) ToLicenseGrantAccepterMapOutputWithContext(ctx context.Context) LicenseGrantAccepterMapOutput {
   327  	return o
   328  }
   329  
   330  func (o LicenseGrantAccepterMapOutput) MapIndex(k pulumi.StringInput) LicenseGrantAccepterOutput {
   331  	return pulumi.All(o, k).ApplyT(func(vs []interface{}) *LicenseGrantAccepter {
   332  		return vs[0].(map[string]*LicenseGrantAccepter)[vs[1].(string)]
   333  	}).(LicenseGrantAccepterOutput)
   334  }
   335  
   336  func init() {
   337  	pulumi.RegisterInputType(reflect.TypeOf((*LicenseGrantAccepterInput)(nil)).Elem(), &LicenseGrantAccepter{})
   338  	pulumi.RegisterInputType(reflect.TypeOf((*LicenseGrantAccepterArrayInput)(nil)).Elem(), LicenseGrantAccepterArray{})
   339  	pulumi.RegisterInputType(reflect.TypeOf((*LicenseGrantAccepterMapInput)(nil)).Elem(), LicenseGrantAccepterMap{})
   340  	pulumi.RegisterOutputType(LicenseGrantAccepterOutput{})
   341  	pulumi.RegisterOutputType(LicenseGrantAccepterArrayOutput{})
   342  	pulumi.RegisterOutputType(LicenseGrantAccepterMapOutput{})
   343  }