-
According to the official Snowflake documentation, integrating Snowflake with AWS requires 3 steps:
In terms of resource provisioning, this creates a circular dependency: I'm wondering how other people in the community usually solve this ? In AWS, there's a similar example or this regarding ACM SSL Certificates ( I'm not sure this would help us here, because the 3rd step is on AWS' side but I'm just tossing ideas here ;) |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 1 reply
-
@LouisAmon - the IAM role you supply into the storage integration does not need to exist beforehand. As you can construct the format of a IAM role arn yourself with interpolation and consistent naming standards, this can be supplied without a reference to the However, if you then go on to use a snowpipe the IAM role does need to exist as Snowflake will check the stage can access the data before accepting the snowpipe definition. You may also need to add a local exec provisioner to sleep for a few seconds as IAM can be delayed; we add a delay of 5 seconds onto the creation of the stage and a depends_on so that it executes successfully. |
Beta Was this translation helpful? Give feedback.
-
That's actually a great solution ! Thanks @robbruce |
Beta Was this translation helpful? Give feedback.
@LouisAmon - the IAM role you supply into the storage integration does not need to exist beforehand. As you can construct the format of a IAM role arn yourself with interpolation and consistent naming standards, this can be supplied without a reference to the
aws_iam_role
's arn attribute.However, if you then go on to use a snowpipe the IAM role does need to exist as Snowflake will check the stage can access the data before accepting the snowpipe definition.
You may also need to add a local exec provisioner to sleep for a few seconds as IAM can be delayed; we add a delay of 5 seconds onto the creation of the stage and a depends_on so that it executes successfully.