Hi Guys Does anyone know if there’s a way to crea...
# general
a
Hi Guys Does anyone know if there’s a way to create a redshift view with Pulumi?
f
I asked Pulumi AI and it says its possible and even gives an example. Here is the relevant snippet:
Copy code
# Example SQL to create a view in Redshift
create_view_sql = """
CREATE VIEW example_view AS
SELECT
    *
FROM
    some_table
WHERE
    some_column = 'some_value';
"""

# Command to execute the SQL on the Redshift cluster
create_view = command.remote.Command("createView",
                                     connection=command.remote.ConnectionArgs(
                                         host=cluster_endpoint,
                                         user="yourusername",
                                         password="yourpassword"
                                     ),
                                     create=create_view_sql)
Basically executing some SQL via Pulumi