Deploy Pre-built OCI Function & Configure Event Rule

This article details the process for deploying a pre-built OCI Function and configuring an OCI Event Rule to trigger it automatically.

1. Log In to Oracle Cloud 

Go to cloud.oracle.com, enter your Cloud Account Name, and click Next. Then, enter your username and password to log in.


2. Navigate to Pre-Built Functions

Open the main navigation menu, go to Developer Services, locate Functions, and click Pre-Built Functions.



3. Select the Function Template

Find and select the Object Storage File Extractor pre-built function card, then click Create function.



4. Configure Function Details

Enter a unique Name for your function, select the appropriate Application compartment and Application, and then click Create.


5. Review Dynamic Group and IAM Policies 

If automatic IAM policy creation is enabled, OCI will automatically create the required dynamic group and assign the policies (provided you have sufficient permissions). If you lack administrative rights, work with your administrator to set up the dynamic group and assign policies manually.

6. Verify Function Creation

Navigate to your selected Application to verify that the function appears in the list and shows an Active status.


7. Navigate to OCI Events Service

Open the main menu, navigate to Observability & Management, and select Rules under the Events Service section.



8. Define Rule Conditions

Click Create rule. Enter a Display name and Description. Under Rule conditions, set the following parameters: 
Condition: Event type | Service name: Object Storage | Event type: Object - Create
Condition: Attribute | Attribute name: resourceName | Attribute value: *.zip
Condition: Attribute | Attribute name: bucketName | Attribute value:  STAGE_RODS


9. Set Action and Create Rule
In the Actions section, select Functions as the Action type. Choose the target Function compartment, Function application, and Function. Click Create rule. Once configured, the function will execute automatically whenever a new ZIP file is uploaded to the specified bucket.



No comments:

Post a Comment