Salta al contenuto

aws rds cli -- need to search the db-parameter-group(s) for a specific parameter

0

Hello all. I am successful at querying "aws --no-verify-ssl rds describe-db-parameter-groups". But, I'm trying to filter down in order to view one parameter (audit_trail). Secondly, I need to modify the parameter value to a new string. All I'm finding in the documentation, however, looks like "-> (file)". IOW search the parameter groups for the string "oracle", then the parameters for the string "audit_trail", then the parameterVaule for the string "os". Your guidance is appreciated.

3 Risposte
1
Risposta accettata

Hello,

Thanks for posting to AWS re:Post. Viewing of these parameters can be done by describe-db-parameters https://docs.aws.amazon.com/cli/latest/reference/rds/describe-db-parameters.html

Example aws rds describe-db-parameters --db-parameter-group-name xxxx --query 'Parameters[].{ParameterName: ParameterName, ParameterValue: ParameterValue}' --output json https://docs.aws.amazon.com/cli/latest/userguide/cli-usage-filter.html

You can also output to a file ">filename.txt" at the end

Modify by aws rds modify-db-parameter-group --db-parameter-group-name xxxx --parameters "ParameterName='xxxx',ParameterValue=xxxx,ApplyMethod=immediate" https://docs.aws.amazon.com/cli/latest/reference/rds/modify-db-parameter-group.html

AWS
ESPERTO
con risposta 3 anni fa
0

Hi,

Is there no option for the command below to just show all the information instead of having to itemize each entry in {}?

aws rds describe-db-parameters --db-parameter-group-name blah --query 'Parameters[].{ParameterName: ParameterName, ParameterValue: ParameterValue}'

For example am trying to run

aws rds describe-db-cluster-parameters \
  --db-cluster-parameter-group-name blah
  --query "Parameters[?ParameterName == 'password_encryption'].{ParameterName: ParameterName, ParameterValue: ParameterValue}"

The output is as below:

[
    [
        "md5"
    ]
]

And I just want it to output the whole lot like below instead of having to list each and every item :(

        {
            "ParameterName": "password_encryption",
            "ParameterValue": "md5",
            "Description": "Encrypt passwords.",
            "Source": "system",
            "ApplyType": "dynamic",
            "DataType": "string",
            "AllowedValues": "md5,scram-sha-256",
            "IsModifiable": true,
            "ApplyMethod": "pending-reboot",
            "SupportedEngineModes": [
                "provisioned"
            ]
        },

I can run

aws rds describe-db-cluster-parameters \
  --db-cluster-parameter-group-name blah \
  --query "Parameters[?ParameterName == 'password_encryption'].*"

And the output is below but without the labels? :(

[
    [
        "password_encryption",
        "md5",
        "Encrypt passwords.",
        "system",
        "dynamic",
        "string",
        "md5,scram-sha-256",
        true,
        "pending-reboot",
        [
            "provisioned"
        ]
    ]
]

con risposta 9 mesi fa
0

Perhaps the jq utility might help you here.

aws rds describe-db-parameters \
  --db-parameter-group-name default.mysql8.0 \
  --output json | jq '.Parameters[] | select(.ParameterName == "wait_timeout")'
{
  "ParameterName": "wait_timeout",
  "Description": "The number of seconds the server waits for activity on a non-interactive TCP/IP or UNIX File connection before closing it.",
  "Source": "engine-default",
  "ApplyType": "dynamic",
  "DataType": "integer",
  "AllowedValues": "1-31536000",
  "IsModifiable": true,
  "ApplyMethod": "pending-reboot"
}
AWS
con risposta 9 mesi fa

Accesso non effettuato. Accedi per postare una risposta.

Una buona risposta soddisfa chiaramente la domanda, fornisce un feedback costruttivo e incoraggia la crescita professionale del richiedente.