1. Packages
  2. Ucloud Provider
  3. API Docs
  4. IamAccessKey
ucloud 1.39.1 published on Monday, Apr 14, 2025 by ucloud

ucloud.IamAccessKey

Explore with Pulumi AI

Provides an IAM access key resource.

Example Usage

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

const fooIamUser = new ucloud.IamUser("fooIamUser", {
    isFrozen: false,
    loginEnable: false,
});
const fooIamAccessKey = new ucloud.IamAccessKey("fooIamAccessKey", {userName: fooIamUser.name});
Copy
import pulumi
import pulumi_ucloud as ucloud

foo_iam_user = ucloud.IamUser("fooIamUser",
    is_frozen=False,
    login_enable=False)
foo_iam_access_key = ucloud.IamAccessKey("fooIamAccessKey", user_name=foo_iam_user.name)
Copy
package main

import (
	"github.com/pulumi/pulumi-terraform-provider/sdks/go/ucloud/ucloud"
	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)

func main() {
	pulumi.Run(func(ctx *pulumi.Context) error {
		fooIamUser, err := ucloud.NewIamUser(ctx, "fooIamUser", &ucloud.IamUserArgs{
			IsFrozen:    pulumi.Bool(false),
			LoginEnable: pulumi.Bool(false),
		})
		if err != nil {
			return err
		}
		_, err = ucloud.NewIamAccessKey(ctx, "fooIamAccessKey", &ucloud.IamAccessKeyArgs{
			UserName: fooIamUser.Name,
		})
		if err != nil {
			return err
		}
		return nil
	})
}
Copy
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using Ucloud = Pulumi.Ucloud;

return await Deployment.RunAsync(() => 
{
    var fooIamUser = new Ucloud.IamUser("fooIamUser", new()
    {
        IsFrozen = false,
        LoginEnable = false,
    });

    var fooIamAccessKey = new Ucloud.IamAccessKey("fooIamAccessKey", new()
    {
        UserName = fooIamUser.Name,
    });

});
Copy
package generated_program;

import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.ucloud.IamUser;
import com.pulumi.ucloud.IamUserArgs;
import com.pulumi.ucloud.IamAccessKey;
import com.pulumi.ucloud.IamAccessKeyArgs;
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 fooIamUser = new IamUser("fooIamUser", IamUserArgs.builder()
            .isFrozen(false)
            .loginEnable(false)
            .build());

        var fooIamAccessKey = new IamAccessKey("fooIamAccessKey", IamAccessKeyArgs.builder()
            .userName(fooIamUser.name())
            .build());

    }
}
Copy
resources:
  fooIamUser:
    type: ucloud:IamUser
    properties:
      isFrozen: false
      loginEnable: false
  fooIamAccessKey:
    type: ucloud:IamAccessKey
    properties:
      userName: ${fooIamUser.name}
Copy

Create IamAccessKey Resource

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

Constructor syntax

new IamAccessKey(name: string, args: IamAccessKeyArgs, opts?: CustomResourceOptions);
@overload
def IamAccessKey(resource_name: str,
                 args: IamAccessKeyArgs,
                 opts: Optional[ResourceOptions] = None)

@overload
def IamAccessKey(resource_name: str,
                 opts: Optional[ResourceOptions] = None,
                 user_name: Optional[str] = None,
                 iam_access_key_id: Optional[str] = None,
                 pgp_key: Optional[str] = None,
                 secret_file: Optional[str] = None,
                 status: Optional[str] = None)
func NewIamAccessKey(ctx *Context, name string, args IamAccessKeyArgs, opts ...ResourceOption) (*IamAccessKey, error)
public IamAccessKey(string name, IamAccessKeyArgs args, CustomResourceOptions? opts = null)
public IamAccessKey(String name, IamAccessKeyArgs args)
public IamAccessKey(String name, IamAccessKeyArgs args, CustomResourceOptions options)
type: ucloud:IamAccessKey
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 This property is required. IamAccessKeyArgs
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 This property is required. IamAccessKeyArgs
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 This property is required. IamAccessKeyArgs
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 This property is required. IamAccessKeyArgs
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. IamAccessKeyArgs
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 iamAccessKeyResource = new Ucloud.IamAccessKey("iamAccessKeyResource", new()
{
    UserName = "string",
    IamAccessKeyId = "string",
    PgpKey = "string",
    SecretFile = "string",
    Status = "string",
});
Copy
example, err := ucloud.NewIamAccessKey(ctx, "iamAccessKeyResource", &ucloud.IamAccessKeyArgs{
UserName: pulumi.String("string"),
IamAccessKeyId: pulumi.String("string"),
PgpKey: pulumi.String("string"),
SecretFile: pulumi.String("string"),
Status: pulumi.String("string"),
})
Copy
var iamAccessKeyResource = new IamAccessKey("iamAccessKeyResource", IamAccessKeyArgs.builder()
    .userName("string")
    .iamAccessKeyId("string")
    .pgpKey("string")
    .secretFile("string")
    .status("string")
    .build());
Copy
iam_access_key_resource = ucloud.IamAccessKey("iamAccessKeyResource",
    user_name="string",
    iam_access_key_id="string",
    pgp_key="string",
    secret_file="string",
    status="string")
Copy
const iamAccessKeyResource = new ucloud.IamAccessKey("iamAccessKeyResource", {
    userName: "string",
    iamAccessKeyId: "string",
    pgpKey: "string",
    secretFile: "string",
    status: "string",
});
Copy
type: ucloud:IamAccessKey
properties:
    iamAccessKeyId: string
    pgpKey: string
    secretFile: string
    status: string
    userName: string
Copy

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

UserName This property is required. string
Name of the IAM user.
IamAccessKeyId string
The access key ID.
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 name of file that can save access key id and access key secret.
Status string
Status of access key. It must be Active or Inactive. Default value is Active.
UserName This property is required. string
Name of the IAM user.
IamAccessKeyId string
The access key ID.
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 name of file that can save access key id and access key secret.
Status string
Status of access key. It must be Active or Inactive. Default value is Active.
userName This property is required. String
Name of the IAM user.
iamAccessKeyId String
The access key ID.
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 name of file that can save access key id and access key secret.
status String
Status of access key. It must be Active or Inactive. Default value is Active.
userName This property is required. string
Name of the IAM user.
iamAccessKeyId string
The access key ID.
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 name of file that can save access key id and access key secret.
status string
Status of access key. It must be Active or Inactive. Default value is Active.
user_name This property is required. str
Name of the IAM user.
iam_access_key_id str
The access key ID.
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 name of file that can save access key id and access key secret.
status str
Status of access key. It must be Active or Inactive. Default value is Active.
userName This property is required. String
Name of the IAM user.
iamAccessKeyId String
The access key ID.
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 name of file that can save access key id and access key secret.
status String
Status of access key. It must be Active or Inactive. Default value is Active.

Outputs

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

EncryptedSecret string
Id string
The provider-assigned unique ID for this managed resource.
KeyFingerprint string
The fingerprint of the PGP key used to encrypt the secret
Secret string
The secret access key. Note that this will be written to the state file. Alternatively, you may supply a pgp_key instead, which will prevent the secret from being stored in plaintext.
EncryptedSecret string
Id string
The provider-assigned unique ID for this managed resource.
KeyFingerprint string
The fingerprint of the PGP key used to encrypt the secret
Secret string
The secret access key. Note that this will be written to the state file. Alternatively, you may supply a pgp_key instead, which will prevent the secret from being stored in plaintext.
encryptedSecret String
id String
The provider-assigned unique ID for this managed resource.
keyFingerprint String
The fingerprint of the PGP key used to encrypt the secret
secret String
The secret access key. Note that this will be written to the state file. Alternatively, you may supply a pgp_key instead, which will prevent the secret from being stored in plaintext.
encryptedSecret string
id string
The provider-assigned unique ID for this managed resource.
keyFingerprint string
The fingerprint of the PGP key used to encrypt the secret
secret string
The secret access key. Note that this will be written to the state file. Alternatively, you may supply a pgp_key instead, which will prevent the secret from being stored in plaintext.
encrypted_secret str
id str
The provider-assigned unique ID for this managed resource.
key_fingerprint str
The fingerprint of the PGP key used to encrypt the secret
secret str
The secret access key. Note that this will be written to the state file. Alternatively, you may supply a pgp_key instead, which will prevent the secret from being stored in plaintext.
encryptedSecret String
id String
The provider-assigned unique ID for this managed resource.
keyFingerprint String
The fingerprint of the PGP key used to encrypt the secret
secret String
The secret access key. Note that this will be written to the state file. Alternatively, you may supply a pgp_key instead, which will prevent the secret from being stored in plaintext.

Look up Existing IamAccessKey Resource

Get an existing IamAccessKey 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?: IamAccessKeyState, opts?: CustomResourceOptions): IamAccessKey
@staticmethod
def get(resource_name: str,
        id: str,
        opts: Optional[ResourceOptions] = None,
        encrypted_secret: Optional[str] = None,
        iam_access_key_id: 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) -> IamAccessKey
func GetIamAccessKey(ctx *Context, name string, id IDInput, state *IamAccessKeyState, opts ...ResourceOption) (*IamAccessKey, error)
public static IamAccessKey Get(string name, Input<string> id, IamAccessKeyState? state, CustomResourceOptions? opts = null)
public static IamAccessKey get(String name, Output<String> id, IamAccessKeyState state, CustomResourceOptions options)
resources:  _:    type: ucloud:IamAccessKey    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:
EncryptedSecret string
IamAccessKeyId string
The access key ID.
KeyFingerprint string
The fingerprint of the PGP key used to encrypt the 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 access key. Note that this will be written to the state file. Alternatively, you may supply a pgp_key instead, which will prevent the secret from being stored in plaintext.
SecretFile string
The name of file that can save access key id and access key secret.
Status string
Status of access key. It must be Active or Inactive. Default value is Active.
UserName string
Name of the IAM user.
EncryptedSecret string
IamAccessKeyId string
The access key ID.
KeyFingerprint string
The fingerprint of the PGP key used to encrypt the 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 access key. Note that this will be written to the state file. Alternatively, you may supply a pgp_key instead, which will prevent the secret from being stored in plaintext.
SecretFile string
The name of file that can save access key id and access key secret.
Status string
Status of access key. It must be Active or Inactive. Default value is Active.
UserName string
Name of the IAM user.
encryptedSecret String
iamAccessKeyId String
The access key ID.
keyFingerprint String
The fingerprint of the PGP key used to encrypt the 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 access key. Note that this will be written to the state file. Alternatively, you may supply a pgp_key instead, which will prevent the secret from being stored in plaintext.
secretFile String
The name of file that can save access key id and access key secret.
status String
Status of access key. It must be Active or Inactive. Default value is Active.
userName String
Name of the IAM user.
encryptedSecret string
iamAccessKeyId string
The access key ID.
keyFingerprint string
The fingerprint of the PGP key used to encrypt the 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 access key. Note that this will be written to the state file. Alternatively, you may supply a pgp_key instead, which will prevent the secret from being stored in plaintext.
secretFile string
The name of file that can save access key id and access key secret.
status string
Status of access key. It must be Active or Inactive. Default value is Active.
userName string
Name of the IAM user.
encrypted_secret str
iam_access_key_id str
The access key ID.
key_fingerprint str
The fingerprint of the PGP key used to encrypt the 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 access key. Note that this will be written to the state file. Alternatively, you may supply a pgp_key instead, which will prevent the secret from being stored in plaintext.
secret_file str
The name of file that can save access key id and access key secret.
status str
Status of access key. It must be Active or Inactive. Default value is Active.
user_name str
Name of the IAM user.
encryptedSecret String
iamAccessKeyId String
The access key ID.
keyFingerprint String
The fingerprint of the PGP key used to encrypt the 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 access key. Note that this will be written to the state file. Alternatively, you may supply a pgp_key instead, which will prevent the secret from being stored in plaintext.
secretFile String
The name of file that can save access key id and access key secret.
status String
Status of access key. It must be Active or Inactive. Default value is Active.
userName String
Name of the IAM user.

Package Details

Repository
ucloud ucloud/terraform-provider-ucloud
License
Notes
This Pulumi package is based on the ucloud Terraform Provider.