Manage GCP BeyondCorp Security Gateway Application IAM

The gcp:beyondcorp/securityGatewayApplicationIamMember:SecurityGatewayApplicationIamMember resource, part of the Pulumi GCP provider, grants IAM permissions to individual identities for BeyondCorp Security Gateway Applications. It adds members to roles without affecting existing grants. This guide focuses on two capabilities: single-member access grants and time-based access expiration with IAM Conditions.

This resource references existing Security Gateway and Application resources rather than creating them. The examples are intentionally small. Combine them with your own BeyondCorp infrastructure and identity management.

Grant a single user access to an application

Most access control starts by granting individual users permission to access specific applications without disrupting other members’ access.

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 member property identifies who receives access (user, service account, group, or domain). The role property specifies what they can do; roles/beyondcorp.securityGatewayUser allows connecting through the gateway. The applicationId and securityGatewayId properties locate the application within your BeyondCorp deployment. This resource is non-authoritative: it adds one member without removing others.

Grant time-limited access with IAM Conditions

Temporary access grants expire automatically when conditions evaluate to false, eliminating manual cleanup.

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",
    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.SecurityGatewayApplicationIamMember("member",
    project=example["project"],
    security_gateway_id=example["securityGatewayId"],
    application_id=example["applicationId"],
    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.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"),
			Condition: &beyondcorp.SecurityGatewayApplicationIamMemberConditionArgs{
				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.SecurityGatewayApplicationIamMember("member", new()
    {
        Project = example.Project,
        SecurityGatewayId = example.SecurityGatewayId,
        ApplicationId = example.ApplicationId,
        Role = "roles/beyondcorp.securityGatewayUser",
        Member = "user:jane@example.com",
        Condition = new Gcp.Beyondcorp.Inputs.SecurityGatewayApplicationIamMemberConditionArgs
        {
            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.SecurityGatewayApplicationIamMember;
import com.pulumi.gcp.beyondcorp.SecurityGatewayApplicationIamMemberArgs;
import com.pulumi.gcp.beyondcorp.inputs.SecurityGatewayApplicationIamMemberConditionArgs;
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")
            .condition(SecurityGatewayApplicationIamMemberConditionArgs.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:SecurityGatewayApplicationIamMember
    properties:
      project: ${example.project}
      securityGatewayId: ${example.securityGatewayId}
      applicationId: ${example.applicationId}
      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 property adds time-based or attribute-based restrictions to the grant. The expression uses CEL (Common Expression Language) to define when access is valid; here, it expires at midnight on 2020-01-01. The title and description document the condition’s purpose. IAM evaluates conditions on every request, automatically denying access once the timestamp passes.

Beyond these examples

These snippets focus on specific IAM member features: single-member grants and time-based access expiration. They’re intentionally minimal rather than complete access control systems.

The examples reference pre-existing infrastructure such as BeyondCorp Security Gateway and Application resources, and a GCP project with the BeyondCorp API enabled. They focus on granting access rather than provisioning the gateway infrastructure.

To keep things focused, common IAM patterns are omitted, including:

  • Policy and Binding resources (authoritative alternatives)
  • Multiple members or roles in one resource
  • Complex condition expressions (location, resource attributes)
  • Service account and group identities

These omissions are intentional: the goal is to illustrate how member grants are wired, not provide drop-in access control modules. See the SecurityGatewayApplicationIamMember resource reference for all available configuration options.

Let's manage GCP BeyondCorp Security Gateway Application IAM

Get started with Pulumi Cloud, then follow our quick setup guide to deploy this infrastructure.

Try Pulumi Cloud for FREE

Frequently Asked Questions

Resource Selection & Conflicts
Which IAM resource should I use for managing access?
Choose based on your needs: SecurityGatewayApplicationIamPolicy for full policy control (replaces entire policy), SecurityGatewayApplicationIamBinding for managing all members of a specific role, or SecurityGatewayApplicationIamMember for adding individual members without affecting others.
Can I use IamPolicy with IamBinding or IamMember?
No, SecurityGatewayApplicationIamPolicy cannot be used with SecurityGatewayApplicationIamBinding or SecurityGatewayApplicationIamMember because they will conflict over the policy configuration.
Can I use IamBinding and IamMember together?
Yes, but only if they manage different roles. Using both SecurityGatewayApplicationIamBinding and SecurityGatewayApplicationIamMember for the same role will cause conflicts.
IAM Configuration
What member identity formats are supported?
You can use: allUsers, allAuthenticatedUsers, user:{email}, serviceAccount:{email}, group:{email}, domain:{domain}, projectOwner/Editor/Viewer:{projectid}, or federated identities like principal://iam.googleapis.com/....
How do I specify a custom IAM role?
Custom roles must use the format [projects|organizations]/{parent-name}/roles/{role-name}, for example projects/my-project/roles/customRole.
How do I add conditional access with IAM Conditions?
Add a condition block with title, description, and expression fields. For example, you can restrict access by time using expressions like request.time < timestamp("2020-01-01T00:00:00Z").
What are the limitations of IAM Conditions?
IAM Conditions have known limitations that may affect certain use cases. If you encounter issues, consult the GCP IAM Conditions limitations documentation.
Resource Management
What properties can't be changed after creation?
All required properties are immutable: applicationId, securityGatewayId, project, member, role, and condition. You must recreate the resource to change any of these.

Using a different cloud?

Explore security guides for other cloud providers: