Created
May 20, 2021 04:34
-
-
Save calum-github/800592ceead32bb6695b4c2c1482eeea to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Create a conditional IAM rule that grants access to establish an IAP tunnel | |
# IF the user is connecting from an authorised network defined in the access | |
# list | |
resource "google_iap_tunnel_iam_member" "allow-remote-access-to-iap" { | |
project = "<your-project-id>" | |
role = "roles/iap.tunnelResourceAccessor" | |
member = "user:[email protected]" | |
condition { | |
title = "allow_remote_access_to_iap" | |
description = "Allow access to IAP tunnel for authorized users" | |
expression = "\"accessPolicies/<access-policy-id>/accessLevels/<my-access-level-name>\" in request.auth.access_levels" | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment