AWS CLI output configuration for date format

0

I will like to use AWS CLI to view information about AWS Backup and also use AWS CLI to perform restore

When I tried to list the content of a backup vault using the command below, the creation and complete date in the output is not in datetime format. Is there any configuration for AWS CLI to output the date fields in a datetime format? Or Humand readable format

profile picture
Lottie
preguntada hace 5 meses208 visualizaciones
1 Respuesta
0

Hello.

I executed the following command with CloudShell, but the timestamp seems to be displayed in UTC.
Could you please share which command you used?

aws backup list-recovery-points-by-backup-vault --backup-vault-name VaultName --by-resource-type Aurora
{
    "RecoveryPoints": [
        {
            "RecoveryPointArn": "arn:aws:backup:ap-northeast-1:11111111111:recovery-point:continuous:cluster-yyyyyyyyyyy",
            "BackupVaultName": "VaultName",
            "BackupVaultArn": "arn:aws:backup:ap-northeast-1:11111111111:backup-vault:VaultName",
            "ResourceArn": "arn:aws:rds:ap-northeast-1:11111111111:cluster:test-aurora",
            "ResourceType": "Aurora",
            "CreatedBy": {
                "BackupPlanId": "yyyyyyyy-yyyy-yyyy-yyyy-yyyyyyyyy",
                "BackupPlanArn": "arn:aws:backup:ap-northeast-1:11111111111:backup-plan:yyyyyyyy-yyyy-yyyy-yyyy-yyyyyyyyy",
                "BackupPlanVersion": "yyyyyyyyy......",
                "BackupRuleId": "yyyyyyyy-yyyy-yyyy-yyyy-yyyyyyyyy"
            },
            "IamRoleArn": "arn:aws:iam::11111111111:role/test-role",
            "Status": "AVAILABLE",
            "StatusMessage": "",
            "CreationDate": "2023-11-17T16:00:00+00:00",
            "CompletionDate": "2023-12-12T16:19:37.158000+00:00",
            "CalculatedLifecycle": {
                "DeleteAt": "2023-12-19T16:19:37.167000+00:00"
            },
            "Lifecycle": {
                "DeleteAfterDays": 7
            },
            "EncryptionKeyArn": "arn:aws:kms:ap-northeast-1:11111111111:key/yyyyyyyy-yyyy-yyyy-yyyy-yyyyyyyyy",
            "IsEncrypted": true,
            "IsParent": false,
            "ResourceName": "test-aurora"
        }
    ]
}
profile picture
EXPERTO
respondido hace 5 meses
  • I used the same command on cli aws backup list-recovery-points-by-backup-vault --backup-vault-name mybackup-hourly ]$ aws backup list-recovery-points-by-backup-vault --backup-vault-name mybackup-hourly { "RecoveryPoints": [ { "Status": "COMPLETED", "BackupVaultArn": "arn:aws:backup:ap-southeast-2:857574822812:backup-vault:mybackup-hourly", "RecoveryPointArn": "arn:aws:rds:ap-southeast-2:857574822812:snapshot:awsbackup:job-d2039684-f4e1-05de-f474-6c307e262d14", "CalculatedLifecycle": { "DeleteAt": 1702512000.0 }, "ResourceType": "RDS", "BackupSizeInBytes": 0, "IamRoleArn": "arn:aws:iam::857574822812:role/service-role/AWSBackupDefaultServiceRole", "EncryptionKeyArn": "arn:aws:kms:ap-southeast-2:857574822812:key/fc0239d4-49fe-4ecb-92a5-72edf42067b5", "ResourceArn": "arn:aws:rds:ap-southeast-2:857574822812:db:sysdevdb", "IsEncrypted": true, "CreatedBy": { "BackupPlanArn": "arn:aws:backup:ap-southeast-2:857574822812:backup-plan:b37a7e3d-5977-477a-8bc4-1ea2858df370", "BackupRuleId": "fff99313-f3f2-4173-9bf3-ada777f9f383", "BackupPlanId": "b37a7e3d-5977-477a-8bc4-1ea2858df370", "BackupPlanVersion": "MjZmZWFkZDItNDZjMy00MTJkLTg5MmUtNzM4OGMxZTEzZTdk" }, "CompletionDate": 1702340841.607, "CreationDate": 1702339200.0,

  • What happens when you run it in CloudShell?

  • When i ran it on CloudShell I get an error: An error occurred (AccessDeniedException) when calling the ListRecoveryPointsByBackupVault operation: Insufficient privileges to perform this action. I did not get any error running the same command on AWS cli. How do I fix this permission related problem?

No has iniciado sesión. Iniciar sesión para publicar una respuesta.

Una buena respuesta responde claramente a la pregunta, proporciona comentarios constructivos y fomenta el crecimiento profesional en la persona que hace la pregunta.

Pautas para responder preguntas