1. Packages
  2. Volcengine
  3. API Docs
  4. iam
  5. AccessKey
Volcengine v0.0.26 published on Friday, Sep 13, 2024 by Volcengine

volcengine.iam.AccessKey

Explore with Pulumi AI

volcengine logo
Volcengine v0.0.26 published on Friday, Sep 13, 2024 by Volcengine

    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:

    PgpKey string
    Either a base-64 encoded PGP public key, or a keybase username in the form keybase:some_person_that_exists.
    SecretFile 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 string
    The user name.
    PgpKey string
    Either a base-64 encoded PGP public key, or a keybase username in the form keybase:some_person_that_exists.
    SecretFile 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 string
    The user name.
    pgpKey String
    Either a base-64 encoded PGP public key, or a keybase username in the form keybase:some_person_that_exists.
    secretFile 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 String
    The user name.
    pgpKey string
    Either a base-64 encoded PGP public key, or a keybase username in the form keybase:some_person_that_exists.
    secretFile 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 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 or inactive.
    user_name str
    The user name.
    pgpKey String
    Either a base-64 encoded PGP public key, or a keybase username in the form keybase:some_person_that_exists.
    secretFile 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 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)
    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.
    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 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 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 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 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 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 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 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 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 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 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 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 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 or inactive.
    user_name 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 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 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 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.
    volcengine logo
    Volcengine v0.0.26 published on Friday, Sep 13, 2024 by Volcengine