gcp.beyondcorp.SecurityGatewayApplicationIamPolicy
Explore with Pulumi AI
Three different resources help you manage your IAM policy for BeyondCorp SecurityGatewayApplication. Each of these resources serves a different use case:
gcp.beyondcorp.SecurityGatewayApplicationIamPolicy
: Authoritative. Sets the IAM policy for the securitygatewayapplication and replaces any existing policy already attached.gcp.beyondcorp.SecurityGatewayApplicationIamBinding
: 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 securitygatewayapplication are preserved.gcp.beyondcorp.SecurityGatewayApplicationIamMember
: Non-authoritative. Updates the IAM policy to grant a role to a new member. Other members for the role for the securitygatewayapplication are preserved.
A data source can be used to retrieve policy data in advent you do not need creation
gcp.beyondcorp.SecurityGatewayApplicationIamPolicy
: Retrieves the IAM policy for the securitygatewayapplication
Note:
gcp.beyondcorp.SecurityGatewayApplicationIamPolicy
cannot be used in conjunction withgcp.beyondcorp.SecurityGatewayApplicationIamBinding
andgcp.beyondcorp.SecurityGatewayApplicationIamMember
or they will fight over what your policy should be.
Note:
gcp.beyondcorp.SecurityGatewayApplicationIamBinding
resources can be used in conjunction withgcp.beyondcorp.SecurityGatewayApplicationIamMember
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.SecurityGatewayApplicationIamPolicy
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.SecurityGatewayApplicationIamPolicy("policy", {
project: example.project,
securityGatewayId: example.securityGatewayId,
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.SecurityGatewayApplicationIamPolicy("policy",
project=example["project"],
security_gateway_id=example["securityGatewayId"],
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.NewSecurityGatewayApplicationIamPolicy(ctx, "policy", &beyondcorp.SecurityGatewayApplicationIamPolicyArgs{
Project: pulumi.Any(example.Project),
SecurityGatewayId: pulumi.Any(example.SecurityGatewayId),
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.SecurityGatewayApplicationIamPolicy("policy", new()
{
Project = example.Project,
SecurityGatewayId = example.SecurityGatewayId,
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.SecurityGatewayApplicationIamPolicy;
import com.pulumi.gcp.beyondcorp.SecurityGatewayApplicationIamPolicyArgs;
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 SecurityGatewayApplicationIamPolicy("policy", SecurityGatewayApplicationIamPolicyArgs.builder()
.project(example.project())
.securityGatewayId(example.securityGatewayId())
.applicationId(example.applicationId())
.policyData(admin.policyData())
.build());
}
}
resources:
policy:
type: gcp:beyondcorp:SecurityGatewayApplicationIamPolicy
properties:
project: ${example.project}
securityGatewayId: ${example.securityGatewayId}
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.SecurityGatewayApplicationIamPolicy("policy", {
project: example.project,
securityGatewayId: example.securityGatewayId,
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.SecurityGatewayApplicationIamPolicy("policy",
project=example["project"],
security_gateway_id=example["securityGatewayId"],
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.NewSecurityGatewayApplicationIamPolicy(ctx, "policy", &beyondcorp.SecurityGatewayApplicationIamPolicyArgs{
Project: pulumi.Any(example.Project),
SecurityGatewayId: pulumi.Any(example.SecurityGatewayId),
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.SecurityGatewayApplicationIamPolicy("policy", new()
{
Project = example.Project,
SecurityGatewayId = example.SecurityGatewayId,
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.SecurityGatewayApplicationIamPolicy;
import com.pulumi.gcp.beyondcorp.SecurityGatewayApplicationIamPolicyArgs;
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 SecurityGatewayApplicationIamPolicy("policy", SecurityGatewayApplicationIamPolicyArgs.builder()
.project(example.project())
.securityGatewayId(example.securityGatewayId())
.applicationId(example.applicationId())
.policyData(admin.policyData())
.build());
}
}
resources:
policy:
type: gcp:beyondcorp:SecurityGatewayApplicationIamPolicy
properties:
project: ${example.project}
securityGatewayId: ${example.securityGatewayId}
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.SecurityGatewayApplicationIamBinding
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/v8/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
With IAM Conditions:
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/v8/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")
gcp.beyondcorp.SecurityGatewayApplicationIamMember
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/v8/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
With IAM Conditions:
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/v8/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")
This resource supports User Project Overrides.
IAM policy for BeyondCorp SecurityGatewayApplication
Three different resources help you manage your IAM policy for BeyondCorp SecurityGatewayApplication. Each of these resources serves a different use case:
gcp.beyondcorp.SecurityGatewayApplicationIamPolicy
: Authoritative. Sets the IAM policy for the securitygatewayapplication and replaces any existing policy already attached.gcp.beyondcorp.SecurityGatewayApplicationIamBinding
: 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 securitygatewayapplication are preserved.gcp.beyondcorp.SecurityGatewayApplicationIamMember
: Non-authoritative. Updates the IAM policy to grant a role to a new member. Other members for the role for the securitygatewayapplication are preserved.
A data source can be used to retrieve policy data in advent you do not need creation
gcp.beyondcorp.SecurityGatewayApplicationIamPolicy
: Retrieves the IAM policy for the securitygatewayapplication
Note:
gcp.beyondcorp.SecurityGatewayApplicationIamPolicy
cannot be used in conjunction withgcp.beyondcorp.SecurityGatewayApplicationIamBinding
andgcp.beyondcorp.SecurityGatewayApplicationIamMember
or they will fight over what your policy should be.
Note:
gcp.beyondcorp.SecurityGatewayApplicationIamBinding
resources can be used in conjunction withgcp.beyondcorp.SecurityGatewayApplicationIamMember
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.SecurityGatewayApplicationIamPolicy
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.SecurityGatewayApplicationIamPolicy("policy", {
project: example.project,
securityGatewayId: example.securityGatewayId,
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.SecurityGatewayApplicationIamPolicy("policy",
project=example["project"],
security_gateway_id=example["securityGatewayId"],
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.NewSecurityGatewayApplicationIamPolicy(ctx, "policy", &beyondcorp.SecurityGatewayApplicationIamPolicyArgs{
Project: pulumi.Any(example.Project),
SecurityGatewayId: pulumi.Any(example.SecurityGatewayId),
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.SecurityGatewayApplicationIamPolicy("policy", new()
{
Project = example.Project,
SecurityGatewayId = example.SecurityGatewayId,
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.SecurityGatewayApplicationIamPolicy;
import com.pulumi.gcp.beyondcorp.SecurityGatewayApplicationIamPolicyArgs;
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 SecurityGatewayApplicationIamPolicy("policy", SecurityGatewayApplicationIamPolicyArgs.builder()
.project(example.project())
.securityGatewayId(example.securityGatewayId())
.applicationId(example.applicationId())
.policyData(admin.policyData())
.build());
}
}
resources:
policy:
type: gcp:beyondcorp:SecurityGatewayApplicationIamPolicy
properties:
project: ${example.project}
securityGatewayId: ${example.securityGatewayId}
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.SecurityGatewayApplicationIamPolicy("policy", {
project: example.project,
securityGatewayId: example.securityGatewayId,
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.SecurityGatewayApplicationIamPolicy("policy",
project=example["project"],
security_gateway_id=example["securityGatewayId"],
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.NewSecurityGatewayApplicationIamPolicy(ctx, "policy", &beyondcorp.SecurityGatewayApplicationIamPolicyArgs{
Project: pulumi.Any(example.Project),
SecurityGatewayId: pulumi.Any(example.SecurityGatewayId),
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.SecurityGatewayApplicationIamPolicy("policy", new()
{
Project = example.Project,
SecurityGatewayId = example.SecurityGatewayId,
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.SecurityGatewayApplicationIamPolicy;
import com.pulumi.gcp.beyondcorp.SecurityGatewayApplicationIamPolicyArgs;
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 SecurityGatewayApplicationIamPolicy("policy", SecurityGatewayApplicationIamPolicyArgs.builder()
.project(example.project())
.securityGatewayId(example.securityGatewayId())
.applicationId(example.applicationId())
.policyData(admin.policyData())
.build());
}
}
resources:
policy:
type: gcp:beyondcorp:SecurityGatewayApplicationIamPolicy
properties:
project: ${example.project}
securityGatewayId: ${example.securityGatewayId}
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.SecurityGatewayApplicationIamBinding
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/v8/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
With IAM Conditions:
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/v8/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")
gcp.beyondcorp.SecurityGatewayApplicationIamMember
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/v8/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
With IAM Conditions:
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/v8/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")
Create SecurityGatewayApplicationIamPolicy Resource
Resources are created with functions called constructors. To learn more about declaring and configuring resources, see Resources.
Constructor syntax
new SecurityGatewayApplicationIamPolicy(name: string, args: SecurityGatewayApplicationIamPolicyArgs, opts?: CustomResourceOptions);
@overload
def SecurityGatewayApplicationIamPolicy(resource_name: str,
args: SecurityGatewayApplicationIamPolicyArgs,
opts: Optional[ResourceOptions] = None)
@overload
def SecurityGatewayApplicationIamPolicy(resource_name: str,
opts: Optional[ResourceOptions] = None,
application_id: Optional[str] = None,
policy_data: Optional[str] = None,
security_gateway_id: Optional[str] = None,
project: Optional[str] = None)
func NewSecurityGatewayApplicationIamPolicy(ctx *Context, name string, args SecurityGatewayApplicationIamPolicyArgs, opts ...ResourceOption) (*SecurityGatewayApplicationIamPolicy, error)
public SecurityGatewayApplicationIamPolicy(string name, SecurityGatewayApplicationIamPolicyArgs args, CustomResourceOptions? opts = null)
public SecurityGatewayApplicationIamPolicy(String name, SecurityGatewayApplicationIamPolicyArgs args)
public SecurityGatewayApplicationIamPolicy(String name, SecurityGatewayApplicationIamPolicyArgs args, CustomResourceOptions options)
type: gcp:beyondcorp:SecurityGatewayApplicationIamPolicy
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 SecurityGatewayApplicationIamPolicyArgs
- 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 SecurityGatewayApplicationIamPolicyArgs
- 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 SecurityGatewayApplicationIamPolicyArgs
- The arguments to resource properties.
- opts ResourceOption
- Bag of options to control resource's behavior.
- name string
- The unique name of the resource.
- args SecurityGatewayApplicationIamPolicyArgs
- The arguments to resource properties.
- opts CustomResourceOptions
- Bag of options to control resource's behavior.
- name String
- The unique name of the resource.
- args SecurityGatewayApplicationIamPolicyArgs
- 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 securityGatewayApplicationIamPolicyResource = new Gcp.Beyondcorp.SecurityGatewayApplicationIamPolicy("securityGatewayApplicationIamPolicyResource", new()
{
ApplicationId = "string",
PolicyData = "string",
SecurityGatewayId = "string",
Project = "string",
});
example, err := beyondcorp.NewSecurityGatewayApplicationIamPolicy(ctx, "securityGatewayApplicationIamPolicyResource", &beyondcorp.SecurityGatewayApplicationIamPolicyArgs{
ApplicationId: pulumi.String("string"),
PolicyData: pulumi.String("string"),
SecurityGatewayId: pulumi.String("string"),
Project: pulumi.String("string"),
})
var securityGatewayApplicationIamPolicyResource = new SecurityGatewayApplicationIamPolicy("securityGatewayApplicationIamPolicyResource", SecurityGatewayApplicationIamPolicyArgs.builder()
.applicationId("string")
.policyData("string")
.securityGatewayId("string")
.project("string")
.build());
security_gateway_application_iam_policy_resource = gcp.beyondcorp.SecurityGatewayApplicationIamPolicy("securityGatewayApplicationIamPolicyResource",
application_id="string",
policy_data="string",
security_gateway_id="string",
project="string")
const securityGatewayApplicationIamPolicyResource = new gcp.beyondcorp.SecurityGatewayApplicationIamPolicy("securityGatewayApplicationIamPolicyResource", {
applicationId: "string",
policyData: "string",
securityGatewayId: "string",
project: "string",
});
type: gcp:beyondcorp:SecurityGatewayApplicationIamPolicy
properties:
applicationId: string
policyData: string
project: string
securityGatewayId: string
SecurityGatewayApplicationIamPolicy 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 SecurityGatewayApplicationIamPolicy resource accepts the following input properties:
- Application
Id string - Used to find the parent resource to bind the IAM policy to
- Policy
Data string - The policy data generated by
a
gcp.organizations.getIAMPolicy
data source. - Security
Gateway stringId - ID of the Security Gateway resource this belongs to. Used to find the parent resource to bind the IAM policy to
- 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 - Used to find the parent resource to bind the IAM policy to
- Policy
Data string - The policy data generated by
a
gcp.organizations.getIAMPolicy
data source. - Security
Gateway stringId - ID of the Security Gateway resource this belongs to. Used to find the parent resource to bind the IAM policy to
- 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 - Used to find the parent resource to bind the IAM policy to
- policy
Data String - The policy data generated by
a
gcp.organizations.getIAMPolicy
data source. - security
Gateway StringId - ID of the Security Gateway resource this belongs to. Used to find the parent resource to bind the IAM policy to
- 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 - Used to find the parent resource to bind the IAM policy to
- policy
Data string - The policy data generated by
a
gcp.organizations.getIAMPolicy
data source. - security
Gateway stringId - ID of the Security Gateway resource this belongs to. Used to find the parent resource to bind the IAM policy to
- 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 - Used to find the parent resource to bind the IAM policy to
- policy_
data str - The policy data generated by
a
gcp.organizations.getIAMPolicy
data source. - security_
gateway_ strid - ID of the Security Gateway resource this belongs to. Used to find the parent resource to bind the IAM policy to
- 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 - Used to find the parent resource to bind the IAM policy to
- policy
Data String - The policy data generated by
a
gcp.organizations.getIAMPolicy
data source. - security
Gateway StringId - ID of the Security Gateway resource this belongs to. Used to find the parent resource to bind the IAM policy to
- 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 SecurityGatewayApplicationIamPolicy resource produces the following output properties:
Look up Existing SecurityGatewayApplicationIamPolicy Resource
Get an existing SecurityGatewayApplicationIamPolicy 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?: SecurityGatewayApplicationIamPolicyState, opts?: CustomResourceOptions): SecurityGatewayApplicationIamPolicy
@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_gateway_id: Optional[str] = None) -> SecurityGatewayApplicationIamPolicy
func GetSecurityGatewayApplicationIamPolicy(ctx *Context, name string, id IDInput, state *SecurityGatewayApplicationIamPolicyState, opts ...ResourceOption) (*SecurityGatewayApplicationIamPolicy, error)
public static SecurityGatewayApplicationIamPolicy Get(string name, Input<string> id, SecurityGatewayApplicationIamPolicyState? state, CustomResourceOptions? opts = null)
public static SecurityGatewayApplicationIamPolicy get(String name, Output<String> id, SecurityGatewayApplicationIamPolicyState state, CustomResourceOptions options)
resources: _: type: gcp:beyondcorp:SecurityGatewayApplicationIamPolicy 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 - Used to find the parent resource to bind the IAM policy to
- 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
Gateway stringId - ID of the Security Gateway resource this belongs to. Used to find the parent resource to bind the IAM policy to
- Application
Id string - Used to find the parent resource to bind the IAM policy to
- 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
Gateway stringId - ID of the Security Gateway resource this belongs to. Used to find the parent resource to bind the IAM policy to
- application
Id String - Used to find the parent resource to bind the IAM policy to
- 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
Gateway StringId - ID of the Security Gateway resource this belongs to. Used to find the parent resource to bind the IAM policy to
- application
Id string - Used to find the parent resource to bind the IAM policy to
- 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
Gateway stringId - ID of the Security Gateway resource this belongs to. Used to find the parent resource to bind the IAM policy to
- application_
id str - Used to find the parent resource to bind the IAM policy to
- 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_
gateway_ strid - ID of the Security Gateway resource this belongs to. Used to find the parent resource to bind the IAM policy to
- application
Id String - Used to find the parent resource to bind the IAM policy to
- 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
Gateway StringId - ID of the Security Gateway resource this belongs to. Used to find the parent resource to bind the IAM policy to
Import
For all import syntaxes, the “resource in question” can take any of the following forms:
projects/{{project}}/locations/global/securityGateways/{{security_gateway_id}}/applications/{{application_id}}
{{project}}/{{security_gateway_id}}/{{application_id}}
{{security_gateway_id}}/{{application_id}}
{{application_id}}
Any variables not passed in the import command will be taken from the provider configuration.
BeyondCorp securitygatewayapplication 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/securityGatewayApplicationIamPolicy:SecurityGatewayApplicationIamPolicy editor "projects/{{project}}/locations/global/securityGateways/{{security_gateway_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/securityGatewayApplicationIamPolicy:SecurityGatewayApplicationIamPolicy editor "projects/{{project}}/locations/global/securityGateways/{{security_gateway_id}}/applications/{{application_id}} roles/beyondcorp.securityGatewayUser"
IAM policy imports use the identifier of the resource in question, e.g.
$ pulumi import gcp:beyondcorp/securityGatewayApplicationIamPolicy:SecurityGatewayApplicationIamPolicy editor projects/{{project}}/locations/global/securityGateways/{{security_gateway_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.