volcengine.iam.AccessKey
Explore with Pulumi AI
Provides a resource to manage iam access key
Example Usage
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"
});
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
})
}
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());
}
}
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"
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"
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
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 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 Volcengine.Iam.AccessKey("accessKeyResource", new()
{
PgpKey = "string",
SecretFile = "string",
Status = "string",
UserName = "string",
});
example, err := iam.NewAccessKey(ctx, "accessKeyResource", &iam.AccessKeyArgs{
PgpKey: pulumi.String("string"),
SecretFile: pulumi.String("string"),
Status: pulumi.String("string"),
UserName: pulumi.String("string"),
})
var accessKeyResource = new AccessKey("accessKeyResource", AccessKeyArgs.builder()
.pgpKey("string")
.secretFile("string")
.status("string")
.userName("string")
.build());
access_key_resource = volcengine.iam.AccessKey("accessKeyResource",
pgp_key="string",
secret_file="string",
status="string",
user_name="string")
const accessKeyResource = new volcengine.iam.AccessKey("accessKeyResource", {
pgpKey: "string",
secretFile: "string",
status: "string",
userName: "string",
});
type: volcengine:iam:AccessKey
properties:
pgpKey: string
secretFile: 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:
- Pgp
Key string - Either a base-64 encoded PGP public key, or a keybase username in the form
keybase:some_person_that_exists
. - Secret
File 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
orinactive
. - User
Name string - The user name.
- Pgp
Key string - Either a base-64 encoded PGP public key, or a keybase username in the form
keybase:some_person_that_exists
. - Secret
File 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
orinactive
. - User
Name string - The user name.
- pgp
Key String - Either a base-64 encoded PGP public key, or a keybase username in the form
keybase:some_person_that_exists
. - secret
File 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
orinactive
. - user
Name String - The user name.
- pgp
Key string - Either a base-64 encoded PGP public key, or a keybase username in the form
keybase:some_person_that_exists
. - secret
File 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
orinactive
. - user
Name string - The user name.
- pgp_
key str - Either a base-64 encoded PGP public key, or a keybase username in the form
keybase:some_person_that_exists
. - secret_
file 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
orinactive
. - user_
name str - The user name.
- pgp
Key String - Either a base-64 encoded PGP public key, or a keybase username in the form
keybase:some_person_that_exists
. - secret
File 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
orinactive
. - user
Name String - The user name.
Outputs
All input properties are implicitly available as output properties. Additionally, the AccessKey resource produces the following output properties:
- Create
Date string - The create date of the access key.
- Encrypted
Secret string - The encrypted secret of the access key by pgp key, base64 encoded.
- Id string
- The provider-assigned unique ID for this managed resource.
- Key
Fingerprint string - The key fingerprint of the encrypted secret.
- Secret string
- The secret of the access key.
- Create
Date string - The create date of the access key.
- Encrypted
Secret string - The encrypted secret of the access key by pgp key, base64 encoded.
- Id string
- The provider-assigned unique ID for this managed resource.
- Key
Fingerprint string - The key fingerprint of the encrypted secret.
- Secret string
- The secret of the access key.
- create
Date String - The create date of the access key.
- encrypted
Secret String - The encrypted secret of the access key by pgp key, base64 encoded.
- id String
- The provider-assigned unique ID for this managed resource.
- key
Fingerprint String - The key fingerprint of the encrypted secret.
- secret String
- The secret of the access key.
- create
Date string - The create date of the access key.
- encrypted
Secret string - The encrypted secret of the access key by pgp key, base64 encoded.
- id string
- The provider-assigned unique ID for this managed resource.
- key
Fingerprint 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.
- create
Date String - The create date of the access key.
- encrypted
Secret String - The encrypted secret of the access key by pgp key, base64 encoded.
- id String
- The provider-assigned unique ID for this managed resource.
- key
Fingerprint 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)
Resource lookup is not supported in YAML
- 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.
- Create
Date string - The create date of the access key.
- Encrypted
Secret string - The encrypted secret of the access key by pgp key, base64 encoded.
- Key
Fingerprint string - The key fingerprint of the encrypted secret.
- Pgp
Key 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.
- Secret
File 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
orinactive
. - User
Name string - The user name.
- Create
Date string - The create date of the access key.
- Encrypted
Secret string - The encrypted secret of the access key by pgp key, base64 encoded.
- Key
Fingerprint string - The key fingerprint of the encrypted secret.
- Pgp
Key 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.
- Secret
File 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
orinactive
. - User
Name string - The user name.
- create
Date String - The create date of the access key.
- encrypted
Secret String - The encrypted secret of the access key by pgp key, base64 encoded.
- key
Fingerprint String - The key fingerprint of the encrypted secret.
- pgp
Key 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.
- secret
File 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
orinactive
. - user
Name String - The user name.
- create
Date string - The create date of the access key.
- encrypted
Secret string - The encrypted secret of the access key by pgp key, base64 encoded.
- key
Fingerprint string - The key fingerprint of the encrypted secret.
- pgp
Key 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.
- secret
File 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
orinactive
. - user
Name 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 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 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
orinactive
. - user_
name str - The user name.
- create
Date String - The create date of the access key.
- encrypted
Secret String - The encrypted secret of the access key by pgp key, base64 encoded.
- key
Fingerprint String - The key fingerprint of the encrypted secret.
- pgp
Key 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.
- secret
File 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
orinactive
. - user
Name 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.