The gcp:beyondcorp/securityGatewayApplicationIamBinding:SecurityGatewayApplicationIamBinding resource, part of the Pulumi GCP provider, manages IAM role bindings for BeyondCorp Security Gateway Applications. This guide focuses on three capabilities: authoritative role bindings for multiple members, time-based access with IAM Conditions, and non-authoritative member grants.
IAM bindings reference existing Security Gateway and Application resources. The examples are intentionally small. Combine them with your own Security Gateway infrastructure and identity management.
Grant a role to multiple members at once
Teams managing application access often need to assign the same role to multiple users or service accounts, ensuring consistent permissions across a group.
import * as pulumi from "@pulumi/pulumi";
import * as gcp from "@pulumi/gcp";
const binding = new gcp.beyondcorp.SecurityGatewayApplicationIamBinding("binding", {
project: example.project,
securityGatewayId: example.securityGatewayId,
applicationId: example.applicationId,
role: "roles/beyondcorp.securityGatewayUser",
members: ["user:jane@example.com"],
});
import pulumi
import pulumi_gcp as gcp
binding = gcp.beyondcorp.SecurityGatewayApplicationIamBinding("binding",
project=example["project"],
security_gateway_id=example["securityGatewayId"],
application_id=example["applicationId"],
role="roles/beyondcorp.securityGatewayUser",
members=["user:jane@example.com"])
package main
import (
"github.com/pulumi/pulumi-gcp/sdk/v9/go/gcp/beyondcorp"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)
func main() {
pulumi.Run(func(ctx *pulumi.Context) error {
_, err := beyondcorp.NewSecurityGatewayApplicationIamBinding(ctx, "binding", &beyondcorp.SecurityGatewayApplicationIamBindingArgs{
Project: pulumi.Any(example.Project),
SecurityGatewayId: pulumi.Any(example.SecurityGatewayId),
ApplicationId: pulumi.Any(example.ApplicationId),
Role: pulumi.String("roles/beyondcorp.securityGatewayUser"),
Members: pulumi.StringArray{
pulumi.String("user:jane@example.com"),
},
})
if err != nil {
return err
}
return nil
})
}
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using Gcp = Pulumi.Gcp;
return await Deployment.RunAsync(() =>
{
var binding = new Gcp.Beyondcorp.SecurityGatewayApplicationIamBinding("binding", new()
{
Project = example.Project,
SecurityGatewayId = example.SecurityGatewayId,
ApplicationId = example.ApplicationId,
Role = "roles/beyondcorp.securityGatewayUser",
Members = new[]
{
"user:jane@example.com",
},
});
});
package generated_program;
import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.gcp.beyondcorp.SecurityGatewayApplicationIamBinding;
import com.pulumi.gcp.beyondcorp.SecurityGatewayApplicationIamBindingArgs;
import java.util.List;
import java.util.ArrayList;
import java.util.Map;
import java.io.File;
import java.nio.file.Files;
import java.nio.file.Paths;
public class App {
public static void main(String[] args) {
Pulumi.run(App::stack);
}
public static void stack(Context ctx) {
var binding = new SecurityGatewayApplicationIamBinding("binding", SecurityGatewayApplicationIamBindingArgs.builder()
.project(example.project())
.securityGatewayId(example.securityGatewayId())
.applicationId(example.applicationId())
.role("roles/beyondcorp.securityGatewayUser")
.members("user:jane@example.com")
.build());
}
}
resources:
binding:
type: gcp:beyondcorp:SecurityGatewayApplicationIamBinding
properties:
project: ${example.project}
securityGatewayId: ${example.securityGatewayId}
applicationId: ${example.applicationId}
role: roles/beyondcorp.securityGatewayUser
members:
- user:jane@example.com
The SecurityGatewayApplicationIamBinding resource is authoritative for the specified role. The members array lists all identities that should have this role; any members not in this list will be removed from the role. The role property specifies which permission set to grant, and applicationId plus securityGatewayId identify the target application.
Add time-based access with IAM Conditions
Organizations implementing temporary access use IAM Conditions to automatically expire grants at a specific timestamp.
import * as pulumi from "@pulumi/pulumi";
import * as gcp from "@pulumi/gcp";
const binding = new gcp.beyondcorp.SecurityGatewayApplicationIamBinding("binding", {
project: example.project,
securityGatewayId: example.securityGatewayId,
applicationId: example.applicationId,
role: "roles/beyondcorp.securityGatewayUser",
members: ["user:jane@example.com"],
condition: {
title: "expires_after_2019_12_31",
description: "Expiring at midnight of 2019-12-31",
expression: "request.time < timestamp(\"2020-01-01T00:00:00Z\")",
},
});
import pulumi
import pulumi_gcp as gcp
binding = gcp.beyondcorp.SecurityGatewayApplicationIamBinding("binding",
project=example["project"],
security_gateway_id=example["securityGatewayId"],
application_id=example["applicationId"],
role="roles/beyondcorp.securityGatewayUser",
members=["user:jane@example.com"],
condition={
"title": "expires_after_2019_12_31",
"description": "Expiring at midnight of 2019-12-31",
"expression": "request.time < timestamp(\"2020-01-01T00:00:00Z\")",
})
package main
import (
"github.com/pulumi/pulumi-gcp/sdk/v9/go/gcp/beyondcorp"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)
func main() {
pulumi.Run(func(ctx *pulumi.Context) error {
_, err := beyondcorp.NewSecurityGatewayApplicationIamBinding(ctx, "binding", &beyondcorp.SecurityGatewayApplicationIamBindingArgs{
Project: pulumi.Any(example.Project),
SecurityGatewayId: pulumi.Any(example.SecurityGatewayId),
ApplicationId: pulumi.Any(example.ApplicationId),
Role: pulumi.String("roles/beyondcorp.securityGatewayUser"),
Members: pulumi.StringArray{
pulumi.String("user:jane@example.com"),
},
Condition: &beyondcorp.SecurityGatewayApplicationIamBindingConditionArgs{
Title: pulumi.String("expires_after_2019_12_31"),
Description: pulumi.String("Expiring at midnight of 2019-12-31"),
Expression: pulumi.String("request.time < timestamp(\"2020-01-01T00:00:00Z\")"),
},
})
if err != nil {
return err
}
return nil
})
}
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using Gcp = Pulumi.Gcp;
return await Deployment.RunAsync(() =>
{
var binding = new Gcp.Beyondcorp.SecurityGatewayApplicationIamBinding("binding", new()
{
Project = example.Project,
SecurityGatewayId = example.SecurityGatewayId,
ApplicationId = example.ApplicationId,
Role = "roles/beyondcorp.securityGatewayUser",
Members = new[]
{
"user:jane@example.com",
},
Condition = new Gcp.Beyondcorp.Inputs.SecurityGatewayApplicationIamBindingConditionArgs
{
Title = "expires_after_2019_12_31",
Description = "Expiring at midnight of 2019-12-31",
Expression = "request.time < timestamp(\"2020-01-01T00:00:00Z\")",
},
});
});
package generated_program;
import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.gcp.beyondcorp.SecurityGatewayApplicationIamBinding;
import com.pulumi.gcp.beyondcorp.SecurityGatewayApplicationIamBindingArgs;
import com.pulumi.gcp.beyondcorp.inputs.SecurityGatewayApplicationIamBindingConditionArgs;
import java.util.List;
import java.util.ArrayList;
import java.util.Map;
import java.io.File;
import java.nio.file.Files;
import java.nio.file.Paths;
public class App {
public static void main(String[] args) {
Pulumi.run(App::stack);
}
public static void stack(Context ctx) {
var binding = new SecurityGatewayApplicationIamBinding("binding", SecurityGatewayApplicationIamBindingArgs.builder()
.project(example.project())
.securityGatewayId(example.securityGatewayId())
.applicationId(example.applicationId())
.role("roles/beyondcorp.securityGatewayUser")
.members("user:jane@example.com")
.condition(SecurityGatewayApplicationIamBindingConditionArgs.builder()
.title("expires_after_2019_12_31")
.description("Expiring at midnight of 2019-12-31")
.expression("request.time < timestamp(\"2020-01-01T00:00:00Z\")")
.build())
.build());
}
}
resources:
binding:
type: gcp:beyondcorp:SecurityGatewayApplicationIamBinding
properties:
project: ${example.project}
securityGatewayId: ${example.securityGatewayId}
applicationId: ${example.applicationId}
role: roles/beyondcorp.securityGatewayUser
members:
- user:jane@example.com
condition:
title: expires_after_2019_12_31
description: Expiring at midnight of 2019-12-31
expression: request.time < timestamp("2020-01-01T00:00:00Z")
The condition block adds temporal constraints to the binding. The expression property uses CEL (Common Expression Language) to define when access is valid; here, access expires at midnight on 2020-01-01. The title and description provide human-readable context for the condition. This extends the basic binding pattern with automatic expiration.
Add a single member to a role non-authoritatively
When multiple teams manage access to the same application, non-authoritative member resources allow independent grants without overwriting others’ changes.
import * as pulumi from "@pulumi/pulumi";
import * as gcp from "@pulumi/gcp";
const member = new gcp.beyondcorp.SecurityGatewayApplicationIamMember("member", {
project: example.project,
securityGatewayId: example.securityGatewayId,
applicationId: example.applicationId,
role: "roles/beyondcorp.securityGatewayUser",
member: "user:jane@example.com",
});
import pulumi
import pulumi_gcp as gcp
member = gcp.beyondcorp.SecurityGatewayApplicationIamMember("member",
project=example["project"],
security_gateway_id=example["securityGatewayId"],
application_id=example["applicationId"],
role="roles/beyondcorp.securityGatewayUser",
member="user:jane@example.com")
package main
import (
"github.com/pulumi/pulumi-gcp/sdk/v9/go/gcp/beyondcorp"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)
func main() {
pulumi.Run(func(ctx *pulumi.Context) error {
_, err := beyondcorp.NewSecurityGatewayApplicationIamMember(ctx, "member", &beyondcorp.SecurityGatewayApplicationIamMemberArgs{
Project: pulumi.Any(example.Project),
SecurityGatewayId: pulumi.Any(example.SecurityGatewayId),
ApplicationId: pulumi.Any(example.ApplicationId),
Role: pulumi.String("roles/beyondcorp.securityGatewayUser"),
Member: pulumi.String("user:jane@example.com"),
})
if err != nil {
return err
}
return nil
})
}
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using Gcp = Pulumi.Gcp;
return await Deployment.RunAsync(() =>
{
var member = new Gcp.Beyondcorp.SecurityGatewayApplicationIamMember("member", new()
{
Project = example.Project,
SecurityGatewayId = example.SecurityGatewayId,
ApplicationId = example.ApplicationId,
Role = "roles/beyondcorp.securityGatewayUser",
Member = "user:jane@example.com",
});
});
package generated_program;
import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.gcp.beyondcorp.SecurityGatewayApplicationIamMember;
import com.pulumi.gcp.beyondcorp.SecurityGatewayApplicationIamMemberArgs;
import java.util.List;
import java.util.ArrayList;
import java.util.Map;
import java.io.File;
import java.nio.file.Files;
import java.nio.file.Paths;
public class App {
public static void main(String[] args) {
Pulumi.run(App::stack);
}
public static void stack(Context ctx) {
var member = new SecurityGatewayApplicationIamMember("member", SecurityGatewayApplicationIamMemberArgs.builder()
.project(example.project())
.securityGatewayId(example.securityGatewayId())
.applicationId(example.applicationId())
.role("roles/beyondcorp.securityGatewayUser")
.member("user:jane@example.com")
.build());
}
}
resources:
member:
type: gcp:beyondcorp:SecurityGatewayApplicationIamMember
properties:
project: ${example.project}
securityGatewayId: ${example.securityGatewayId}
applicationId: ${example.applicationId}
role: roles/beyondcorp.securityGatewayUser
member: user:jane@example.com
The SecurityGatewayApplicationIamMember resource adds one identity to a role without affecting other members. Unlike IamBinding, this resource is non-authoritative: it only ensures this specific member has the role, leaving other members unchanged. Use this when different teams need to manage access independently.
Beyond these examples
These snippets focus on specific IAM binding features: authoritative role bindings, non-authoritative member grants, and time-based access with IAM Conditions. They’re intentionally minimal rather than full access control systems.
The examples reference pre-existing infrastructure such as BeyondCorp Security Gateway and Application resources, and a GCP project with BeyondCorp API enabled. They focus on configuring IAM bindings rather than provisioning the underlying gateway infrastructure.
To keep things focused, common IAM patterns are omitted, including:
- Full policy replacement (IamPolicy resource)
- Complex condition expressions (attribute-based access)
- Service account creation and management
- Security Gateway and Application provisioning
These omissions are intentional: the goal is to illustrate how each IAM binding feature is wired, not provide drop-in access control modules. See the SecurityGatewayApplicationIamBinding resource reference for all available configuration options.
Let's manage GCP BeyondCorp Security Gateway Application IAM Bindings
Get started with Pulumi Cloud, then follow our quick setup guide to deploy this infrastructure.
Try Pulumi Cloud for FREEFrequently Asked Questions
Resource Selection & Conflicts
SecurityGatewayApplicationIamPolicy cannot be used with SecurityGatewayApplicationIamBinding or SecurityGatewayApplicationIamMember because they will conflict over the policy. Choose one approach: use IamPolicy alone for full policy control, or use IamBinding/IamMember for granular management.SecurityGatewayApplicationIamBinding and SecurityGatewayApplicationIamMember will conflict if they both grant privileges to the same role.IamPolicy is authoritative and replaces the entire IAM policy. IamBinding is authoritative for a specific role, managing all members for that role while preserving other roles. IamMember is non-authoritative, adding individual members without affecting other members for the same role.IAM Configuration
allUsers, allAuthenticatedUsers, user:{email}, serviceAccount:{email}, group:{email}, domain:{domain}, projectOwner:projectid, projectEditor:projectid, projectViewer:projectid, or federated identities like principal://iam.googleapis.com/locations/global/workforcePools/example-contractors/subject/joe@example.com.[projects|organizations]/{parent-name}/roles/{role-name}. For example: projects/my-project/roles/my-custom-role or organizations/my-org/roles/my-custom-role.IAM Conditions
condition property with title, description, and expression. For example, to expire access at a specific time: expression: "request.time < timestamp(\"2020-01-01T00:00:00Z\")".