0
0
GCPcloud~10 mins

Lifecycle management rules in GCP - Interactive Code Practice

Choose your learning style9 modes available
Practice - 5 Tasks
Answer the questions below
1fill in blank
easy

Complete the code to specify the action type in a lifecycle rule.

GCP
{
  "rule": {
    "action": {
      "type": "[1]"
    },
    "condition": {
      "age": 30
    }
  }
}
Drag options to blanks, or click blank then click option'
ADelete
BEncrypt
CNotify
DArchive
Attempts:
3 left
💡 Hint
Common Mistakes
Using an invalid action type like 'Notify' which is not supported.
Confusing action types with condition fields.
2fill in blank
medium

Complete the code to set the condition for object age in days.

GCP
{
  "rule": {
    "action": {
      "type": "Delete"
    },
    "condition": {
      "[1]": 60
    }
  }
}
Drag options to blanks, or click blank then click option'
AcreatedBefore
Bage
CisLive
DmatchesStorageClass
Attempts:
3 left
💡 Hint
Common Mistakes
Using 'createdBefore' which expects a date, not a number.
Using 'isLive' which is a boolean, not an age.
3fill in blank
hard

Fix the error in the lifecycle rule by completing the missing field for storage class transition.

GCP
{
  "rule": {
    "action": {
      "type": "SetStorageClass",
      "storageClass": "[1]"
    },
    "condition": {
      "age": 90
    }
  }
}
Drag options to blanks, or click blank then click option'
ANEARLINE
BSTANDARD
CARCHIVE
DCOLDLINE
Attempts:
3 left
💡 Hint
Common Mistakes
Using 'STANDARD' which is the default and not a transition.
Using 'ARCHIVE' which is usually for very long-term storage.
4fill in blank
hard

Fill both blanks to create a lifecycle rule that deletes noncurrent versions older than 30 days.

GCP
{
  "rule": {
    "action": {
      "type": "[1]"
    },
    "condition": {
      "age": 30,
      "[2]": false
    }
  }
}
Drag options to blanks, or click blank then click option'
ADelete
BSetStorageClass
CisLive
DmatchesPrefix
Attempts:
3 left
💡 Hint
Common Mistakes
Using 'SetStorageClass' instead of 'Delete' for removal.
Confusing 'isLive' with 'matchesPrefix' which filters by name.
5fill in blank
hard

Fill all three blanks to create a lifecycle rule that transitions objects with prefix 'logs/' to NEARLINE storage after 45 days.

GCP
{
  "rule": {
    "action": {
      "type": "[1]",
      "storageClass": "[2]"
    },
    "condition": {
      "age": [3],
      "matchesPrefix": ["logs/"]
    }
  }
}
Drag options to blanks, or click blank then click option'
ADelete
BSetStorageClass
CNEARLINE
D45
Attempts:
3 left
💡 Hint
Common Mistakes
Using 'Delete' instead of 'SetStorageClass' for transition.
Setting age to 60 instead of 45.
Using wrong storage class like 'COLDLINE'.