The gcp:beyondcorp/securityGatewayIamMember:SecurityGatewayIamMember resource, part of the Pulumi GCP provider, grants IAM permissions to individual identities on BeyondCorp security gateways without affecting other members or roles. This guide focuses on three capabilities: non-authoritative member grants, time-limited access with IAM Conditions, and role-level member management.
IAM resources reference existing security gateways and require valid project and location identifiers. The examples are intentionally small. Combine them with your own security gateway infrastructure and identity management strategy.
Grant a single user access to a security gateway
Most IAM configurations add individual users to specific roles without disrupting existing permissions.
import * as pulumi from "@pulumi/pulumi";
import * as gcp from "@pulumi/gcp";
const member = new gcp.beyondcorp.SecurityGatewayIamMember("member", {
project: example.project,
location: example.location,
securityGatewayId: example.securityGatewayId,
role: "roles/beyondcorp.securityGatewayUser",
member: "user:jane@example.com",
});
import pulumi
import pulumi_gcp as gcp
member = gcp.beyondcorp.SecurityGatewayIamMember("member",
project=example["project"],
location=example["location"],
security_gateway_id=example["securityGatewayId"],
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.NewSecurityGatewayIamMember(ctx, "member", &beyondcorp.SecurityGatewayIamMemberArgs{
Project: pulumi.Any(example.Project),
Location: pulumi.Any(example.Location),
SecurityGatewayId: pulumi.Any(example.SecurityGatewayId),
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.SecurityGatewayIamMember("member", new()
{
Project = example.Project,
Location = example.Location,
SecurityGatewayId = example.SecurityGatewayId,
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.SecurityGatewayIamMember;
import com.pulumi.gcp.beyondcorp.SecurityGatewayIamMemberArgs;
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 SecurityGatewayIamMember("member", SecurityGatewayIamMemberArgs.builder()
.project(example.project())
.location(example.location())
.securityGatewayId(example.securityGatewayId())
.role("roles/beyondcorp.securityGatewayUser")
.member("user:jane@example.com")
.build());
}
}
resources:
member:
type: gcp:beyondcorp:SecurityGatewayIamMember
properties:
project: ${example.project}
location: ${example.location}
securityGatewayId: ${example.securityGatewayId}
role: roles/beyondcorp.securityGatewayUser
member: user:jane@example.com
The member property specifies the identity to grant access, using the format “user:email@example.com”. The role property defines the permission level. SecurityGatewayIamMember is non-authoritative: it adds this member without removing others who already have the role.
Grant time-limited access with IAM Conditions
Organizations often need temporary access that expires automatically, such as contractor permissions or time-boxed projects.
import * as pulumi from "@pulumi/pulumi";
import * as gcp from "@pulumi/gcp";
const member = new gcp.beyondcorp.SecurityGatewayIamMember("member", {
project: example.project,
location: example.location,
securityGatewayId: example.securityGatewayId,
role: "roles/beyondcorp.securityGatewayUser",
member: "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
member = gcp.beyondcorp.SecurityGatewayIamMember("member",
project=example["project"],
location=example["location"],
security_gateway_id=example["securityGatewayId"],
role="roles/beyondcorp.securityGatewayUser",
member="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.NewSecurityGatewayIamMember(ctx, "member", &beyondcorp.SecurityGatewayIamMemberArgs{
Project: pulumi.Any(example.Project),
Location: pulumi.Any(example.Location),
SecurityGatewayId: pulumi.Any(example.SecurityGatewayId),
Role: pulumi.String("roles/beyondcorp.securityGatewayUser"),
Member: pulumi.String("user:jane@example.com"),
Condition: &beyondcorp.SecurityGatewayIamMemberConditionArgs{
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 member = new Gcp.Beyondcorp.SecurityGatewayIamMember("member", new()
{
Project = example.Project,
Location = example.Location,
SecurityGatewayId = example.SecurityGatewayId,
Role = "roles/beyondcorp.securityGatewayUser",
Member = "user:jane@example.com",
Condition = new Gcp.Beyondcorp.Inputs.SecurityGatewayIamMemberConditionArgs
{
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.SecurityGatewayIamMember;
import com.pulumi.gcp.beyondcorp.SecurityGatewayIamMemberArgs;
import com.pulumi.gcp.beyondcorp.inputs.SecurityGatewayIamMemberConditionArgs;
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 SecurityGatewayIamMember("member", SecurityGatewayIamMemberArgs.builder()
.project(example.project())
.location(example.location())
.securityGatewayId(example.securityGatewayId())
.role("roles/beyondcorp.securityGatewayUser")
.member("user:jane@example.com")
.condition(SecurityGatewayIamMemberConditionArgs.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:
member:
type: gcp:beyondcorp:SecurityGatewayIamMember
properties:
project: ${example.project}
location: ${example.location}
securityGatewayId: ${example.securityGatewayId}
role: roles/beyondcorp.securityGatewayUser
member: 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 time-based restrictions to the grant. The expression property uses CEL (Common Expression Language) to define when access is valid. Here, the condition checks that the request time is before January 1, 2020. The title and description properties document the condition’s purpose.
Manage all members for a role authoritatively
When you need to control the complete member list for a role, SecurityGatewayIamBinding replaces all members for that role.
import * as pulumi from "@pulumi/pulumi";
import * as gcp from "@pulumi/gcp";
const binding = new gcp.beyondcorp.SecurityGatewayIamBinding("binding", {
project: example.project,
location: example.location,
securityGatewayId: example.securityGatewayId,
role: "roles/beyondcorp.securityGatewayUser",
members: ["user:jane@example.com"],
});
import pulumi
import pulumi_gcp as gcp
binding = gcp.beyondcorp.SecurityGatewayIamBinding("binding",
project=example["project"],
location=example["location"],
security_gateway_id=example["securityGatewayId"],
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.NewSecurityGatewayIamBinding(ctx, "binding", &beyondcorp.SecurityGatewayIamBindingArgs{
Project: pulumi.Any(example.Project),
Location: pulumi.Any(example.Location),
SecurityGatewayId: pulumi.Any(example.SecurityGatewayId),
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.SecurityGatewayIamBinding("binding", new()
{
Project = example.Project,
Location = example.Location,
SecurityGatewayId = example.SecurityGatewayId,
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.SecurityGatewayIamBinding;
import com.pulumi.gcp.beyondcorp.SecurityGatewayIamBindingArgs;
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 SecurityGatewayIamBinding("binding", SecurityGatewayIamBindingArgs.builder()
.project(example.project())
.location(example.location())
.securityGatewayId(example.securityGatewayId())
.role("roles/beyondcorp.securityGatewayUser")
.members("user:jane@example.com")
.build());
}
}
resources:
binding:
type: gcp:beyondcorp:SecurityGatewayIamBinding
properties:
project: ${example.project}
location: ${example.location}
securityGatewayId: ${example.securityGatewayId}
role: roles/beyondcorp.securityGatewayUser
members:
- user:jane@example.com
SecurityGatewayIamBinding sets the entire member list for the specified role. The members property takes an array of identities. This resource is authoritative for the role: it removes any members not listed. Other roles on the security gateway remain unchanged.
Beyond these examples
These snippets focus on specific IAM management features: single-member grants, role-level member management, and time-based access with IAM Conditions. They’re intentionally minimal rather than full access control configurations.
The examples reference pre-existing infrastructure such as BeyondCorp security gateways and GCP projects with BeyondCorp enabled. They focus on granting permissions rather than provisioning the underlying security gateway resources.
To keep things focused, common IAM patterns are omitted, including:
- Full policy replacement (SecurityGatewayIamPolicy)
- Multiple condition types (resource attributes, request context)
- Service account and group identities
- Federated identity and workload identity pool principals
These omissions are intentional: the goal is to illustrate how each IAM resource type is wired, not provide drop-in access control modules. See the SecurityGatewayIamMember resource reference for all available configuration options.
Let's manage GCP BeyondCorp Security Gateway IAM Members
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
SecurityGatewayIamPolicy cannot be used with SecurityGatewayIamBinding or SecurityGatewayIamMember as they will conflict over the policy configuration.Choose based on your needs:
- SecurityGatewayIamPolicy: Authoritative control of the entire IAM policy (replaces existing policy)
- SecurityGatewayIamBinding: Authoritative control of all members for a specific role (preserves other roles)
- SecurityGatewayIamMember: Non-authoritative addition of individual members to a role (preserves other members)
IAM Configuration
allUsers, allAuthenticatedUsers, user:{email}, serviceAccount:{email}, group:{email}, domain:{domain}, projectOwner/Editor/Viewer:{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/customRole.condition property with title, description, and expression fields. For example, set expression to request.time < timestamp("2020-01-01T00:00:00Z") for expiring access.Resource Properties
location property must be omitted or set to global. If not specified, it will be parsed from the parent resource identifier or taken from the provider configuration.