1. Packages
  2. Volcengine
  3. API Docs
  4. iam
  5. PolicyProject
Volcengine v0.0.45 published on Tuesday, Feb 10, 2026 by Volcengine
volcengine logo
Volcengine v0.0.45 published on Tuesday, Feb 10, 2026 by Volcengine

    Provides a resource to manage iam policy project

    Example Usage

    import * as pulumi from "@pulumi/pulumi";
    import * as volcengine from "@volcengine/pulumi";
    
    const foo = new volcengine.iam.PolicyProject("foo", {
        policyName: "restart-oas-ecs",
        policyType: "Custom",
        principalName: "jonny",
        principalType: "User",
        projectNames: ["default"],
    });
    
    import pulumi
    import pulumi_volcengine as volcengine
    
    foo = volcengine.iam.PolicyProject("foo",
        policy_name="restart-oas-ecs",
        policy_type="Custom",
        principal_name="jonny",
        principal_type="User",
        project_names=["default"])
    
    package main
    
    import (
    	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
    	"github.com/volcengine/pulumi-volcengine/sdk/go/volcengine/iam"
    )
    
    func main() {
    	pulumi.Run(func(ctx *pulumi.Context) error {
    		_, err := iam.NewPolicyProject(ctx, "foo", &iam.PolicyProjectArgs{
    			PolicyName:    pulumi.String("restart-oas-ecs"),
    			PolicyType:    pulumi.String("Custom"),
    			PrincipalName: pulumi.String("jonny"),
    			PrincipalType: pulumi.String("User"),
    			ProjectNames: pulumi.StringArray{
    				pulumi.String("default"),
    			},
    		})
    		if err != nil {
    			return err
    		}
    		return nil
    	})
    }
    
    using System.Collections.Generic;
    using System.Linq;
    using Pulumi;
    using Volcengine = Pulumi.Volcengine;
    
    return await Deployment.RunAsync(() => 
    {
        var foo = new Volcengine.Iam.PolicyProject("foo", new()
        {
            PolicyName = "restart-oas-ecs",
            PolicyType = "Custom",
            PrincipalName = "jonny",
            PrincipalType = "User",
            ProjectNames = new[]
            {
                "default",
            },
        });
    
    });
    
    package generated_program;
    
    import com.pulumi.Context;
    import com.pulumi.Pulumi;
    import com.pulumi.core.Output;
    import com.pulumi.volcengine.iam.PolicyProject;
    import com.pulumi.volcengine.iam.PolicyProjectArgs;
    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 foo = new PolicyProject("foo", PolicyProjectArgs.builder()        
                .policyName("restart-oas-ecs")
                .policyType("Custom")
                .principalName("jonny")
                .principalType("User")
                .projectNames("default")
                .build());
    
        }
    }
    
    resources:
      foo:
        type: volcengine:iam:PolicyProject
        properties:
          policyName: restart-oas-ecs
          policyType: Custom
          principalName: jonny
          principalType: User
          projectNames:
            - default
    

    Create PolicyProject Resource

    Resources are created with functions called constructors. To learn more about declaring and configuring resources, see Resources.

    Constructor syntax

    new PolicyProject(name: string, args: PolicyProjectArgs, opts?: CustomResourceOptions);
    @overload
    def PolicyProject(resource_name: str,
                      args: PolicyProjectArgs,
                      opts: Optional[ResourceOptions] = None)
    
    @overload
    def PolicyProject(resource_name: str,
                      opts: Optional[ResourceOptions] = None,
                      policy_name: Optional[str] = None,
                      policy_type: Optional[str] = None,
                      principal_name: Optional[str] = None,
                      principal_type: Optional[str] = None,
                      project_names: Optional[Sequence[str]] = None)
    func NewPolicyProject(ctx *Context, name string, args PolicyProjectArgs, opts ...ResourceOption) (*PolicyProject, error)
    public PolicyProject(string name, PolicyProjectArgs args, CustomResourceOptions? opts = null)
    public PolicyProject(String name, PolicyProjectArgs args)
    public PolicyProject(String name, PolicyProjectArgs args, CustomResourceOptions options)
    
    type: volcengine:iam:PolicyProject
    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 PolicyProjectArgs
    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 PolicyProjectArgs
    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 PolicyProjectArgs
    The arguments to resource properties.
    opts ResourceOption
    Bag of options to control resource's behavior.
    name string
    The unique name of the resource.
    args PolicyProjectArgs
    The arguments to resource properties.
    opts CustomResourceOptions
    Bag of options to control resource's behavior.
    name String
    The unique name of the resource.
    args PolicyProjectArgs
    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 policyProjectResource = new Volcengine.Iam.PolicyProject("policyProjectResource", new()
    {
        PolicyName = "string",
        PolicyType = "string",
        PrincipalName = "string",
        PrincipalType = "string",
        ProjectNames = new[]
        {
            "string",
        },
    });
    
    example, err := iam.NewPolicyProject(ctx, "policyProjectResource", &iam.PolicyProjectArgs{
    	PolicyName:    pulumi.String("string"),
    	PolicyType:    pulumi.String("string"),
    	PrincipalName: pulumi.String("string"),
    	PrincipalType: pulumi.String("string"),
    	ProjectNames: pulumi.StringArray{
    		pulumi.String("string"),
    	},
    })
    
    var policyProjectResource = new PolicyProject("policyProjectResource", PolicyProjectArgs.builder()
        .policyName("string")
        .policyType("string")
        .principalName("string")
        .principalType("string")
        .projectNames("string")
        .build());
    
    policy_project_resource = volcengine.iam.PolicyProject("policyProjectResource",
        policy_name="string",
        policy_type="string",
        principal_name="string",
        principal_type="string",
        project_names=["string"])
    
    const policyProjectResource = new volcengine.iam.PolicyProject("policyProjectResource", {
        policyName: "string",
        policyType: "string",
        principalName: "string",
        principalType: "string",
        projectNames: ["string"],
    });
    
    type: volcengine:iam:PolicyProject
    properties:
        policyName: string
        policyType: string
        principalName: string
        principalType: string
        projectNames:
            - string
    

    PolicyProject 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 PolicyProject resource accepts the following input properties:

    PolicyName string
    The name of the policy.
    PolicyType string
    The type of the policy. Valid values: System, Custom.
    PrincipalName string
    The name of the principal.
    PrincipalType string
    The type of the principal. Valid values: User, Role, UserGroup.
    ProjectNames List<string>
    The list of project names, which is the scope of the policy.
    PolicyName string
    The name of the policy.
    PolicyType string
    The type of the policy. Valid values: System, Custom.
    PrincipalName string
    The name of the principal.
    PrincipalType string
    The type of the principal. Valid values: User, Role, UserGroup.
    ProjectNames []string
    The list of project names, which is the scope of the policy.
    policyName String
    The name of the policy.
    policyType String
    The type of the policy. Valid values: System, Custom.
    principalName String
    The name of the principal.
    principalType String
    The type of the principal. Valid values: User, Role, UserGroup.
    projectNames List<String>
    The list of project names, which is the scope of the policy.
    policyName string
    The name of the policy.
    policyType string
    The type of the policy. Valid values: System, Custom.
    principalName string
    The name of the principal.
    principalType string
    The type of the principal. Valid values: User, Role, UserGroup.
    projectNames string[]
    The list of project names, which is the scope of the policy.
    policy_name str
    The name of the policy.
    policy_type str
    The type of the policy. Valid values: System, Custom.
    principal_name str
    The name of the principal.
    principal_type str
    The type of the principal. Valid values: User, Role, UserGroup.
    project_names Sequence[str]
    The list of project names, which is the scope of the policy.
    policyName String
    The name of the policy.
    policyType String
    The type of the policy. Valid values: System, Custom.
    principalName String
    The name of the principal.
    principalType String
    The type of the principal. Valid values: User, Role, UserGroup.
    projectNames List<String>
    The list of project names, which is the scope of the policy.

    Outputs

    All input properties are implicitly available as output properties. Additionally, the PolicyProject resource produces the following output properties:

    Id string
    The provider-assigned unique ID for this managed resource.
    Id string
    The provider-assigned unique ID for this managed resource.
    id String
    The provider-assigned unique ID for this managed resource.
    id string
    The provider-assigned unique ID for this managed resource.
    id str
    The provider-assigned unique ID for this managed resource.
    id String
    The provider-assigned unique ID for this managed resource.

    Look up Existing PolicyProject Resource

    Get an existing PolicyProject 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?: PolicyProjectState, opts?: CustomResourceOptions): PolicyProject
    @staticmethod
    def get(resource_name: str,
            id: str,
            opts: Optional[ResourceOptions] = None,
            policy_name: Optional[str] = None,
            policy_type: Optional[str] = None,
            principal_name: Optional[str] = None,
            principal_type: Optional[str] = None,
            project_names: Optional[Sequence[str]] = None) -> PolicyProject
    func GetPolicyProject(ctx *Context, name string, id IDInput, state *PolicyProjectState, opts ...ResourceOption) (*PolicyProject, error)
    public static PolicyProject Get(string name, Input<string> id, PolicyProjectState? state, CustomResourceOptions? opts = null)
    public static PolicyProject get(String name, Output<String> id, PolicyProjectState state, CustomResourceOptions options)
    resources:  _:    type: volcengine:iam:PolicyProject    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.
    The following state arguments are supported:
    PolicyName string
    The name of the policy.
    PolicyType string
    The type of the policy. Valid values: System, Custom.
    PrincipalName string
    The name of the principal.
    PrincipalType string
    The type of the principal. Valid values: User, Role, UserGroup.
    ProjectNames List<string>
    The list of project names, which is the scope of the policy.
    PolicyName string
    The name of the policy.
    PolicyType string
    The type of the policy. Valid values: System, Custom.
    PrincipalName string
    The name of the principal.
    PrincipalType string
    The type of the principal. Valid values: User, Role, UserGroup.
    ProjectNames []string
    The list of project names, which is the scope of the policy.
    policyName String
    The name of the policy.
    policyType String
    The type of the policy. Valid values: System, Custom.
    principalName String
    The name of the principal.
    principalType String
    The type of the principal. Valid values: User, Role, UserGroup.
    projectNames List<String>
    The list of project names, which is the scope of the policy.
    policyName string
    The name of the policy.
    policyType string
    The type of the policy. Valid values: System, Custom.
    principalName string
    The name of the principal.
    principalType string
    The type of the principal. Valid values: User, Role, UserGroup.
    projectNames string[]
    The list of project names, which is the scope of the policy.
    policy_name str
    The name of the policy.
    policy_type str
    The type of the policy. Valid values: System, Custom.
    principal_name str
    The name of the principal.
    principal_type str
    The type of the principal. Valid values: User, Role, UserGroup.
    project_names Sequence[str]
    The list of project names, which is the scope of the policy.
    policyName String
    The name of the policy.
    policyType String
    The type of the policy. Valid values: System, Custom.
    principalName String
    The name of the principal.
    principalType String
    The type of the principal. Valid values: User, Role, UserGroup.
    projectNames List<String>
    The list of project names, which is the scope of the policy.

    Import

    IamPolicyProject can be imported using the id, e.g.

    $ pulumi import volcengine:iam/policyProject:PolicyProject default PrincipalType:PrincipalName:PolicyType:PolicyName:ProjectName
    

    To learn more about importing existing cloud resources, see Importing resources.

    Package Details

    Repository
    volcengine volcengine/pulumi-volcengine
    License
    Apache-2.0
    Notes
    This Pulumi package is based on the volcengine Terraform Provider.
    volcengine logo
    Volcengine v0.0.45 published on Tuesday, Feb 10, 2026 by Volcengine
      Meet Neo: Your AI Platform Teammate