published on Monday, Mar 9, 2026 by Byteplus
published on Monday, Mar 9, 2026 by Byteplus
访问控制(Identity and Access Management,缩写为IAM)是火山引擎为客户提供的一套权限管理系统,用于控制不同身份对云资源的访问权限。
Example Usage
import * as pulumi from "@pulumi/pulumi";
import * as bytepluscc from "@byteplus/pulumi-bytepluscc";
const accesskeyDemo = new bytepluscc.iam.Accesskey("AccesskeyDemo", {userName: "s2222"});
import pulumi
import pulumi_bytepluscc as bytepluscc
accesskey_demo = bytepluscc.iam.Accesskey("AccesskeyDemo", user_name="s2222")
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.NewAccesskey(ctx, "AccesskeyDemo", &iam.AccesskeyArgs{
UserName: pulumi.String("s2222"),
})
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 accesskeyDemo = new Bytepluscc.Iam.Accesskey("AccesskeyDemo", new()
{
UserName = "s2222",
});
});
package generated_program;
import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.byteplus.bytepluscc.iam.Accesskey;
import com.byteplus.bytepluscc.iam.AccesskeyArgs;
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 accesskeyDemo = new Accesskey("accesskeyDemo", AccesskeyArgs.builder()
.userName("s2222")
.build());
}
}
resources:
accesskeyDemo:
type: bytepluscc:iam:Accesskey
name: AccesskeyDemo
properties:
userName: s2222
Create Accesskey Resource
Resources are created with functions called constructors. To learn more about declaring and configuring resources, see Resources.
Constructor syntax
new Accesskey(name: string, args?: AccesskeyArgs, opts?: CustomResourceOptions);@overload
def Accesskey(resource_name: str,
args: Optional[AccesskeyArgs] = None,
opts: Optional[ResourceOptions] = None)
@overload
def Accesskey(resource_name: str,
opts: Optional[ResourceOptions] = None,
secret_access_key: Optional[str] = None,
status: Optional[str] = None,
user_name: Optional[str] = None)func NewAccesskey(ctx *Context, name string, args *AccesskeyArgs, opts ...ResourceOption) (*Accesskey, error)public Accesskey(string name, AccesskeyArgs? args = null, CustomResourceOptions? opts = null)
public Accesskey(String name, AccesskeyArgs args)
public Accesskey(String name, AccesskeyArgs args, CustomResourceOptions options)
type: bytepluscc:iam:Accesskey
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 AccesskeyArgs
- 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 AccesskeyArgs
- 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 AccesskeyArgs
- The arguments to resource properties.
- opts ResourceOption
- Bag of options to control resource's behavior.
- name string
- The unique name of the resource.
- args AccesskeyArgs
- The arguments to resource properties.
- opts CustomResourceOptions
- Bag of options to control resource's behavior.
- name String
- The unique name of the resource.
- args AccesskeyArgs
- 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 accesskeyResource = new Bytepluscc.Iam.Accesskey("accesskeyResource", new()
{
SecretAccessKey = "string",
Status = "string",
UserName = "string",
});
example, err := iam.NewAccesskey(ctx, "accesskeyResource", &iam.AccesskeyArgs{
SecretAccessKey: pulumi.String("string"),
Status: pulumi.String("string"),
UserName: pulumi.String("string"),
})
var accesskeyResource = new Accesskey("accesskeyResource", AccesskeyArgs.builder()
.secretAccessKey("string")
.status("string")
.userName("string")
.build());
accesskey_resource = bytepluscc.iam.Accesskey("accesskeyResource",
secret_access_key="string",
status="string",
user_name="string")
const accesskeyResource = new bytepluscc.iam.Accesskey("accesskeyResource", {
secretAccessKey: "string",
status: "string",
userName: "string",
});
type: bytepluscc:iam:Accesskey
properties:
secretAccessKey: string
status: string
userName: string
Accesskey 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 Accesskey resource accepts the following input properties:
- Secret
Access stringKey - 私有密钥(Secret Access Key)。
- Status string
- 密钥状态。active代表启用状态,inactive代表禁用状态。
- User
Name string - 用户名。用于给指定的IAM用户创建密钥,未指定用户名时则为当前请求身份创建密钥(即主账号请求时为主账号自身创建密钥,IAM用户请求时为IAM用户自身创建密钥。注意:角色不支持为自身创建密钥)。当IAM用户拥有密钥自管理权限时(AccessKeySelfManageAccess),如需为自身创建密钥则需要在请求中传递自身的UserName。
- Secret
Access stringKey - 私有密钥(Secret Access Key)。
- Status string
- 密钥状态。active代表启用状态,inactive代表禁用状态。
- User
Name string - 用户名。用于给指定的IAM用户创建密钥,未指定用户名时则为当前请求身份创建密钥(即主账号请求时为主账号自身创建密钥,IAM用户请求时为IAM用户自身创建密钥。注意:角色不支持为自身创建密钥)。当IAM用户拥有密钥自管理权限时(AccessKeySelfManageAccess),如需为自身创建密钥则需要在请求中传递自身的UserName。
- secret
Access StringKey - 私有密钥(Secret Access Key)。
- status String
- 密钥状态。active代表启用状态,inactive代表禁用状态。
- user
Name String - 用户名。用于给指定的IAM用户创建密钥,未指定用户名时则为当前请求身份创建密钥(即主账号请求时为主账号自身创建密钥,IAM用户请求时为IAM用户自身创建密钥。注意:角色不支持为自身创建密钥)。当IAM用户拥有密钥自管理权限时(AccessKeySelfManageAccess),如需为自身创建密钥则需要在请求中传递自身的UserName。
- secret
Access stringKey - 私有密钥(Secret Access Key)。
- status string
- 密钥状态。active代表启用状态,inactive代表禁用状态。
- user
Name string - 用户名。用于给指定的IAM用户创建密钥,未指定用户名时则为当前请求身份创建密钥(即主账号请求时为主账号自身创建密钥,IAM用户请求时为IAM用户自身创建密钥。注意:角色不支持为自身创建密钥)。当IAM用户拥有密钥自管理权限时(AccessKeySelfManageAccess),如需为自身创建密钥则需要在请求中传递自身的UserName。
- secret_
access_ strkey - 私有密钥(Secret Access Key)。
- status str
- 密钥状态。active代表启用状态,inactive代表禁用状态。
- user_
name str - 用户名。用于给指定的IAM用户创建密钥,未指定用户名时则为当前请求身份创建密钥(即主账号请求时为主账号自身创建密钥,IAM用户请求时为IAM用户自身创建密钥。注意:角色不支持为自身创建密钥)。当IAM用户拥有密钥自管理权限时(AccessKeySelfManageAccess),如需为自身创建密钥则需要在请求中传递自身的UserName。
- secret
Access StringKey - 私有密钥(Secret Access Key)。
- status String
- 密钥状态。active代表启用状态,inactive代表禁用状态。
- user
Name String - 用户名。用于给指定的IAM用户创建密钥,未指定用户名时则为当前请求身份创建密钥(即主账号请求时为主账号自身创建密钥,IAM用户请求时为IAM用户自身创建密钥。注意:角色不支持为自身创建密钥)。当IAM用户拥有密钥自管理权限时(AccessKeySelfManageAccess),如需为自身创建密钥则需要在请求中传递自身的UserName。
Outputs
All input properties are implicitly available as output properties. Additionally, the Accesskey resource produces the following output properties:
- Access
Key stringId - 密钥ID(Access Key Id)。
- Created
Time string - 密钥创建时间。时间格式为ISO8601。
- Id string
- The provider-assigned unique ID for this managed resource.
- Last
Login stringDate - 最后登录时间。
- Region string
- API密钥最后访问的地域。
- Request
Time string - API密钥的最后使用的时间。
- Service string
- API密钥最后访问的服务的英文简称。
- Updated
Time string - 密钥更新时间。时间格式为ISO8601。
- Access
Key stringId - 密钥ID(Access Key Id)。
- Created
Time string - 密钥创建时间。时间格式为ISO8601。
- Id string
- The provider-assigned unique ID for this managed resource.
- Last
Login stringDate - 最后登录时间。
- Region string
- API密钥最后访问的地域。
- Request
Time string - API密钥的最后使用的时间。
- Service string
- API密钥最后访问的服务的英文简称。
- Updated
Time string - 密钥更新时间。时间格式为ISO8601。
- access
Key StringId - 密钥ID(Access Key Id)。
- created
Time String - 密钥创建时间。时间格式为ISO8601。
- id String
- The provider-assigned unique ID for this managed resource.
- last
Login StringDate - 最后登录时间。
- region String
- API密钥最后访问的地域。
- request
Time String - API密钥的最后使用的时间。
- service String
- API密钥最后访问的服务的英文简称。
- updated
Time String - 密钥更新时间。时间格式为ISO8601。
- access
Key stringId - 密钥ID(Access Key Id)。
- created
Time string - 密钥创建时间。时间格式为ISO8601。
- id string
- The provider-assigned unique ID for this managed resource.
- last
Login stringDate - 最后登录时间。
- region string
- API密钥最后访问的地域。
- request
Time string - API密钥的最后使用的时间。
- service string
- API密钥最后访问的服务的英文简称。
- updated
Time string - 密钥更新时间。时间格式为ISO8601。
- access_
key_ strid - 密钥ID(Access Key Id)。
- created_
time str - 密钥创建时间。时间格式为ISO8601。
- id str
- The provider-assigned unique ID for this managed resource.
- last_
login_ strdate - 最后登录时间。
- region str
- API密钥最后访问的地域。
- request_
time str - API密钥的最后使用的时间。
- service str
- API密钥最后访问的服务的英文简称。
- updated_
time str - 密钥更新时间。时间格式为ISO8601。
- access
Key StringId - 密钥ID(Access Key Id)。
- created
Time String - 密钥创建时间。时间格式为ISO8601。
- id String
- The provider-assigned unique ID for this managed resource.
- last
Login StringDate - 最后登录时间。
- region String
- API密钥最后访问的地域。
- request
Time String - API密钥的最后使用的时间。
- service String
- API密钥最后访问的服务的英文简称。
- updated
Time String - 密钥更新时间。时间格式为ISO8601。
Look up Existing Accesskey Resource
Get an existing Accesskey 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?: AccesskeyState, opts?: CustomResourceOptions): Accesskey@staticmethod
def get(resource_name: str,
id: str,
opts: Optional[ResourceOptions] = None,
access_key_id: Optional[str] = None,
created_time: Optional[str] = None,
last_login_date: Optional[str] = None,
region: Optional[str] = None,
request_time: Optional[str] = None,
secret_access_key: Optional[str] = None,
service: Optional[str] = None,
status: Optional[str] = None,
updated_time: Optional[str] = None,
user_name: Optional[str] = None) -> Accesskeyfunc GetAccesskey(ctx *Context, name string, id IDInput, state *AccesskeyState, opts ...ResourceOption) (*Accesskey, error)public static Accesskey Get(string name, Input<string> id, AccesskeyState? state, CustomResourceOptions? opts = null)public static Accesskey get(String name, Output<String> id, AccesskeyState state, CustomResourceOptions options)resources: _: type: bytepluscc:iam:Accesskey 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.
- Access
Key stringId - 密钥ID(Access Key Id)。
- Created
Time string - 密钥创建时间。时间格式为ISO8601。
- Last
Login stringDate - 最后登录时间。
- Region string
- API密钥最后访问的地域。
- Request
Time string - API密钥的最后使用的时间。
- Secret
Access stringKey - 私有密钥(Secret Access Key)。
- Service string
- API密钥最后访问的服务的英文简称。
- Status string
- 密钥状态。active代表启用状态,inactive代表禁用状态。
- Updated
Time string - 密钥更新时间。时间格式为ISO8601。
- User
Name string - 用户名。用于给指定的IAM用户创建密钥,未指定用户名时则为当前请求身份创建密钥(即主账号请求时为主账号自身创建密钥,IAM用户请求时为IAM用户自身创建密钥。注意:角色不支持为自身创建密钥)。当IAM用户拥有密钥自管理权限时(AccessKeySelfManageAccess),如需为自身创建密钥则需要在请求中传递自身的UserName。
- Access
Key stringId - 密钥ID(Access Key Id)。
- Created
Time string - 密钥创建时间。时间格式为ISO8601。
- Last
Login stringDate - 最后登录时间。
- Region string
- API密钥最后访问的地域。
- Request
Time string - API密钥的最后使用的时间。
- Secret
Access stringKey - 私有密钥(Secret Access Key)。
- Service string
- API密钥最后访问的服务的英文简称。
- Status string
- 密钥状态。active代表启用状态,inactive代表禁用状态。
- Updated
Time string - 密钥更新时间。时间格式为ISO8601。
- User
Name string - 用户名。用于给指定的IAM用户创建密钥,未指定用户名时则为当前请求身份创建密钥(即主账号请求时为主账号自身创建密钥,IAM用户请求时为IAM用户自身创建密钥。注意:角色不支持为自身创建密钥)。当IAM用户拥有密钥自管理权限时(AccessKeySelfManageAccess),如需为自身创建密钥则需要在请求中传递自身的UserName。
- access
Key StringId - 密钥ID(Access Key Id)。
- created
Time String - 密钥创建时间。时间格式为ISO8601。
- last
Login StringDate - 最后登录时间。
- region String
- API密钥最后访问的地域。
- request
Time String - API密钥的最后使用的时间。
- secret
Access StringKey - 私有密钥(Secret Access Key)。
- service String
- API密钥最后访问的服务的英文简称。
- status String
- 密钥状态。active代表启用状态,inactive代表禁用状态。
- updated
Time String - 密钥更新时间。时间格式为ISO8601。
- user
Name String - 用户名。用于给指定的IAM用户创建密钥,未指定用户名时则为当前请求身份创建密钥(即主账号请求时为主账号自身创建密钥,IAM用户请求时为IAM用户自身创建密钥。注意:角色不支持为自身创建密钥)。当IAM用户拥有密钥自管理权限时(AccessKeySelfManageAccess),如需为自身创建密钥则需要在请求中传递自身的UserName。
- access
Key stringId - 密钥ID(Access Key Id)。
- created
Time string - 密钥创建时间。时间格式为ISO8601。
- last
Login stringDate - 最后登录时间。
- region string
- API密钥最后访问的地域。
- request
Time string - API密钥的最后使用的时间。
- secret
Access stringKey - 私有密钥(Secret Access Key)。
- service string
- API密钥最后访问的服务的英文简称。
- status string
- 密钥状态。active代表启用状态,inactive代表禁用状态。
- updated
Time string - 密钥更新时间。时间格式为ISO8601。
- user
Name string - 用户名。用于给指定的IAM用户创建密钥,未指定用户名时则为当前请求身份创建密钥(即主账号请求时为主账号自身创建密钥,IAM用户请求时为IAM用户自身创建密钥。注意:角色不支持为自身创建密钥)。当IAM用户拥有密钥自管理权限时(AccessKeySelfManageAccess),如需为自身创建密钥则需要在请求中传递自身的UserName。
- access_
key_ strid - 密钥ID(Access Key Id)。
- created_
time str - 密钥创建时间。时间格式为ISO8601。
- last_
login_ strdate - 最后登录时间。
- region str
- API密钥最后访问的地域。
- request_
time str - API密钥的最后使用的时间。
- secret_
access_ strkey - 私有密钥(Secret Access Key)。
- service str
- API密钥最后访问的服务的英文简称。
- status str
- 密钥状态。active代表启用状态,inactive代表禁用状态。
- updated_
time str - 密钥更新时间。时间格式为ISO8601。
- user_
name str - 用户名。用于给指定的IAM用户创建密钥,未指定用户名时则为当前请求身份创建密钥(即主账号请求时为主账号自身创建密钥,IAM用户请求时为IAM用户自身创建密钥。注意:角色不支持为自身创建密钥)。当IAM用户拥有密钥自管理权限时(AccessKeySelfManageAccess),如需为自身创建密钥则需要在请求中传递自身的UserName。
- access
Key StringId - 密钥ID(Access Key Id)。
- created
Time String - 密钥创建时间。时间格式为ISO8601。
- last
Login StringDate - 最后登录时间。
- region String
- API密钥最后访问的地域。
- request
Time String - API密钥的最后使用的时间。
- secret
Access StringKey - 私有密钥(Secret Access Key)。
- service String
- API密钥最后访问的服务的英文简称。
- status String
- 密钥状态。active代表启用状态,inactive代表禁用状态。
- updated
Time String - 密钥更新时间。时间格式为ISO8601。
- user
Name String - 用户名。用于给指定的IAM用户创建密钥,未指定用户名时则为当前请求身份创建密钥(即主账号请求时为主账号自身创建密钥,IAM用户请求时为IAM用户自身创建密钥。注意:角色不支持为自身创建密钥)。当IAM用户拥有密钥自管理权限时(AccessKeySelfManageAccess),如需为自身创建密钥则需要在请求中传递自身的UserName。
Import
$ pulumi import bytepluscc:iam/accesskey:Accesskey example "access_key_id"
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.
published on Monday, Mar 9, 2026 by Byteplus
