Skip to content

get_parameter async

get_parameter(
    name: PSParameterName,
    *,
    config_overrides: Optional[AsyncSSMClientConfig] = None,
    with_decryption: Optional[Boolean] = None,
) -> GetParameterResult

Get information about a single parameter by specifying the parameter name.

Parameter names can't contain spaces. The service removes any spaces specified for the beginning or end of a parameter name. If the specified name for a parameter contains spaces between characters, the request fails with a ValidationException error.

To get information about more than one parameter at a time, use the GetParameters operation.

Parameter Store throughput defines the number of API transactions per second (TPS) that Systems Manager can process. This applies to GetParameter, GetParameters, and PutParameter API calls for your Amazon Web Services account and Amazon Web Services Region. By default, Parameter Store is configured with a standard throughput quota suitable for low- to moderate-volume workloads. Applications that retrieve configuration data infrequently or operate at smaller scale can use this default setting without additional cost.

For higher-volume workloads, you can enable higher throughput. This increases the maximum number of supported transactions per second for your account and Region. Increased throughput supports applications and workloads that need concurrent access to multiple parameters. If you experience ThrottlingException: Rate exceeded errors, enable higher throughput. For more information, see Changing Parameter Store throughput.

Parameters:

  • name (PSParameterName) –

    The name or Amazon Resource Name (ARN) of the parameter that you want to query. For parameters shared with you from another account, you must use the full ARN.

    To query by parameter label, use "Name": "name:label". To query by parameter version, use "Name": "name:version".

    For more information about shared parameters, see Working with shared parameters in the Amazon Web Services Systems Manager User Guide.

  • with_decryption (Optional[Boolean], default: None ) –

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

Raises:

  • InternalServerError –

    An error occurred on the server side.

  • InvalidKeyId –

    The query key ID isn't valid.

  • ParameterNotFound –

    The parameter couldn't be found. Verify the name and try again.

    For the DeleteParameter and GetParameter actions, if the specified parameter doesn't exist, the ParameterNotFound exception is not recorded in CloudTrail event logs.

  • ParameterVersionNotFound –

    The specified parameter version wasn't found. Verify the parameter name and version, and try again.

  • UnknownServiceError –

    The service returned an error code this client does not model.

Source code in docs_src/capo_ssm/_services/async_ssm.py
async def get_parameter(
    self,
    name: "capo_ssm.types.ps_parameter_name.PSParameterName",
    *,
    config_overrides: Optional[AsyncSSMClientConfig] = None,
    with_decryption: Optional["capo_ssm.types.boolean.Boolean"] = None,
) -> "capo_ssm.types.get_parameter_result.GetParameterResult":
    """<p>Get information about a single parameter by specifying the parameter name.</p> <p>Parameter names can't contain spaces. The service removes any spaces specified for the beginning or end of a parameter name. If the specified name for a parameter contains spaces between characters, the request fails with a <code>ValidationException</code> error.</p> <note> <p>To get information about more than one parameter at a time, use the <a>GetParameters</a> operation.</p> </note> <note> <p>Parameter Store throughput defines the number of API transactions per second (TPS) that Systems Manager can process. This applies to <code>GetParameter</code>, <code>GetParameters</code>, and <code>PutParameter</code> API calls for your Amazon Web Services account and Amazon Web Services Region. By default, Parameter Store is configured with a standard throughput quota suitable for low- to moderate-volume workloads. Applications that retrieve configuration data infrequently or operate at smaller scale can use this default setting without additional cost.</p> <p>For higher-volume workloads, you can enable higher throughput. This increases the maximum number of supported transactions per second for your account and Region. Increased throughput supports applications and workloads that need concurrent access to multiple parameters. If you experience <code>ThrottlingException: Rate exceeded</code> errors, enable higher throughput. For more information, see <a href="https://docs.aws.amazon.com/systems-manager/latest/userguide/parameter-store-throughput.html">Changing Parameter Store throughput</a>.</p> </note>

    Args:
        name: <p>The name or Amazon Resource Name (ARN) of the parameter that you want to query. For parameters shared with you from another account, you must use the full ARN.</p> <p>To query by parameter label, use <code>"Name": "name:label"</code>. To query by parameter version, use <code>"Name": "name:version"</code>.</p> <p>For more information about shared parameters, see <a href="https://docs.aws.amazon.com/systems-manager/latest/userguide/parameter-store-shared-parameters.html">Working with shared parameters</a> in the <i>Amazon Web Services Systems Manager User Guide</i>.</p>
        with_decryption: <p>Return decrypted values for secure string parameters. This flag is ignored for <code>String</code> and <code>StringList</code> parameter types.</p>

    Raises:
        capo_ssm.errors.internal_server_error.InternalServerError: <p>An error occurred on the server side.</p>
        capo_ssm.errors.invalid_key_id.InvalidKeyId: <p>The query key ID isn't valid.</p>
        capo_ssm.errors.parameter_not_found.ParameterNotFound: <p>The parameter couldn't be found. Verify the name and try again.</p> <note> <p>For the <code>DeleteParameter</code> and <code>GetParameter</code> actions, if the specified parameter doesn't exist, the <code>ParameterNotFound</code> exception is <i>not</i> recorded in CloudTrail event logs.</p> </note>
        capo_ssm.errors.parameter_version_not_found.ParameterVersionNotFound: <p>The specified parameter version wasn't found. Verify the parameter name and version, and try again.</p>
        capo_ssm.errors.UnknownServiceError: The service returned an error code this client does not model.
    """

    async def _handler(
        req: "AsyncOperationRequest[capo_ssm.types.get_parameter_request.GetParameterRequest]",
    ) -> AsyncOperationResponse[
        "capo_ssm.types.get_parameter_result.GetParameterResult"
    ]:
        import capo_ssm._operations.amazon_ssm.get_parameter

        (
            output,
            http_response,
        ) = await capo_ssm._operations.amazon_ssm.get_parameter.async_get_parameter(
            req.options, req.input
        )
        return AsyncOperationResponse(output=output, response=http_response)

    def _redact_output(
        output: "capo_ssm.types.get_parameter_result.GetParameterResult",
    ) -> dict[str, Any]:
        import capo_ssm.types.get_parameter_result

        return capo_ssm.types.get_parameter_result.redact_sensitive(output)

    interceptors_, options_ = self.operation_options(
        config_overrides,
        OperationLogging("GetParameter", redact_output=_redact_output),
    )
    input_: capo_ssm.types.get_parameter_request.GetParameterRequest = {
        "name": name
    }
    if with_decryption is not None:
        input_["with_decryption"] = with_decryption

    response = await aexecute_pipeline(
        AsyncOperationRequest(input=input_, options=options_),
        handler=_handler,
        interceptors=list(interceptors_),
    )
    await response.response.aclose()
    return response.output