gcp.dataproc.MetastoreTableIamPolicy
Explore with Pulumi AI
Three different resources help you manage your IAM policy for Dataproc Metastore Table. Each of these resources serves a different use case:
gcp.dataproc.MetastoreTableIamPolicy
: Authoritative. Sets the IAM policy for the table and replaces any existing policy already attached.gcp.dataproc.MetastoreTableIamBinding
: 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 table are preserved.gcp.dataproc.MetastoreTableIamMember
: Non-authoritative. Updates the IAM policy to grant a role to a new member. Other members for the role for the table are preserved.
A data source can be used to retrieve policy data in advent you do not need creation
gcp.dataproc.MetastoreTableIamPolicy
: Retrieves the IAM policy for the table
Note:
gcp.dataproc.MetastoreTableIamPolicy
cannot be used in conjunction withgcp.dataproc.MetastoreTableIamBinding
andgcp.dataproc.MetastoreTableIamMember
or they will fight over what your policy should be.
Note:
gcp.dataproc.MetastoreTableIamBinding
resources can be used in conjunction withgcp.dataproc.MetastoreTableIamMember
resources only if they do not grant privilege to the same role.
gcp.dataproc.MetastoreTableIamPolicy
import * as pulumi from "@pulumi/pulumi";
import * as gcp from "@pulumi/gcp";
const admin = gcp.organizations.getIAMPolicy({
bindings: [{
role: "roles/viewer",
members: ["user:jane@example.com"],
}],
});
const policy = new gcp.dataproc.MetastoreTableIamPolicy("policy", {
project: dpmsService.project,
location: dpmsService.location,
serviceId: dpmsService.serviceId,
databaseId: hive.hiveConfig[0].properties.database,
table: hive.hiveConfig[0].properties.table,
policyData: admin.then(admin => admin.policyData),
});
import pulumi
import pulumi_gcp as gcp
admin = gcp.organizations.get_iam_policy(bindings=[{
"role": "roles/viewer",
"members": ["user:jane@example.com"],
}])
policy = gcp.dataproc.MetastoreTableIamPolicy("policy",
project=dpms_service["project"],
location=dpms_service["location"],
service_id=dpms_service["serviceId"],
database_id=hive["hiveConfig"][0]["properties"]["database"],
table=hive["hiveConfig"][0]["properties"]["table"],
policy_data=admin.policy_data)
package main
import (
"github.com/pulumi/pulumi-gcp/sdk/v8/go/gcp/dataproc"
"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/viewer",
Members: []string{
"user:jane@example.com",
},
},
},
}, nil)
if err != nil {
return err
}
_, err = dataproc.NewMetastoreTableIamPolicy(ctx, "policy", &dataproc.MetastoreTableIamPolicyArgs{
Project: pulumi.Any(dpmsService.Project),
Location: pulumi.Any(dpmsService.Location),
ServiceId: pulumi.Any(dpmsService.ServiceId),
DatabaseId: pulumi.Any(hive.HiveConfig[0].Properties.Database),
Table: pulumi.Any(hive.HiveConfig[0].Properties.Table),
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/viewer",
Members = new[]
{
"user:jane@example.com",
},
},
},
});
var policy = new Gcp.Dataproc.MetastoreTableIamPolicy("policy", new()
{
Project = dpmsService.Project,
Location = dpmsService.Location,
ServiceId = dpmsService.ServiceId,
DatabaseId = hive.HiveConfig[0].Properties.Database,
Table = hive.HiveConfig[0].Properties.Table,
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.dataproc.MetastoreTableIamPolicy;
import com.pulumi.gcp.dataproc.MetastoreTableIamPolicyArgs;
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/viewer")
.members("user:jane@example.com")
.build())
.build());
var policy = new MetastoreTableIamPolicy("policy", MetastoreTableIamPolicyArgs.builder()
.project(dpmsService.project())
.location(dpmsService.location())
.serviceId(dpmsService.serviceId())
.databaseId(hive.hiveConfig()[0].properties().database())
.table(hive.hiveConfig()[0].properties().table())
.policyData(admin.policyData())
.build());
}
}
resources:
policy:
type: gcp:dataproc:MetastoreTableIamPolicy
properties:
project: ${dpmsService.project}
location: ${dpmsService.location}
serviceId: ${dpmsService.serviceId}
databaseId: ${hive.hiveConfig[0].properties.database}
table: ${hive.hiveConfig[0].properties.table}
policyData: ${admin.policyData}
variables:
admin:
fn::invoke:
function: gcp:organizations:getIAMPolicy
arguments:
bindings:
- role: roles/viewer
members:
- user:jane@example.com
gcp.dataproc.MetastoreTableIamBinding
import * as pulumi from "@pulumi/pulumi";
import * as gcp from "@pulumi/gcp";
const binding = new gcp.dataproc.MetastoreTableIamBinding("binding", {
project: dpmsService.project,
location: dpmsService.location,
serviceId: dpmsService.serviceId,
databaseId: hive.hiveConfig[0].properties.database,
table: hive.hiveConfig[0].properties.table,
role: "roles/viewer",
members: ["user:jane@example.com"],
});
import pulumi
import pulumi_gcp as gcp
binding = gcp.dataproc.MetastoreTableIamBinding("binding",
project=dpms_service["project"],
location=dpms_service["location"],
service_id=dpms_service["serviceId"],
database_id=hive["hiveConfig"][0]["properties"]["database"],
table=hive["hiveConfig"][0]["properties"]["table"],
role="roles/viewer",
members=["user:jane@example.com"])
package main
import (
"github.com/pulumi/pulumi-gcp/sdk/v8/go/gcp/dataproc"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)
func main() {
pulumi.Run(func(ctx *pulumi.Context) error {
_, err := dataproc.NewMetastoreTableIamBinding(ctx, "binding", &dataproc.MetastoreTableIamBindingArgs{
Project: pulumi.Any(dpmsService.Project),
Location: pulumi.Any(dpmsService.Location),
ServiceId: pulumi.Any(dpmsService.ServiceId),
DatabaseId: pulumi.Any(hive.HiveConfig[0].Properties.Database),
Table: pulumi.Any(hive.HiveConfig[0].Properties.Table),
Role: pulumi.String("roles/viewer"),
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.Dataproc.MetastoreTableIamBinding("binding", new()
{
Project = dpmsService.Project,
Location = dpmsService.Location,
ServiceId = dpmsService.ServiceId,
DatabaseId = hive.HiveConfig[0].Properties.Database,
Table = hive.HiveConfig[0].Properties.Table,
Role = "roles/viewer",
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.dataproc.MetastoreTableIamBinding;
import com.pulumi.gcp.dataproc.MetastoreTableIamBindingArgs;
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 MetastoreTableIamBinding("binding", MetastoreTableIamBindingArgs.builder()
.project(dpmsService.project())
.location(dpmsService.location())
.serviceId(dpmsService.serviceId())
.databaseId(hive.hiveConfig()[0].properties().database())
.table(hive.hiveConfig()[0].properties().table())
.role("roles/viewer")
.members("user:jane@example.com")
.build());
}
}
resources:
binding:
type: gcp:dataproc:MetastoreTableIamBinding
properties:
project: ${dpmsService.project}
location: ${dpmsService.location}
serviceId: ${dpmsService.serviceId}
databaseId: ${hive.hiveConfig[0].properties.database}
table: ${hive.hiveConfig[0].properties.table}
role: roles/viewer
members:
- user:jane@example.com
gcp.dataproc.MetastoreTableIamMember
import * as pulumi from "@pulumi/pulumi";
import * as gcp from "@pulumi/gcp";
const member = new gcp.dataproc.MetastoreTableIamMember("member", {
project: dpmsService.project,
location: dpmsService.location,
serviceId: dpmsService.serviceId,
databaseId: hive.hiveConfig[0].properties.database,
table: hive.hiveConfig[0].properties.table,
role: "roles/viewer",
member: "user:jane@example.com",
});
import pulumi
import pulumi_gcp as gcp
member = gcp.dataproc.MetastoreTableIamMember("member",
project=dpms_service["project"],
location=dpms_service["location"],
service_id=dpms_service["serviceId"],
database_id=hive["hiveConfig"][0]["properties"]["database"],
table=hive["hiveConfig"][0]["properties"]["table"],
role="roles/viewer",
member="user:jane@example.com")
package main
import (
"github.com/pulumi/pulumi-gcp/sdk/v8/go/gcp/dataproc"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)
func main() {
pulumi.Run(func(ctx *pulumi.Context) error {
_, err := dataproc.NewMetastoreTableIamMember(ctx, "member", &dataproc.MetastoreTableIamMemberArgs{
Project: pulumi.Any(dpmsService.Project),
Location: pulumi.Any(dpmsService.Location),
ServiceId: pulumi.Any(dpmsService.ServiceId),
DatabaseId: pulumi.Any(hive.HiveConfig[0].Properties.Database),
Table: pulumi.Any(hive.HiveConfig[0].Properties.Table),
Role: pulumi.String("roles/viewer"),
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.Dataproc.MetastoreTableIamMember("member", new()
{
Project = dpmsService.Project,
Location = dpmsService.Location,
ServiceId = dpmsService.ServiceId,
DatabaseId = hive.HiveConfig[0].Properties.Database,
Table = hive.HiveConfig[0].Properties.Table,
Role = "roles/viewer",
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.dataproc.MetastoreTableIamMember;
import com.pulumi.gcp.dataproc.MetastoreTableIamMemberArgs;
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 MetastoreTableIamMember("member", MetastoreTableIamMemberArgs.builder()
.project(dpmsService.project())
.location(dpmsService.location())
.serviceId(dpmsService.serviceId())
.databaseId(hive.hiveConfig()[0].properties().database())
.table(hive.hiveConfig()[0].properties().table())
.role("roles/viewer")
.member("user:jane@example.com")
.build());
}
}
resources:
member:
type: gcp:dataproc:MetastoreTableIamMember
properties:
project: ${dpmsService.project}
location: ${dpmsService.location}
serviceId: ${dpmsService.serviceId}
databaseId: ${hive.hiveConfig[0].properties.database}
table: ${hive.hiveConfig[0].properties.table}
role: roles/viewer
member: user:jane@example.com
This resource supports User Project Overrides.
IAM policy for Dataproc Metastore Table
Three different resources help you manage your IAM policy for Dataproc Metastore Table. Each of these resources serves a different use case:
gcp.dataproc.MetastoreTableIamPolicy
: Authoritative. Sets the IAM policy for the table and replaces any existing policy already attached.gcp.dataproc.MetastoreTableIamBinding
: 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 table are preserved.gcp.dataproc.MetastoreTableIamMember
: Non-authoritative. Updates the IAM policy to grant a role to a new member. Other members for the role for the table are preserved.
A data source can be used to retrieve policy data in advent you do not need creation
gcp.dataproc.MetastoreTableIamPolicy
: Retrieves the IAM policy for the table
Note:
gcp.dataproc.MetastoreTableIamPolicy
cannot be used in conjunction withgcp.dataproc.MetastoreTableIamBinding
andgcp.dataproc.MetastoreTableIamMember
or they will fight over what your policy should be.
Note:
gcp.dataproc.MetastoreTableIamBinding
resources can be used in conjunction withgcp.dataproc.MetastoreTableIamMember
resources only if they do not grant privilege to the same role.
gcp.dataproc.MetastoreTableIamPolicy
import * as pulumi from "@pulumi/pulumi";
import * as gcp from "@pulumi/gcp";
const admin = gcp.organizations.getIAMPolicy({
bindings: [{
role: "roles/viewer",
members: ["user:jane@example.com"],
}],
});
const policy = new gcp.dataproc.MetastoreTableIamPolicy("policy", {
project: dpmsService.project,
location: dpmsService.location,
serviceId: dpmsService.serviceId,
databaseId: hive.hiveConfig[0].properties.database,
table: hive.hiveConfig[0].properties.table,
policyData: admin.then(admin => admin.policyData),
});
import pulumi
import pulumi_gcp as gcp
admin = gcp.organizations.get_iam_policy(bindings=[{
"role": "roles/viewer",
"members": ["user:jane@example.com"],
}])
policy = gcp.dataproc.MetastoreTableIamPolicy("policy",
project=dpms_service["project"],
location=dpms_service["location"],
service_id=dpms_service["serviceId"],
database_id=hive["hiveConfig"][0]["properties"]["database"],
table=hive["hiveConfig"][0]["properties"]["table"],
policy_data=admin.policy_data)
package main
import (
"github.com/pulumi/pulumi-gcp/sdk/v8/go/gcp/dataproc"
"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/viewer",
Members: []string{
"user:jane@example.com",
},
},
},
}, nil)
if err != nil {
return err
}
_, err = dataproc.NewMetastoreTableIamPolicy(ctx, "policy", &dataproc.MetastoreTableIamPolicyArgs{
Project: pulumi.Any(dpmsService.Project),
Location: pulumi.Any(dpmsService.Location),
ServiceId: pulumi.Any(dpmsService.ServiceId),
DatabaseId: pulumi.Any(hive.HiveConfig[0].Properties.Database),
Table: pulumi.Any(hive.HiveConfig[0].Properties.Table),
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/viewer",
Members = new[]
{
"user:jane@example.com",
},
},
},
});
var policy = new Gcp.Dataproc.MetastoreTableIamPolicy("policy", new()
{
Project = dpmsService.Project,
Location = dpmsService.Location,
ServiceId = dpmsService.ServiceId,
DatabaseId = hive.HiveConfig[0].Properties.Database,
Table = hive.HiveConfig[0].Properties.Table,
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.dataproc.MetastoreTableIamPolicy;
import com.pulumi.gcp.dataproc.MetastoreTableIamPolicyArgs;
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/viewer")
.members("user:jane@example.com")
.build())
.build());
var policy = new MetastoreTableIamPolicy("policy", MetastoreTableIamPolicyArgs.builder()
.project(dpmsService.project())
.location(dpmsService.location())
.serviceId(dpmsService.serviceId())
.databaseId(hive.hiveConfig()[0].properties().database())
.table(hive.hiveConfig()[0].properties().table())
.policyData(admin.policyData())
.build());
}
}
resources:
policy:
type: gcp:dataproc:MetastoreTableIamPolicy
properties:
project: ${dpmsService.project}
location: ${dpmsService.location}
serviceId: ${dpmsService.serviceId}
databaseId: ${hive.hiveConfig[0].properties.database}
table: ${hive.hiveConfig[0].properties.table}
policyData: ${admin.policyData}
variables:
admin:
fn::invoke:
function: gcp:organizations:getIAMPolicy
arguments:
bindings:
- role: roles/viewer
members:
- user:jane@example.com
gcp.dataproc.MetastoreTableIamBinding
import * as pulumi from "@pulumi/pulumi";
import * as gcp from "@pulumi/gcp";
const binding = new gcp.dataproc.MetastoreTableIamBinding("binding", {
project: dpmsService.project,
location: dpmsService.location,
serviceId: dpmsService.serviceId,
databaseId: hive.hiveConfig[0].properties.database,
table: hive.hiveConfig[0].properties.table,
role: "roles/viewer",
members: ["user:jane@example.com"],
});
import pulumi
import pulumi_gcp as gcp
binding = gcp.dataproc.MetastoreTableIamBinding("binding",
project=dpms_service["project"],
location=dpms_service["location"],
service_id=dpms_service["serviceId"],
database_id=hive["hiveConfig"][0]["properties"]["database"],
table=hive["hiveConfig"][0]["properties"]["table"],
role="roles/viewer",
members=["user:jane@example.com"])
package main
import (
"github.com/pulumi/pulumi-gcp/sdk/v8/go/gcp/dataproc"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)
func main() {
pulumi.Run(func(ctx *pulumi.Context) error {
_, err := dataproc.NewMetastoreTableIamBinding(ctx, "binding", &dataproc.MetastoreTableIamBindingArgs{
Project: pulumi.Any(dpmsService.Project),
Location: pulumi.Any(dpmsService.Location),
ServiceId: pulumi.Any(dpmsService.ServiceId),
DatabaseId: pulumi.Any(hive.HiveConfig[0].Properties.Database),
Table: pulumi.Any(hive.HiveConfig[0].Properties.Table),
Role: pulumi.String("roles/viewer"),
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.Dataproc.MetastoreTableIamBinding("binding", new()
{
Project = dpmsService.Project,
Location = dpmsService.Location,
ServiceId = dpmsService.ServiceId,
DatabaseId = hive.HiveConfig[0].Properties.Database,
Table = hive.HiveConfig[0].Properties.Table,
Role = "roles/viewer",
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.dataproc.MetastoreTableIamBinding;
import com.pulumi.gcp.dataproc.MetastoreTableIamBindingArgs;
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 MetastoreTableIamBinding("binding", MetastoreTableIamBindingArgs.builder()
.project(dpmsService.project())
.location(dpmsService.location())
.serviceId(dpmsService.serviceId())
.databaseId(hive.hiveConfig()[0].properties().database())
.table(hive.hiveConfig()[0].properties().table())
.role("roles/viewer")
.members("user:jane@example.com")
.build());
}
}
resources:
binding:
type: gcp:dataproc:MetastoreTableIamBinding
properties:
project: ${dpmsService.project}
location: ${dpmsService.location}
serviceId: ${dpmsService.serviceId}
databaseId: ${hive.hiveConfig[0].properties.database}
table: ${hive.hiveConfig[0].properties.table}
role: roles/viewer
members:
- user:jane@example.com
gcp.dataproc.MetastoreTableIamMember
import * as pulumi from "@pulumi/pulumi";
import * as gcp from "@pulumi/gcp";
const member = new gcp.dataproc.MetastoreTableIamMember("member", {
project: dpmsService.project,
location: dpmsService.location,
serviceId: dpmsService.serviceId,
databaseId: hive.hiveConfig[0].properties.database,
table: hive.hiveConfig[0].properties.table,
role: "roles/viewer",
member: "user:jane@example.com",
});
import pulumi
import pulumi_gcp as gcp
member = gcp.dataproc.MetastoreTableIamMember("member",
project=dpms_service["project"],
location=dpms_service["location"],
service_id=dpms_service["serviceId"],
database_id=hive["hiveConfig"][0]["properties"]["database"],
table=hive["hiveConfig"][0]["properties"]["table"],
role="roles/viewer",
member="user:jane@example.com")
package main
import (
"github.com/pulumi/pulumi-gcp/sdk/v8/go/gcp/dataproc"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)
func main() {
pulumi.Run(func(ctx *pulumi.Context) error {
_, err := dataproc.NewMetastoreTableIamMember(ctx, "member", &dataproc.MetastoreTableIamMemberArgs{
Project: pulumi.Any(dpmsService.Project),
Location: pulumi.Any(dpmsService.Location),
ServiceId: pulumi.Any(dpmsService.ServiceId),
DatabaseId: pulumi.Any(hive.HiveConfig[0].Properties.Database),
Table: pulumi.Any(hive.HiveConfig[0].Properties.Table),
Role: pulumi.String("roles/viewer"),
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.Dataproc.MetastoreTableIamMember("member", new()
{
Project = dpmsService.Project,
Location = dpmsService.Location,
ServiceId = dpmsService.ServiceId,
DatabaseId = hive.HiveConfig[0].Properties.Database,
Table = hive.HiveConfig[0].Properties.Table,
Role = "roles/viewer",
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.dataproc.MetastoreTableIamMember;
import com.pulumi.gcp.dataproc.MetastoreTableIamMemberArgs;
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 MetastoreTableIamMember("member", MetastoreTableIamMemberArgs.builder()
.project(dpmsService.project())
.location(dpmsService.location())
.serviceId(dpmsService.serviceId())
.databaseId(hive.hiveConfig()[0].properties().database())
.table(hive.hiveConfig()[0].properties().table())
.role("roles/viewer")
.member("user:jane@example.com")
.build());
}
}
resources:
member:
type: gcp:dataproc:MetastoreTableIamMember
properties:
project: ${dpmsService.project}
location: ${dpmsService.location}
serviceId: ${dpmsService.serviceId}
databaseId: ${hive.hiveConfig[0].properties.database}
table: ${hive.hiveConfig[0].properties.table}
role: roles/viewer
member: user:jane@example.com
Create MetastoreTableIamPolicy Resource
Resources are created with functions called constructors. To learn more about declaring and configuring resources, see Resources.
Constructor syntax
new MetastoreTableIamPolicy(name: string, args: MetastoreTableIamPolicyArgs, opts?: CustomResourceOptions);
@overload
def MetastoreTableIamPolicy(resource_name: str,
args: MetastoreTableIamPolicyArgs,
opts: Optional[ResourceOptions] = None)
@overload
def MetastoreTableIamPolicy(resource_name: str,
opts: Optional[ResourceOptions] = None,
database_id: Optional[str] = None,
policy_data: Optional[str] = None,
service_id: Optional[str] = None,
table: Optional[str] = None,
location: Optional[str] = None,
project: Optional[str] = None)
func NewMetastoreTableIamPolicy(ctx *Context, name string, args MetastoreTableIamPolicyArgs, opts ...ResourceOption) (*MetastoreTableIamPolicy, error)
public MetastoreTableIamPolicy(string name, MetastoreTableIamPolicyArgs args, CustomResourceOptions? opts = null)
public MetastoreTableIamPolicy(String name, MetastoreTableIamPolicyArgs args)
public MetastoreTableIamPolicy(String name, MetastoreTableIamPolicyArgs args, CustomResourceOptions options)
type: gcp:dataproc:MetastoreTableIamPolicy
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 MetastoreTableIamPolicyArgs
- 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 MetastoreTableIamPolicyArgs
- 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 MetastoreTableIamPolicyArgs
- The arguments to resource properties.
- opts ResourceOption
- Bag of options to control resource's behavior.
- name string
- The unique name of the resource.
- args MetastoreTableIamPolicyArgs
- The arguments to resource properties.
- opts CustomResourceOptions
- Bag of options to control resource's behavior.
- name String
- The unique name of the resource.
- args MetastoreTableIamPolicyArgs
- 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 metastoreTableIamPolicyResource = new Gcp.Dataproc.MetastoreTableIamPolicy("metastoreTableIamPolicyResource", new()
{
DatabaseId = "string",
PolicyData = "string",
ServiceId = "string",
Table = "string",
Location = "string",
Project = "string",
});
example, err := dataproc.NewMetastoreTableIamPolicy(ctx, "metastoreTableIamPolicyResource", &dataproc.MetastoreTableIamPolicyArgs{
DatabaseId: pulumi.String("string"),
PolicyData: pulumi.String("string"),
ServiceId: pulumi.String("string"),
Table: pulumi.String("string"),
Location: pulumi.String("string"),
Project: pulumi.String("string"),
})
var metastoreTableIamPolicyResource = new MetastoreTableIamPolicy("metastoreTableIamPolicyResource", MetastoreTableIamPolicyArgs.builder()
.databaseId("string")
.policyData("string")
.serviceId("string")
.table("string")
.location("string")
.project("string")
.build());
metastore_table_iam_policy_resource = gcp.dataproc.MetastoreTableIamPolicy("metastoreTableIamPolicyResource",
database_id="string",
policy_data="string",
service_id="string",
table="string",
location="string",
project="string")
const metastoreTableIamPolicyResource = new gcp.dataproc.MetastoreTableIamPolicy("metastoreTableIamPolicyResource", {
databaseId: "string",
policyData: "string",
serviceId: "string",
table: "string",
location: "string",
project: "string",
});
type: gcp:dataproc:MetastoreTableIamPolicy
properties:
databaseId: string
location: string
policyData: string
project: string
serviceId: string
table: string
MetastoreTableIamPolicy 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 MetastoreTableIamPolicy resource accepts the following input properties:
- Database
Id string - Policy
Data string - The policy data generated by
a
gcp.organizations.getIAMPolicy
data source. - Service
Id string - Table string
- Used to find the parent resource to bind the IAM policy to
- Location string
- 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.
- Database
Id string - Policy
Data string - The policy data generated by
a
gcp.organizations.getIAMPolicy
data source. - Service
Id string - Table string
- Used to find the parent resource to bind the IAM policy to
- Location string
- 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.
- database
Id String - policy
Data String - The policy data generated by
a
gcp.organizations.getIAMPolicy
data source. - service
Id String - table String
- Used to find the parent resource to bind the IAM policy to
- location String
- 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.
- database
Id string - policy
Data string - The policy data generated by
a
gcp.organizations.getIAMPolicy
data source. - service
Id string - table string
- Used to find the parent resource to bind the IAM policy to
- location string
- 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.
- database_
id str - policy_
data str - The policy data generated by
a
gcp.organizations.getIAMPolicy
data source. - service_
id str - table str
- Used to find the parent resource to bind the IAM policy to
- location str
- 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.
- database
Id String - policy
Data String - The policy data generated by
a
gcp.organizations.getIAMPolicy
data source. - service
Id String - table String
- Used to find the parent resource to bind the IAM policy to
- location String
- 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 MetastoreTableIamPolicy resource produces the following output properties:
Look up Existing MetastoreTableIamPolicy Resource
Get an existing MetastoreTableIamPolicy 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?: MetastoreTableIamPolicyState, opts?: CustomResourceOptions): MetastoreTableIamPolicy
@staticmethod
def get(resource_name: str,
id: str,
opts: Optional[ResourceOptions] = None,
database_id: Optional[str] = None,
etag: Optional[str] = None,
location: Optional[str] = None,
policy_data: Optional[str] = None,
project: Optional[str] = None,
service_id: Optional[str] = None,
table: Optional[str] = None) -> MetastoreTableIamPolicy
func GetMetastoreTableIamPolicy(ctx *Context, name string, id IDInput, state *MetastoreTableIamPolicyState, opts ...ResourceOption) (*MetastoreTableIamPolicy, error)
public static MetastoreTableIamPolicy Get(string name, Input<string> id, MetastoreTableIamPolicyState? state, CustomResourceOptions? opts = null)
public static MetastoreTableIamPolicy get(String name, Output<String> id, MetastoreTableIamPolicyState state, CustomResourceOptions options)
resources: _: type: gcp:dataproc:MetastoreTableIamPolicy 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.
- Database
Id string - Etag string
- (Computed) The etag of the IAM policy.
- Location string
- 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.
- Service
Id string - Table string
- Used to find the parent resource to bind the IAM policy to
- Database
Id string - Etag string
- (Computed) The etag of the IAM policy.
- Location string
- 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.
- Service
Id string - Table string
- Used to find the parent resource to bind the IAM policy to
- database
Id String - etag String
- (Computed) The etag of the IAM policy.
- location String
- 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.
- service
Id String - table String
- Used to find the parent resource to bind the IAM policy to
- database
Id string - etag string
- (Computed) The etag of the IAM policy.
- location string
- 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.
- service
Id string - table string
- Used to find the parent resource to bind the IAM policy to
- database_
id str - etag str
- (Computed) The etag of the IAM policy.
- location str
- 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.
- service_
id str - table str
- Used to find the parent resource to bind the IAM policy to
- database
Id String - etag String
- (Computed) The etag of the IAM policy.
- location String
- 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.
- service
Id String - table String
- 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/{{location}}/services/{{serviceId}}/databases/{{databaseId}}/tables/{{name}}
{{project}}/{{location}}/{{serviceId}}/{{databaseId}}/{{name}}
{{location}}/{{serviceId}}/{{databaseId}}/{{name}}
{{name}}
Any variables not passed in the import command will be taken from the provider configuration.
Dataproc Metastore table 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:dataproc/metastoreTableIamPolicy:MetastoreTableIamPolicy editor "projects/{{project}}/locations/{{location}}/services/{{serviceId}}/databases/{{databaseId}}/tables/{{table}} roles/viewer user:jane@example.com"
IAM binding imports use space-delimited identifiers: the resource in question and the role, e.g.
$ pulumi import gcp:dataproc/metastoreTableIamPolicy:MetastoreTableIamPolicy editor "projects/{{project}}/locations/{{location}}/services/{{serviceId}}/databases/{{databaseId}}/tables/{{table}} roles/viewer"
IAM policy imports use the identifier of the resource in question, e.g.
$ pulumi import gcp:dataproc/metastoreTableIamPolicy:MetastoreTableIamPolicy editor projects/{{project}}/locations/{{location}}/services/{{serviceId}}/databases/{{databaseId}}/tables/{{table}}
-> 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.