Get information about one or more parameters by specifying multiple parameter names.
Note
To get information about a single parameter, you can use the GetParameter operation instead.
See also: AWS API Documentation
See ‘aws help’ for descriptions of global parameters.
get-parameters
--names <value>
[--with-decryption | --no-with-decryption]
[--cli-input-json | --cli-input-yaml]
[--generate-cli-skeleton <value>]
--names
(list)
Names of the parameters for which you want to query information.
To query by parameter label, use
"Name": "name:label"
. To query by parameter version, use"Name": "name:version"
.(string)
Syntax:
"string" "string" ...
--with-decryption
| --no-with-decryption
(boolean)
Return decrypted secure string value. Return decrypted values for secure string parameters. This flag is ignored for
String
andStringList
parameter types.
--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.
See ‘aws help’ for descriptions of global parameters.
Example 1: To list the values for a parameter
The following get-parameters
example lists the values for the three specified parameters.
aws ssm get-parameters \
--names "MyStringParameter" "MyStringListParameter" "MyInvalidParameterName"
Output:
{
"Parameters": [
{
"Name": "MyStringListParameter",
"Type": "StringList",
"Value": "alpha,beta,gamma",
"Version": 1,
"LastModifiedDate": 1582154764.222,
"ARN": "arn:aws:ssm:us-east-2:111222333444:parameter/MyStringListParameter"
"DataType": "text"
},
{
"Name": "MyStringParameter",
"Type": "String",
"Value": "Vici",
"Version": 3,
"LastModifiedDate": 1582156117.545,
"ARN": "arn:aws:ssm:us-east-2:111222333444:parameter/MyStringParameter"
"DataType": "text"
}
],
"InvalidParameters": [
"MyInvalidParameterName"
]
}
For more information, see Working with Parameter Store in the AWS Systems Manager User Guide.
Example 2: To list names and values of multiple parameters using the ``–query`` option
The following get-parameters
example lists the names and values for the specified parameters.
aws ssm get-parameters \
--names MyStringParameter MyStringListParameter \
--query "Parameters[*].{Name:Name,Value:Value}"
Output:
[
{
"Name": "MyStringListParameter",
"Value": "alpha,beta,gamma"
},
{
"Name": "MyStringParameter",
"Value": "Vidi"
}
]
For more information, see Working with Parameter Store in the AWS Systems Manager User Guide.
Example 3: To display the value of a parameter using labels
The following get-parameter
example lists the value for the specified single parameter with a specified label.
aws ssm get-parameter \
--name "MyParameter:label"
Output:
{
"Parameters": [
{
"Name": "MyLabelParameter",
"Type": "String",
"Value": "parameter by label",
"Version": 1,
"Selector": ":label",
"LastModifiedDate": "2021-07-12T09:49:15.865000-07:00",
"ARN": "arn:aws:ssm:us-west-2:786973925828:parameter/MyParameter",
"DataType": "text"
},
{
"Name": "MyVersionParameter",
"Type": "String",
"Value": "parameter by version",
"Version": 2,
"Selector": ":2",
"LastModifiedDate": "2021-03-24T16:20:28.236000-07:00",
"ARN": "arn:aws:ssm:us-west-2:786973925828:parameter/unlabel-param",
"DataType": "text"
}
],
"InvalidParameters": []
}
For more information, see Working with parameter labels in the AWS Systems Manager User Guide.
Parameters -> (list)
A list of details for a parameter.
(structure)
An Amazon Web Services Systems Manager parameter in Parameter Store.
Name -> (string)
The name of the parameter.
Type -> (string)
The type of parameter. Valid values include the following:
String
,StringList
, andSecureString
.Note
If type is
StringList
, the system returns a comma-separated string with no spaces between commas in theValue
field.Value -> (string)
The parameter value.
Note
If type is
StringList
, the system returns a comma-separated string with no spaces between commas in theValue
field.Version -> (long)
The parameter version.
Selector -> (string)
Either the version number or the label used to retrieve the parameter value. Specify selectors by using one of the following formats:
parameter_name:version
parameter_name:label
SourceResult -> (string)
Applies to parameters that reference information in other Amazon Web Services services.
SourceResult
is the raw result or response from the source.LastModifiedDate -> (timestamp)
Date the parameter was last changed or updated and the parameter version was created.
ARN -> (string)
The Amazon Resource Name (ARN) of the parameter.
DataType -> (string)
The data type of the parameter, such as
text
oraws:ec2:image
. The default istext
.
InvalidParameters -> (list)
A list of parameters that aren’t formatted correctly or don’t run during an execution.
(string)