Queries for available tag keys and tag values for a specified period. You can search the tag values for an arbitrary string.
See also: AWS API Documentation
See ‘aws help’ for descriptions of global parameters.
get-tags
[--search-string <value>]
--time-period <value>
[--tag-key <value>]
[--next-page-token <value>]
[--cli-input-json | --cli-input-yaml]
[--generate-cli-skeleton <value>]
[--cli-auto-prompt <value>]
--search-string
(string)
The value that you want to search for.
--time-period
(structure)
The start and end dates for retrieving the dimension values. The start date is inclusive, but the end date is exclusive. For example, if
start
is2017-01-01
andend
is2017-05-01
, then the cost and usage data is retrieved from2017-01-01
up to and including2017-04-30
but not including2017-05-01
.Start -> (string)
The beginning of the time period that you want the usage and costs for. The start date is inclusive. For example, if
start
is2017-01-01
, AWS retrieves cost and usage data starting at2017-01-01
up to the end date.End -> (string)
The end of the time period that you want the usage and costs for. The end date is exclusive. For example, if
end
is2017-05-01
, AWS retrieves cost and usage data from the start date up to, but not including,2017-05-01
.
Shorthand Syntax:
Start=string,End=string
JSON Syntax:
{
"Start": "string",
"End": "string"
}
--tag-key
(string)
The key of the tag that you want to return values for.
--next-page-token
(string)
The token to retrieve the next set of results. AWS provides the token when the response from a previous call has more results than the maximum page size.
--cli-input-json
| --cli-input-yaml
(string)
Reads arguments from the JSON string provided. The JSON string follows the format provided by --generate-cli-skeleton
. If other arguments are provided on the command line, those values will override the JSON-provided values. It is not possible to pass arbitrary binary values using a JSON-provided value as the string will be taken literally. This may not be specified along with --cli-input-yaml
.
--generate-cli-skeleton
(string)
Prints a JSON skeleton to standard output without sending an API request. If provided with no value or the value input
, prints a sample input JSON that can be used as an argument for --cli-input-json
. Similarly, if provided yaml-input
it will print a sample input YAML that can be used with --cli-input-yaml
. If provided with the value output
, it validates the command inputs and returns a sample output JSON for that command.
--cli-auto-prompt
(boolean)
Automatically prompt for CLI input parameters.
See ‘aws help’ for descriptions of global parameters.
To retrieve keys and values for a cost allocation tag
This example retrieves all cost allocation tags with a key of “Project” and a value that contains “secretProject”.
Command:
aws ce get-tags --search-string secretProject --time-period Start=2017-01-01,End=2017-05-18 --tag-key Project
Output:
{
"ReturnSize": 2,
"Tags": [
"secretProject1",
"secretProject2"
],
"TotalSize": 2
}
NextPageToken -> (string)
The token for the next set of retrievable results. AWS provides the token when the response from a previous call has more results than the maximum page size.
Tags -> (list)
The tags that match your request.
(string)
ReturnSize -> (integer)
The number of query results that AWS returns at a time.
TotalSize -> (integer)
The total number of query results.