published on Thursday, Sep 10, 2026 by Byteplus
published on Thursday, Sep 10, 2026 by Byteplus
IAM API Key。
Example Usage
import * as pulumi from "@pulumi/pulumi";
import * as bytepluscc from "@byteplus/pulumi-bytepluscc";
const example = new bytepluscc.iam.ApiKey("example", {
userName: "user-xxxx",
name: "ccapi-apikey-full",
permissionsBoundary: "{\"Statement\":[{\"Effect\":\"Allow\",\"Action\":[\"iam:*\"],\"Resource\":[\"*\"]}]}",
});
import pulumi
import pulumi_bytepluscc as bytepluscc
example = bytepluscc.iam.ApiKey("example",
user_name="user-xxxx",
name="ccapi-apikey-full",
permissions_boundary="{\"Statement\":[{\"Effect\":\"Allow\",\"Action\":[\"iam:*\"],\"Resource\":[\"*\"]}]}")
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.NewApiKey(ctx, "example", &iam.ApiKeyArgs{
UserName: pulumi.String("user-xxxx"),
Name: pulumi.String("ccapi-apikey-full"),
PermissionsBoundary: pulumi.String("{\"Statement\":[{\"Effect\":\"Allow\",\"Action\":[\"iam:*\"],\"Resource\":[\"*\"]}]}"),
})
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 example = new Bytepluscc.Iam.ApiKey("example", new()
{
UserName = "user-xxxx",
Name = "ccapi-apikey-full",
PermissionsBoundary = "{\"Statement\":[{\"Effect\":\"Allow\",\"Action\":[\"iam:*\"],\"Resource\":[\"*\"]}]}",
});
});
package generated_program;
import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.byteplus.bytepluscc.iam.ApiKey;
import com.byteplus.bytepluscc.iam.ApiKeyArgs;
import java.util.ArrayList;
import java.util.Arrays;
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 example = new ApiKey("example", ApiKeyArgs.builder()
.userName("user-xxxx")
.name("ccapi-apikey-full")
.permissionsBoundary("{\"Statement\":[{\"Effect\":\"Allow\",\"Action\":[\"iam:*\"],\"Resource\":[\"*\"]}]}")
.build());
}
}
resources:
example:
type: bytepluscc:iam:ApiKey
properties:
userName: user-xxxx
name: ccapi-apikey-full
permissionsBoundary: '{"Statement":[{"Effect":"Allow","Action":["iam:*"],"Resource":["*"]}]}'
pulumi {
required_providers {
bytepluscc = {
source = "pulumi/bytepluscc"
}
}
}
resource "bytepluscc_iam_apikey" "example" {
user_name = "user-xxxx"
name = "ccapi-apikey-full"
permissions_boundary = "{\"Statement\":[{\"Effect\":\"Allow\",\"Action\":[\"iam:*\"],\"Resource\":[\"*\"]}]}"
}
Create ApiKey Resource
Resources are created with functions called constructors. To learn more about declaring and configuring resources, see Resources.
Constructor syntax
new ApiKey(name: string, args: ApiKeyArgs, opts?: CustomResourceOptions);@overload
def ApiKey(resource_name: str,
args: ApiKeyArgs,
opts: Optional[ResourceOptions] = None)
@overload
def ApiKey(resource_name: str,
opts: Optional[ResourceOptions] = None,
name: Optional[str] = None,
user_name: Optional[str] = None,
permissions_boundary: Optional[str] = None,
status: Optional[str] = None)func NewApiKey(ctx *Context, name string, args ApiKeyArgs, opts ...ResourceOption) (*ApiKey, error)public ApiKey(string name, ApiKeyArgs args, CustomResourceOptions? opts = null)
public ApiKey(String name, ApiKeyArgs args)
public ApiKey(String name, ApiKeyArgs args, CustomResourceOptions options)
type: bytepluscc:iam:ApiKey
properties: # The arguments to resource properties.
options: # Bag of options to control resource's behavior.
resource "bytepluscc_iam_api_key" "name" {
# resource properties
}Parameters
- name string
- The unique name of the resource.
- args ApiKeyArgs
- 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 ApiKeyArgs
- 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 ApiKeyArgs
- The arguments to resource properties.
- opts ResourceOption
- Bag of options to control resource's behavior.
- name string
- The unique name of the resource.
- args ApiKeyArgs
- The arguments to resource properties.
- opts CustomResourceOptions
- Bag of options to control resource's behavior.
- name String
- The unique name of the resource.
- args ApiKeyArgs
- 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 apiKeyResource = new Bytepluscc.Iam.ApiKey("apiKeyResource", new()
{
Name = "string",
UserName = "string",
PermissionsBoundary = "string",
Status = "string",
});
example, err := iam.NewApiKey(ctx, "apiKeyResource", &iam.ApiKeyArgs{
Name: pulumi.String("string"),
UserName: pulumi.String("string"),
PermissionsBoundary: pulumi.String("string"),
Status: pulumi.String("string"),
})
resource "bytepluscc_iam_api_key" "apiKeyResource" {
lifecycle {
create_before_destroy = true
}
name = "string"
user_name = "string"
permissions_boundary = "string"
status = "string"
}
var apiKeyResource = new ApiKey("apiKeyResource", ApiKeyArgs.builder()
.name("string")
.userName("string")
.permissionsBoundary("string")
.status("string")
.build());
api_key_resource = bytepluscc.iam.ApiKey("apiKeyResource",
name="string",
user_name="string",
permissions_boundary="string",
status="string")
const apiKeyResource = new bytepluscc.iam.ApiKey("apiKeyResource", {
name: "string",
userName: "string",
permissionsBoundary: "string",
status: "string",
});
type: bytepluscc:iam:ApiKey
properties:
name: string
permissionsBoundary: string
status: string
userName: string
ApiKey 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 ApiKey resource accepts the following input properties:
- Name string
- API Key Name
- User
Name string - Username
- Permissions
Boundary string - Permission Boundary
- Status string
- API Key Status
- Name string
- API Key Name
- User
Name string - Username
- Permissions
Boundary string - Permission Boundary
- Status string
- API Key Status
- name string
- API Key Name
- user_
name string - Username
- permissions_
boundary string - Permission Boundary
- status string
- API Key Status
- name String
- API Key Name
- user
Name String - Username
- permissions
Boundary String - Permission Boundary
- status String
- API Key Status
- name string
- API Key Name
- user
Name string - Username
- permissions
Boundary string - Permission Boundary
- status string
- API Key Status
- name str
- API Key Name
- user_
name str - Username
- permissions_
boundary str - Permission Boundary
- status str
- API Key Status
- name String
- API Key Name
- user
Name String - Username
- permissions
Boundary String - Permission Boundary
- status String
- API Key Status
Outputs
All input properties are implicitly available as output properties. Additionally, the ApiKey resource produces the following output properties:
- Api
Key stringId - API Key ID。
- Create
Date string - Created At
- Id string
- The provider-assigned unique ID for this managed resource.
- Secret string
- API Key Secret
- Update
Date string - Last Updated
- Api
Key stringId - API Key ID。
- Create
Date string - Created At
- Id string
- The provider-assigned unique ID for this managed resource.
- Secret string
- API Key Secret
- Update
Date string - Last Updated
- api_
key_ stringid - API Key ID。
- create_
date string - Created At
- id string
- The provider-assigned unique ID for this managed resource.
- secret string
- API Key Secret
- update_
date string - Last Updated
- api
Key StringId - API Key ID。
- create
Date String - Created At
- id String
- The provider-assigned unique ID for this managed resource.
- secret String
- API Key Secret
- update
Date String - Last Updated
- api
Key stringId - API Key ID。
- create
Date string - Created At
- id string
- The provider-assigned unique ID for this managed resource.
- secret string
- API Key Secret
- update
Date string - Last Updated
- api_
key_ strid - API Key ID。
- create_
date str - Created At
- id str
- The provider-assigned unique ID for this managed resource.
- secret str
- API Key Secret
- update_
date str - Last Updated
- api
Key StringId - API Key ID。
- create
Date String - Created At
- id String
- The provider-assigned unique ID for this managed resource.
- secret String
- API Key Secret
- update
Date String - Last Updated
Look up Existing ApiKey Resource
Get an existing ApiKey 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?: ApiKeyState, opts?: CustomResourceOptions): ApiKey@staticmethod
def get(resource_name: str,
id: str,
opts: Optional[ResourceOptions] = None,
api_key_id: Optional[str] = None,
create_date: Optional[str] = None,
name: Optional[str] = None,
permissions_boundary: Optional[str] = None,
secret: Optional[str] = None,
status: Optional[str] = None,
update_date: Optional[str] = None,
user_name: Optional[str] = None) -> ApiKeyfunc GetApiKey(ctx *Context, name string, id IDInput, state *ApiKeyState, opts ...ResourceOption) (*ApiKey, error)public static ApiKey Get(string name, Input<string> id, ApiKeyState? state, CustomResourceOptions? opts = null)public static ApiKey get(String name, Output<String> id, ApiKeyState state, CustomResourceOptions options)resources: _: type: bytepluscc:iam:ApiKey get: id: ${id}import {
to = bytepluscc_iam_api_key.example
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.
- Api
Key stringId - API Key ID。
- Create
Date string - Created At
- Name string
- API Key Name
- Permissions
Boundary string - Permission Boundary
- Secret string
- API Key Secret
- Status string
- API Key Status
- Update
Date string - Last Updated
- User
Name string - Username
- Api
Key stringId - API Key ID。
- Create
Date string - Created At
- Name string
- API Key Name
- Permissions
Boundary string - Permission Boundary
- Secret string
- API Key Secret
- Status string
- API Key Status
- Update
Date string - Last Updated
- User
Name string - Username
- api_
key_ stringid - API Key ID。
- create_
date string - Created At
- name string
- API Key Name
- permissions_
boundary string - Permission Boundary
- secret string
- API Key Secret
- status string
- API Key Status
- update_
date string - Last Updated
- user_
name string - Username
- api
Key StringId - API Key ID。
- create
Date String - Created At
- name String
- API Key Name
- permissions
Boundary String - Permission Boundary
- secret String
- API Key Secret
- status String
- API Key Status
- update
Date String - Last Updated
- user
Name String - Username
- api
Key stringId - API Key ID。
- create
Date string - Created At
- name string
- API Key Name
- permissions
Boundary string - Permission Boundary
- secret string
- API Key Secret
- status string
- API Key Status
- update
Date string - Last Updated
- user
Name string - Username
- api_
key_ strid - API Key ID。
- create_
date str - Created At
- name str
- API Key Name
- permissions_
boundary str - Permission Boundary
- secret str
- API Key Secret
- status str
- API Key Status
- update_
date str - Last Updated
- user_
name str - Username
- api
Key StringId - API Key ID。
- create
Date String - Created At
- name String
- API Key Name
- permissions
Boundary String - Permission Boundary
- secret String
- API Key Secret
- status String
- API Key Status
- update
Date String - Last Updated
- user
Name String - Username
Import
$ pulumi import bytepluscc:iam/apiKey:ApiKey example "user_name|api_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 Thursday, Sep 10, 2026 by Byteplus