
Answer-first summary for fast verification
Answer: 1. Enable Private Google Access in the subnetwork, and set up Cloud Storage notifications to a Pub/Sub topic. 2. Create a push subscription that points to the web server URL.
The correct answer is A. This approach ensures that the Cloud Composer instance can reactively run the DAG every time a new file is received in the Cloud Storage bucket. By enabling Private Google Access in the subnetwork, the instance can communicate with Google services without requiring public internet access. Setting up Cloud Storage notifications to a Pub/Sub topic allows for immediate event-driven execution. Creating a push subscription that points to the web server URL effectively triggers the execution of the DAG when a new file arrives. This method leverages the available Google Cloud services in a private and secure manner, suitable for a no-internet-access environment.
Author: LeetQuiz Editorial Team
Ultimate access to all questions.
You are deploying an Apache Airflow directed acyclic graph (DAG) in a Cloud Composer 2 instance. The Cloud Composer instance is located within a subnetwork that has no Internet access. Your workflow involves processing incoming files stored in a Cloud Storage bucket, handling them one file at a time. Rather than executing the DAG at regular intervals according to a schedule, you need the DAG to be triggered reactively, so it runs automatically whenever a new file is uploaded to the Cloud Storage bucket. What approach should you take to implement this functionality?
A
B
C
D