Example 1: Creating a Materialized View with a source Data Pool with an access policy
This example shows how to create a Materialized View with a source Data Pool that has an access policy.1
Create the source Data Pool
First, we create the source Data Pool with access control enabled. This is done using the
propel_data_pool
resource.2
Create the access policy
Next, we create the access policy for the source Data Pool. This policy gives access to the Terraform application and any other Applications that you specify. We use the
propel_data_pool_access_policy
resource for this.3
Create the Materialized View
Finally, we create the Materialized View. The challenge here is that the policy needs to be created before the Materialized View queries, otherwise it will not have access to the data. To avoid this, we use the Data Pool ID from the Data Pool Access Policy
${propel_data_pool_access_policy.my_terraform_policy.data_pool}
so that Terraform will wait for the policy to be created before the Materialized View is created.