gcp.beyondcorp.ApplicationIamPolicy
Explore with Pulumi AI
Three different resources help you manage your IAM policy for BeyondCorp Application. Each of these resources serves a different use case:
gcp.beyondcorp.ApplicationIamPolicy
: Authoritative. Sets the IAM policy for the application and replaces any existing policy already attached.gcp.beyondcorp.ApplicationIamBinding
: Authoritative for a given role. Updates the IAM policy to grant a role to a list of members. Other roles within the IAM policy for the application are preserved.gcp.beyondcorp.ApplicationIamMember
: Non-authoritative. Updates the IAM policy to grant a role to a new member. Other members for the role for the application are preserved.
A data source can be used to retrieve policy data in advent you do not need creation
gcp.beyondcorp.ApplicationIamPolicy
: Retrieves the IAM policy for the application
Note:
gcp.beyondcorp.ApplicationIamPolicy
cannot be used in conjunction withgcp.beyondcorp.ApplicationIamBinding
andgcp.beyondcorp.ApplicationIamMember
or they will fight over what your policy should be.
Note:
gcp.beyondcorp.ApplicationIamBinding
resources can be used in conjunction withgcp.beyondcorp.ApplicationIamMember
resources only if they do not grant privilege to the same role.
Note: This resource supports IAM Conditions but they have some known limitations which can be found here. Please review this article if you are having issues with IAM Conditions.
gcp.beyondcorp.ApplicationIamPolicy
import * as pulumi from "@pulumi/pulumi";
import * as gcp from "@pulumi/gcp";
const admin = gcp.organizations.getIAMPolicy({
bindings: [{
role: "roles/beyondcorp.securityGatewayUser",
members: ["user:jane@example.com"],
}],
});
const policy = new gcp.beyondcorp.ApplicationIamPolicy("policy", {
project: example.project,
securityGatewaysId: example.securityGatewaysId,
applicationId: example.applicationId,
policyData: admin.then(admin => admin.policyData),
});
import pulumi
import pulumi_gcp as gcp
admin = gcp.organizations.get_iam_policy(bindings=[{
"role": "roles/beyondcorp.securityGatewayUser",
"members": ["user:jane@example.com"],
}])
policy = gcp.beyondcorp.ApplicationIamPolicy("policy",
project=example["project"],
security_gateways_id=example["securityGatewaysId"],
application_id=example["applicationId"],
policy_data=admin.policy_data)
package main
import (
"github.com/pulumi/pulumi-gcp/sdk/v8/go/gcp/beyondcorp"
"github.com/pulumi/pulumi-gcp/sdk/v8/go/gcp/organizations"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)
func main() {
pulumi.Run(func(ctx *pulumi.Context) error {
admin, err := organizations.LookupIAMPolicy(ctx, &organizations.LookupIAMPolicyArgs{
Bindings: []organizations.GetIAMPolicyBinding{
{
Role: "roles/beyondcorp.securityGatewayUser",
Members: []string{
"user:jane@example.com",
},
},
},
}, nil)
if err != nil {
return err
}
_, err = beyondcorp.NewApplicationIamPolicy(ctx, "policy", &beyondcorp.ApplicationIamPolicyArgs{
Project: pulumi.Any(example.Project),
SecurityGatewaysId: pulumi.Any(example.SecurityGatewaysId),
ApplicationId: pulumi.Any(example.ApplicationId),
PolicyData: pulumi.String(admin.PolicyData),
})
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 admin = Gcp.Organizations.GetIAMPolicy.Invoke(new()
{
Bindings = new[]
{
new Gcp.Organizations.Inputs.GetIAMPolicyBindingInputArgs
{
Role = "roles/beyondcorp.securityGatewayUser",
Members = new[]
{
"user:jane@example.com",
},
},
},
});
var policy = new Gcp.Beyondcorp.ApplicationIamPolicy("policy", new()
{
Project = example.Project,
SecurityGatewaysId = example.SecurityGatewaysId,
ApplicationId = example.ApplicationId,
PolicyData = admin.Apply(getIAMPolicyResult => getIAMPolicyResult.PolicyData),
});
});
package generated_program;
import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.gcp.organizations.OrganizationsFunctions;
import com.pulumi.gcp.organizations.inputs.GetIAMPolicyArgs;
import com.pulumi.gcp.beyondcorp.ApplicationIamPolicy;
import com.pulumi.gcp.beyondcorp.ApplicationIamPolicyArgs;
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) {
final var admin = OrganizationsFunctions.getIAMPolicy(GetIAMPolicyArgs.builder()
.bindings(GetIAMPolicyBindingArgs.builder()
.role("roles/beyondcorp.securityGatewayUser")
.members("user:jane@example.com")
.build())
.build());
var policy = new ApplicationIamPolicy("policy", ApplicationIamPolicyArgs.builder()
.project(example.project())
.securityGatewaysId(example.securityGatewaysId())
.applicationId(example.applicationId())
.policyData(admin.applyValue(getIAMPolicyResult -> getIAMPolicyResult.policyData()))
.build());
}
}
resources:
policy:
type: gcp:beyondcorp:ApplicationIamPolicy
properties:
project: ${example.project}
securityGatewaysId: ${example.securityGatewaysId}
applicationId: ${example.applicationId}
policyData: ${admin.policyData}
variables:
admin:
fn::invoke:
function: gcp:organizations:getIAMPolicy
arguments:
bindings:
- role: roles/beyondcorp.securityGatewayUser
members:
- user:jane@example.com
With IAM Conditions:
import * as pulumi from "@pulumi/pulumi";
import * as gcp from "@pulumi/gcp";
const admin = gcp.organizations.getIAMPolicy({
bindings: [{
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\")",
},
}],
});
const policy = new gcp.beyondcorp.ApplicationIamPolicy("policy", {
project: example.project,
securityGatewaysId: example.securityGatewaysId,
applicationId: example.applicationId,
policyData: admin.then(admin => admin.policyData),
});
import pulumi
import pulumi_gcp as gcp
admin = gcp.organizations.get_iam_policy(bindings=[{
"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\")",
},
}])
policy = gcp.beyondcorp.ApplicationIamPolicy("policy",
project=example["project"],
security_gateways_id=example["securityGatewaysId"],
application_id=example["applicationId"],
policy_data=admin.policy_data)
package main
import (
"github.com/pulumi/pulumi-gcp/sdk/v8/go/gcp/beyondcorp"
"github.com/pulumi/pulumi-gcp/sdk/v8/go/gcp/organizations"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)
func main() {
pulumi.Run(func(ctx *pulumi.Context) error {
admin, err := organizations.LookupIAMPolicy(ctx, &organizations.LookupIAMPolicyArgs{
Bindings: []organizations.GetIAMPolicyBinding{
{
Role: "roles/beyondcorp.securityGatewayUser",
Members: []string{
"user:jane@example.com",
},
Condition: {
Title: "expires_after_2019_12_31",
Description: pulumi.StringRef("Expiring at midnight of 2019-12-31"),
Expression: "request.time < timestamp(\"2020-01-01T00:00:00Z\")",
},
},
},
}, nil)
if err != nil {
return err
}
_, err = beyondcorp.NewApplicationIamPolicy(ctx, "policy", &beyondcorp.ApplicationIamPolicyArgs{
Project: pulumi.Any(example.Project),
SecurityGatewaysId: pulumi.Any(example.SecurityGatewaysId),
ApplicationId: pulumi.Any(example.ApplicationId),
PolicyData: pulumi.String(admin.PolicyData),
})
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 admin = Gcp.Organizations.GetIAMPolicy.Invoke(new()
{
Bindings = new[]
{
new Gcp.Organizations.Inputs.GetIAMPolicyBindingInputArgs
{
Role = "roles/beyondcorp.securityGatewayUser",
Members = new[]
{
"user:jane@example.com",
},
Condition = new Gcp.Organizations.Inputs.GetIAMPolicyBindingConditionInputArgs
{
Title = "expires_after_2019_12_31",
Description = "Expiring at midnight of 2019-12-31",
Expression = "request.time < timestamp(\"2020-01-01T00:00:00Z\")",
},
},
},
});
var policy = new Gcp.Beyondcorp.ApplicationIamPolicy("policy", new()
{
Project = example.Project,
SecurityGatewaysId = example.SecurityGatewaysId,
ApplicationId = example.ApplicationId,
PolicyData = admin.Apply(getIAMPolicyResult => getIAMPolicyResult.PolicyData),
});
});
package generated_program;
import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.gcp.organizations.OrganizationsFunctions;
import com.pulumi.gcp.organizations.inputs.GetIAMPolicyArgs;
import com.pulumi.gcp.beyondcorp.ApplicationIamPolicy;
import com.pulumi.gcp.beyondcorp.ApplicationIamPolicyArgs;
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) {
final var admin = OrganizationsFunctions.getIAMPolicy(GetIAMPolicyArgs.builder()
.bindings(GetIAMPolicyBindingArgs.builder()
.role("roles/beyondcorp.securityGatewayUser")
.members("user:jane@example.com")
.condition(GetIAMPolicyBindingConditionArgs.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())
.build());
var policy = new ApplicationIamPolicy("policy", ApplicationIamPolicyArgs.builder()
.project(example.project())
.securityGatewaysId(example.securityGatewaysId())
.applicationId(example.applicationId())
.policyData(admin.applyValue(getIAMPolicyResult -> getIAMPolicyResult.policyData()))
.build());
}
}
resources:
policy:
type: gcp:beyondcorp:ApplicationIamPolicy
properties:
project: ${example.project}
securityGatewaysId: ${example.securityGatewaysId}
applicationId: ${example.applicationId}
policyData: ${admin.policyData}
variables:
admin:
fn::invoke:
function: gcp:organizations:getIAMPolicy
arguments:
bindings:
- 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")
gcp.beyondcorp.ApplicationIamBinding
import * as pulumi from "@pulumi/pulumi";
import * as gcp from "@pulumi/gcp";
const binding = new gcp.beyondcorp.ApplicationIamBinding("binding", {
project: example.project,
securityGatewaysId: example.securityGatewaysId,
applicationId: example.applicationId,
role: "roles/beyondcorp.securityGatewayUser",
members: ["user:jane@example.com"],
});
import pulumi
import pulumi_gcp as gcp
binding = gcp.beyondcorp.ApplicationIamBinding("binding",
project=example["project"],
security_gateways_id=example["securityGatewaysId"],
application_id=example["applicationId"],
role="roles/beyondcorp.securityGatewayUser",
members=["user:jane@example.com"])
package main
import (
"github.com/pulumi/pulumi-gcp/sdk/v8/go/gcp/beyondcorp"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)
func main() {
pulumi.Run(func(ctx *pulumi.Context) error {
_, err := beyondcorp.NewApplicationIamBinding(ctx, "binding", &beyondcorp.ApplicationIamBindingArgs{
Project: pulumi.Any(example.Project),
SecurityGatewaysId: pulumi.Any(example.SecurityGatewaysId),
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.ApplicationIamBinding("binding", new()
{
Project = example.Project,
SecurityGatewaysId = example.SecurityGatewaysId,
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.ApplicationIamBinding;
import com.pulumi.gcp.beyondcorp.ApplicationIamBindingArgs;
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 ApplicationIamBinding("binding", ApplicationIamBindingArgs.builder()
.project(example.project())
.securityGatewaysId(example.securityGatewaysId())
.applicationId(example.applicationId())
.role("roles/beyondcorp.securityGatewayUser")
.members("user:jane@example.com")
.build());
}
}
resources:
binding:
type: gcp:beyondcorp:ApplicationIamBinding
properties:
project: ${example.project}
securityGatewaysId: ${example.securityGatewaysId}
applicationId: ${example.applicationId}
role: roles/beyondcorp.securityGatewayUser
members:
- user:jane@example.com
With IAM Conditions:
import * as pulumi from "@pulumi/pulumi";
import * as gcp from "@pulumi/gcp";
const binding = new gcp.beyondcorp.ApplicationIamBinding("binding", {
project: example.project,
securityGatewaysId: example.securityGatewaysId,
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.ApplicationIamBinding("binding",
project=example["project"],
security_gateways_id=example["securityGatewaysId"],
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/v8/go/gcp/beyondcorp"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)
func main() {
pulumi.Run(func(ctx *pulumi.Context) error {
_, err := beyondcorp.NewApplicationIamBinding(ctx, "binding", &beyondcorp.ApplicationIamBindingArgs{
Project: pulumi.Any(example.Project),
SecurityGatewaysId: pulumi.Any(example.SecurityGatewaysId),
ApplicationId: pulumi.Any(example.ApplicationId),
Role: pulumi.String("roles/beyondcorp.securityGatewayUser"),
Members: pulumi.StringArray{
pulumi.String("user:jane@example.com"),
},
Condition: &beyondcorp.ApplicationIamBindingConditionArgs{
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.ApplicationIamBinding("binding", new()
{
Project = example.Project,
SecurityGatewaysId = example.SecurityGatewaysId,
ApplicationId = example.ApplicationId,
Role = "roles/beyondcorp.securityGatewayUser",
Members = new[]
{
"user:jane@example.com",
},
Condition = new Gcp.Beyondcorp.Inputs.ApplicationIamBindingConditionArgs
{
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.ApplicationIamBinding;
import com.pulumi.gcp.beyondcorp.ApplicationIamBindingArgs;
import com.pulumi.gcp.beyondcorp.inputs.ApplicationIamBindingConditionArgs;
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 ApplicationIamBinding("binding", ApplicationIamBindingArgs.builder()
.project(example.project())
.securityGatewaysId(example.securityGatewaysId())
.applicationId(example.applicationId())
.role("roles/beyondcorp.securityGatewayUser")
.members("user:jane@example.com")
.condition(ApplicationIamBindingConditionArgs.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:ApplicationIamBinding
properties:
project: ${example.project}
securityGatewaysId: ${example.securityGatewaysId}
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")
gcp.beyondcorp.ApplicationIamMember
import * as pulumi from "@pulumi/pulumi";
import * as gcp from "@pulumi/gcp";
const member = new gcp.beyondcorp.ApplicationIamMember("member", {
project: example.project,
securityGatewaysId: example.securityGatewaysId,
applicationId: example.applicationId,
role: "roles/beyondcorp.securityGatewayUser",
member: "user:jane@example.com",
});
import pulumi
import pulumi_gcp as gcp
member = gcp.beyondcorp.ApplicationIamMember("member",
project=example["project"],
security_gateways_id=example["securityGatewaysId"],
application_id=example["applicationId"],
role="roles/beyondcorp.securityGatewayUser",
member="user:jane@example.com")
package main
import (
"github.com/pulumi/pulumi-gcp/sdk/v8/go/gcp/beyondcorp"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)
func main() {
pulumi.Run(func(ctx *pulumi.Context) error {
_, err := beyondcorp.NewApplicationIamMember(ctx, "member", &beyondcorp.ApplicationIamMemberArgs{
Project: pulumi.Any(example.Project),
SecurityGatewaysId: pulumi.Any(example.SecurityGatewaysId),
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.ApplicationIamMember("member", new()
{
Project = example.Project,
SecurityGatewaysId = example.SecurityGatewaysId,
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.ApplicationIamMember;
import com.pulumi.gcp.beyondcorp.ApplicationIamMemberArgs;
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 ApplicationIamMember("member", ApplicationIamMemberArgs.builder()
.project(example.project())
.securityGatewaysId(example.securityGatewaysId())
.applicationId(example.applicationId())
.role("roles/beyondcorp.securityGatewayUser")
.member("user:jane@example.com")
.build());
}
}
resources:
member:
type: gcp:beyondcorp:ApplicationIamMember
properties:
project: ${example.project}
securityGatewaysId: ${example.securityGatewaysId}
applicationId: ${example.applicationId}
role: roles/beyondcorp.securityGatewayUser
member: user:jane@example.com
With IAM Conditions:
import * as pulumi from "@pulumi/pulumi";
import * as gcp from "@pulumi/gcp";
const member = new gcp.beyondcorp.ApplicationIamMember("member", {
project: example.project,
securityGatewaysId: example.securityGatewaysId,
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.ApplicationIamMember("member",
project=example["project"],
security_gateways_id=example["securityGatewaysId"],
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/v8/go/gcp/beyondcorp"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)
func main() {
pulumi.Run(func(ctx *pulumi.Context) error {
_, err := beyondcorp.NewApplicationIamMember(ctx, "member", &beyondcorp.ApplicationIamMemberArgs{
Project: pulumi.Any(example.Project),
SecurityGatewaysId: pulumi.Any(example.SecurityGatewaysId),
ApplicationId: pulumi.Any(example.ApplicationId),
Role: pulumi.String("roles/beyondcorp.securityGatewayUser"),
Member: pulumi.String("user:jane@example.com"),
Condition: &beyondcorp.ApplicationIamMemberConditionArgs{
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.ApplicationIamMember("member", new()
{
Project = example.Project,
SecurityGatewaysId = example.SecurityGatewaysId,
ApplicationId = example.ApplicationId,
Role = "roles/beyondcorp.securityGatewayUser",
Member = "user:jane@example.com",
Condition = new Gcp.Beyondcorp.Inputs.ApplicationIamMemberConditionArgs
{
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.ApplicationIamMember;
import com.pulumi.gcp.beyondcorp.ApplicationIamMemberArgs;
import com.pulumi.gcp.beyondcorp.inputs.ApplicationIamMemberConditionArgs;
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 ApplicationIamMember("member", ApplicationIamMemberArgs.builder()
.project(example.project())
.securityGatewaysId(example.securityGatewaysId())
.applicationId(example.applicationId())
.role("roles/beyondcorp.securityGatewayUser")
.member("user:jane@example.com")
.condition(ApplicationIamMemberConditionArgs.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:ApplicationIamMember
properties:
project: ${example.project}
securityGatewaysId: ${example.securityGatewaysId}
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")
This resource supports User Project Overrides.
IAM policy for BeyondCorp Application
Three different resources help you manage your IAM policy for BeyondCorp Application. Each of these resources serves a different use case:
gcp.beyondcorp.ApplicationIamPolicy
: Authoritative. Sets the IAM policy for the application and replaces any existing policy already attached.gcp.beyondcorp.ApplicationIamBinding
: Authoritative for a given role. Updates the IAM policy to grant a role to a list of members. Other roles within the IAM policy for the application are preserved.gcp.beyondcorp.ApplicationIamMember
: Non-authoritative. Updates the IAM policy to grant a role to a new member. Other members for the role for the application are preserved.
A data source can be used to retrieve policy data in advent you do not need creation
gcp.beyondcorp.ApplicationIamPolicy
: Retrieves the IAM policy for the application
Note:
gcp.beyondcorp.ApplicationIamPolicy
cannot be used in conjunction withgcp.beyondcorp.ApplicationIamBinding
andgcp.beyondcorp.ApplicationIamMember
or they will fight over what your policy should be.
Note:
gcp.beyondcorp.ApplicationIamBinding
resources can be used in conjunction withgcp.beyondcorp.ApplicationIamMember
resources only if they do not grant privilege to the same role.
Note: This resource supports IAM Conditions but they have some known limitations which can be found here. Please review this article if you are having issues with IAM Conditions.
gcp.beyondcorp.ApplicationIamPolicy
import * as pulumi from "@pulumi/pulumi";
import * as gcp from "@pulumi/gcp";
const admin = gcp.organizations.getIAMPolicy({
bindings: [{
role: "roles/beyondcorp.securityGatewayUser",
members: ["user:jane@example.com"],
}],
});
const policy = new gcp.beyondcorp.ApplicationIamPolicy("policy", {
project: example.project,
securityGatewaysId: example.securityGatewaysId,
applicationId: example.applicationId,
policyData: admin.then(admin => admin.policyData),
});
import pulumi
import pulumi_gcp as gcp
admin = gcp.organizations.get_iam_policy(bindings=[{
"role": "roles/beyondcorp.securityGatewayUser",
"members": ["user:jane@example.com"],
}])
policy = gcp.beyondcorp.ApplicationIamPolicy("policy",
project=example["project"],
security_gateways_id=example["securityGatewaysId"],
application_id=example["applicationId"],
policy_data=admin.policy_data)
package main
import (
"github.com/pulumi/pulumi-gcp/sdk/v8/go/gcp/beyondcorp"
"github.com/pulumi/pulumi-gcp/sdk/v8/go/gcp/organizations"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)
func main() {
pulumi.Run(func(ctx *pulumi.Context) error {
admin, err := organizations.LookupIAMPolicy(ctx, &organizations.LookupIAMPolicyArgs{
Bindings: []organizations.GetIAMPolicyBinding{
{
Role: "roles/beyondcorp.securityGatewayUser",
Members: []string{
"user:jane@example.com",
},
},
},
}, nil)
if err != nil {
return err
}
_, err = beyondcorp.NewApplicationIamPolicy(ctx, "policy", &beyondcorp.ApplicationIamPolicyArgs{
Project: pulumi.Any(example.Project),
SecurityGatewaysId: pulumi.Any(example.SecurityGatewaysId),
ApplicationId: pulumi.Any(example.ApplicationId),
PolicyData: pulumi.String(admin.PolicyData),
})
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 admin = Gcp.Organizations.GetIAMPolicy.Invoke(new()
{
Bindings = new[]
{
new Gcp.Organizations.Inputs.GetIAMPolicyBindingInputArgs
{
Role = "roles/beyondcorp.securityGatewayUser",
Members = new[]
{
"user:jane@example.com",
},
},
},
});
var policy = new Gcp.Beyondcorp.ApplicationIamPolicy("policy", new()
{
Project = example.Project,
SecurityGatewaysId = example.SecurityGatewaysId,
ApplicationId = example.ApplicationId,
PolicyData = admin.Apply(getIAMPolicyResult => getIAMPolicyResult.PolicyData),
});
});
package generated_program;
import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.gcp.organizations.OrganizationsFunctions;
import com.pulumi.gcp.organizations.inputs.GetIAMPolicyArgs;
import com.pulumi.gcp.beyondcorp.ApplicationIamPolicy;
import com.pulumi.gcp.beyondcorp.ApplicationIamPolicyArgs;
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) {
final var admin = OrganizationsFunctions.getIAMPolicy(GetIAMPolicyArgs.builder()
.bindings(GetIAMPolicyBindingArgs.builder()
.role("roles/beyondcorp.securityGatewayUser")
.members("user:jane@example.com")
.build())
.build());
var policy = new ApplicationIamPolicy("policy", ApplicationIamPolicyArgs.builder()
.project(example.project())
.securityGatewaysId(example.securityGatewaysId())
.applicationId(example.applicationId())
.policyData(admin.applyValue(getIAMPolicyResult -> getIAMPolicyResult.policyData()))
.build());
}
}
resources:
policy:
type: gcp:beyondcorp:ApplicationIamPolicy
properties:
project: ${example.project}
securityGatewaysId: ${example.securityGatewaysId}
applicationId: ${example.applicationId}
policyData: ${admin.policyData}
variables:
admin:
fn::invoke:
function: gcp:organizations:getIAMPolicy
arguments:
bindings:
- role: roles/beyondcorp.securityGatewayUser
members:
- user:jane@example.com
With IAM Conditions:
import * as pulumi from "@pulumi/pulumi";
import * as gcp from "@pulumi/gcp";
const admin = gcp.organizations.getIAMPolicy({
bindings: [{
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\")",
},
}],
});
const policy = new gcp.beyondcorp.ApplicationIamPolicy("policy", {
project: example.project,
securityGatewaysId: example.securityGatewaysId,
applicationId: example.applicationId,
policyData: admin.then(admin => admin.policyData),
});
import pulumi
import pulumi_gcp as gcp
admin = gcp.organizations.get_iam_policy(bindings=[{
"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\")",
},
}])
policy = gcp.beyondcorp.ApplicationIamPolicy("policy",
project=example["project"],
security_gateways_id=example["securityGatewaysId"],
application_id=example["applicationId"],
policy_data=admin.policy_data)
package main
import (
"github.com/pulumi/pulumi-gcp/sdk/v8/go/gcp/beyondcorp"
"github.com/pulumi/pulumi-gcp/sdk/v8/go/gcp/organizations"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)
func main() {
pulumi.Run(func(ctx *pulumi.Context) error {
admin, err := organizations.LookupIAMPolicy(ctx, &organizations.LookupIAMPolicyArgs{
Bindings: []organizations.GetIAMPolicyBinding{
{
Role: "roles/beyondcorp.securityGatewayUser",
Members: []string{
"user:jane@example.com",
},
Condition: {
Title: "expires_after_2019_12_31",
Description: pulumi.StringRef("Expiring at midnight of 2019-12-31"),
Expression: "request.time < timestamp(\"2020-01-01T00:00:00Z\")",
},
},
},
}, nil)
if err != nil {
return err
}
_, err = beyondcorp.NewApplicationIamPolicy(ctx, "policy", &beyondcorp.ApplicationIamPolicyArgs{
Project: pulumi.Any(example.Project),
SecurityGatewaysId: pulumi.Any(example.SecurityGatewaysId),
ApplicationId: pulumi.Any(example.ApplicationId),
PolicyData: pulumi.String(admin.PolicyData),
})
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 admin = Gcp.Organizations.GetIAMPolicy.Invoke(new()
{
Bindings = new[]
{
new Gcp.Organizations.Inputs.GetIAMPolicyBindingInputArgs
{
Role = "roles/beyondcorp.securityGatewayUser",
Members = new[]
{
"user:jane@example.com",
},
Condition = new Gcp.Organizations.Inputs.GetIAMPolicyBindingConditionInputArgs
{
Title = "expires_after_2019_12_31",
Description = "Expiring at midnight of 2019-12-31",
Expression = "request.time < timestamp(\"2020-01-01T00:00:00Z\")",
},
},
},
});
var policy = new Gcp.Beyondcorp.ApplicationIamPolicy("policy", new()
{
Project = example.Project,
SecurityGatewaysId = example.SecurityGatewaysId,
ApplicationId = example.ApplicationId,
PolicyData = admin.Apply(getIAMPolicyResult => getIAMPolicyResult.PolicyData),
});
});
package generated_program;
import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.gcp.organizations.OrganizationsFunctions;
import com.pulumi.gcp.organizations.inputs.GetIAMPolicyArgs;
import com.pulumi.gcp.beyondcorp.ApplicationIamPolicy;
import com.pulumi.gcp.beyondcorp.ApplicationIamPolicyArgs;
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) {
final var admin = OrganizationsFunctions.getIAMPolicy(GetIAMPolicyArgs.builder()
.bindings(GetIAMPolicyBindingArgs.builder()
.role("roles/beyondcorp.securityGatewayUser")
.members("user:jane@example.com")
.condition(GetIAMPolicyBindingConditionArgs.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())
.build());
var policy = new ApplicationIamPolicy("policy", ApplicationIamPolicyArgs.builder()
.project(example.project())
.securityGatewaysId(example.securityGatewaysId())
.applicationId(example.applicationId())
.policyData(admin.applyValue(getIAMPolicyResult -> getIAMPolicyResult.policyData()))
.build());
}
}
resources:
policy:
type: gcp:beyondcorp:ApplicationIamPolicy
properties:
project: ${example.project}
securityGatewaysId: ${example.securityGatewaysId}
applicationId: ${example.applicationId}
policyData: ${admin.policyData}
variables:
admin:
fn::invoke:
function: gcp:organizations:getIAMPolicy
arguments:
bindings:
- 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")
gcp.beyondcorp.ApplicationIamBinding
import * as pulumi from "@pulumi/pulumi";
import * as gcp from "@pulumi/gcp";
const binding = new gcp.beyondcorp.ApplicationIamBinding("binding", {
project: example.project,
securityGatewaysId: example.securityGatewaysId,
applicationId: example.applicationId,
role: "roles/beyondcorp.securityGatewayUser",
members: ["user:jane@example.com"],
});
import pulumi
import pulumi_gcp as gcp
binding = gcp.beyondcorp.ApplicationIamBinding("binding",
project=example["project"],
security_gateways_id=example["securityGatewaysId"],
application_id=example["applicationId"],
role="roles/beyondcorp.securityGatewayUser",
members=["user:jane@example.com"])
package main
import (
"github.com/pulumi/pulumi-gcp/sdk/v8/go/gcp/beyondcorp"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)
func main() {
pulumi.Run(func(ctx *pulumi.Context) error {
_, err := beyondcorp.NewApplicationIamBinding(ctx, "binding", &beyondcorp.ApplicationIamBindingArgs{
Project: pulumi.Any(example.Project),
SecurityGatewaysId: pulumi.Any(example.SecurityGatewaysId),
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.ApplicationIamBinding("binding", new()
{
Project = example.Project,
SecurityGatewaysId = example.SecurityGatewaysId,
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.ApplicationIamBinding;
import com.pulumi.gcp.beyondcorp.ApplicationIamBindingArgs;
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 ApplicationIamBinding("binding", ApplicationIamBindingArgs.builder()
.project(example.project())
.securityGatewaysId(example.securityGatewaysId())
.applicationId(example.applicationId())
.role("roles/beyondcorp.securityGatewayUser")
.members("user:jane@example.com")
.build());
}
}
resources:
binding:
type: gcp:beyondcorp:ApplicationIamBinding
properties:
project: ${example.project}
securityGatewaysId: ${example.securityGatewaysId}
applicationId: ${example.applicationId}
role: roles/beyondcorp.securityGatewayUser
members:
- user:jane@example.com
With IAM Conditions:
import * as pulumi from "@pulumi/pulumi";
import * as gcp from "@pulumi/gcp";
const binding = new gcp.beyondcorp.ApplicationIamBinding("binding", {
project: example.project,
securityGatewaysId: example.securityGatewaysId,
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.ApplicationIamBinding("binding",
project=example["project"],
security_gateways_id=example["securityGatewaysId"],
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/v8/go/gcp/beyondcorp"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)
func main() {
pulumi.Run(func(ctx *pulumi.Context) error {
_, err := beyondcorp.NewApplicationIamBinding(ctx, "binding", &beyondcorp.ApplicationIamBindingArgs{
Project: pulumi.Any(example.Project),
SecurityGatewaysId: pulumi.Any(example.SecurityGatewaysId),
ApplicationId: pulumi.Any(example.ApplicationId),
Role: pulumi.String("roles/beyondcorp.securityGatewayUser"),
Members: pulumi.StringArray{
pulumi.String("user:jane@example.com"),
},
Condition: &beyondcorp.ApplicationIamBindingConditionArgs{
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.ApplicationIamBinding("binding", new()
{
Project = example.Project,
SecurityGatewaysId = example.SecurityGatewaysId,
ApplicationId = example.ApplicationId,
Role = "roles/beyondcorp.securityGatewayUser",
Members = new[]
{
"user:jane@example.com",
},
Condition = new Gcp.Beyondcorp.Inputs.ApplicationIamBindingConditionArgs
{
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.ApplicationIamBinding;
import com.pulumi.gcp.beyondcorp.ApplicationIamBindingArgs;
import com.pulumi.gcp.beyondcorp.inputs.ApplicationIamBindingConditionArgs;
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 ApplicationIamBinding("binding", ApplicationIamBindingArgs.builder()
.project(example.project())
.securityGatewaysId(example.securityGatewaysId())
.applicationId(example.applicationId())
.role("roles/beyondcorp.securityGatewayUser")
.members("user:jane@example.com")
.condition(ApplicationIamBindingConditionArgs.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:ApplicationIamBinding
properties:
project: ${example.project}
securityGatewaysId: ${example.securityGatewaysId}
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")
gcp.beyondcorp.ApplicationIamMember
import * as pulumi from "@pulumi/pulumi";
import * as gcp from "@pulumi/gcp";
const member = new gcp.beyondcorp.ApplicationIamMember("member", {
project: example.project,
securityGatewaysId: example.securityGatewaysId,
applicationId: example.applicationId,
role: "roles/beyondcorp.securityGatewayUser",
member: "user:jane@example.com",
});
import pulumi
import pulumi_gcp as gcp
member = gcp.beyondcorp.ApplicationIamMember("member",
project=example["project"],
security_gateways_id=example["securityGatewaysId"],
application_id=example["applicationId"],
role="roles/beyondcorp.securityGatewayUser",
member="user:jane@example.com")
package main
import (
"github.com/pulumi/pulumi-gcp/sdk/v8/go/gcp/beyondcorp"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)
func main() {
pulumi.Run(func(ctx *pulumi.Context) error {
_, err := beyondcorp.NewApplicationIamMember(ctx, "member", &beyondcorp.ApplicationIamMemberArgs{
Project: pulumi.Any(example.Project),
SecurityGatewaysId: pulumi.Any(example.SecurityGatewaysId),
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.ApplicationIamMember("member", new()
{
Project = example.Project,
SecurityGatewaysId = example.SecurityGatewaysId,
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.ApplicationIamMember;
import com.pulumi.gcp.beyondcorp.ApplicationIamMemberArgs;
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 ApplicationIamMember("member", ApplicationIamMemberArgs.builder()
.project(example.project())
.securityGatewaysId(example.securityGatewaysId())
.applicationId(example.applicationId())
.role("roles/beyondcorp.securityGatewayUser")
.member("user:jane@example.com")
.build());
}
}
resources:
member:
type: gcp:beyondcorp:ApplicationIamMember
properties:
project: ${example.project}
securityGatewaysId: ${example.securityGatewaysId}
applicationId: ${example.applicationId}
role: roles/beyondcorp.securityGatewayUser
member: user:jane@example.com
With IAM Conditions:
import * as pulumi from "@pulumi/pulumi";
import * as gcp from "@pulumi/gcp";
const member = new gcp.beyondcorp.ApplicationIamMember("member", {
project: example.project,
securityGatewaysId: example.securityGatewaysId,
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.ApplicationIamMember("member",
project=example["project"],
security_gateways_id=example["securityGatewaysId"],
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/v8/go/gcp/beyondcorp"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)
func main() {
pulumi.Run(func(ctx *pulumi.Context) error {
_, err := beyondcorp.NewApplicationIamMember(ctx, "member", &beyondcorp.ApplicationIamMemberArgs{
Project: pulumi.Any(example.Project),
SecurityGatewaysId: pulumi.Any(example.SecurityGatewaysId),
ApplicationId: pulumi.Any(example.ApplicationId),
Role: pulumi.String("roles/beyondcorp.securityGatewayUser"),
Member: pulumi.String("user:jane@example.com"),
Condition: &beyondcorp.ApplicationIamMemberConditionArgs{
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.ApplicationIamMember("member", new()
{
Project = example.Project,
SecurityGatewaysId = example.SecurityGatewaysId,
ApplicationId = example.ApplicationId,
Role = "roles/beyondcorp.securityGatewayUser",
Member = "user:jane@example.com",
Condition = new Gcp.Beyondcorp.Inputs.ApplicationIamMemberConditionArgs
{
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.ApplicationIamMember;
import com.pulumi.gcp.beyondcorp.ApplicationIamMemberArgs;
import com.pulumi.gcp.beyondcorp.inputs.ApplicationIamMemberConditionArgs;
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 ApplicationIamMember("member", ApplicationIamMemberArgs.builder()
.project(example.project())
.securityGatewaysId(example.securityGatewaysId())
.applicationId(example.applicationId())
.role("roles/beyondcorp.securityGatewayUser")
.member("user:jane@example.com")
.condition(ApplicationIamMemberConditionArgs.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:ApplicationIamMember
properties:
project: ${example.project}
securityGatewaysId: ${example.securityGatewaysId}
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")
Create ApplicationIamPolicy Resource
Resources are created with functions called constructors. To learn more about declaring and configuring resources, see Resources.
Constructor syntax
new ApplicationIamPolicy(name: string, args: ApplicationIamPolicyArgs, opts?: CustomResourceOptions);
@overload
def ApplicationIamPolicy(resource_name: str,
args: ApplicationIamPolicyArgs,
opts: Optional[ResourceOptions] = None)
@overload
def ApplicationIamPolicy(resource_name: str,
opts: Optional[ResourceOptions] = None,
application_id: Optional[str] = None,
policy_data: Optional[str] = None,
security_gateways_id: Optional[str] = None,
project: Optional[str] = None)
func NewApplicationIamPolicy(ctx *Context, name string, args ApplicationIamPolicyArgs, opts ...ResourceOption) (*ApplicationIamPolicy, error)
public ApplicationIamPolicy(string name, ApplicationIamPolicyArgs args, CustomResourceOptions? opts = null)
public ApplicationIamPolicy(String name, ApplicationIamPolicyArgs args)
public ApplicationIamPolicy(String name, ApplicationIamPolicyArgs args, CustomResourceOptions options)
type: gcp:beyondcorp:ApplicationIamPolicy
properties: # The arguments to resource properties.
options: # Bag of options to control resource's behavior.
Parameters
- name string
- The unique name of the resource.
- args ApplicationIamPolicyArgs
- The arguments to resource properties.
- opts CustomResourceOptions
- Bag of options to control resource's behavior.
- resource_name str
- The unique name of the resource.
- args ApplicationIamPolicyArgs
- The arguments to resource properties.
- opts ResourceOptions
- Bag of options to control resource's behavior.
- ctx Context
- Context object for the current deployment.
- name string
- The unique name of the resource.
- args ApplicationIamPolicyArgs
- The arguments to resource properties.
- opts ResourceOption
- Bag of options to control resource's behavior.
- name string
- The unique name of the resource.
- args ApplicationIamPolicyArgs
- The arguments to resource properties.
- opts CustomResourceOptions
- Bag of options to control resource's behavior.
- name String
- The unique name of the resource.
- args ApplicationIamPolicyArgs
- The arguments to resource properties.
- options CustomResourceOptions
- Bag of options to control resource's behavior.
Constructor example
The following reference example uses placeholder values for all input properties.
var applicationIamPolicyResource = new Gcp.Beyondcorp.ApplicationIamPolicy("applicationIamPolicyResource", new()
{
ApplicationId = "string",
PolicyData = "string",
SecurityGatewaysId = "string",
Project = "string",
});
example, err := beyondcorp.NewApplicationIamPolicy(ctx, "applicationIamPolicyResource", &beyondcorp.ApplicationIamPolicyArgs{
ApplicationId: pulumi.String("string"),
PolicyData: pulumi.String("string"),
SecurityGatewaysId: pulumi.String("string"),
Project: pulumi.String("string"),
})
var applicationIamPolicyResource = new ApplicationIamPolicy("applicationIamPolicyResource", ApplicationIamPolicyArgs.builder()
.applicationId("string")
.policyData("string")
.securityGatewaysId("string")
.project("string")
.build());
application_iam_policy_resource = gcp.beyondcorp.ApplicationIamPolicy("applicationIamPolicyResource",
application_id="string",
policy_data="string",
security_gateways_id="string",
project="string")
const applicationIamPolicyResource = new gcp.beyondcorp.ApplicationIamPolicy("applicationIamPolicyResource", {
applicationId: "string",
policyData: "string",
securityGatewaysId: "string",
project: "string",
});
type: gcp:beyondcorp:ApplicationIamPolicy
properties:
applicationId: string
policyData: string
project: string
securityGatewaysId: string
ApplicationIamPolicy Resource Properties
To learn more about resource properties and how to use them, see Inputs and Outputs in the Architecture and Concepts docs.
Inputs
In Python, inputs that are objects can be passed either as argument classes or as dictionary literals.
The ApplicationIamPolicy resource accepts the following input properties:
- Application
Id string - Policy
Data string - The policy data generated by
a
gcp.organizations.getIAMPolicy
data source. - Security
Gateways stringId - Project string
- The ID of the project in which the resource belongs. If it is not provided, the project will be parsed from the identifier of the parent resource. If no project is provided in the parent identifier and no project is specified, the provider project is used.
- Application
Id string - Policy
Data string - The policy data generated by
a
gcp.organizations.getIAMPolicy
data source. - Security
Gateways stringId - Project string
- The ID of the project in which the resource belongs. If it is not provided, the project will be parsed from the identifier of the parent resource. If no project is provided in the parent identifier and no project is specified, the provider project is used.
- application
Id String - policy
Data String - The policy data generated by
a
gcp.organizations.getIAMPolicy
data source. - security
Gateways StringId - project String
- The ID of the project in which the resource belongs. If it is not provided, the project will be parsed from the identifier of the parent resource. If no project is provided in the parent identifier and no project is specified, the provider project is used.
- application
Id string - policy
Data string - The policy data generated by
a
gcp.organizations.getIAMPolicy
data source. - security
Gateways stringId - project string
- The ID of the project in which the resource belongs. If it is not provided, the project will be parsed from the identifier of the parent resource. If no project is provided in the parent identifier and no project is specified, the provider project is used.
- application_
id str - policy_
data str - The policy data generated by
a
gcp.organizations.getIAMPolicy
data source. - security_
gateways_ strid - project str
- The ID of the project in which the resource belongs. If it is not provided, the project will be parsed from the identifier of the parent resource. If no project is provided in the parent identifier and no project is specified, the provider project is used.
- application
Id String - policy
Data String - The policy data generated by
a
gcp.organizations.getIAMPolicy
data source. - security
Gateways StringId - project String
- The ID of the project in which the resource belongs. If it is not provided, the project will be parsed from the identifier of the parent resource. If no project is provided in the parent identifier and no project is specified, the provider project is used.
Outputs
All input properties are implicitly available as output properties. Additionally, the ApplicationIamPolicy resource produces the following output properties:
Look up Existing ApplicationIamPolicy Resource
Get an existing ApplicationIamPolicy resource’s state with the given name, ID, and optional extra properties used to qualify the lookup.
public static get(name: string, id: Input<ID>, state?: ApplicationIamPolicyState, opts?: CustomResourceOptions): ApplicationIamPolicy
@staticmethod
def get(resource_name: str,
id: str,
opts: Optional[ResourceOptions] = None,
application_id: Optional[str] = None,
etag: Optional[str] = None,
policy_data: Optional[str] = None,
project: Optional[str] = None,
security_gateways_id: Optional[str] = None) -> ApplicationIamPolicy
func GetApplicationIamPolicy(ctx *Context, name string, id IDInput, state *ApplicationIamPolicyState, opts ...ResourceOption) (*ApplicationIamPolicy, error)
public static ApplicationIamPolicy Get(string name, Input<string> id, ApplicationIamPolicyState? state, CustomResourceOptions? opts = null)
public static ApplicationIamPolicy get(String name, Output<String> id, ApplicationIamPolicyState state, CustomResourceOptions options)
resources: _: type: gcp:beyondcorp:ApplicationIamPolicy get: id: ${id}
- name
- The unique name of the resulting resource.
- id
- The unique provider ID of the resource to lookup.
- state
- Any extra arguments used during the lookup.
- opts
- A bag of options that control this resource's behavior.
- resource_name
- The unique name of the resulting resource.
- id
- The unique provider ID of the resource to lookup.
- name
- The unique name of the resulting resource.
- id
- The unique provider ID of the resource to lookup.
- state
- Any extra arguments used during the lookup.
- opts
- A bag of options that control this resource's behavior.
- name
- The unique name of the resulting resource.
- id
- The unique provider ID of the resource to lookup.
- state
- Any extra arguments used during the lookup.
- opts
- A bag of options that control this resource's behavior.
- name
- The unique name of the resulting resource.
- id
- The unique provider ID of the resource to lookup.
- state
- Any extra arguments used during the lookup.
- opts
- A bag of options that control this resource's behavior.
- Application
Id string - Etag string
- (Computed) The etag of the IAM policy.
- Policy
Data string - The policy data generated by
a
gcp.organizations.getIAMPolicy
data source. - Project string
- The ID of the project in which the resource belongs. If it is not provided, the project will be parsed from the identifier of the parent resource. If no project is provided in the parent identifier and no project is specified, the provider project is used.
- Security
Gateways stringId
- Application
Id string - Etag string
- (Computed) The etag of the IAM policy.
- Policy
Data string - The policy data generated by
a
gcp.organizations.getIAMPolicy
data source. - Project string
- The ID of the project in which the resource belongs. If it is not provided, the project will be parsed from the identifier of the parent resource. If no project is provided in the parent identifier and no project is specified, the provider project is used.
- Security
Gateways stringId
- application
Id String - etag String
- (Computed) The etag of the IAM policy.
- policy
Data String - The policy data generated by
a
gcp.organizations.getIAMPolicy
data source. - project String
- The ID of the project in which the resource belongs. If it is not provided, the project will be parsed from the identifier of the parent resource. If no project is provided in the parent identifier and no project is specified, the provider project is used.
- security
Gateways StringId
- application
Id string - etag string
- (Computed) The etag of the IAM policy.
- policy
Data string - The policy data generated by
a
gcp.organizations.getIAMPolicy
data source. - project string
- The ID of the project in which the resource belongs. If it is not provided, the project will be parsed from the identifier of the parent resource. If no project is provided in the parent identifier and no project is specified, the provider project is used.
- security
Gateways stringId
- application_
id str - etag str
- (Computed) The etag of the IAM policy.
- policy_
data str - The policy data generated by
a
gcp.organizations.getIAMPolicy
data source. - project str
- The ID of the project in which the resource belongs. If it is not provided, the project will be parsed from the identifier of the parent resource. If no project is provided in the parent identifier and no project is specified, the provider project is used.
- security_
gateways_ strid
- application
Id String - etag String
- (Computed) The etag of the IAM policy.
- policy
Data String - The policy data generated by
a
gcp.organizations.getIAMPolicy
data source. - project String
- The ID of the project in which the resource belongs. If it is not provided, the project will be parsed from the identifier of the parent resource. If no project is provided in the parent identifier and no project is specified, the provider project is used.
- security
Gateways StringId
Import
For all import syntaxes, the “resource in question” can take any of the following forms:
projects/{{project}}/locations/global/securityGateways/{{security_gateways_id}}/applications/{{application_id}}
{{project}}/{{security_gateways_id}}/{{application_id}}
{{security_gateways_id}}/{{application_id}}
{{application_id}}
Any variables not passed in the import command will be taken from the provider configuration.
BeyondCorp application IAM resources can be imported using the resource identifiers, role, and member.
IAM member imports use space-delimited identifiers: the resource in question, the role, and the member identity, e.g.
$ pulumi import gcp:beyondcorp/applicationIamPolicy:ApplicationIamPolicy editor "projects/{{project}}/locations/global/securityGateways/{{security_gateways_id}}/applications/{{application_id}} roles/beyondcorp.securityGatewayUser user:jane@example.com"
IAM binding imports use space-delimited identifiers: the resource in question and the role, e.g.
$ pulumi import gcp:beyondcorp/applicationIamPolicy:ApplicationIamPolicy editor "projects/{{project}}/locations/global/securityGateways/{{security_gateways_id}}/applications/{{application_id}} roles/beyondcorp.securityGatewayUser"
IAM policy imports use the identifier of the resource in question, e.g.
$ pulumi import gcp:beyondcorp/applicationIamPolicy:ApplicationIamPolicy editor projects/{{project}}/locations/global/securityGateways/{{security_gateways_id}}/applications/{{application_id}}
-> Custom Roles If you’re importing a IAM resource with a custom role, make sure to use the
full name of the custom role, e.g. [projects/my-project|organizations/my-org]/roles/my-custom-role
.
To learn more about importing existing cloud resources, see Importing resources.
Package Details
- Repository
- Google Cloud (GCP) Classic pulumi/pulumi-gcp
- License
- Apache-2.0
- Notes
- This Pulumi package is based on the
google-beta
Terraform Provider.