mondoohq / cnquery

open source, cloud-native, graph-based asset inventory

Home Page:https://cnquery.io

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

New resources for `aws.backup.`

mm-weber opened this issue · comments

To reach the goal

aws.backup.plan.selection.any(backupSelection.resources.any(_ == /arn\:aws\:rds\:/)

We need to add The following resources need to be added:

aws.backup.plans

aws backup list-backup-plans --region us-east-1
{
    "BackupPlansList": [
        {
            "BackupPlanArn": "arn:aws:backup:us-east-1:xxx:backup-plan:aws/efs/73d922fb-9312-3a70-99c3-e69367f9fdad",
            "BackupPlanId": "aws/efs/73d922fb-9312-3a70-99c3-e69367f9fdad",
            "CreationDate": "2021-10-06T19:21:50.720000+02:00",
            "VersionId": "NDdhZGMxMmUtMTA5Zi00NDgzLThhNzItYmI1Mjk3ZWRlY2M4",
            "BackupPlanName": "aws/efs/automatic-backup-plan",
            "CreatorRequestId": "aws/efs/automatic-backup-xxx-us-east-1",
            "LastExecutionDate": "2024-03-06T07:48:01.200000+01:00"
        },
        {
            "BackupPlanArn": "arn:aws:backup:us-east-1:xxx:backup-plan:b32413e8-0dbb-44b9-abf7-2d91ddeda368",
            "BackupPlanId": "b32413e8-0dbb-44b9-abf7-2d91ddeda368",
            "CreationDate": "2024-03-06T19:38:46.884000+01:00",
            "VersionId": "NzcxMzNkYTgtNDNkNC00MzJkLTk1YWItM2I4NDAyYzExODQx",
            "BackupPlanName": "RDS-instance-delete-me"
        }
    ]
}

aws backup list-backup-selections --backup-plan-id b32413e8-0dbb-44b9-abf7-2d91ddeda368 --region us-east-1
{
    "BackupSelectionsList": [
        {
            "SelectionId": "a71e03ce-5c55-41ad-a844-4f63345d08dc",
            "SelectionName": "rds-1-single-db",
            "BackupPlanId": "b32413e8-0dbb-44b9-abf7-2d91ddeda368",
            "CreationDate": "2024-03-06T19:39:23.714000+01:00",
            "CreatorRequestId": "15ede6ca-97cd-447e-ab55-0b2a1f3613cc",
            "IamRoleArn": "arn:aws:iam::xxx:role/service-role/AWSBackupDefaultServiceRole"
        }
    ]
}

aws.backup.plans.selections

aws backup get-backup-selection --backup-plan-id b32413e8-0dbb-44b9-abf7-2d91ddeda368 --selection-id a71e03ce-5c55-41ad-a844-4f63345d08dc --region us-east-1
{
    "BackupSelection": {
        "SelectionName": "rds-1-single-db",
        "IamRoleArn": "arn:aws:iam::xxxx:role/service-role/AWSBackupDefaultServiceRole",
        "Resources": [
            "arn:aws:rds:us-east-1:xxx:db:database-1"
        ],
        "ListOfTags": [],
        "NotResources": [],
        "Conditions": {
            "StringEquals": [],
            "StringNotEquals": [],
            "StringLike": [],
            "StringNotLike": []
        }
    },
    "SelectionId": "a71e03ce-5c55-41ad-a844-4f63345d08dc",
    "BackupPlanId": "b32413e8-0dbb-44b9-abf7-2d91ddeda368",
    "CreationDate": "2024-03-06T19:39:23.714000+01:00",
    "CreatorRequestId": "15ede6ca-97cd-447e-ab55-0b2a1f3613cc"
}

@mm-weber Do we need this now that we expose the backup plan on the DB instance itself?