Try AWS Native preview for resources not in the classic version.
aws.licensemanager.getLicenseGrants
Explore with Pulumi AI
Try AWS Native preview for resources not in the classic version.
This resource can be used to get a set of license grant ARNs matching a filter.
Example Usage
The following shows getting all license grant ARNs granted to your account.
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using Aws = Pulumi.Aws;
return await Deployment.RunAsync(() =>
{
var current = Aws.GetCallerIdentity.Invoke();
var test = Aws.LicenseManager.GetLicenseGrants.Invoke(new()
{
Filters = new[]
{
new Aws.LicenseManager.Inputs.GetLicenseGrantsFilterInputArgs
{
Name = "GranteePrincipalARN",
Values = new[]
{
$"arn:aws:iam::{current.Apply(getCallerIdentityResult => getCallerIdentityResult.AccountId)}:root",
},
},
},
});
});
package main
import (
"fmt"
"github.com/pulumi/pulumi-aws/sdk/v6/go/aws"
"github.com/pulumi/pulumi-aws/sdk/v6/go/aws/licensemanager"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)
func main() {
pulumi.Run(func(ctx *pulumi.Context) error {
current, err := aws.GetCallerIdentity(ctx, nil, nil)
if err != nil {
return err
}
_, err = licensemanager.GetLicenseGrants(ctx, &licensemanager.GetLicenseGrantsArgs{
Filters: []licensemanager.GetLicenseGrantsFilter{
{
Name: "GranteePrincipalARN",
Values: []string{
fmt.Sprintf("arn:aws:iam::%v:root", current.AccountId),
},
},
},
}, nil)
if err != nil {
return err
}
return nil
})
}
package generated_program;
import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.aws.AwsFunctions;
import com.pulumi.aws.inputs.GetCallerIdentityArgs;
import com.pulumi.aws.licensemanager.LicensemanagerFunctions;
import com.pulumi.aws.licensemanager.inputs.GetLicenseGrantsArgs;
import java.util.List;
import java.util.ArrayList;
import java.util.Map;
import java.io.File;
import java.nio.file.Files;
import java.nio.file.Paths;
public class App {
public static void main(String[] args) {
Pulumi.run(App::stack);
}
public static void stack(Context ctx) {
final var current = AwsFunctions.getCallerIdentity();
final var test = LicensemanagerFunctions.getLicenseGrants(GetLicenseGrantsArgs.builder()
.filters(GetLicenseGrantsFilterArgs.builder()
.name("GranteePrincipalARN")
.values(String.format("arn:aws:iam::%s:root", current.applyValue(getCallerIdentityResult -> getCallerIdentityResult.accountId())))
.build())
.build());
}
}
import pulumi
import pulumi_aws as aws
current = aws.get_caller_identity()
test = aws.licensemanager.get_license_grants(filters=[aws.licensemanager.GetLicenseGrantsFilterArgs(
name="GranteePrincipalARN",
values=[f"arn:aws:iam::{current.account_id}:root"],
)])
import * as pulumi from "@pulumi/pulumi";
import * as aws from "@pulumi/aws";
const current = aws.getCallerIdentity({});
const test = current.then(current => aws.licensemanager.getLicenseGrants({
filters: [{
name: "GranteePrincipalARN",
values: [`arn:aws:iam::${current.accountId}:root`],
}],
}));
variables:
current:
fn::invoke:
Function: aws:getCallerIdentity
Arguments: {}
test:
fn::invoke:
Function: aws:licensemanager:getLicenseGrants
Arguments:
filters:
- name: GranteePrincipalARN
values:
- arn:aws:iam::${current.accountId}:root
Using getLicenseGrants
Two invocation forms are available. The direct form accepts plain arguments and either blocks until the result value is available, or returns a Promise-wrapped result. The output form accepts Input-wrapped arguments and returns an Output-wrapped result.
function getLicenseGrants(args: GetLicenseGrantsArgs, opts?: InvokeOptions): Promise<GetLicenseGrantsResult>
function getLicenseGrantsOutput(args: GetLicenseGrantsOutputArgs, opts?: InvokeOptions): Output<GetLicenseGrantsResult>
def get_license_grants(filters: Optional[Sequence[GetLicenseGrantsFilter]] = None,
opts: Optional[InvokeOptions] = None) -> GetLicenseGrantsResult
def get_license_grants_output(filters: Optional[pulumi.Input[Sequence[pulumi.Input[GetLicenseGrantsFilterArgs]]]] = None,
opts: Optional[InvokeOptions] = None) -> Output[GetLicenseGrantsResult]
func GetLicenseGrants(ctx *Context, args *GetLicenseGrantsArgs, opts ...InvokeOption) (*GetLicenseGrantsResult, error)
func GetLicenseGrantsOutput(ctx *Context, args *GetLicenseGrantsOutputArgs, opts ...InvokeOption) GetLicenseGrantsResultOutput
> Note: This function is named GetLicenseGrants
in the Go SDK.
public static class GetLicenseGrants
{
public static Task<GetLicenseGrantsResult> InvokeAsync(GetLicenseGrantsArgs args, InvokeOptions? opts = null)
public static Output<GetLicenseGrantsResult> Invoke(GetLicenseGrantsInvokeArgs args, InvokeOptions? opts = null)
}
public static CompletableFuture<GetLicenseGrantsResult> getLicenseGrants(GetLicenseGrantsArgs args, InvokeOptions options)
// Output-based functions aren't available in Java yet
fn::invoke:
function: aws:licensemanager/getLicenseGrants:getLicenseGrants
arguments:
# arguments dictionary
The following arguments are supported:
- Filters
List<Get
License Grants Filter> Custom filter block as described below.
More complex filters can be expressed using one or more
filter
sub-blocks, which take the following arguments:
- Filters
[]Get
License Grants Filter Custom filter block as described below.
More complex filters can be expressed using one or more
filter
sub-blocks, which take the following arguments:
- filters
List<Get
License Grants Filter> Custom filter block as described below.
More complex filters can be expressed using one or more
filter
sub-blocks, which take the following arguments:
- filters
Get
License Grants Filter[] Custom filter block as described below.
More complex filters can be expressed using one or more
filter
sub-blocks, which take the following arguments:
- filters
Sequence[Get
License Grants Filter] Custom filter block as described below.
More complex filters can be expressed using one or more
filter
sub-blocks, which take the following arguments:
- filters List<Property Map>
Custom filter block as described below.
More complex filters can be expressed using one or more
filter
sub-blocks, which take the following arguments:
getLicenseGrants Result
The following output properties are available:
- Arns List<string>
List of all the license grant ARNs found.
- Id string
The provider-assigned unique ID for this managed resource.
- Filters
List<Get
License Grants Filter>
- Arns []string
List of all the license grant ARNs found.
- Id string
The provider-assigned unique ID for this managed resource.
- Filters
[]Get
License Grants Filter
- arns List<String>
List of all the license grant ARNs found.
- id String
The provider-assigned unique ID for this managed resource.
- filters
List<Get
License Grants Filter>
- arns string[]
List of all the license grant ARNs found.
- id string
The provider-assigned unique ID for this managed resource.
- filters
Get
License Grants Filter[]
- arns Sequence[str]
List of all the license grant ARNs found.
- id str
The provider-assigned unique ID for this managed resource.
- filters
Sequence[Get
License Grants Filter]
- arns List<String>
List of all the license grant ARNs found.
- id String
The provider-assigned unique ID for this managed resource.
- filters List<Property Map>
Supporting Types
GetLicenseGrantsFilter
- Name string
Name of the field to filter by, as defined by the underlying AWS API. For example, if filtering using
ProductSKU
, use:import * as pulumi from "@pulumi/pulumi"; import * as aws from "@pulumi/aws";
const selected = aws.licensemanager.getLicenseGrants({ filters: [{ name: "ProductSKU", values: [""], }], });
import pulumi import pulumi_aws as aws selected = aws.licensemanager.get_license_grants(filters=[aws.licensemanager.GetLicenseGrantsFilterArgs( name="ProductSKU", values=[""], )])
using System.Collections.Generic; using System.Linq; using Pulumi; using Aws = Pulumi.Aws; return await Deployment.RunAsync(() => { var selected = Aws.LicenseManager.GetLicenseGrants.Invoke(new() { Filters = new[] { new Aws.LicenseManager.Inputs.GetLicenseGrantsFilterInputArgs { Name = "ProductSKU", Values = new[] { "", }, }, }, }); });
package main import ( "github.com/pulumi/pulumi-aws/sdk/v6/go/aws/licensemanager" "github.com/pulumi/pulumi/sdk/v3/go/pulumi" ) func main() { pulumi.Run(func(ctx *pulumi.Context) error { _, err := licensemanager.GetLicenseGrants(ctx, &licensemanager.GetLicenseGrantsArgs{ Filters: []licensemanager.GetLicenseGrantsFilter{ { Name: "ProductSKU", Values: []string{ "", }, }, }, }, nil) if err != nil { return err } return nil }) }
package generated_program; import com.pulumi.Context; import com.pulumi.Pulumi; import com.pulumi.core.Output; import com.pulumi.aws.licensemanager.LicensemanagerFunctions; import com.pulumi.aws.licensemanager.inputs.GetLicenseGrantsArgs; import java.util.List; import java.util.ArrayList; import java.util.Map; import java.io.File; import java.nio.file.Files; import java.nio.file.Paths; public class App { public static void main(String[] args) { Pulumi.run(App::stack); } public static void stack(Context ctx) { final var selected = LicensemanagerFunctions.getLicenseGrants(GetLicenseGrantsArgs.builder() .filters(GetLicenseGrantsFilterArgs.builder() .name("ProductSKU") .values("") .build()) .build()); } }
variables: selected: fn::invoke: Function: aws:licensemanager:getLicenseGrants Arguments: filters: - name: ProductSKU values: -
- Values List<string>
Set of values that are accepted for the given field.
- Name string
Name of the field to filter by, as defined by the underlying AWS API. For example, if filtering using
ProductSKU
, use:import * as pulumi from "@pulumi/pulumi"; import * as aws from "@pulumi/aws";
const selected = aws.licensemanager.getLicenseGrants({ filters: [{ name: "ProductSKU", values: [""], }], });
import pulumi import pulumi_aws as aws selected = aws.licensemanager.get_license_grants(filters=[aws.licensemanager.GetLicenseGrantsFilterArgs( name="ProductSKU", values=[""], )])
using System.Collections.Generic; using System.Linq; using Pulumi; using Aws = Pulumi.Aws; return await Deployment.RunAsync(() => { var selected = Aws.LicenseManager.GetLicenseGrants.Invoke(new() { Filters = new[] { new Aws.LicenseManager.Inputs.GetLicenseGrantsFilterInputArgs { Name = "ProductSKU", Values = new[] { "", }, }, }, }); });
package main import ( "github.com/pulumi/pulumi-aws/sdk/v6/go/aws/licensemanager" "github.com/pulumi/pulumi/sdk/v3/go/pulumi" ) func main() { pulumi.Run(func(ctx *pulumi.Context) error { _, err := licensemanager.GetLicenseGrants(ctx, &licensemanager.GetLicenseGrantsArgs{ Filters: []licensemanager.GetLicenseGrantsFilter{ { Name: "ProductSKU", Values: []string{ "", }, }, }, }, nil) if err != nil { return err } return nil }) }
package generated_program; import com.pulumi.Context; import com.pulumi.Pulumi; import com.pulumi.core.Output; import com.pulumi.aws.licensemanager.LicensemanagerFunctions; import com.pulumi.aws.licensemanager.inputs.GetLicenseGrantsArgs; import java.util.List; import java.util.ArrayList; import java.util.Map; import java.io.File; import java.nio.file.Files; import java.nio.file.Paths; public class App { public static void main(String[] args) { Pulumi.run(App::stack); } public static void stack(Context ctx) { final var selected = LicensemanagerFunctions.getLicenseGrants(GetLicenseGrantsArgs.builder() .filters(GetLicenseGrantsFilterArgs.builder() .name("ProductSKU") .values("") .build()) .build()); } }
variables: selected: fn::invoke: Function: aws:licensemanager:getLicenseGrants Arguments: filters: - name: ProductSKU values: -
- Values []string
Set of values that are accepted for the given field.
- name String
Name of the field to filter by, as defined by the underlying AWS API. For example, if filtering using
ProductSKU
, use:import * as pulumi from "@pulumi/pulumi"; import * as aws from "@pulumi/aws";
const selected = aws.licensemanager.getLicenseGrants({ filters: [{ name: "ProductSKU", values: [""], }], });
import pulumi import pulumi_aws as aws selected = aws.licensemanager.get_license_grants(filters=[aws.licensemanager.GetLicenseGrantsFilterArgs( name="ProductSKU", values=[""], )])
using System.Collections.Generic; using System.Linq; using Pulumi; using Aws = Pulumi.Aws; return await Deployment.RunAsync(() => { var selected = Aws.LicenseManager.GetLicenseGrants.Invoke(new() { Filters = new[] { new Aws.LicenseManager.Inputs.GetLicenseGrantsFilterInputArgs { Name = "ProductSKU", Values = new[] { "", }, }, }, }); });
package main import ( "github.com/pulumi/pulumi-aws/sdk/v6/go/aws/licensemanager" "github.com/pulumi/pulumi/sdk/v3/go/pulumi" ) func main() { pulumi.Run(func(ctx *pulumi.Context) error { _, err := licensemanager.GetLicenseGrants(ctx, &licensemanager.GetLicenseGrantsArgs{ Filters: []licensemanager.GetLicenseGrantsFilter{ { Name: "ProductSKU", Values: []string{ "", }, }, }, }, nil) if err != nil { return err } return nil }) }
package generated_program; import com.pulumi.Context; import com.pulumi.Pulumi; import com.pulumi.core.Output; import com.pulumi.aws.licensemanager.LicensemanagerFunctions; import com.pulumi.aws.licensemanager.inputs.GetLicenseGrantsArgs; import java.util.List; import java.util.ArrayList; import java.util.Map; import java.io.File; import java.nio.file.Files; import java.nio.file.Paths; public class App { public static void main(String[] args) { Pulumi.run(App::stack); } public static void stack(Context ctx) { final var selected = LicensemanagerFunctions.getLicenseGrants(GetLicenseGrantsArgs.builder() .filters(GetLicenseGrantsFilterArgs.builder() .name("ProductSKU") .values("") .build()) .build()); } }
variables: selected: fn::invoke: Function: aws:licensemanager:getLicenseGrants Arguments: filters: - name: ProductSKU values: -
- values List<String>
Set of values that are accepted for the given field.
- name string
Name of the field to filter by, as defined by the underlying AWS API. For example, if filtering using
ProductSKU
, use:import * as pulumi from "@pulumi/pulumi"; import * as aws from "@pulumi/aws";
const selected = aws.licensemanager.getLicenseGrants({ filters: [{ name: "ProductSKU", values: [""], }], });
import pulumi import pulumi_aws as aws selected = aws.licensemanager.get_license_grants(filters=[aws.licensemanager.GetLicenseGrantsFilterArgs( name="ProductSKU", values=[""], )])
using System.Collections.Generic; using System.Linq; using Pulumi; using Aws = Pulumi.Aws; return await Deployment.RunAsync(() => { var selected = Aws.LicenseManager.GetLicenseGrants.Invoke(new() { Filters = new[] { new Aws.LicenseManager.Inputs.GetLicenseGrantsFilterInputArgs { Name = "ProductSKU", Values = new[] { "", }, }, }, }); });
package main import ( "github.com/pulumi/pulumi-aws/sdk/v6/go/aws/licensemanager" "github.com/pulumi/pulumi/sdk/v3/go/pulumi" ) func main() { pulumi.Run(func(ctx *pulumi.Context) error { _, err := licensemanager.GetLicenseGrants(ctx, &licensemanager.GetLicenseGrantsArgs{ Filters: []licensemanager.GetLicenseGrantsFilter{ { Name: "ProductSKU", Values: []string{ "", }, }, }, }, nil) if err != nil { return err } return nil }) }
package generated_program; import com.pulumi.Context; import com.pulumi.Pulumi; import com.pulumi.core.Output; import com.pulumi.aws.licensemanager.LicensemanagerFunctions; import com.pulumi.aws.licensemanager.inputs.GetLicenseGrantsArgs; import java.util.List; import java.util.ArrayList; import java.util.Map; import java.io.File; import java.nio.file.Files; import java.nio.file.Paths; public class App { public static void main(String[] args) { Pulumi.run(App::stack); } public static void stack(Context ctx) { final var selected = LicensemanagerFunctions.getLicenseGrants(GetLicenseGrantsArgs.builder() .filters(GetLicenseGrantsFilterArgs.builder() .name("ProductSKU") .values("") .build()) .build()); } }
variables: selected: fn::invoke: Function: aws:licensemanager:getLicenseGrants Arguments: filters: - name: ProductSKU values: -
- values string[]
Set of values that are accepted for the given field.
- name str
Name of the field to filter by, as defined by the underlying AWS API. For example, if filtering using
ProductSKU
, use:import * as pulumi from "@pulumi/pulumi"; import * as aws from "@pulumi/aws";
const selected = aws.licensemanager.getLicenseGrants({ filters: [{ name: "ProductSKU", values: [""], }], });
import pulumi import pulumi_aws as aws selected = aws.licensemanager.get_license_grants(filters=[aws.licensemanager.GetLicenseGrantsFilterArgs( name="ProductSKU", values=[""], )])
using System.Collections.Generic; using System.Linq; using Pulumi; using Aws = Pulumi.Aws; return await Deployment.RunAsync(() => { var selected = Aws.LicenseManager.GetLicenseGrants.Invoke(new() { Filters = new[] { new Aws.LicenseManager.Inputs.GetLicenseGrantsFilterInputArgs { Name = "ProductSKU", Values = new[] { "", }, }, }, }); });
package main import ( "github.com/pulumi/pulumi-aws/sdk/v6/go/aws/licensemanager" "github.com/pulumi/pulumi/sdk/v3/go/pulumi" ) func main() { pulumi.Run(func(ctx *pulumi.Context) error { _, err := licensemanager.GetLicenseGrants(ctx, &licensemanager.GetLicenseGrantsArgs{ Filters: []licensemanager.GetLicenseGrantsFilter{ { Name: "ProductSKU", Values: []string{ "", }, }, }, }, nil) if err != nil { return err } return nil }) }
package generated_program; import com.pulumi.Context; import com.pulumi.Pulumi; import com.pulumi.core.Output; import com.pulumi.aws.licensemanager.LicensemanagerFunctions; import com.pulumi.aws.licensemanager.inputs.GetLicenseGrantsArgs; import java.util.List; import java.util.ArrayList; import java.util.Map; import java.io.File; import java.nio.file.Files; import java.nio.file.Paths; public class App { public static void main(String[] args) { Pulumi.run(App::stack); } public static void stack(Context ctx) { final var selected = LicensemanagerFunctions.getLicenseGrants(GetLicenseGrantsArgs.builder() .filters(GetLicenseGrantsFilterArgs.builder() .name("ProductSKU") .values("") .build()) .build()); } }
variables: selected: fn::invoke: Function: aws:licensemanager:getLicenseGrants Arguments: filters: - name: ProductSKU values: -
- values Sequence[str]
Set of values that are accepted for the given field.
- name String
Name of the field to filter by, as defined by the underlying AWS API. For example, if filtering using
ProductSKU
, use:import * as pulumi from "@pulumi/pulumi"; import * as aws from "@pulumi/aws";
const selected = aws.licensemanager.getLicenseGrants({ filters: [{ name: "ProductSKU", values: [""], }], });
import pulumi import pulumi_aws as aws selected = aws.licensemanager.get_license_grants(filters=[aws.licensemanager.GetLicenseGrantsFilterArgs( name="ProductSKU", values=[""], )])
using System.Collections.Generic; using System.Linq; using Pulumi; using Aws = Pulumi.Aws; return await Deployment.RunAsync(() => { var selected = Aws.LicenseManager.GetLicenseGrants.Invoke(new() { Filters = new[] { new Aws.LicenseManager.Inputs.GetLicenseGrantsFilterInputArgs { Name = "ProductSKU", Values = new[] { "", }, }, }, }); });
package main import ( "github.com/pulumi/pulumi-aws/sdk/v6/go/aws/licensemanager" "github.com/pulumi/pulumi/sdk/v3/go/pulumi" ) func main() { pulumi.Run(func(ctx *pulumi.Context) error { _, err := licensemanager.GetLicenseGrants(ctx, &licensemanager.GetLicenseGrantsArgs{ Filters: []licensemanager.GetLicenseGrantsFilter{ { Name: "ProductSKU", Values: []string{ "", }, }, }, }, nil) if err != nil { return err } return nil }) }
package generated_program; import com.pulumi.Context; import com.pulumi.Pulumi; import com.pulumi.core.Output; import com.pulumi.aws.licensemanager.LicensemanagerFunctions; import com.pulumi.aws.licensemanager.inputs.GetLicenseGrantsArgs; import java.util.List; import java.util.ArrayList; import java.util.Map; import java.io.File; import java.nio.file.Files; import java.nio.file.Paths; public class App { public static void main(String[] args) { Pulumi.run(App::stack); } public static void stack(Context ctx) { final var selected = LicensemanagerFunctions.getLicenseGrants(GetLicenseGrantsArgs.builder() .filters(GetLicenseGrantsFilterArgs.builder() .name("ProductSKU") .values("") .build()) .build()); } }
variables: selected: fn::invoke: Function: aws:licensemanager:getLicenseGrants Arguments: filters: - name: ProductSKU values: -
- values List<String>
Set of values that are accepted for the given field.
Package Details
- Repository
- AWS Classic pulumi/pulumi-aws
- License
- Apache-2.0
- Notes
This Pulumi package is based on the
aws
Terraform Provider.
Try AWS Native preview for resources not in the classic version.