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