Cloud Functions Flashcards

1
Q

Cloud Functions - Definition

A

Serverless computing platform designed to run single-purpose pieces of code in response to events in GCP environments (PaaS)

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

How are Cloud Functions managed? (3 key points)

A
  1. functions execute in a secure isolated environment
  2. since they each run in a separate instance, they don’t share memory, so they need to be stateless
  3. multiple instances may be running at once.
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

How long can a Cloud Function run?

A

default timeout is 1 min, but can be configured up to 9 min

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

What languages do Cloud Functions support?

A

Node.js 8
Node.js 10
Python 3.7
Go 1.1

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

Cloud Functions - key points (3)

A
  1. managed independently from other services
  2. short running code
  3. fully managed - serverless
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
6
Q

How do cloud functions work?

A

Events have triggers which executes a function in response to the event.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
7
Q

Examples of Cloud Function events (5)

A
  1. HTTP Request
  2. Cloud Storage event - adding, deleting, etc… a file
  3. Cloud Pub/Sub event - publishing a message
  4. Firebase - database trigger
  5. Stackdriver logging
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
8
Q

Cloud Function functions - key points (3)

A
  1. run in a separate instance every time they are invoked
  2. no way to share data without using external service
  3. the function is passed arguments about the event
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
9
Q

Cloud Functions use case examples (4)

A
  1. webhooks - respond to an http request
  2. image processing - validate or transform images
  3. mobile back end - react to storage, authentication or data event
  4. IOT - react to pub/sub from devices
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
10
Q

What needs to be filled in when creating a cloud function via the cloud console?

A
  1. name
  2. memory allocation - 128MB to 2GB
  3. trigger
  4. event type - depends on trigger
  5. source of function code - editor , zip file , upload, etc…
  6. runtime - node, python or go
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
11
Q

Create cloud function via shell - main command

A

gcloud functions deploy [NAME]

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
12
Q

Cloud function shell parameters (3)

A
  • -trigger-resource or –trigger-topic

- -trigger-event

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
13
Q

Command to delete a cloud function via shell?

A

gcloud functions delete [NAME]

How well did you know this?
1
Not at all
2
3
4
5
Perfectly