tencentcloud.CamAccessKey
Explore with Pulumi AI
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:
- Access
Key string - Access_key is the access key identification, required when updating.
- Cam
Access stringKey Id - ID of the resource.
- Pgp
Key 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.
- Target
Uin double - Specify user Uin, if not filled, the access key is created for the current user by default.
- Access
Key string - Access_key is the access key identification, required when updating.
- Cam
Access stringKey Id - ID of the resource.
- Pgp
Key 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.
- Target
Uin float64 - Specify user Uin, if not filled, the access key is created for the current user by default.
- access
Key String - Access_key is the access key identification, required when updating.
- cam
Access StringKey Id - ID of the resource.
- pgp
Key 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.
- target
Uin Double - Specify user Uin, if not filled, the access key is created for the current user by default.
- access
Key string - Access_key is the access key identification, required when updating.
- cam
Access stringKey Id - ID of the resource.
- pgp
Key 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.
- target
Uin 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_ strkey_ id - 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.
- access
Key String - Access_key is the access key identification, required when updating.
- cam
Access StringKey Id - ID of the resource.
- pgp
Key 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.
- target
Uin 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:
- Encrypted
Secret stringAccess Key - Id string
- The provider-assigned unique ID for this managed resource.
- Key
Fingerprint string - Fingerprint of the PGP key used to encrypt the secret. This attribute is not available for imported resources.
- Secret
Access stringKey - Access key (key is only visible when created, please keep it properly).
- Encrypted
Secret stringAccess Key - Id string
- The provider-assigned unique ID for this managed resource.
- Key
Fingerprint string - Fingerprint of the PGP key used to encrypt the secret. This attribute is not available for imported resources.
- Secret
Access stringKey - Access key (key is only visible when created, please keep it properly).
- encrypted
Secret StringAccess Key - id String
- The provider-assigned unique ID for this managed resource.
- key
Fingerprint String - Fingerprint of the PGP key used to encrypt the secret. This attribute is not available for imported resources.
- secret
Access StringKey - Access key (key is only visible when created, please keep it properly).
- encrypted
Secret stringAccess Key - id string
- The provider-assigned unique ID for this managed resource.
- key
Fingerprint string - Fingerprint of the PGP key used to encrypt the secret. This attribute is not available for imported resources.
- secret
Access stringKey - Access key (key is only visible when created, please keep it properly).
- encrypted_
secret_ straccess_ key - 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_ strkey - Access key (key is only visible when created, please keep it properly).
- encrypted
Secret StringAccess Key - id String
- The provider-assigned unique ID for this managed resource.
- key
Fingerprint String - Fingerprint of the PGP key used to encrypt the secret. This attribute is not available for imported resources.
- secret
Access StringKey - 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.
- Access
Key string - Access_key is the access key identification, required when updating.
- Cam
Access stringKey Id - ID of the resource.
- Encrypted
Secret stringAccess Key - Key
Fingerprint string - Fingerprint of the PGP key used to encrypt the secret. This attribute is not available for imported resources.
- Pgp
Key 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).
- Secret
Access stringKey - Access key (key is only visible when created, please keep it properly).
- Status string
- Key status, activated (Active) or inactive (Inactive), required when updating.
- Target
Uin double - Specify user Uin, if not filled, the access key is created for the current user by default.
- Access
Key string - Access_key is the access key identification, required when updating.
- Cam
Access stringKey Id - ID of the resource.
- Encrypted
Secret stringAccess Key - Key
Fingerprint string - Fingerprint of the PGP key used to encrypt the secret. This attribute is not available for imported resources.
- Pgp
Key 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).
- Secret
Access stringKey - Access key (key is only visible when created, please keep it properly).
- Status string
- Key status, activated (Active) or inactive (Inactive), required when updating.
- Target
Uin float64 - Specify user Uin, if not filled, the access key is created for the current user by default.
- access
Key String - Access_key is the access key identification, required when updating.
- cam
Access StringKey Id - ID of the resource.
- encrypted
Secret StringAccess Key - key
Fingerprint String - Fingerprint of the PGP key used to encrypt the secret. This attribute is not available for imported resources.
- pgp
Key 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).
- secret
Access StringKey - Access key (key is only visible when created, please keep it properly).
- status String
- Key status, activated (Active) or inactive (Inactive), required when updating.
- target
Uin Double - Specify user Uin, if not filled, the access key is created for the current user by default.
- access
Key string - Access_key is the access key identification, required when updating.
- cam
Access stringKey Id - ID of the resource.
- encrypted
Secret stringAccess Key - key
Fingerprint string - Fingerprint of the PGP key used to encrypt the secret. This attribute is not available for imported resources.
- pgp
Key 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).
- secret
Access stringKey - Access key (key is only visible when created, please keep it properly).
- status string
- Key status, activated (Active) or inactive (Inactive), required when updating.
- target
Uin 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_ strkey_ id - ID of the resource.
- encrypted_
secret_ straccess_ key - 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_ strkey - 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.
- access
Key String - Access_key is the access key identification, required when updating.
- cam
Access StringKey Id - ID of the resource.
- encrypted
Secret StringAccess Key - key
Fingerprint String - Fingerprint of the PGP key used to encrypt the secret. This attribute is not available for imported resources.
- pgp
Key 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).
- secret
Access StringKey - Access key (key is only visible when created, please keep it properly).
- status String
- Key status, activated (Active) or inactive (Inactive), required when updating.
- target
Uin 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.