资源项目(Project)是提供的一种资源分组管理的机制,帮助您达成逻辑层面的资源隔离,您能够通过资源项目进行项目制授权和分账等操作。
Example Usage
import * as pulumi from "@pulumi/pulumi";
import * as bytepluscc from "@byteplus/pulumi-bytepluscc";
const iAMProjectDemo = new bytepluscc.iam.Project("IAMProjectDemo", {
description: "IAMProjectDemo description",
projectName: "default",
displayName: "IAMProjectDemo",
parentProjectName: "default",
});
import pulumi
import pulumi_bytepluscc as bytepluscc
i_am_project_demo = bytepluscc.iam.Project("IAMProjectDemo",
description="IAMProjectDemo description",
project_name="default",
display_name="IAMProjectDemo",
parent_project_name="default")
package main
import (
"github.com/byteplus-sdk/pulumi-bytepluscc/sdk/go/bytepluscc/iam"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)
func main() {
pulumi.Run(func(ctx *pulumi.Context) error {
_, err := iam.NewProject(ctx, "IAMProjectDemo", &iam.ProjectArgs{
Description: pulumi.String("IAMProjectDemo description"),
ProjectName: pulumi.String("default"),
DisplayName: pulumi.String("IAMProjectDemo"),
ParentProjectName: pulumi.String("default"),
})
if err != nil {
return err
}
return nil
})
}
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using Bytepluscc = Byteplus.Pulumi.Bytepluscc;
return await Deployment.RunAsync(() =>
{
var iAMProjectDemo = new Bytepluscc.Iam.Project("IAMProjectDemo", new()
{
Description = "IAMProjectDemo description",
ProjectName = "default",
DisplayName = "IAMProjectDemo",
ParentProjectName = "default",
});
});
package generated_program;
import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.byteplus.bytepluscc.iam.Project;
import com.byteplus.bytepluscc.iam.ProjectArgs;
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 iAMProjectDemo = new Project("iAMProjectDemo", ProjectArgs.builder()
.description("IAMProjectDemo description")
.projectName("default")
.displayName("IAMProjectDemo")
.parentProjectName("default")
.build());
}
}
resources:
iAMProjectDemo:
type: bytepluscc:iam:Project
name: IAMProjectDemo
properties:
description: IAMProjectDemo description
projectName: default
displayName: IAMProjectDemo
parentProjectName: default
Create Project Resource
Resources are created with functions called constructors. To learn more about declaring and configuring resources, see Resources.
Constructor syntax
new Project(name: string, args: ProjectArgs, opts?: CustomResourceOptions);@overload
def Project(resource_name: str,
args: ProjectArgs,
opts: Optional[ResourceOptions] = None)
@overload
def Project(resource_name: str,
opts: Optional[ResourceOptions] = None,
project_name: Optional[str] = None,
description: Optional[str] = None,
display_name: Optional[str] = None,
parent_project_name: Optional[str] = None)func NewProject(ctx *Context, name string, args ProjectArgs, opts ...ResourceOption) (*Project, error)public Project(string name, ProjectArgs args, CustomResourceOptions? opts = null)
public Project(String name, ProjectArgs args)
public Project(String name, ProjectArgs args, CustomResourceOptions options)
type: bytepluscc:iam:Project
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 ProjectArgs
- 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 ProjectArgs
- 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 ProjectArgs
- The arguments to resource properties.
- opts ResourceOption
- Bag of options to control resource's behavior.
- name string
- The unique name of the resource.
- args ProjectArgs
- The arguments to resource properties.
- opts CustomResourceOptions
- Bag of options to control resource's behavior.
- name String
- The unique name of the resource.
- args ProjectArgs
- 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 projectResource = new Bytepluscc.Iam.Project("projectResource", new()
{
ProjectName = "string",
Description = "string",
DisplayName = "string",
ParentProjectName = "string",
});
example, err := iam.NewProject(ctx, "projectResource", &iam.ProjectArgs{
ProjectName: pulumi.String("string"),
Description: pulumi.String("string"),
DisplayName: pulumi.String("string"),
ParentProjectName: pulumi.String("string"),
})
var projectResource = new Project("projectResource", ProjectArgs.builder()
.projectName("string")
.description("string")
.displayName("string")
.parentProjectName("string")
.build());
project_resource = bytepluscc.iam.Project("projectResource",
project_name="string",
description="string",
display_name="string",
parent_project_name="string")
const projectResource = new bytepluscc.iam.Project("projectResource", {
projectName: "string",
description: "string",
displayName: "string",
parentProjectName: "string",
});
type: bytepluscc:iam:Project
properties:
description: string
displayName: string
parentProjectName: string
projectName: string
Project 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 Project resource accepts the following input properties:
- Project
Name string - 项目名称
- Description string
- 描述
- Display
Name string - 展示名
- Parent
Project stringName - 父项目名称
- Project
Name string - 项目名称
- Description string
- 描述
- Display
Name string - 展示名
- Parent
Project stringName - 父项目名称
- project
Name String - 项目名称
- description String
- 描述
- display
Name String - 展示名
- parent
Project StringName - 父项目名称
- project
Name string - 项目名称
- description string
- 描述
- display
Name string - 展示名
- parent
Project stringName - 父项目名称
- project_
name str - 项目名称
- description str
- 描述
- display_
name str - 展示名
- parent_
project_ strname - 父项目名称
- project
Name String - 项目名称
- description String
- 描述
- display
Name String - 展示名
- parent
Project StringName - 父项目名称
Outputs
All input properties are implicitly available as output properties. Additionally, the Project resource produces the following output properties:
- Account
Id int - 账号ID
- Created
Time string - 创建时间
- Has
Permission bool - 是否可见
- Id string
- The provider-assigned unique ID for this managed resource.
- Path string
- 项目路径
- Status string
- 启用状态
- Updated
Time string - 更新时间
- Account
Id int - 账号ID
- Created
Time string - 创建时间
- Has
Permission bool - 是否可见
- Id string
- The provider-assigned unique ID for this managed resource.
- Path string
- 项目路径
- Status string
- 启用状态
- Updated
Time string - 更新时间
- account
Id Integer - 账号ID
- created
Time String - 创建时间
- has
Permission Boolean - 是否可见
- id String
- The provider-assigned unique ID for this managed resource.
- path String
- 项目路径
- status String
- 启用状态
- updated
Time String - 更新时间
- account
Id number - 账号ID
- created
Time string - 创建时间
- has
Permission boolean - 是否可见
- id string
- The provider-assigned unique ID for this managed resource.
- path string
- 项目路径
- status string
- 启用状态
- updated
Time string - 更新时间
- account_
id int - 账号ID
- created_
time str - 创建时间
- has_
permission bool - 是否可见
- id str
- The provider-assigned unique ID for this managed resource.
- path str
- 项目路径
- status str
- 启用状态
- updated_
time str - 更新时间
- account
Id Number - 账号ID
- created
Time String - 创建时间
- has
Permission Boolean - 是否可见
- id String
- The provider-assigned unique ID for this managed resource.
- path String
- 项目路径
- status String
- 启用状态
- updated
Time String - 更新时间
Look up Existing Project Resource
Get an existing Project 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?: ProjectState, opts?: CustomResourceOptions): Project@staticmethod
def get(resource_name: str,
id: str,
opts: Optional[ResourceOptions] = None,
account_id: Optional[int] = None,
created_time: Optional[str] = None,
description: Optional[str] = None,
display_name: Optional[str] = None,
has_permission: Optional[bool] = None,
parent_project_name: Optional[str] = None,
path: Optional[str] = None,
project_name: Optional[str] = None,
status: Optional[str] = None,
updated_time: Optional[str] = None) -> Projectfunc GetProject(ctx *Context, name string, id IDInput, state *ProjectState, opts ...ResourceOption) (*Project, error)public static Project Get(string name, Input<string> id, ProjectState? state, CustomResourceOptions? opts = null)public static Project get(String name, Output<String> id, ProjectState state, CustomResourceOptions options)resources: _: type: bytepluscc:iam:Project 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.
- Account
Id int - 账号ID
- Created
Time string - 创建时间
- Description string
- 描述
- Display
Name string - 展示名
- Has
Permission bool - 是否可见
- Parent
Project stringName - 父项目名称
- Path string
- 项目路径
- Project
Name string - 项目名称
- Status string
- 启用状态
- Updated
Time string - 更新时间
- Account
Id int - 账号ID
- Created
Time string - 创建时间
- Description string
- 描述
- Display
Name string - 展示名
- Has
Permission bool - 是否可见
- Parent
Project stringName - 父项目名称
- Path string
- 项目路径
- Project
Name string - 项目名称
- Status string
- 启用状态
- Updated
Time string - 更新时间
- account
Id Integer - 账号ID
- created
Time String - 创建时间
- description String
- 描述
- display
Name String - 展示名
- has
Permission Boolean - 是否可见
- parent
Project StringName - 父项目名称
- path String
- 项目路径
- project
Name String - 项目名称
- status String
- 启用状态
- updated
Time String - 更新时间
- account
Id number - 账号ID
- created
Time string - 创建时间
- description string
- 描述
- display
Name string - 展示名
- has
Permission boolean - 是否可见
- parent
Project stringName - 父项目名称
- path string
- 项目路径
- project
Name string - 项目名称
- status string
- 启用状态
- updated
Time string - 更新时间
- account_
id int - 账号ID
- created_
time str - 创建时间
- description str
- 描述
- display_
name str - 展示名
- has_
permission bool - 是否可见
- parent_
project_ strname - 父项目名称
- path str
- 项目路径
- project_
name str - 项目名称
- status str
- 启用状态
- updated_
time str - 更新时间
- account
Id Number - 账号ID
- created
Time String - 创建时间
- description String
- 描述
- display
Name String - 展示名
- has
Permission Boolean - 是否可见
- parent
Project StringName - 父项目名称
- path String
- 项目路径
- project
Name String - 项目名称
- status String
- 启用状态
- updated
Time String - 更新时间
Import
$ pulumi import bytepluscc:iam/project:Project example "project_name"
To learn more about importing existing cloud resources, see Importing resources.
Package Details
- Repository
- bytepluscc byteplus-sdk/pulumi-bytepluscc
- License
- MPL-2.0
- Notes
- This Pulumi package is based on the
byteplusccTerraform Provider.
