1. Packages
  2. Volcengine
  3. API Docs
  4. iam
  5. AccessKey
Volcengine v0.0.27 published on Tuesday, Dec 10, 2024 by Volcengine

volcengine.iam.AccessKey

Explore with Pulumi AI

Provides a resource to manage iam access key

Example Usage

import * as pulumi from "@pulumi/pulumi";
import * as volcengine from "@volcengine/pulumi";

const fooUser = new volcengine.iam.User("fooUser", {
    userName: "acc-test-user",
    description: "acc-test",
    displayName: "name",
});
const fooAccessKey = new volcengine.iam.AccessKey("fooAccessKey", {
    userName: fooUser.userName,
    secretFile: "./sk",
    status: "active",
});
//  pgp_key = "keybase:some_person_that_exists"
Copy
import pulumi
import pulumi_volcengine as volcengine

foo_user = volcengine.iam.User("fooUser",
    user_name="acc-test-user",
    description="acc-test",
    display_name="name")
foo_access_key = volcengine.iam.AccessKey("fooAccessKey",
    user_name=foo_user.user_name,
    secret_file="./sk",
    status="active")
#  pgp_key = "keybase:some_person_that_exists"
Copy
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 {
		fooUser, err := iam.NewUser(ctx, "fooUser", &iam.UserArgs{
			UserName:    pulumi.String("acc-test-user"),
			Description: pulumi.String("acc-test"),
			DisplayName: pulumi.String("name"),
		})
		if err != nil {
			return err
		}
		_, err = iam.NewAccessKey(ctx, "fooAccessKey", &iam.AccessKeyArgs{
			UserName:   fooUser.UserName,
			SecretFile: pulumi.String("./sk"),
			Status:     pulumi.String("active"),
		})
		if err != nil {
			return err
		}
		return nil
	})
}
Copy
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using Volcengine = Pulumi.Volcengine;

return await Deployment.RunAsync(() => 
{
    var fooUser = new Volcengine.Iam.User("fooUser", new()
    {
        UserName = "acc-test-user",
        Description = "acc-test",
        DisplayName = "name",
    });

    var fooAccessKey = new Volcengine.Iam.AccessKey("fooAccessKey", new()
    {
        UserName = fooUser.UserName,
        SecretFile = "./sk",
        Status = "active",
    });

    //  pgp_key = "keybase:some_person_that_exists"
});
Copy
package generated_program;

import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.volcengine.iam.User;
import com.pulumi.volcengine.iam.UserArgs;
import com.pulumi.volcengine.iam.AccessKey;
import com.pulumi.volcengine.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 fooUser = new User("fooUser", UserArgs.builder()        
            .userName("acc-test-user")
            .description("acc-test")
            .displayName("name")
            .build());

        var fooAccessKey = new AccessKey("fooAccessKey", AccessKeyArgs.builder()        
            .userName(fooUser.userName())
            .secretFile("./sk")
            .status("active")
            .build());

        //  pgp_key = "keybase:some_person_that_exists"
    }
}
Copy
resources:
  fooUser:
    type: volcengine:iam:User
    properties:
      userName: acc-test-user
      description: acc-test
      displayName: name
  fooAccessKey:
    type: volcengine:iam:AccessKey
    properties:
      userName: ${fooUser.userName}
      secretFile: ./sk
      status: active
Copy

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,
              pgp_key: Optional[str] = None,
              secret_file: 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: volcengine:iam:AccessKey
properties: # The arguments to resource properties.
options: # Bag of options to control resource's behavior.

Parameters

name This property is required. 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 This property is required. 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 This property is required. 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 This property is required. 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 This property is required. String
The unique name of the resource.
args This property is required. 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 Volcengine.Iam.AccessKey("accessKeyResource", new()
{
    PgpKey = "string",
    SecretFile = "string",
    Status = "string",
    UserName = "string",
});
Copy
example, err := iam.NewAccessKey(ctx, "accessKeyResource", &iam.AccessKeyArgs{
	PgpKey:     pulumi.String("string"),
	SecretFile: pulumi.String("string"),
	Status:     pulumi.String("string"),
	UserName:   pulumi.String("string"),
})
Copy
var accessKeyResource = new AccessKey("accessKeyResource", AccessKeyArgs.builder()
    .pgpKey("string")
    .secretFile("string")
    .status("string")
    .userName("string")
    .build());
Copy
access_key_resource = volcengine.iam.AccessKey("accessKeyResource",
    pgp_key="string",
    secret_file="string",
    status="string",
    user_name="string")
Copy
const accessKeyResource = new volcengine.iam.AccessKey("accessKeyResource", {
    pgpKey: "string",
    secretFile: "string",
    status: "string",
    userName: "string",
});
Copy
type: volcengine:iam:AccessKey
properties:
    pgpKey: string
    secretFile: string
    status: string
    userName: string
Copy

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:

PgpKey Changes to this property will trigger replacement. string
Either a base-64 encoded PGP public key, or a keybase username in the form keybase:some_person_that_exists.
SecretFile Changes to this property will trigger replacement. string
The file to save the access id and secret. Strongly suggest you to specified it when you creating access key, otherwise, you wouldn't get its secret ever.
Status string
The status of the access key, Optional choice contains active or inactive.
UserName Changes to this property will trigger replacement. string
The user name.
PgpKey Changes to this property will trigger replacement. string
Either a base-64 encoded PGP public key, or a keybase username in the form keybase:some_person_that_exists.
SecretFile Changes to this property will trigger replacement. string
The file to save the access id and secret. Strongly suggest you to specified it when you creating access key, otherwise, you wouldn't get its secret ever.
Status string
The status of the access key, Optional choice contains active or inactive.
UserName Changes to this property will trigger replacement. string
The user name.
pgpKey Changes to this property will trigger replacement. String
Either a base-64 encoded PGP public key, or a keybase username in the form keybase:some_person_that_exists.
secretFile Changes to this property will trigger replacement. String
The file to save the access id and secret. Strongly suggest you to specified it when you creating access key, otherwise, you wouldn't get its secret ever.
status String
The status of the access key, Optional choice contains active or inactive.
userName Changes to this property will trigger replacement. String
The user name.
pgpKey Changes to this property will trigger replacement. string
Either a base-64 encoded PGP public key, or a keybase username in the form keybase:some_person_that_exists.
secretFile Changes to this property will trigger replacement. string
The file to save the access id and secret. Strongly suggest you to specified it when you creating access key, otherwise, you wouldn't get its secret ever.
status string
The status of the access key, Optional choice contains active or inactive.
userName Changes to this property will trigger replacement. string
The user name.
pgp_key Changes to this property will trigger replacement. str
Either a base-64 encoded PGP public key, or a keybase username in the form keybase:some_person_that_exists.
secret_file Changes to this property will trigger replacement. str
The file to save the access id and secret. Strongly suggest you to specified it when you creating access key, otherwise, you wouldn't get its secret ever.
status str
The status of the access key, Optional choice contains active or inactive.
user_name Changes to this property will trigger replacement. str
The user name.
pgpKey Changes to this property will trigger replacement. String
Either a base-64 encoded PGP public key, or a keybase username in the form keybase:some_person_that_exists.
secretFile Changes to this property will trigger replacement. String
The file to save the access id and secret. Strongly suggest you to specified it when you creating access key, otherwise, you wouldn't get its secret ever.
status String
The status of the access key, Optional choice contains active or inactive.
userName Changes to this property will trigger replacement. String
The user name.

Outputs

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

CreateDate string
The create date of the access key.
EncryptedSecret string
The encrypted secret of the access key by pgp key, base64 encoded.
Id string
The provider-assigned unique ID for this managed resource.
KeyFingerprint string
The key fingerprint of the encrypted secret.
Secret string
The secret of the access key.
CreateDate string
The create date of the access key.
EncryptedSecret string
The encrypted secret of the access key by pgp key, base64 encoded.
Id string
The provider-assigned unique ID for this managed resource.
KeyFingerprint string
The key fingerprint of the encrypted secret.
Secret string
The secret of the access key.
createDate String
The create date of the access key.
encryptedSecret String
The encrypted secret of the access key by pgp key, base64 encoded.
id String
The provider-assigned unique ID for this managed resource.
keyFingerprint String
The key fingerprint of the encrypted secret.
secret String
The secret of the access key.
createDate string
The create date of the access key.
encryptedSecret string
The encrypted secret of the access key by pgp key, base64 encoded.
id string
The provider-assigned unique ID for this managed resource.
keyFingerprint string
The key fingerprint of the encrypted secret.
secret string
The secret of the access key.
create_date str
The create date of the access key.
encrypted_secret str
The encrypted secret of the access key by pgp key, base64 encoded.
id str
The provider-assigned unique ID for this managed resource.
key_fingerprint str
The key fingerprint of the encrypted secret.
secret str
The secret of the access key.
createDate String
The create date of the access key.
encryptedSecret String
The encrypted secret of the access key by pgp key, base64 encoded.
id String
The provider-assigned unique ID for this managed resource.
keyFingerprint String
The key fingerprint of the encrypted secret.
secret String
The secret of the access key.

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,
        create_date: Optional[str] = None,
        encrypted_secret: Optional[str] = None,
        key_fingerprint: Optional[str] = None,
        pgp_key: Optional[str] = None,
        secret: Optional[str] = None,
        secret_file: Optional[str] = None,
        status: Optional[str] = None,
        user_name: Optional[str] = None) -> AccessKey
func 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: volcengine:iam:AccessKey    get:      id: ${id}
name This property is required.
The unique name of the resulting resource.
id This property is required.
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 This property is required.
The unique name of the resulting resource.
id This property is required.
The unique provider ID of the resource to lookup.
name This property is required.
The unique name of the resulting resource.
id This property is required.
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 This property is required.
The unique name of the resulting resource.
id This property is required.
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 This property is required.
The unique name of the resulting resource.
id This property is required.
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:
CreateDate string
The create date of the access key.
EncryptedSecret string
The encrypted secret of the access key by pgp key, base64 encoded.
KeyFingerprint string
The key fingerprint of the encrypted secret.
PgpKey Changes to this property will trigger replacement. string
Either a base-64 encoded PGP public key, or a keybase username in the form keybase:some_person_that_exists.
Secret string
The secret of the access key.
SecretFile Changes to this property will trigger replacement. string
The file to save the access id and secret. Strongly suggest you to specified it when you creating access key, otherwise, you wouldn't get its secret ever.
Status string
The status of the access key, Optional choice contains active or inactive.
UserName Changes to this property will trigger replacement. string
The user name.
CreateDate string
The create date of the access key.
EncryptedSecret string
The encrypted secret of the access key by pgp key, base64 encoded.
KeyFingerprint string
The key fingerprint of the encrypted secret.
PgpKey Changes to this property will trigger replacement. string
Either a base-64 encoded PGP public key, or a keybase username in the form keybase:some_person_that_exists.
Secret string
The secret of the access key.
SecretFile Changes to this property will trigger replacement. string
The file to save the access id and secret. Strongly suggest you to specified it when you creating access key, otherwise, you wouldn't get its secret ever.
Status string
The status of the access key, Optional choice contains active or inactive.
UserName Changes to this property will trigger replacement. string
The user name.
createDate String
The create date of the access key.
encryptedSecret String
The encrypted secret of the access key by pgp key, base64 encoded.
keyFingerprint String
The key fingerprint of the encrypted secret.
pgpKey Changes to this property will trigger replacement. String
Either a base-64 encoded PGP public key, or a keybase username in the form keybase:some_person_that_exists.
secret String
The secret of the access key.
secretFile Changes to this property will trigger replacement. String
The file to save the access id and secret. Strongly suggest you to specified it when you creating access key, otherwise, you wouldn't get its secret ever.
status String
The status of the access key, Optional choice contains active or inactive.
userName Changes to this property will trigger replacement. String
The user name.
createDate string
The create date of the access key.
encryptedSecret string
The encrypted secret of the access key by pgp key, base64 encoded.
keyFingerprint string
The key fingerprint of the encrypted secret.
pgpKey Changes to this property will trigger replacement. string
Either a base-64 encoded PGP public key, or a keybase username in the form keybase:some_person_that_exists.
secret string
The secret of the access key.
secretFile Changes to this property will trigger replacement. string
The file to save the access id and secret. Strongly suggest you to specified it when you creating access key, otherwise, you wouldn't get its secret ever.
status string
The status of the access key, Optional choice contains active or inactive.
userName Changes to this property will trigger replacement. string
The user name.
create_date str
The create date of the access key.
encrypted_secret str
The encrypted secret of the access key by pgp key, base64 encoded.
key_fingerprint str
The key fingerprint of the encrypted secret.
pgp_key Changes to this property will trigger replacement. str
Either a base-64 encoded PGP public key, or a keybase username in the form keybase:some_person_that_exists.
secret str
The secret of the access key.
secret_file Changes to this property will trigger replacement. str
The file to save the access id and secret. Strongly suggest you to specified it when you creating access key, otherwise, you wouldn't get its secret ever.
status str
The status of the access key, Optional choice contains active or inactive.
user_name Changes to this property will trigger replacement. str
The user name.
createDate String
The create date of the access key.
encryptedSecret String
The encrypted secret of the access key by pgp key, base64 encoded.
keyFingerprint String
The key fingerprint of the encrypted secret.
pgpKey Changes to this property will trigger replacement. String
Either a base-64 encoded PGP public key, or a keybase username in the form keybase:some_person_that_exists.
secret String
The secret of the access key.
secretFile Changes to this property will trigger replacement. String
The file to save the access id and secret. Strongly suggest you to specified it when you creating access key, otherwise, you wouldn't get its secret ever.
status String
The status of the access key, Optional choice contains active or inactive.
userName Changes to this property will trigger replacement. String
The user name.

Import

Iam access key don’t support import

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.