1. Packages
  2. Tencentcloud Provider
  3. API Docs
  4. CamAccessKey
tencentcloud 1.81.189 published on Wednesday, Apr 30, 2025 by tencentcloudstack

tencentcloud.CamAccessKey

Explore with Pulumi AI

tencentcloud logo
tencentcloud 1.81.189 published on Wednesday, Apr 30, 2025 by tencentcloudstack

    Provides a resource to create a CAM access key

    Example Usage

    Create access key

    import * as pulumi from "@pulumi/pulumi";
    import * as tencentcloud from "@pulumi/tencentcloud";
    
    const info = tencentcloud.getUserInfo({});
    const example = new tencentcloud.CamAccessKey("example", {targetUin: info.then(info => info.uin)});
    
    import pulumi
    import pulumi_tencentcloud as tencentcloud
    
    info = tencentcloud.get_user_info()
    example = tencentcloud.CamAccessKey("example", target_uin=info.uin)
    
    package main
    
    import (
    	"github.com/pulumi/pulumi-terraform-provider/sdks/go/tencentcloud/tencentcloud"
    	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
    )
    
    func main() {
    	pulumi.Run(func(ctx *pulumi.Context) error {
    		info, err := tencentcloud.GetUserInfo(ctx, &tencentcloud.GetUserInfoArgs{}, nil)
    		if err != nil {
    			return err
    		}
    		_, err = tencentcloud.NewCamAccessKey(ctx, "example", &tencentcloud.CamAccessKeyArgs{
    			TargetUin: pulumi.String(info.Uin),
    		})
    		if err != nil {
    			return err
    		}
    		return nil
    	})
    }
    
    using System.Collections.Generic;
    using System.Linq;
    using Pulumi;
    using Tencentcloud = Pulumi.Tencentcloud;
    
    return await Deployment.RunAsync(() => 
    {
        var info = Tencentcloud.GetUserInfo.Invoke();
    
        var example = new Tencentcloud.CamAccessKey("example", new()
        {
            TargetUin = info.Apply(getUserInfoResult => getUserInfoResult.Uin),
        });
    
    });
    
    package generated_program;
    
    import com.pulumi.Context;
    import com.pulumi.Pulumi;
    import com.pulumi.core.Output;
    import com.pulumi.tencentcloud.TencentcloudFunctions;
    import com.pulumi.tencentcloud.inputs.GetUserInfoArgs;
    import com.pulumi.tencentcloud.CamAccessKey;
    import com.pulumi.tencentcloud.CamAccessKeyArgs;
    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) {
            final var info = TencentcloudFunctions.getUserInfo();
    
            var example = new CamAccessKey("example", CamAccessKeyArgs.builder()
                .targetUin(info.applyValue(getUserInfoResult -> getUserInfoResult.uin()))
                .build());
    
        }
    }
    
    resources:
      example:
        type: tencentcloud:CamAccessKey
        properties:
          targetUin: ${info.uin}
    variables:
      info:
        fn::invoke:
          function: tencentcloud:getUserInfo
          arguments: {}
    

    Update access key

    import * as pulumi from "@pulumi/pulumi";
    import * as tencentcloud from "@pulumi/tencentcloud";
    
    const info = tencentcloud.getUserInfo({});
    const example = new tencentcloud.CamAccessKey("example", {
        targetUin: info.then(info => info.uin),
        status: "Inactive",
    });
    
    import pulumi
    import pulumi_tencentcloud as tencentcloud
    
    info = tencentcloud.get_user_info()
    example = tencentcloud.CamAccessKey("example",
        target_uin=info.uin,
        status="Inactive")
    
    package main
    
    import (
    	"github.com/pulumi/pulumi-terraform-provider/sdks/go/tencentcloud/tencentcloud"
    	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
    )
    
    func main() {
    	pulumi.Run(func(ctx *pulumi.Context) error {
    		info, err := tencentcloud.GetUserInfo(ctx, &tencentcloud.GetUserInfoArgs{}, nil)
    		if err != nil {
    			return err
    		}
    		_, err = tencentcloud.NewCamAccessKey(ctx, "example", &tencentcloud.CamAccessKeyArgs{
    			TargetUin: pulumi.String(info.Uin),
    			Status:    pulumi.String("Inactive"),
    		})
    		if err != nil {
    			return err
    		}
    		return nil
    	})
    }
    
    using System.Collections.Generic;
    using System.Linq;
    using Pulumi;
    using Tencentcloud = Pulumi.Tencentcloud;
    
    return await Deployment.RunAsync(() => 
    {
        var info = Tencentcloud.GetUserInfo.Invoke();
    
        var example = new Tencentcloud.CamAccessKey("example", new()
        {
            TargetUin = info.Apply(getUserInfoResult => getUserInfoResult.Uin),
            Status = "Inactive",
        });
    
    });
    
    package generated_program;
    
    import com.pulumi.Context;
    import com.pulumi.Pulumi;
    import com.pulumi.core.Output;
    import com.pulumi.tencentcloud.TencentcloudFunctions;
    import com.pulumi.tencentcloud.inputs.GetUserInfoArgs;
    import com.pulumi.tencentcloud.CamAccessKey;
    import com.pulumi.tencentcloud.CamAccessKeyArgs;
    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) {
            final var info = TencentcloudFunctions.getUserInfo();
    
            var example = new CamAccessKey("example", CamAccessKeyArgs.builder()
                .targetUin(info.applyValue(getUserInfoResult -> getUserInfoResult.uin()))
                .status("Inactive")
                .build());
    
        }
    }
    
    resources:
      example:
        type: tencentcloud:CamAccessKey
        properties:
          targetUin: ${info.uin}
          status: Inactive
    variables:
      info:
        fn::invoke:
          function: tencentcloud:getUserInfo
          arguments: {}
    

    Encrypted access key

    import * as pulumi from "@pulumi/pulumi";
    import * as tencentcloud from "@pulumi/tencentcloud";
    
    const info = tencentcloud.getUserInfo({});
    const example = new tencentcloud.CamAccessKey("example", {
        targetUin: info.then(info => info.uin),
        pgpKey: "keybase:some_person_that_exists",
    });
    
    import pulumi
    import pulumi_tencentcloud as tencentcloud
    
    info = tencentcloud.get_user_info()
    example = tencentcloud.CamAccessKey("example",
        target_uin=info.uin,
        pgp_key="keybase:some_person_that_exists")
    
    package main
    
    import (
    	"github.com/pulumi/pulumi-terraform-provider/sdks/go/tencentcloud/tencentcloud"
    	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
    )
    
    func main() {
    	pulumi.Run(func(ctx *pulumi.Context) error {
    		info, err := tencentcloud.GetUserInfo(ctx, &tencentcloud.GetUserInfoArgs{}, nil)
    		if err != nil {
    			return err
    		}
    		_, err = tencentcloud.NewCamAccessKey(ctx, "example", &tencentcloud.CamAccessKeyArgs{
    			TargetUin: pulumi.String(info.Uin),
    			PgpKey:    pulumi.String("keybase:some_person_that_exists"),
    		})
    		if err != nil {
    			return err
    		}
    		return nil
    	})
    }
    
    using System.Collections.Generic;
    using System.Linq;
    using Pulumi;
    using Tencentcloud = Pulumi.Tencentcloud;
    
    return await Deployment.RunAsync(() => 
    {
        var info = Tencentcloud.GetUserInfo.Invoke();
    
        var example = new Tencentcloud.CamAccessKey("example", new()
        {
            TargetUin = info.Apply(getUserInfoResult => getUserInfoResult.Uin),
            PgpKey = "keybase:some_person_that_exists",
        });
    
    });
    
    package generated_program;
    
    import com.pulumi.Context;
    import com.pulumi.Pulumi;
    import com.pulumi.core.Output;
    import com.pulumi.tencentcloud.TencentcloudFunctions;
    import com.pulumi.tencentcloud.inputs.GetUserInfoArgs;
    import com.pulumi.tencentcloud.CamAccessKey;
    import com.pulumi.tencentcloud.CamAccessKeyArgs;
    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) {
            final var info = TencentcloudFunctions.getUserInfo();
    
            var example = new CamAccessKey("example", CamAccessKeyArgs.builder()
                .targetUin(info.applyValue(getUserInfoResult -> getUserInfoResult.uin()))
                .pgpKey("keybase:some_person_that_exists")
                .build());
    
        }
    }
    
    resources:
      example:
        type: tencentcloud:CamAccessKey
        properties:
          targetUin: ${info.uin}
          pgpKey: keybase:some_person_that_exists
    variables:
      info:
        fn::invoke:
          function: tencentcloud:getUserInfo
          arguments: {}
    

    Create CamAccessKey Resource

    Resources are created with functions called constructors. To learn more about declaring and configuring resources, see Resources.

    Constructor syntax

    new CamAccessKey(name: string, args?: CamAccessKeyArgs, opts?: CustomResourceOptions);
    @overload
    def CamAccessKey(resource_name: str,
                     args: Optional[CamAccessKeyArgs] = None,
                     opts: Optional[ResourceOptions] = None)
    
    @overload
    def CamAccessKey(resource_name: str,
                     opts: Optional[ResourceOptions] = None,
                     access_key: Optional[str] = None,
                     cam_access_key_id: Optional[str] = None,
                     pgp_key: Optional[str] = None,
                     status: Optional[str] = None,
                     target_uin: Optional[float] = None)
    func NewCamAccessKey(ctx *Context, name string, args *CamAccessKeyArgs, opts ...ResourceOption) (*CamAccessKey, error)
    public CamAccessKey(string name, CamAccessKeyArgs? args = null, CustomResourceOptions? opts = null)
    public CamAccessKey(String name, CamAccessKeyArgs args)
    public CamAccessKey(String name, CamAccessKeyArgs args, CustomResourceOptions options)
    
    type: tencentcloud:CamAccessKey
    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 CamAccessKeyArgs
    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 CamAccessKeyArgs
    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 CamAccessKeyArgs
    The arguments to resource properties.
    opts ResourceOption
    Bag of options to control resource's behavior.
    name string
    The unique name of the resource.
    args CamAccessKeyArgs
    The arguments to resource properties.
    opts CustomResourceOptions
    Bag of options to control resource's behavior.
    name String
    The unique name of the resource.
    args CamAccessKeyArgs
    The arguments to resource properties.
    options CustomResourceOptions
    Bag of options to control resource's behavior.

    CamAccessKey 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 CamAccessKey resource accepts the following input properties:

    AccessKey string
    Access_key is the access key identification, required when updating.
    CamAccessKeyId string
    ID of the resource.
    PgpKey string
    Either a base-64 encoded PGP public key, or a keybase username in the form keybase:some_person_that_exists, for use in the encrypted_secret output attribute. If providing a base-64 encoded PGP public key, make sure to provide the "raw" version and not the "armored" one (e.g. avoid passing the -a option to gpg --export).
    Status string
    Key status, activated (Active) or inactive (Inactive), required when updating.
    TargetUin double
    Specify user Uin, if not filled, the access key is created for the current user by default.
    AccessKey string
    Access_key is the access key identification, required when updating.
    CamAccessKeyId string
    ID of the resource.
    PgpKey string
    Either a base-64 encoded PGP public key, or a keybase username in the form keybase:some_person_that_exists, for use in the encrypted_secret output attribute. If providing a base-64 encoded PGP public key, make sure to provide the "raw" version and not the "armored" one (e.g. avoid passing the -a option to gpg --export).
    Status string
    Key status, activated (Active) or inactive (Inactive), required when updating.
    TargetUin float64
    Specify user Uin, if not filled, the access key is created for the current user by default.
    accessKey String
    Access_key is the access key identification, required when updating.
    camAccessKeyId String
    ID of the resource.
    pgpKey String
    Either a base-64 encoded PGP public key, or a keybase username in the form keybase:some_person_that_exists, for use in the encrypted_secret output attribute. If providing a base-64 encoded PGP public key, make sure to provide the "raw" version and not the "armored" one (e.g. avoid passing the -a option to gpg --export).
    status String
    Key status, activated (Active) or inactive (Inactive), required when updating.
    targetUin Double
    Specify user Uin, if not filled, the access key is created for the current user by default.
    accessKey string
    Access_key is the access key identification, required when updating.
    camAccessKeyId string
    ID of the resource.
    pgpKey string
    Either a base-64 encoded PGP public key, or a keybase username in the form keybase:some_person_that_exists, for use in the encrypted_secret output attribute. If providing a base-64 encoded PGP public key, make sure to provide the "raw" version and not the "armored" one (e.g. avoid passing the -a option to gpg --export).
    status string
    Key status, activated (Active) or inactive (Inactive), required when updating.
    targetUin number
    Specify user Uin, if not filled, the access key is created for the current user by default.
    access_key str
    Access_key is the access key identification, required when updating.
    cam_access_key_id str
    ID of the resource.
    pgp_key str
    Either a base-64 encoded PGP public key, or a keybase username in the form keybase:some_person_that_exists, for use in the encrypted_secret output attribute. If providing a base-64 encoded PGP public key, make sure to provide the "raw" version and not the "armored" one (e.g. avoid passing the -a option to gpg --export).
    status str
    Key status, activated (Active) or inactive (Inactive), required when updating.
    target_uin float
    Specify user Uin, if not filled, the access key is created for the current user by default.
    accessKey String
    Access_key is the access key identification, required when updating.
    camAccessKeyId String
    ID of the resource.
    pgpKey String
    Either a base-64 encoded PGP public key, or a keybase username in the form keybase:some_person_that_exists, for use in the encrypted_secret output attribute. If providing a base-64 encoded PGP public key, make sure to provide the "raw" version and not the "armored" one (e.g. avoid passing the -a option to gpg --export).
    status String
    Key status, activated (Active) or inactive (Inactive), required when updating.
    targetUin Number
    Specify user Uin, if not filled, the access key is created for the current user by default.

    Outputs

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

    EncryptedSecretAccessKey string
    Id string
    The provider-assigned unique ID for this managed resource.
    KeyFingerprint string
    Fingerprint of the PGP key used to encrypt the secret. This attribute is not available for imported resources.
    SecretAccessKey string
    Access key (key is only visible when created, please keep it properly).
    EncryptedSecretAccessKey string
    Id string
    The provider-assigned unique ID for this managed resource.
    KeyFingerprint string
    Fingerprint of the PGP key used to encrypt the secret. This attribute is not available for imported resources.
    SecretAccessKey string
    Access key (key is only visible when created, please keep it properly).
    encryptedSecretAccessKey String
    id String
    The provider-assigned unique ID for this managed resource.
    keyFingerprint String
    Fingerprint of the PGP key used to encrypt the secret. This attribute is not available for imported resources.
    secretAccessKey String
    Access key (key is only visible when created, please keep it properly).
    encryptedSecretAccessKey string
    id string
    The provider-assigned unique ID for this managed resource.
    keyFingerprint string
    Fingerprint of the PGP key used to encrypt the secret. This attribute is not available for imported resources.
    secretAccessKey string
    Access key (key is only visible when created, please keep it properly).
    encrypted_secret_access_key str
    id str
    The provider-assigned unique ID for this managed resource.
    key_fingerprint str
    Fingerprint of the PGP key used to encrypt the secret. This attribute is not available for imported resources.
    secret_access_key str
    Access key (key is only visible when created, please keep it properly).
    encryptedSecretAccessKey String
    id String
    The provider-assigned unique ID for this managed resource.
    keyFingerprint String
    Fingerprint of the PGP key used to encrypt the secret. This attribute is not available for imported resources.
    secretAccessKey String
    Access key (key is only visible when created, please keep it properly).

    Look up Existing CamAccessKey Resource

    Get an existing CamAccessKey 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?: CamAccessKeyState, opts?: CustomResourceOptions): CamAccessKey
    @staticmethod
    def get(resource_name: str,
            id: str,
            opts: Optional[ResourceOptions] = None,
            access_key: Optional[str] = None,
            cam_access_key_id: Optional[str] = None,
            encrypted_secret_access_key: Optional[str] = None,
            key_fingerprint: Optional[str] = None,
            pgp_key: Optional[str] = None,
            secret_access_key: Optional[str] = None,
            status: Optional[str] = None,
            target_uin: Optional[float] = None) -> CamAccessKey
    func GetCamAccessKey(ctx *Context, name string, id IDInput, state *CamAccessKeyState, opts ...ResourceOption) (*CamAccessKey, error)
    public static CamAccessKey Get(string name, Input<string> id, CamAccessKeyState? state, CustomResourceOptions? opts = null)
    public static CamAccessKey get(String name, Output<String> id, CamAccessKeyState state, CustomResourceOptions options)
    resources:  _:    type: tencentcloud:CamAccessKey    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.
    The following state arguments are supported:
    AccessKey string
    Access_key is the access key identification, required when updating.
    CamAccessKeyId string
    ID of the resource.
    EncryptedSecretAccessKey string
    KeyFingerprint string
    Fingerprint of the PGP key used to encrypt the secret. This attribute is not available for imported resources.
    PgpKey string
    Either a base-64 encoded PGP public key, or a keybase username in the form keybase:some_person_that_exists, for use in the encrypted_secret output attribute. If providing a base-64 encoded PGP public key, make sure to provide the "raw" version and not the "armored" one (e.g. avoid passing the -a option to gpg --export).
    SecretAccessKey string
    Access key (key is only visible when created, please keep it properly).
    Status string
    Key status, activated (Active) or inactive (Inactive), required when updating.
    TargetUin double
    Specify user Uin, if not filled, the access key is created for the current user by default.
    AccessKey string
    Access_key is the access key identification, required when updating.
    CamAccessKeyId string
    ID of the resource.
    EncryptedSecretAccessKey string
    KeyFingerprint string
    Fingerprint of the PGP key used to encrypt the secret. This attribute is not available for imported resources.
    PgpKey string
    Either a base-64 encoded PGP public key, or a keybase username in the form keybase:some_person_that_exists, for use in the encrypted_secret output attribute. If providing a base-64 encoded PGP public key, make sure to provide the "raw" version and not the "armored" one (e.g. avoid passing the -a option to gpg --export).
    SecretAccessKey string
    Access key (key is only visible when created, please keep it properly).
    Status string
    Key status, activated (Active) or inactive (Inactive), required when updating.
    TargetUin float64
    Specify user Uin, if not filled, the access key is created for the current user by default.
    accessKey String
    Access_key is the access key identification, required when updating.
    camAccessKeyId String
    ID of the resource.
    encryptedSecretAccessKey String
    keyFingerprint String
    Fingerprint of the PGP key used to encrypt the secret. This attribute is not available for imported resources.
    pgpKey String
    Either a base-64 encoded PGP public key, or a keybase username in the form keybase:some_person_that_exists, for use in the encrypted_secret output attribute. If providing a base-64 encoded PGP public key, make sure to provide the "raw" version and not the "armored" one (e.g. avoid passing the -a option to gpg --export).
    secretAccessKey String
    Access key (key is only visible when created, please keep it properly).
    status String
    Key status, activated (Active) or inactive (Inactive), required when updating.
    targetUin Double
    Specify user Uin, if not filled, the access key is created for the current user by default.
    accessKey string
    Access_key is the access key identification, required when updating.
    camAccessKeyId string
    ID of the resource.
    encryptedSecretAccessKey string
    keyFingerprint string
    Fingerprint of the PGP key used to encrypt the secret. This attribute is not available for imported resources.
    pgpKey string
    Either a base-64 encoded PGP public key, or a keybase username in the form keybase:some_person_that_exists, for use in the encrypted_secret output attribute. If providing a base-64 encoded PGP public key, make sure to provide the "raw" version and not the "armored" one (e.g. avoid passing the -a option to gpg --export).
    secretAccessKey string
    Access key (key is only visible when created, please keep it properly).
    status string
    Key status, activated (Active) or inactive (Inactive), required when updating.
    targetUin number
    Specify user Uin, if not filled, the access key is created for the current user by default.
    access_key str
    Access_key is the access key identification, required when updating.
    cam_access_key_id str
    ID of the resource.
    encrypted_secret_access_key str
    key_fingerprint str
    Fingerprint of the PGP key used to encrypt the secret. This attribute is not available for imported resources.
    pgp_key str
    Either a base-64 encoded PGP public key, or a keybase username in the form keybase:some_person_that_exists, for use in the encrypted_secret output attribute. If providing a base-64 encoded PGP public key, make sure to provide the "raw" version and not the "armored" one (e.g. avoid passing the -a option to gpg --export).
    secret_access_key str
    Access key (key is only visible when created, please keep it properly).
    status str
    Key status, activated (Active) or inactive (Inactive), required when updating.
    target_uin float
    Specify user Uin, if not filled, the access key is created for the current user by default.
    accessKey String
    Access_key is the access key identification, required when updating.
    camAccessKeyId String
    ID of the resource.
    encryptedSecretAccessKey String
    keyFingerprint String
    Fingerprint of the PGP key used to encrypt the secret. This attribute is not available for imported resources.
    pgpKey String
    Either a base-64 encoded PGP public key, or a keybase username in the form keybase:some_person_that_exists, for use in the encrypted_secret output attribute. If providing a base-64 encoded PGP public key, make sure to provide the "raw" version and not the "armored" one (e.g. avoid passing the -a option to gpg --export).
    secretAccessKey String
    Access key (key is only visible when created, please keep it properly).
    status String
    Key status, activated (Active) or inactive (Inactive), required when updating.
    targetUin Number
    Specify user Uin, if not filled, the access key is created for the current user by default.

    Import

    cam access key can be imported using the id, e.g.

    $ pulumi import tencentcloud:index/camAccessKey:CamAccessKey example 100037718101#AKID7F******************
    

    To learn more about importing existing cloud resources, see Importing resources.

    Package Details

    Repository
    tencentcloud tencentcloudstack/terraform-provider-tencentcloud
    License
    Notes
    This Pulumi package is based on the tencentcloud Terraform Provider.
    tencentcloud logo
    tencentcloud 1.81.189 published on Wednesday, Apr 30, 2025 by tencentcloudstack