Amazon Simple Systems Manager (SSM)

2017/10/19 - Amazon Simple Systems Manager (SSM) - 6 updated api methods

Changes  EC2 Systems Manager versioning support for Parameter Store. Also support for referencing parameter versions in SSM Documents.

DescribeParameters (updated) Link ¶
Changes (response)
{'Parameters': {'Version': 'long'}}

Get information about a parameter.

Request results are returned on a best-effort basis. If you specify MaxResults in the request, the response includes information up to the limit specified. The number of items returned, however, can be between zero and the value of MaxResults . If the service reaches an internal limit while processing the results, it stops the operation and returns the matching values up to that point and a NextToken . You can specify the NextToken in a subsequent call to get the next set of results.

See also: AWS API Documentation

Request Syntax

client.describe_parameters(
    Filters=[
        {
            'Key': 'Name'|'Type'|'KeyId',
            'Values': [
                'string',
            ]
        },
    ],
    ParameterFilters=[
        {
            'Key': 'string',
            'Option': 'string',
            'Values': [
                'string',
            ]
        },
    ],
    MaxResults=123,
    NextToken='string'
)
type Filters

list

param Filters

One or more filters. Use a filter to return a more specific list of results.

  • (dict) --

    One or more filters. Use a filter to return a more specific list of results.

    • Key (string) -- [REQUIRED]

      The name of the filter.

    • Values (list) -- [REQUIRED]

      The filter values.

      • (string) --

type ParameterFilters

list

param ParameterFilters

Filters to limit the request results.

  • (dict) --

    One or more filters. Use a filter to return a more specific list of results.

    • Key (string) -- [REQUIRED]

      The name of the filter.

    • Option (string) --

      Valid options are Equals and BeginsWith. For Path filter, valid options are Recursive and OneLevel.

    • Values (list) --

      The value you want to search for.

      • (string) --

type MaxResults

integer

param MaxResults

The maximum number of items to return for this call. The call also returns a token that you can specify in a subsequent call to get the next set of results.

type NextToken

string

param NextToken

The token for the next set of items to return. (You received this token from a previous call.)

rtype

dict

returns

Response Syntax

{
    'Parameters': [
        {
            'Name': 'string',
            'Type': 'String'|'StringList'|'SecureString',
            'KeyId': 'string',
            'LastModifiedDate': datetime(2015, 1, 1),
            'LastModifiedUser': 'string',
            'Description': 'string',
            'AllowedPattern': 'string',
            'Version': 123
        },
    ],
    'NextToken': 'string'
}

Response Structure

  • (dict) --

    • Parameters (list) --

      Parameters returned by the request.

      • (dict) --

        Metada includes information like the ARN of the last user and the date/time the parameter was last used.

        • Name (string) --

          The parameter name.

        • Type (string) --

          The type of parameter. Valid parameter types include the following: String, String list, Secure string.

        • KeyId (string) --

          The ID of the query key used for this parameter.

        • LastModifiedDate (datetime) --

          Date the parameter was last changed or updated.

        • LastModifiedUser (string) --

          Amazon Resource Name (ARN) of the AWS user who last changed the parameter.

        • Description (string) --

          Description of the parameter actions.

        • AllowedPattern (string) --

          A parameter name can include only the following letters and symbols.

          a-zA-Z0-9_.-

        • Version (integer) --

          The parameter version.

    • NextToken (string) --

      The token to use when requesting the next set of items. If there are no additional items to return, the string is empty.

GetParameter (updated) Link ¶
Changes (response)
{'Parameter': {'Version': 'long'}}

Get information about a parameter by using the parameter name.

See also: AWS API Documentation

Request Syntax

client.get_parameter(
    Name='string',
    WithDecryption=True|False
)
type Name

string

param Name

[REQUIRED]

The name of the parameter you want to query.

type WithDecryption

boolean

param WithDecryption

Return decrypted values for secure string parameters. This flag is ignored for String and StringList parameter types.

rtype

dict

returns

Response Syntax

{
    'Parameter': {
        'Name': 'string',
        'Type': 'String'|'StringList'|'SecureString',
        'Value': 'string',
        'Version': 123
    }
}

Response Structure

  • (dict) --

    • Parameter (dict) --

      Information about a parameter.

      • Name (string) --

        The name of the parameter.

      • Type (string) --

        The type of parameter. Valid values include the following: String, String list, Secure string.

      • Value (string) --

        The parameter value.

      • Version (integer) --

        The parameter version.

GetParameterHistory (updated) Link ¶
Changes (response)
{'Parameters': {'Version': 'long'}}

Query a list of all parameters used by the AWS account.

See also: AWS API Documentation

Request Syntax

client.get_parameter_history(
    Name='string',
    WithDecryption=True|False,
    MaxResults=123,
    NextToken='string'
)
type Name

string

param Name

[REQUIRED]

The name of a parameter you want to query.

type WithDecryption

boolean

param WithDecryption

Return decrypted values for secure string parameters. This flag is ignored for String and StringList parameter types.

type MaxResults

integer

param MaxResults

The maximum number of items to return for this call. The call also returns a token that you can specify in a subsequent call to get the next set of results.

type NextToken

string

param NextToken

The token for the next set of items to return. (You received this token from a previous call.)

rtype

dict

returns

Response Syntax

{
    'Parameters': [
        {
            'Name': 'string',
            'Type': 'String'|'StringList'|'SecureString',
            'KeyId': 'string',
            'LastModifiedDate': datetime(2015, 1, 1),
            'LastModifiedUser': 'string',
            'Description': 'string',
            'Value': 'string',
            'AllowedPattern': 'string',
            'Version': 123
        },
    ],
    'NextToken': 'string'
}

Response Structure

  • (dict) --

    • Parameters (list) --

      A list of parameters returned by the request.

      • (dict) --

        Information about parameter usage.

        • Name (string) --

          The name of the parameter.

        • Type (string) --

          The type of parameter used.

        • KeyId (string) --

          The ID of the query key used for this parameter.

        • LastModifiedDate (datetime) --

          Date the parameter was last changed or updated.

        • LastModifiedUser (string) --

          Amazon Resource Name (ARN) of the AWS user who last changed the parameter.

        • Description (string) --

          Information about the parameter.

        • Value (string) --

          The parameter value.

        • AllowedPattern (string) --

          Parameter names can include the following letters and symbols.

          a-zA-Z0-9_.-

        • Version (integer) --

          The parameter version.

    • NextToken (string) --

      The token to use when requesting the next set of items. If there are no additional items to return, the string is empty.

GetParameters (updated) Link ¶
Changes (response)
{'Parameters': {'Version': 'long'}}

Get details of a parameter.

See also: AWS API Documentation

Request Syntax

client.get_parameters(
    Names=[
        'string',
    ],
    WithDecryption=True|False
)
type Names

list

param Names

[REQUIRED]

Names of the parameters for which you want to query information.

  • (string) --

type WithDecryption

boolean

param WithDecryption

Return decrypted secure string value. Return decrypted values for secure string parameters. This flag is ignored for String and StringList parameter types.

rtype

dict

returns

Response Syntax

{
    'Parameters': [
        {
            'Name': 'string',
            'Type': 'String'|'StringList'|'SecureString',
            'Value': 'string',
            'Version': 123
        },
    ],
    'InvalidParameters': [
        'string',
    ]
}

Response Structure

  • (dict) --

    • Parameters (list) --

      A list of details for a parameter.

      • (dict) --

        An Amazon EC2 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, String list, Secure string.

        • Value (string) --

          The parameter value.

        • Version (integer) --

          The parameter version.

    • InvalidParameters (list) --

      A list of parameters that are not formatted correctly or do not run when executed.

      • (string) --

GetParametersByPath (updated) Link ¶
Changes (response)
{'Parameters': {'Version': 'long'}}

Retrieve parameters in a specific hierarchy. For more information, see Working with Systems Manager Parameters.

Request results are returned on a best-effort basis. If you specify MaxResults in the request, the response includes information up to the limit specified. The number of items returned, however, can be between zero and the value of MaxResults . If the service reaches an internal limit while processing the results, it stops the operation and returns the matching values up to that point and a NextToken . You can specify the NextToken in a subsequent call to get the next set of results.

See also: AWS API Documentation

Request Syntax

client.get_parameters_by_path(
    Path='string',
    Recursive=True|False,
    ParameterFilters=[
        {
            'Key': 'string',
            'Option': 'string',
            'Values': [
                'string',
            ]
        },
    ],
    WithDecryption=True|False,
    MaxResults=123,
    NextToken='string'
)
type Path

string

param Path

[REQUIRED]

The hierarchy for the parameter. Hierarchies start with a forward slash (/) and end with the parameter name. A hierarchy can have a maximum of five levels. Examples: /Environment/Test/DBString003

/Finance/Prod/IAD/OS/WinServ2016/license15

type Recursive

boolean

param Recursive

Retrieve all parameters within a hierarchy.

type ParameterFilters

list

param ParameterFilters

Filters to limit the request results.

  • (dict) --

    One or more filters. Use a filter to return a more specific list of results.

    • Key (string) -- [REQUIRED]

      The name of the filter.

    • Option (string) --

      Valid options are Equals and BeginsWith. For Path filter, valid options are Recursive and OneLevel.

    • Values (list) --

      The value you want to search for.

      • (string) --

type WithDecryption

boolean

param WithDecryption

Retrieve all parameters in a hierarchy with their value decrypted.

type MaxResults

integer

param MaxResults

The maximum number of items to return for this call. The call also returns a token that you can specify in a subsequent call to get the next set of results.

type NextToken

string

param NextToken

A token to start the list. Use this token to get the next set of results.

rtype

dict

returns

Response Syntax

{
    'Parameters': [
        {
            'Name': 'string',
            'Type': 'String'|'StringList'|'SecureString',
            'Value': 'string',
            'Version': 123
        },
    ],
    'NextToken': 'string'
}

Response Structure

  • (dict) --

    • Parameters (list) --

      A list of parameters found in the specified hierarchy.

      • (dict) --

        An Amazon EC2 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, String list, Secure string.

        • Value (string) --

          The parameter value.

        • Version (integer) --

          The parameter version.

    • NextToken (string) --

      The token for the next set of items to return. Use this token to get the next set of results.

PutParameter (updated) Link ¶
Changes (response)
{'Version': 'long'}

Add one or more parameters to the system.

See also: AWS API Documentation

Request Syntax

client.put_parameter(
    Name='string',
    Description='string',
    Value='string',
    Type='String'|'StringList'|'SecureString',
    KeyId='string',
    Overwrite=True|False,
    AllowedPattern='string'
)
type Name

string

param Name

[REQUIRED]

The name of the parameter that you want to add to the system.

type Description

string

param Description

Information about the parameter that you want to add to the system

type Value

string

param Value

[REQUIRED]

The parameter value that you want to add to the system.

type Type

string

param Type

[REQUIRED]

The type of parameter that you want to add to the system.

type KeyId

string

param KeyId

The KMS Key ID that you want to use to encrypt a parameter when you choose the SecureString data type. If you don't specify a key ID, the system uses the default key associated with your AWS account.

type Overwrite

boolean

param Overwrite

Overwrite an existing parameter. If not specified, will default to "false".

type AllowedPattern

string

param AllowedPattern

A regular expression used to validate the parameter value. For example, for String types with values restricted to numbers, you can specify the following: AllowedPattern=^d+$

rtype

dict

returns

Response Syntax

{
    'Version': 123
}

Response Structure

  • (dict) --

    • Version (integer) --

      The new version number of a parameter. If you edit a parameter value, Parameter Store automatically creates a new version and assigns this new version a unique ID. You can reference a parameter version ID in API actions or in Systems Manager documents (SSM documents). By default, if you don't specify a specific version, the system returns the latest parameter value when a parameter is called.