Skip to content

Circular dependency during StorageIntegration with AWS S3 #627

Answered by robbruce
LouisAmon asked this question in Q&A
Discussion options

You must be logged in to vote

@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.

Replies: 2 comments 1 reply

Comment options

You must be logged in to vote
0 replies
Answer selected by LouisAmon
Comment options

You must be logged in to vote
1 reply
@robbruce
Comment options

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants