Skip to content

Commit a79b570

Browse files
authored
feat: allow security admin to create network rules (#4)
* feat: allow security admin to create network rules * fix: keys
1 parent a5707a6 commit a79b570

File tree

2 files changed

+13
-13
lines changed

2 files changed

+13
-13
lines changed

.github/workflows/github_actions.yaml

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -108,10 +108,10 @@ jobs:
108108
- name: Download Encrypted Artifact & Decrypt Artifact
109109
uses: badgerhobbs/terraform-state@v2
110110
with:
111-
encryption_key: ${{ secrets.encryption_key }}
111+
encryption_key: ${{ secrets.ENCRYPTION_KEY }}
112112
operation: download
113113
location: artifact
114-
github_token: ${{ secrets.gh_access_token }}
114+
github_token: ${{ secrets.GITHUB_TOKEN }}
115115
directory: terraform
116116
continue-on-error: true
117117

@@ -141,10 +141,10 @@ jobs:
141141
- name: Download Encrypted Artifact & Decrypt Artifact
142142
uses: badgerhobbs/terraform-state@v2
143143
with:
144-
encryption_key: ${{ secrets.encryption_key }}
144+
encryption_key: ${{ secrets.ENCRYPTION_KEY }}
145145
operation: download
146146
location: artifact
147-
github_token: ${{ secrets.gh_access_token }}
147+
github_token: ${{ secrets.GITHUB_TOKEN }}
148148
directory: terraform
149149
continue-on-error: true
150150

@@ -183,10 +183,10 @@ jobs:
183183
- name: Download Encrypted Artifact & Decrypt Artifact
184184
uses: badgerhobbs/terraform-state@v2
185185
with:
186-
encryption_key: ${{ secrets.encryption_key }}
186+
encryption_key: ${{ secrets.ENCRYPTION_KEY }}
187187
operation: download
188188
location: artifact
189-
github_token: ${{ secrets.gh_access_token }}
189+
github_token: ${{ secrets.GITHUB_TOKEN }}
190190
directory: terraform
191191
continue-on-error: true
192192

@@ -216,8 +216,8 @@ jobs:
216216
- name: Encrypt Artifact & Upload Encrypted Artifact
217217
uses: badgerhobbs/terraform-state@v2
218218
with:
219-
encryption_key: ${{ secrets.encryption_key }}
219+
encryption_key: ${{ secrets.ENCRYPTION_KEY }}
220220
operation: upload
221221
location: artifact
222-
github_token: ${{ secrets.gh_access_token }}
222+
github_token: ${{ secrets.GITHUB_TOKEN }}
223223
directory: terraform

terraform/access_roles.tf

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -18,8 +18,8 @@ module "access_roles" {
1818
}
1919

2020
# SECURITYADMIN needs to be allowed to use COMMON schema for network policies
21-
# resource "snowflake_execute" "grant_create_network_rule_to_securityadmin" {
22-
# provider = snowflake.sysadmin
23-
# execute = "GRANT CREATE NETWORK RULE ON SCHEMA ${snowflake_database.common_db.name}.${snowflake_schema.common_common_schema.name} TO ROLE SECURITYADMIN;"
24-
# revert = "REVOKE CREATE NETWORK RULE ON SCHEMA ${snowflake_database.common_db.name}.${snowflake_schema.common_common_schema.name} FROM ROLE SECURITYADMIN;"
25-
# }
21+
resource "snowflake_execute" "grant_create_network_rule_to_securityadmin" {
22+
provider = snowflake.sysadmin
23+
execute = "GRANT CREATE NETWORK RULE ON SCHEMA ${snowflake_database.common_db.name}.${snowflake_schema.common_common_schema.name} TO ROLE SECURITYADMIN;"
24+
revert = "REVOKE CREATE NETWORK RULE ON SCHEMA ${snowflake_database.common_db.name}.${snowflake_schema.common_common_schema.name} FROM ROLE SECURITYADMIN;"
25+
}

0 commit comments

Comments
 (0)