UNPKG

@pulumi/aws

Version:

A Pulumi package for creating and managing Amazon Web Services (AWS) cloud resources.

167 lines (166 loc) 6.19 kB
import * as pulumi from "@pulumi/pulumi"; import * as inputs from "../types/input"; import * as outputs from "../types/output"; /** * Provides details about resource tagging. * * ## Example Usage * * ### Get All Resource Tag Mappings * * ```typescript * import * as pulumi from "@pulumi/pulumi"; * import * as aws from "@pulumi/aws"; * * const test = aws.resourcegroupstaggingapi.getResources({}); * ``` * * ### Filter By Tag Key and Value * * ```typescript * import * as pulumi from "@pulumi/pulumi"; * import * as aws from "@pulumi/aws"; * * const test = aws.resourcegroupstaggingapi.getResources({ * tagFilters: [{ * key: "tag-key", * values: [ * "tag-value-1", * "tag-value-2", * ], * }], * }); * ``` * * ### Filter By Resource Type * * ```typescript * import * as pulumi from "@pulumi/pulumi"; * import * as aws from "@pulumi/aws"; * * const test = aws.resourcegroupstaggingapi.getResources({ * resourceTypeFilters: ["ec2:instance"], * }); * ``` */ export declare function getResources(args?: GetResourcesArgs, opts?: pulumi.InvokeOptions): Promise<GetResourcesResult>; /** * A collection of arguments for invoking getResources. */ export interface GetResourcesArgs { /** * Specifies whether to exclude resources that are compliant with the tag policy. You can use this parameter only if the `includeComplianceDetails` argument is also set to `true`. */ excludeCompliantResources?: boolean; /** * Specifies whether to include details regarding the compliance with the effective tag policy. */ includeComplianceDetails?: boolean; /** * Region where this resource will be [managed](https://docs.aws.amazon.com/general/latest/gr/rande.html#regional-endpoints). Defaults to the Region set in the provider configuration. */ region?: string; /** * Specifies a list of ARNs of resources for which you want to retrieve tag data. Conflicts with `filter`. */ resourceArnLists?: string[]; /** * Constraints on the resources that you want returned. The format of each resource type is `service:resourceType`. For example, specifying a resource type of `ec2` returns all Amazon EC2 resources (which includes EC2 instances). Specifying a resource type of `ec2:instance` returns only EC2 instances. */ resourceTypeFilters?: string[]; /** * Specifies a list of Tag Filters (keys and values) to restrict the output to only those resources that have the specified tag and, if included, the specified value. See Tag Filter below. Conflicts with `resourceArnList`. */ tagFilters?: inputs.resourcegroupstaggingapi.GetResourcesTagFilter[]; } /** * A collection of values returned by getResources. */ export interface GetResourcesResult { readonly excludeCompliantResources?: boolean; /** * The provider-assigned unique ID for this managed resource. */ readonly id: string; readonly includeComplianceDetails?: boolean; readonly region: string; readonly resourceArnLists?: string[]; /** * List of objects matching the search criteria. */ readonly resourceTagMappingLists: outputs.resourcegroupstaggingapi.GetResourcesResourceTagMappingList[]; readonly resourceTypeFilters?: string[]; readonly tagFilters?: outputs.resourcegroupstaggingapi.GetResourcesTagFilter[]; } /** * Provides details about resource tagging. * * ## Example Usage * * ### Get All Resource Tag Mappings * * ```typescript * import * as pulumi from "@pulumi/pulumi"; * import * as aws from "@pulumi/aws"; * * const test = aws.resourcegroupstaggingapi.getResources({}); * ``` * * ### Filter By Tag Key and Value * * ```typescript * import * as pulumi from "@pulumi/pulumi"; * import * as aws from "@pulumi/aws"; * * const test = aws.resourcegroupstaggingapi.getResources({ * tagFilters: [{ * key: "tag-key", * values: [ * "tag-value-1", * "tag-value-2", * ], * }], * }); * ``` * * ### Filter By Resource Type * * ```typescript * import * as pulumi from "@pulumi/pulumi"; * import * as aws from "@pulumi/aws"; * * const test = aws.resourcegroupstaggingapi.getResources({ * resourceTypeFilters: ["ec2:instance"], * }); * ``` */ export declare function getResourcesOutput(args?: GetResourcesOutputArgs, opts?: pulumi.InvokeOutputOptions): pulumi.Output<GetResourcesResult>; /** * A collection of arguments for invoking getResources. */ export interface GetResourcesOutputArgs { /** * Specifies whether to exclude resources that are compliant with the tag policy. You can use this parameter only if the `includeComplianceDetails` argument is also set to `true`. */ excludeCompliantResources?: pulumi.Input<boolean>; /** * Specifies whether to include details regarding the compliance with the effective tag policy. */ includeComplianceDetails?: pulumi.Input<boolean>; /** * Region where this resource will be [managed](https://docs.aws.amazon.com/general/latest/gr/rande.html#regional-endpoints). Defaults to the Region set in the provider configuration. */ region?: pulumi.Input<string>; /** * Specifies a list of ARNs of resources for which you want to retrieve tag data. Conflicts with `filter`. */ resourceArnLists?: pulumi.Input<pulumi.Input<string>[]>; /** * Constraints on the resources that you want returned. The format of each resource type is `service:resourceType`. For example, specifying a resource type of `ec2` returns all Amazon EC2 resources (which includes EC2 instances). Specifying a resource type of `ec2:instance` returns only EC2 instances. */ resourceTypeFilters?: pulumi.Input<pulumi.Input<string>[]>; /** * Specifies a list of Tag Filters (keys and values) to restrict the output to only those resources that have the specified tag and, if included, the specified value. See Tag Filter below. Conflicts with `resourceArnList`. */ tagFilters?: pulumi.Input<pulumi.Input<inputs.resourcegroupstaggingapi.GetResourcesTagFilterArgs>[]>; }