You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: oci-event-display-python/README.md
+23-16Lines changed: 23 additions & 16 deletions
Original file line number
Diff line number
Diff line change
@@ -5,42 +5,49 @@ This function logs the details of a Cloud event.
5
5
As you make your way through this tutorial, look out for this icon .
6
6
Whenever you see it, it's time for you to perform an action.
7
7
8
-
## Pre-requisites
9
-
1. Start by making sure all of your policies are correct from this [guide](https://docs.cloud.oracle.com/iaas/Content/Functions/Tasks/functionscreatingpolicies.htm?tocpath=Services%7CFunctions%7CPreparing%20for%20Oracle%20Functions%7CConfiguring%20Your%20Tenancy%20for%20Function%20Development%7C_____4)
10
8
11
-
2. Have [Fn CLI setup with Oracle Functions](https://docs.cloud.oracle.com/iaas/Content/Functions/Tasks/functionsconfiguringclient.htm?tocpath=Services%7CFunctions%7CPreparing%20for%20Oracle%20Functions%7CConfiguring%20Your%20Client%20Environment%20for%20Function%20Development%7C_____0)
9
+
## Prerequisites
10
+
Before you deploy this sample function, make sure you have run step A, B and C of the [Oracle Functions Quick Start Guide for Cloud Shell](https://www.oracle.com/webfolder/technetwork/tutorials/infographics/oci_functions_cloudshell_quickview/functions_quickview_top/functions_quickview/index.html)
11
+
* A - Set up your tenancy
12
+
* B - Create application
13
+
* C - Set up your Cloud Shell dev environment
12
14
13
-
## Create an Application to run your function
14
-
You can use an application already created or create a new one as follow:
15
-

15
+
16
+
## List Applications
17
+
Assuming your have successfully completed the prerequisites, you should see your
Get the OCID of the subnet in your VCN you wish to use.
20
22
21
-
e.g.
23
+
24
+
## Create or Update your Dynamic Group
25
+
In order to use other OCI Services, your function must be part of a dynamic group. For information on how to create a dynamic group, refer to the [documentation](https://docs.cloud.oracle.com/iaas/Content/Identity/Tasks/managingdynamicgroups.htm#To).
26
+
27
+
When specifying the *Matching Rules*, we suggest matching all functions in a compartment with:
ALL {resource.type = 'fnfunc', resource.compartment.id = 'ocid1.compartment.oc1..aaaaaxxxxx'}
24
30
```
31
+
Please check the [Accessing Other Oracle Cloud Infrastructure Resources from Running Functions](https://docs.cloud.oracle.com/en-us/iaas/Content/Functions/Tasks/functionsaccessingociresources.htm) for other *Matching Rules* options.
25
32
26
-
Running this function without access to the logs will have a limited value, we recommend configuring the application logs to go to Papertrail. Refer to [syslog-setup](https://orahub.oraclecorp.com/oracle-functions-samples/syslog-setup).
27
33
28
34
## Review and customize your function
29
35
Review the following files in the current folder:
30
36
* the code of the function, [func.py](./func.py)
31
37
* its dependencies, [requirements.txt](./requirements.txt)
32
38
* the function metadata, [func.yaml](./func.yaml)
33
39
40
+
34
41
## Deploy the function
42
+
In Cloud Shell, run the *fn deploy* command to build the function and its dependencies as a Docker image,
43
+
push the image to OCIR, and deploy the function to Oracle Functions in your application.
44
+
35
45

36
46
```
37
-
fn -v deploy --app <your app name>
38
-
```
39
-
e.g.
40
-
```
41
-
fn -v deploy --app myapp
47
+
fn -v deploy --app <app-name>
42
48
```
43
49
50
+
44
51
## Create the Cloud Event rule
45
52
Create a Cloud Event rule on the console navigating to Application Integration > Event Service. Click *Create Rule*.
0 commit comments