dew

package
v0.0.8 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jul 28, 2023 License: Apache-2.0 Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func PkgVersion added in v0.0.2

func PkgVersion() (semver.Version, error)

PkgVersion uses reflection to determine the version of the current package. If a version cannot be determined, v1 will be assumed. The second return value is always nil.

Types

type GetCsmsSecretVersionArgs

type GetCsmsSecretVersionArgs struct {
	// Specifies the region in which to obtain the CSMS secrets.
	// If omitted, the provider-level region will be used.
	Region *string `pulumi:"region"`
	// The name of the CSMS secret to query.
	SecretName string `pulumi:"secretName"`
	// The version ID of the CSMS secret version to query.
	// If omitted, the latest version will be used.
	Version *string `pulumi:"version"`
}

A collection of arguments for invoking getCsmsSecretVersion.

type GetCsmsSecretVersionOutputArgs

type GetCsmsSecretVersionOutputArgs struct {
	// Specifies the region in which to obtain the CSMS secrets.
	// If omitted, the provider-level region will be used.
	Region pulumi.StringPtrInput `pulumi:"region"`
	// The name of the CSMS secret to query.
	SecretName pulumi.StringInput `pulumi:"secretName"`
	// The version ID of the CSMS secret version to query.
	// If omitted, the latest version will be used.
	Version pulumi.StringPtrInput `pulumi:"version"`
}

A collection of arguments for invoking getCsmsSecretVersion.

func (GetCsmsSecretVersionOutputArgs) ElementType

type GetCsmsSecretVersionResult

type GetCsmsSecretVersionResult struct {
	// Time when the CSMS secret version created, in UTC format.
	CreatedAt string `pulumi:"createdAt"`
	// The provider-assigned unique ID for this managed resource.
	Id string `pulumi:"id"`
	// The ID of the KMS CMK used for secret encryption.
	KmsKeyId   string `pulumi:"kmsKeyId"`
	Region     string `pulumi:"region"`
	SecretName string `pulumi:"secretName"`
	// The plaintext of a secret in text format.
	SecretText string `pulumi:"secretText"`
	// The status of the CSMS secret version.
	Statuses []string `pulumi:"statuses"`
	Version  string   `pulumi:"version"`
}

A collection of values returned by getCsmsSecretVersion.

func GetCsmsSecretVersion

func GetCsmsSecretVersion(ctx *pulumi.Context, args *GetCsmsSecretVersionArgs, opts ...pulumi.InvokeOption) (*GetCsmsSecretVersionResult, error)

Use this data source to query the version and plaintext of the CSMS(Cloud Secret Management Service) secret.

## Example Usage

```go package main

import (

"github.com/huaweicloud/pulumi-huaweicloud/sdk/go/huaweicloud/Dew"
"github.com/pulumi/pulumi-huaweicloud/sdk/go/huaweicloud/Dew"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"

)

func main() {
	pulumi.Run(func(ctx *pulumi.Context) error {
		_, err := Dew.GetCsmsSecretVersion(ctx, &dew.GetCsmsSecretVersionArgs{
			SecretName: "your_secret_name",
		}, nil)
		if err != nil {
			return err
		}
		return nil
	})
}

```

type GetCsmsSecretVersionResultOutput

type GetCsmsSecretVersionResultOutput struct{ *pulumi.OutputState }

A collection of values returned by getCsmsSecretVersion.

func (GetCsmsSecretVersionResultOutput) CreatedAt

Time when the CSMS secret version created, in UTC format.

func (GetCsmsSecretVersionResultOutput) ElementType

func (GetCsmsSecretVersionResultOutput) Id

The provider-assigned unique ID for this managed resource.

func (GetCsmsSecretVersionResultOutput) KmsKeyId

The ID of the KMS CMK used for secret encryption.

func (GetCsmsSecretVersionResultOutput) Region

func (GetCsmsSecretVersionResultOutput) SecretName

func (GetCsmsSecretVersionResultOutput) SecretText

The plaintext of a secret in text format.

func (GetCsmsSecretVersionResultOutput) Statuses

The status of the CSMS secret version.

func (GetCsmsSecretVersionResultOutput) ToGetCsmsSecretVersionResultOutput

func (o GetCsmsSecretVersionResultOutput) ToGetCsmsSecretVersionResultOutput() GetCsmsSecretVersionResultOutput

func (GetCsmsSecretVersionResultOutput) ToGetCsmsSecretVersionResultOutputWithContext

func (o GetCsmsSecretVersionResultOutput) ToGetCsmsSecretVersionResultOutputWithContext(ctx context.Context) GetCsmsSecretVersionResultOutput

func (GetCsmsSecretVersionResultOutput) Version

type GetDataKeyArgs

type GetDataKeyArgs struct {
	// Number of bits in the length of a DEK (data encryption keys). The maximum number
	// is 512. Changing this gets the new data encryption key.
	DatakeyLength string `pulumi:"datakeyLength"`
	// The value of this parameter must be a series of
	// "key:value" pairs used to record resource context information. The value of this parameter must not contain sensitive
	// information and must be within 8192 characters in length. Example: {"Key1":"Value1","Key2":"Value2"}
	EncryptionContext *string `pulumi:"encryptionContext"`
	// The globally unique identifier for the key. Changing this gets the new data encryption
	// key.
	KeyId string `pulumi:"keyId"`
	// The region in which to obtain the keys. If omitted, the provider-level region will be
	// used.
	Region *string `pulumi:"region"`
}

A collection of arguments for invoking getDataKey.

type GetDataKeyOutputArgs

type GetDataKeyOutputArgs struct {
	// Number of bits in the length of a DEK (data encryption keys). The maximum number
	// is 512. Changing this gets the new data encryption key.
	DatakeyLength pulumi.StringInput `pulumi:"datakeyLength"`
	// The value of this parameter must be a series of
	// "key:value" pairs used to record resource context information. The value of this parameter must not contain sensitive
	// information and must be within 8192 characters in length. Example: {"Key1":"Value1","Key2":"Value2"}
	EncryptionContext pulumi.StringPtrInput `pulumi:"encryptionContext"`
	// The globally unique identifier for the key. Changing this gets the new data encryption
	// key.
	KeyId pulumi.StringInput `pulumi:"keyId"`
	// The region in which to obtain the keys. If omitted, the provider-level region will be
	// used.
	Region pulumi.StringPtrInput `pulumi:"region"`
}

A collection of arguments for invoking getDataKey.

func (GetDataKeyOutputArgs) ElementType

func (GetDataKeyOutputArgs) ElementType() reflect.Type

type GetDataKeyResult

type GetDataKeyResult struct {
	// The ciphertext of a DEK is expressed in hexadecimal format, and two characters indicate one byte.
	CipherText        string  `pulumi:"cipherText"`
	DatakeyLength     string  `pulumi:"datakeyLength"`
	EncryptionContext *string `pulumi:"encryptionContext"`
	// The provider-assigned unique ID for this managed resource.
	Id    string `pulumi:"id"`
	KeyId string `pulumi:"keyId"`
	// The plaintext of a DEK is expressed in hexadecimal format, and two characters indicate one byte.
	PlainText string `pulumi:"plainText"`
	Region    string `pulumi:"region"`
}

A collection of values returned by getDataKey.

func GetDataKey

func GetDataKey(ctx *pulumi.Context, args *GetDataKeyArgs, opts ...pulumi.InvokeOption) (*GetDataKeyResult, error)

Use this data source to get the plaintext and the ciphertext of an available HuaweiCloud KMS DEK (data encryption key).

## Example Usage

```go package main

import (

"github.com/huaweicloud/pulumi-huaweicloud/sdk/go/huaweicloud/Dew"
"github.com/pulumi/pulumi-huaweicloud/sdk/go/huaweicloud/Dew"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"

)

func main() {
	pulumi.Run(func(ctx *pulumi.Context) error {
		key1, err := Dew.NewKey(ctx, "key1", &Dew.KeyArgs{
			KeyAlias:       pulumi.String("key_1"),
			PendingDays:    pulumi.String("7"),
			KeyDescription: pulumi.String("first test key"),
		})
		if err != nil {
			return err
		}
		_ = Dew.GetDataKeyOutput(ctx, dew.GetDataKeyOutputArgs{
			KeyId:         key1.ID(),
			DatakeyLength: pulumi.String("512"),
		}, nil)
		return nil
	})
}

```

type GetDataKeyResultOutput

type GetDataKeyResultOutput struct{ *pulumi.OutputState }

A collection of values returned by getDataKey.

func (GetDataKeyResultOutput) CipherText

The ciphertext of a DEK is expressed in hexadecimal format, and two characters indicate one byte.

func (GetDataKeyResultOutput) DatakeyLength

func (o GetDataKeyResultOutput) DatakeyLength() pulumi.StringOutput

func (GetDataKeyResultOutput) ElementType

func (GetDataKeyResultOutput) ElementType() reflect.Type

func (GetDataKeyResultOutput) EncryptionContext

func (o GetDataKeyResultOutput) EncryptionContext() pulumi.StringPtrOutput

func (GetDataKeyResultOutput) Id

The provider-assigned unique ID for this managed resource.

func (GetDataKeyResultOutput) KeyId

func (GetDataKeyResultOutput) PlainText

The plaintext of a DEK is expressed in hexadecimal format, and two characters indicate one byte.

func (GetDataKeyResultOutput) Region

func (GetDataKeyResultOutput) ToGetDataKeyResultOutput

func (o GetDataKeyResultOutput) ToGetDataKeyResultOutput() GetDataKeyResultOutput

func (GetDataKeyResultOutput) ToGetDataKeyResultOutputWithContext

func (o GetDataKeyResultOutput) ToGetDataKeyResultOutputWithContext(ctx context.Context) GetDataKeyResultOutput

type GetKeypairsArgs

type GetKeypairsArgs struct {
	// Specifies the fingerprint of the keypair.
	Fingerprint *string `pulumi:"fingerprint"`
	// Specifies whether the private key is managed by HuaweiCloud.
	IsManaged *bool `pulumi:"isManaged"`
	// Specifies the name of the keypair.
	Name *string `pulumi:"name"`
	// Specifies the imported OpenSSH-formatted public key.
	PublicKey *string `pulumi:"publicKey"`
	// The region in which to obtain the keypairs. If omitted, the provider-level region will
	// be used.
	Region *string `pulumi:"region"`
}

A collection of arguments for invoking getKeypairs.

type GetKeypairsKeypair

type GetKeypairsKeypair struct {
	// Specifies the fingerprint of the keypair.
	Fingerprint string `pulumi:"fingerprint"`
	// Specifies whether the private key is managed by HuaweiCloud.
	IsManaged bool `pulumi:"isManaged"`
	// Specifies the name of the keypair.
	Name string `pulumi:"name"`
	// Specifies the imported OpenSSH-formatted public key.
	PublicKey string `pulumi:"publicKey"`
	// Indicates the scope of key pair. The value can be **account**or **user**.
	Scope string `pulumi:"scope"`
}

type GetKeypairsKeypairArgs

type GetKeypairsKeypairArgs struct {
	// Specifies the fingerprint of the keypair.
	Fingerprint pulumi.StringInput `pulumi:"fingerprint"`
	// Specifies whether the private key is managed by HuaweiCloud.
	IsManaged pulumi.BoolInput `pulumi:"isManaged"`
	// Specifies the name of the keypair.
	Name pulumi.StringInput `pulumi:"name"`
	// Specifies the imported OpenSSH-formatted public key.
	PublicKey pulumi.StringInput `pulumi:"publicKey"`
	// Indicates the scope of key pair. The value can be **account**or **user**.
	Scope pulumi.StringInput `pulumi:"scope"`
}

func (GetKeypairsKeypairArgs) ElementType

func (GetKeypairsKeypairArgs) ElementType() reflect.Type

func (GetKeypairsKeypairArgs) ToGetKeypairsKeypairOutput

func (i GetKeypairsKeypairArgs) ToGetKeypairsKeypairOutput() GetKeypairsKeypairOutput

func (GetKeypairsKeypairArgs) ToGetKeypairsKeypairOutputWithContext

func (i GetKeypairsKeypairArgs) ToGetKeypairsKeypairOutputWithContext(ctx context.Context) GetKeypairsKeypairOutput

type GetKeypairsKeypairArray

type GetKeypairsKeypairArray []GetKeypairsKeypairInput

func (GetKeypairsKeypairArray) ElementType

func (GetKeypairsKeypairArray) ElementType() reflect.Type

func (GetKeypairsKeypairArray) ToGetKeypairsKeypairArrayOutput

func (i GetKeypairsKeypairArray) ToGetKeypairsKeypairArrayOutput() GetKeypairsKeypairArrayOutput

func (GetKeypairsKeypairArray) ToGetKeypairsKeypairArrayOutputWithContext

func (i GetKeypairsKeypairArray) ToGetKeypairsKeypairArrayOutputWithContext(ctx context.Context) GetKeypairsKeypairArrayOutput

type GetKeypairsKeypairArrayInput

type GetKeypairsKeypairArrayInput interface {
	pulumi.Input

	ToGetKeypairsKeypairArrayOutput() GetKeypairsKeypairArrayOutput
	ToGetKeypairsKeypairArrayOutputWithContext(context.Context) GetKeypairsKeypairArrayOutput
}

GetKeypairsKeypairArrayInput is an input type that accepts GetKeypairsKeypairArray and GetKeypairsKeypairArrayOutput values. You can construct a concrete instance of `GetKeypairsKeypairArrayInput` via:

GetKeypairsKeypairArray{ GetKeypairsKeypairArgs{...} }

type GetKeypairsKeypairArrayOutput

type GetKeypairsKeypairArrayOutput struct{ *pulumi.OutputState }

func (GetKeypairsKeypairArrayOutput) ElementType

func (GetKeypairsKeypairArrayOutput) Index

func (GetKeypairsKeypairArrayOutput) ToGetKeypairsKeypairArrayOutput

func (o GetKeypairsKeypairArrayOutput) ToGetKeypairsKeypairArrayOutput() GetKeypairsKeypairArrayOutput

func (GetKeypairsKeypairArrayOutput) ToGetKeypairsKeypairArrayOutputWithContext

func (o GetKeypairsKeypairArrayOutput) ToGetKeypairsKeypairArrayOutputWithContext(ctx context.Context) GetKeypairsKeypairArrayOutput

type GetKeypairsKeypairInput

type GetKeypairsKeypairInput interface {
	pulumi.Input

	ToGetKeypairsKeypairOutput() GetKeypairsKeypairOutput
	ToGetKeypairsKeypairOutputWithContext(context.Context) GetKeypairsKeypairOutput
}

GetKeypairsKeypairInput is an input type that accepts GetKeypairsKeypairArgs and GetKeypairsKeypairOutput values. You can construct a concrete instance of `GetKeypairsKeypairInput` via:

GetKeypairsKeypairArgs{...}

type GetKeypairsKeypairOutput

type GetKeypairsKeypairOutput struct{ *pulumi.OutputState }

func (GetKeypairsKeypairOutput) ElementType

func (GetKeypairsKeypairOutput) ElementType() reflect.Type

func (GetKeypairsKeypairOutput) Fingerprint

Specifies the fingerprint of the keypair.

func (GetKeypairsKeypairOutput) IsManaged

Specifies whether the private key is managed by HuaweiCloud.

func (GetKeypairsKeypairOutput) Name

Specifies the name of the keypair.

func (GetKeypairsKeypairOutput) PublicKey

Specifies the imported OpenSSH-formatted public key.

func (GetKeypairsKeypairOutput) Scope

Indicates the scope of key pair. The value can be **account**or **user**.

func (GetKeypairsKeypairOutput) ToGetKeypairsKeypairOutput

func (o GetKeypairsKeypairOutput) ToGetKeypairsKeypairOutput() GetKeypairsKeypairOutput

func (GetKeypairsKeypairOutput) ToGetKeypairsKeypairOutputWithContext

func (o GetKeypairsKeypairOutput) ToGetKeypairsKeypairOutputWithContext(ctx context.Context) GetKeypairsKeypairOutput

type GetKeypairsOutputArgs

type GetKeypairsOutputArgs struct {
	// Specifies the fingerprint of the keypair.
	Fingerprint pulumi.StringPtrInput `pulumi:"fingerprint"`
	// Specifies whether the private key is managed by HuaweiCloud.
	IsManaged pulumi.BoolPtrInput `pulumi:"isManaged"`
	// Specifies the name of the keypair.
	Name pulumi.StringPtrInput `pulumi:"name"`
	// Specifies the imported OpenSSH-formatted public key.
	PublicKey pulumi.StringPtrInput `pulumi:"publicKey"`
	// The region in which to obtain the keypairs. If omitted, the provider-level region will
	// be used.
	Region pulumi.StringPtrInput `pulumi:"region"`
}

A collection of arguments for invoking getKeypairs.

func (GetKeypairsOutputArgs) ElementType

func (GetKeypairsOutputArgs) ElementType() reflect.Type

type GetKeypairsResult

type GetKeypairsResult struct {
	// Indicates the fingerprint information about an key pair.
	Fingerprint *string `pulumi:"fingerprint"`
	// The provider-assigned unique ID for this managed resource.
	Id string `pulumi:"id"`
	// Indicates whether the private key is managed by HuaweiCloud.
	IsManaged *bool `pulumi:"isManaged"`
	// Indicates a list of all keypairs found. Structure is documented below.
	Keypairs []GetKeypairsKeypair `pulumi:"keypairs"`
	// Indicates the name of the keypair.
	Name *string `pulumi:"name"`
	// Indicates the imported OpenSSH-formatted public key.
	PublicKey *string `pulumi:"publicKey"`
	Region    *string `pulumi:"region"`
}

A collection of values returned by getKeypairs.

func GetKeypairs

func GetKeypairs(ctx *pulumi.Context, args *GetKeypairsArgs, opts ...pulumi.InvokeOption) (*GetKeypairsResult, error)

Use this data source to get a list of keypairs.

## Example Usage

```go package main

import (

"github.com/huaweicloud/pulumi-huaweicloud/sdk/go/huaweicloud/Dew"
"github.com/pulumi/pulumi-huaweicloud/sdk/go/huaweicloud/Dew"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi/config"

)

func main() {
	pulumi.Run(func(ctx *pulumi.Context) error {
		cfg := config.New(ctx, "")
		keypairName := cfg.RequireObject("keypairName")
		_, err := Dew.GetKeypairs(ctx, &dew.GetKeypairsArgs{
			Name: pulumi.StringRef(keypairName),
		}, nil)
		if err != nil {
			return err
		}
		return nil
	})
}

```

type GetKeypairsResultOutput

type GetKeypairsResultOutput struct{ *pulumi.OutputState }

A collection of values returned by getKeypairs.

func (GetKeypairsResultOutput) ElementType

func (GetKeypairsResultOutput) ElementType() reflect.Type

func (GetKeypairsResultOutput) Fingerprint

Indicates the fingerprint information about an key pair.

func (GetKeypairsResultOutput) Id

The provider-assigned unique ID for this managed resource.

func (GetKeypairsResultOutput) IsManaged

Indicates whether the private key is managed by HuaweiCloud.

func (GetKeypairsResultOutput) Keypairs

Indicates a list of all keypairs found. Structure is documented below.

func (GetKeypairsResultOutput) Name

Indicates the name of the keypair.

func (GetKeypairsResultOutput) PublicKey

Indicates the imported OpenSSH-formatted public key.

func (GetKeypairsResultOutput) Region

func (GetKeypairsResultOutput) ToGetKeypairsResultOutput

func (o GetKeypairsResultOutput) ToGetKeypairsResultOutput() GetKeypairsResultOutput

func (GetKeypairsResultOutput) ToGetKeypairsResultOutputWithContext

func (o GetKeypairsResultOutput) ToGetKeypairsResultOutputWithContext(ctx context.Context) GetKeypairsResultOutput

type Key

type Key struct {
	pulumi.CustomResourceState

	// Creation time (time stamp) of a key.
	CreationDate pulumi.StringOutput `pulumi:"creationDate"`
	// Identification of a Master Key. The value 1 indicates a Default Master Key, and the value 0
	// indicates a key.
	DefaultKeyFlag pulumi.StringOutput `pulumi:"defaultKeyFlag"`
	// ID of a user domain for the key.
	DomainId pulumi.StringOutput `pulumi:"domainId"`
	// The enterprise project id of the kms key. Changing this creates
	// a new key.
	EnterpriseProjectId pulumi.StringOutput `pulumi:"enterpriseProjectId"`
	// Expiration time.
	ExpirationTime pulumi.StringOutput `pulumi:"expirationTime"`
	// Specifies whether the key is enabled. Defaults to true. Changing this updates the
	// state of existing key.
	IsEnabled pulumi.BoolPtrOutput `pulumi:"isEnabled"`
	// The algorithm of the key. Valid values are AES_256, SM4, RSA_2048, RSA_3072,
	// RSA_4096, EC_P256, EC_P384, SM2. Changing this creates a new key.
	KeyAlgorithm pulumi.StringOutput `pulumi:"keyAlgorithm"`
	// The alias in which to create the key. It is required when we create a new key.
	// Changing this updates the alias of key.
	KeyAlias pulumi.StringOutput `pulumi:"keyAlias"`
	// The description of the key as viewed in Huawei console. Changing this updates
	// the description of key.
	KeyDescription pulumi.StringPtrOutput `pulumi:"keyDescription"`
	// The globally unique identifier for the key.
	KeyId pulumi.StringOutput `pulumi:"keyId"`
	// Duration in days after which the key is deleted after destruction of the resource,
	// must be between 7 and 1096 days. It doesn't have default value. It only be used when delete a key.
	PendingDays pulumi.StringPtrOutput `pulumi:"pendingDays"`
	// The region in which to create the KMS key resource. If omitted, the
	// provider-level region will be used. Changing this creates a new KMS key resource.
	Region pulumi.StringOutput `pulumi:"region"`
	// Specifies whether the key rotation is enabled. Defaults to false.
	RotationEnabled pulumi.BoolPtrOutput `pulumi:"rotationEnabled"`
	// Specifies the key rotation interval. The valid value is range from 30 to 365,
	// defaults to 365.
	RotationInterval pulumi.IntOutput `pulumi:"rotationInterval"`
	// The total number of key rotations.
	RotationNumber pulumi.IntOutput `pulumi:"rotationNumber"`
	// Scheduled deletion time (time stamp) of a key.
	ScheduledDeletionDate pulumi.StringOutput `pulumi:"scheduledDeletionDate"`
	// Specifies the key/value pairs to associate with the kms key.
	Tags pulumi.StringMapOutput `pulumi:"tags"`
}

Manages a KMS key resource within HuaweiCloud.

## Example Usage

```go package main

import (

"github.com/huaweicloud/pulumi-huaweicloud/sdk/go/huaweicloud/Dew"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"

)

func main() {
	pulumi.Run(func(ctx *pulumi.Context) error {
		_, err := Dew.NewKey(ctx, "key1", &Dew.KeyArgs{
			IsEnabled:      pulumi.Bool(true),
			KeyAlias:       pulumi.String("key_1"),
			KeyDescription: pulumi.String("first test key"),
			PendingDays:    pulumi.String("7"),
		})
		if err != nil {
			return err
		}
		return nil
	})
}

```

## Import

KMS Keys can be imported using the `id`, e.g.

```sh

$ pulumi import huaweicloud:Dew/key:Key key_1 7056d636-ac60-4663-8a6c-82d3c32c1c64

```

Note that the imported state may not be identical to your resource definition, due to `pending_days` is missing from the API response. It is generally recommended running `terraform plan` after importing a KMS Key. You can then decide if changes should be applied to the KMS Key, or the resource definition should be updated to align with the KMS Key. Also you can ignore changes as below. resource "huaweicloud_kms_key" "key_1" {

...

lifecycle {

ignore_changes = [ pending_days ]

} }

func GetKey

func GetKey(ctx *pulumi.Context,
	name string, id pulumi.IDInput, state *KeyState, opts ...pulumi.ResourceOption) (*Key, error)

GetKey gets an existing Key resource's state with the given name, ID, and optional state properties that are used to uniquely qualify the lookup (nil if not required).

func NewKey

func NewKey(ctx *pulumi.Context,
	name string, args *KeyArgs, opts ...pulumi.ResourceOption) (*Key, error)

NewKey registers a new resource with the given unique name, arguments, and options.

func (*Key) ElementType

func (*Key) ElementType() reflect.Type

func (*Key) ToKeyOutput

func (i *Key) ToKeyOutput() KeyOutput

func (*Key) ToKeyOutputWithContext

func (i *Key) ToKeyOutputWithContext(ctx context.Context) KeyOutput

type KeyArgs

type KeyArgs struct {
	// The enterprise project id of the kms key. Changing this creates
	// a new key.
	EnterpriseProjectId pulumi.StringPtrInput
	// Specifies whether the key is enabled. Defaults to true. Changing this updates the
	// state of existing key.
	IsEnabled pulumi.BoolPtrInput
	// The algorithm of the key. Valid values are AES_256, SM4, RSA_2048, RSA_3072,
	// RSA_4096, EC_P256, EC_P384, SM2. Changing this creates a new key.
	KeyAlgorithm pulumi.StringPtrInput
	// The alias in which to create the key. It is required when we create a new key.
	// Changing this updates the alias of key.
	KeyAlias pulumi.StringInput
	// The description of the key as viewed in Huawei console. Changing this updates
	// the description of key.
	KeyDescription pulumi.StringPtrInput
	// Duration in days after which the key is deleted after destruction of the resource,
	// must be between 7 and 1096 days. It doesn't have default value. It only be used when delete a key.
	PendingDays pulumi.StringPtrInput
	// The region in which to create the KMS key resource. If omitted, the
	// provider-level region will be used. Changing this creates a new KMS key resource.
	Region pulumi.StringPtrInput
	// Specifies whether the key rotation is enabled. Defaults to false.
	RotationEnabled pulumi.BoolPtrInput
	// Specifies the key rotation interval. The valid value is range from 30 to 365,
	// defaults to 365.
	RotationInterval pulumi.IntPtrInput
	// Specifies the key/value pairs to associate with the kms key.
	Tags pulumi.StringMapInput
}

The set of arguments for constructing a Key resource.

func (KeyArgs) ElementType

func (KeyArgs) ElementType() reflect.Type

type KeyArray

type KeyArray []KeyInput

func (KeyArray) ElementType

func (KeyArray) ElementType() reflect.Type

func (KeyArray) ToKeyArrayOutput

func (i KeyArray) ToKeyArrayOutput() KeyArrayOutput

func (KeyArray) ToKeyArrayOutputWithContext

func (i KeyArray) ToKeyArrayOutputWithContext(ctx context.Context) KeyArrayOutput

type KeyArrayInput

type KeyArrayInput interface {
	pulumi.Input

	ToKeyArrayOutput() KeyArrayOutput
	ToKeyArrayOutputWithContext(context.Context) KeyArrayOutput
}

KeyArrayInput is an input type that accepts KeyArray and KeyArrayOutput values. You can construct a concrete instance of `KeyArrayInput` via:

KeyArray{ KeyArgs{...} }

type KeyArrayOutput

type KeyArrayOutput struct{ *pulumi.OutputState }

func (KeyArrayOutput) ElementType

func (KeyArrayOutput) ElementType() reflect.Type

func (KeyArrayOutput) Index

func (KeyArrayOutput) ToKeyArrayOutput

func (o KeyArrayOutput) ToKeyArrayOutput() KeyArrayOutput

func (KeyArrayOutput) ToKeyArrayOutputWithContext

func (o KeyArrayOutput) ToKeyArrayOutputWithContext(ctx context.Context) KeyArrayOutput

type KeyInput

type KeyInput interface {
	pulumi.Input

	ToKeyOutput() KeyOutput
	ToKeyOutputWithContext(ctx context.Context) KeyOutput
}

type KeyMap

type KeyMap map[string]KeyInput

func (KeyMap) ElementType

func (KeyMap) ElementType() reflect.Type

func (KeyMap) ToKeyMapOutput

func (i KeyMap) ToKeyMapOutput() KeyMapOutput

func (KeyMap) ToKeyMapOutputWithContext

func (i KeyMap) ToKeyMapOutputWithContext(ctx context.Context) KeyMapOutput

type KeyMapInput

type KeyMapInput interface {
	pulumi.Input

	ToKeyMapOutput() KeyMapOutput
	ToKeyMapOutputWithContext(context.Context) KeyMapOutput
}

KeyMapInput is an input type that accepts KeyMap and KeyMapOutput values. You can construct a concrete instance of `KeyMapInput` via:

KeyMap{ "key": KeyArgs{...} }

type KeyMapOutput

type KeyMapOutput struct{ *pulumi.OutputState }

func (KeyMapOutput) ElementType

func (KeyMapOutput) ElementType() reflect.Type

func (KeyMapOutput) MapIndex

func (o KeyMapOutput) MapIndex(k pulumi.StringInput) KeyOutput

func (KeyMapOutput) ToKeyMapOutput

func (o KeyMapOutput) ToKeyMapOutput() KeyMapOutput

func (KeyMapOutput) ToKeyMapOutputWithContext

func (o KeyMapOutput) ToKeyMapOutputWithContext(ctx context.Context) KeyMapOutput

type KeyOutput

type KeyOutput struct{ *pulumi.OutputState }

func (KeyOutput) CreationDate

func (o KeyOutput) CreationDate() pulumi.StringOutput

Creation time (time stamp) of a key.

func (KeyOutput) DefaultKeyFlag

func (o KeyOutput) DefaultKeyFlag() pulumi.StringOutput

Identification of a Master Key. The value 1 indicates a Default Master Key, and the value 0 indicates a key.

func (KeyOutput) DomainId

func (o KeyOutput) DomainId() pulumi.StringOutput

ID of a user domain for the key.

func (KeyOutput) ElementType

func (KeyOutput) ElementType() reflect.Type

func (KeyOutput) EnterpriseProjectId

func (o KeyOutput) EnterpriseProjectId() pulumi.StringOutput

The enterprise project id of the kms key. Changing this creates a new key.

func (KeyOutput) ExpirationTime

func (o KeyOutput) ExpirationTime() pulumi.StringOutput

Expiration time.

func (KeyOutput) IsEnabled

func (o KeyOutput) IsEnabled() pulumi.BoolPtrOutput

Specifies whether the key is enabled. Defaults to true. Changing this updates the state of existing key.

func (KeyOutput) KeyAlgorithm

func (o KeyOutput) KeyAlgorithm() pulumi.StringOutput

The algorithm of the key. Valid values are AES_256, SM4, RSA_2048, RSA_3072, RSA_4096, EC_P256, EC_P384, SM2. Changing this creates a new key.

func (KeyOutput) KeyAlias

func (o KeyOutput) KeyAlias() pulumi.StringOutput

The alias in which to create the key. It is required when we create a new key. Changing this updates the alias of key.

func (KeyOutput) KeyDescription

func (o KeyOutput) KeyDescription() pulumi.StringPtrOutput

The description of the key as viewed in Huawei console. Changing this updates the description of key.

func (KeyOutput) KeyId

func (o KeyOutput) KeyId() pulumi.StringOutput

The globally unique identifier for the key.

func (KeyOutput) PendingDays

func (o KeyOutput) PendingDays() pulumi.StringPtrOutput

Duration in days after which the key is deleted after destruction of the resource, must be between 7 and 1096 days. It doesn't have default value. It only be used when delete a key.

func (KeyOutput) Region

func (o KeyOutput) Region() pulumi.StringOutput

The region in which to create the KMS key resource. If omitted, the provider-level region will be used. Changing this creates a new KMS key resource.

func (KeyOutput) RotationEnabled

func (o KeyOutput) RotationEnabled() pulumi.BoolPtrOutput

Specifies whether the key rotation is enabled. Defaults to false.

func (KeyOutput) RotationInterval

func (o KeyOutput) RotationInterval() pulumi.IntOutput

Specifies the key rotation interval. The valid value is range from 30 to 365, defaults to 365.

func (KeyOutput) RotationNumber

func (o KeyOutput) RotationNumber() pulumi.IntOutput

The total number of key rotations.

func (KeyOutput) ScheduledDeletionDate

func (o KeyOutput) ScheduledDeletionDate() pulumi.StringOutput

Scheduled deletion time (time stamp) of a key.

func (KeyOutput) Tags

func (o KeyOutput) Tags() pulumi.StringMapOutput

Specifies the key/value pairs to associate with the kms key.

func (KeyOutput) ToKeyOutput

func (o KeyOutput) ToKeyOutput() KeyOutput

func (KeyOutput) ToKeyOutputWithContext

func (o KeyOutput) ToKeyOutputWithContext(ctx context.Context) KeyOutput

type KeyState

type KeyState struct {
	// Creation time (time stamp) of a key.
	CreationDate pulumi.StringPtrInput
	// Identification of a Master Key. The value 1 indicates a Default Master Key, and the value 0
	// indicates a key.
	DefaultKeyFlag pulumi.StringPtrInput
	// ID of a user domain for the key.
	DomainId pulumi.StringPtrInput
	// The enterprise project id of the kms key. Changing this creates
	// a new key.
	EnterpriseProjectId pulumi.StringPtrInput
	// Expiration time.
	ExpirationTime pulumi.StringPtrInput
	// Specifies whether the key is enabled. Defaults to true. Changing this updates the
	// state of existing key.
	IsEnabled pulumi.BoolPtrInput
	// The algorithm of the key. Valid values are AES_256, SM4, RSA_2048, RSA_3072,
	// RSA_4096, EC_P256, EC_P384, SM2. Changing this creates a new key.
	KeyAlgorithm pulumi.StringPtrInput
	// The alias in which to create the key. It is required when we create a new key.
	// Changing this updates the alias of key.
	KeyAlias pulumi.StringPtrInput
	// The description of the key as viewed in Huawei console. Changing this updates
	// the description of key.
	KeyDescription pulumi.StringPtrInput
	// The globally unique identifier for the key.
	KeyId pulumi.StringPtrInput
	// Duration in days after which the key is deleted after destruction of the resource,
	// must be between 7 and 1096 days. It doesn't have default value. It only be used when delete a key.
	PendingDays pulumi.StringPtrInput
	// The region in which to create the KMS key resource. If omitted, the
	// provider-level region will be used. Changing this creates a new KMS key resource.
	Region pulumi.StringPtrInput
	// Specifies whether the key rotation is enabled. Defaults to false.
	RotationEnabled pulumi.BoolPtrInput
	// Specifies the key rotation interval. The valid value is range from 30 to 365,
	// defaults to 365.
	RotationInterval pulumi.IntPtrInput
	// The total number of key rotations.
	RotationNumber pulumi.IntPtrInput
	// Scheduled deletion time (time stamp) of a key.
	ScheduledDeletionDate pulumi.StringPtrInput
	// Specifies the key/value pairs to associate with the kms key.
	Tags pulumi.StringMapInput
}

func (KeyState) ElementType

func (KeyState) ElementType() reflect.Type

type Keypair

type Keypair struct {
	pulumi.CustomResourceState

	// The key pair creation time.
	CreatedAt pulumi.StringOutput `pulumi:"createdAt"`
	// Specifies the description of key pair.
	Description pulumi.StringPtrOutput `pulumi:"description"`
	// Specifies encryption mode if manages the private key by HuaweiCloud.
	// The options are as follows:
	// - **default**: The default encryption mode. Applicable to sites where KMS is not deployed.
	// - **kms**: KMS encryption mode.
	EncryptionType pulumi.StringOutput `pulumi:"encryptionType"`
	// Fingerprint information about an key pair.
	Fingerprint pulumi.StringOutput `pulumi:"fingerprint"`
	// Whether the private key is managed by HuaweiCloud.
	IsManaged pulumi.BoolOutput `pulumi:"isManaged"`
	// Specifies the path of the created private key.
	// The private key file (**.pem**) is created only after the resource is created.
	// Changing this parameter will create a new resource.
	KeyFile pulumi.StringOutput `pulumi:"keyFile"`
	// Specifies the KMS key name to encrypt private keys.
	// It's mandatory when the `encryptionType` is `kms`. Changing this parameter will create a new resource.
	KmsKeyName pulumi.StringPtrOutput `pulumi:"kmsKeyName"`
	// Specifies a unique name for the keypair. The name can contain a maximum of 64
	// characters, including letters, digits, underscores (_) and hyphens (-).
	// Changing this parameter will create a new resource.
	Name pulumi.StringOutput `pulumi:"name"`
	// Specifies the imported OpenSSH-formatted public key.
	// Changing this parameter will create a new resource.
	PublicKey pulumi.StringOutput `pulumi:"publicKey"`
	// Specifies the region in which to create the keypair resource. If omitted, the
	// provider-level region will be used. Changing this parameter will create a new resource.
	Region pulumi.StringOutput `pulumi:"region"`
	// Specifies the scope of key pair. The options are as follows:
	// - **account**: Tenant-level, available to all users under the same account.
	// - **user**: User-level, only available to that user.
	Scope pulumi.StringOutput `pulumi:"scope"`
}

Manages a keypair resource within HuaweiCloud.

By default, key pairs use the SSH-2 (RSA, 2048) algorithm for encryption and decryption.

Keys imported support the following cryptographic algorithms:

  • RSA-1024
  • RSA-2048
  • RSA-4096

## Example Usage ### Create a new keypair which scope is Tenant-level and the private key is managed by HuaweiCloud

```go package main

import (

"github.com/huaweicloud/pulumi-huaweicloud/sdk/go/huaweicloud/Dew"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"

)

func main() {
	pulumi.Run(func(ctx *pulumi.Context) error {
		test, err := Dew.NewKey(ctx, "test", &Dew.KeyArgs{
			KeyAlias: pulumi.String("kms_test"),
		})
		if err != nil {
			return err
		}
		_, err = Dew.NewKeypair(ctx, "test-keypair", &Dew.KeypairArgs{
			Scope:          pulumi.String("account"),
			EncryptionType: pulumi.String("kms"),
			KmsKeyName:     test.KeyAlias,
		})
		if err != nil {
			return err
		}
		return nil
	})
}

``` ### Create a new keypair and export private key to current folder

```go package main

import (

"github.com/huaweicloud/pulumi-huaweicloud/sdk/go/huaweicloud/Dew"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"

)

func main() {
	pulumi.Run(func(ctx *pulumi.Context) error {
		_, err := Dew.NewKeypair(ctx, "test-keypair", &Dew.KeypairArgs{
			KeyFile: pulumi.String("private_key.pem"),
		})
		if err != nil {
			return err
		}
		return nil
	})
}

``` ### Import an existing keypair

```go package main

import (

"github.com/huaweicloud/pulumi-huaweicloud/sdk/go/huaweicloud/Dew"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"

)

func main() {
	pulumi.Run(func(ctx *pulumi.Context) error {
		_, err := Dew.NewKeypair(ctx, "test-keypair", &Dew.KeypairArgs{
			PublicKey: pulumi.String("ssh-rsa AAAAB3NzaC1yc2EAAAlJq5Pu+eizhou7nFFDxXofr2ySF8k/yuA9OnJdVF9Fbf85Z59CWNZBvcAT... root@terra-dev"),
		})
		if err != nil {
			return err
		}
		return nil
	})
}

```

## Import

Keypairs can be imported using the `name`, e.g.

```sh

$ pulumi import huaweicloud:Dew/keypair:Keypair my-keypair test-keypair

```

Note that the imported state may not be identical to your resource definition, due to some attributes missing from the API response, security or some other reason. The missing attributes include`encryption_type`, and `kms_key_name`. It is generally recommended running `terraform plan` after importing a key pair. You can then decide if changes should be applied to the key pair, or the resource definition should be updated to align with the key pair. Also you can ignore changes as below. resource "huaweicloud_kps_keypair" "test" {

...

lifecycle {

ignore_changes = [

encryption_type, kms_key_name,

]

} }

func GetKeypair

func GetKeypair(ctx *pulumi.Context,
	name string, id pulumi.IDInput, state *KeypairState, opts ...pulumi.ResourceOption) (*Keypair, error)

GetKeypair gets an existing Keypair resource's state with the given name, ID, and optional state properties that are used to uniquely qualify the lookup (nil if not required).

func NewKeypair

func NewKeypair(ctx *pulumi.Context,
	name string, args *KeypairArgs, opts ...pulumi.ResourceOption) (*Keypair, error)

NewKeypair registers a new resource with the given unique name, arguments, and options.

func (*Keypair) ElementType

func (*Keypair) ElementType() reflect.Type

func (*Keypair) ToKeypairOutput

func (i *Keypair) ToKeypairOutput() KeypairOutput

func (*Keypair) ToKeypairOutputWithContext

func (i *Keypair) ToKeypairOutputWithContext(ctx context.Context) KeypairOutput

type KeypairArgs

type KeypairArgs struct {
	// Specifies the description of key pair.
	Description pulumi.StringPtrInput
	// Specifies encryption mode if manages the private key by HuaweiCloud.
	// The options are as follows:
	// - **default**: The default encryption mode. Applicable to sites where KMS is not deployed.
	// - **kms**: KMS encryption mode.
	EncryptionType pulumi.StringPtrInput
	// Specifies the path of the created private key.
	// The private key file (**.pem**) is created only after the resource is created.
	// Changing this parameter will create a new resource.
	KeyFile pulumi.StringPtrInput
	// Specifies the KMS key name to encrypt private keys.
	// It's mandatory when the `encryptionType` is `kms`. Changing this parameter will create a new resource.
	KmsKeyName pulumi.StringPtrInput
	// Specifies a unique name for the keypair. The name can contain a maximum of 64
	// characters, including letters, digits, underscores (_) and hyphens (-).
	// Changing this parameter will create a new resource.
	Name pulumi.StringPtrInput
	// Specifies the imported OpenSSH-formatted public key.
	// Changing this parameter will create a new resource.
	PublicKey pulumi.StringPtrInput
	// Specifies the region in which to create the keypair resource. If omitted, the
	// provider-level region will be used. Changing this parameter will create a new resource.
	Region pulumi.StringPtrInput
	// Specifies the scope of key pair. The options are as follows:
	// - **account**: Tenant-level, available to all users under the same account.
	// - **user**: User-level, only available to that user.
	Scope pulumi.StringPtrInput
}

The set of arguments for constructing a Keypair resource.

func (KeypairArgs) ElementType

func (KeypairArgs) ElementType() reflect.Type

type KeypairArray

type KeypairArray []KeypairInput

func (KeypairArray) ElementType

func (KeypairArray) ElementType() reflect.Type

func (KeypairArray) ToKeypairArrayOutput

func (i KeypairArray) ToKeypairArrayOutput() KeypairArrayOutput

func (KeypairArray) ToKeypairArrayOutputWithContext

func (i KeypairArray) ToKeypairArrayOutputWithContext(ctx context.Context) KeypairArrayOutput

type KeypairArrayInput

type KeypairArrayInput interface {
	pulumi.Input

	ToKeypairArrayOutput() KeypairArrayOutput
	ToKeypairArrayOutputWithContext(context.Context) KeypairArrayOutput
}

KeypairArrayInput is an input type that accepts KeypairArray and KeypairArrayOutput values. You can construct a concrete instance of `KeypairArrayInput` via:

KeypairArray{ KeypairArgs{...} }

type KeypairArrayOutput

type KeypairArrayOutput struct{ *pulumi.OutputState }

func (KeypairArrayOutput) ElementType

func (KeypairArrayOutput) ElementType() reflect.Type

func (KeypairArrayOutput) Index

func (KeypairArrayOutput) ToKeypairArrayOutput

func (o KeypairArrayOutput) ToKeypairArrayOutput() KeypairArrayOutput

func (KeypairArrayOutput) ToKeypairArrayOutputWithContext

func (o KeypairArrayOutput) ToKeypairArrayOutputWithContext(ctx context.Context) KeypairArrayOutput

type KeypairInput

type KeypairInput interface {
	pulumi.Input

	ToKeypairOutput() KeypairOutput
	ToKeypairOutputWithContext(ctx context.Context) KeypairOutput
}

type KeypairMap

type KeypairMap map[string]KeypairInput

func (KeypairMap) ElementType

func (KeypairMap) ElementType() reflect.Type

func (KeypairMap) ToKeypairMapOutput

func (i KeypairMap) ToKeypairMapOutput() KeypairMapOutput

func (KeypairMap) ToKeypairMapOutputWithContext

func (i KeypairMap) ToKeypairMapOutputWithContext(ctx context.Context) KeypairMapOutput

type KeypairMapInput

type KeypairMapInput interface {
	pulumi.Input

	ToKeypairMapOutput() KeypairMapOutput
	ToKeypairMapOutputWithContext(context.Context) KeypairMapOutput
}

KeypairMapInput is an input type that accepts KeypairMap and KeypairMapOutput values. You can construct a concrete instance of `KeypairMapInput` via:

KeypairMap{ "key": KeypairArgs{...} }

type KeypairMapOutput

type KeypairMapOutput struct{ *pulumi.OutputState }

func (KeypairMapOutput) ElementType

func (KeypairMapOutput) ElementType() reflect.Type

func (KeypairMapOutput) MapIndex

func (KeypairMapOutput) ToKeypairMapOutput

func (o KeypairMapOutput) ToKeypairMapOutput() KeypairMapOutput

func (KeypairMapOutput) ToKeypairMapOutputWithContext

func (o KeypairMapOutput) ToKeypairMapOutputWithContext(ctx context.Context) KeypairMapOutput

type KeypairOutput

type KeypairOutput struct{ *pulumi.OutputState }

func (KeypairOutput) CreatedAt

func (o KeypairOutput) CreatedAt() pulumi.StringOutput

The key pair creation time.

func (KeypairOutput) Description

func (o KeypairOutput) Description() pulumi.StringPtrOutput

Specifies the description of key pair.

func (KeypairOutput) ElementType

func (KeypairOutput) ElementType() reflect.Type

func (KeypairOutput) EncryptionType

func (o KeypairOutput) EncryptionType() pulumi.StringOutput

Specifies encryption mode if manages the private key by HuaweiCloud. The options are as follows: - **default**: The default encryption mode. Applicable to sites where KMS is not deployed. - **kms**: KMS encryption mode.

func (KeypairOutput) Fingerprint

func (o KeypairOutput) Fingerprint() pulumi.StringOutput

Fingerprint information about an key pair.

func (KeypairOutput) IsManaged

func (o KeypairOutput) IsManaged() pulumi.BoolOutput

Whether the private key is managed by HuaweiCloud.

func (KeypairOutput) KeyFile

func (o KeypairOutput) KeyFile() pulumi.StringOutput

Specifies the path of the created private key. The private key file (**.pem**) is created only after the resource is created. Changing this parameter will create a new resource.

func (KeypairOutput) KmsKeyName

func (o KeypairOutput) KmsKeyName() pulumi.StringPtrOutput

Specifies the KMS key name to encrypt private keys. It's mandatory when the `encryptionType` is `kms`. Changing this parameter will create a new resource.

func (KeypairOutput) Name

Specifies a unique name for the keypair. The name can contain a maximum of 64 characters, including letters, digits, underscores (_) and hyphens (-). Changing this parameter will create a new resource.

func (KeypairOutput) PublicKey

func (o KeypairOutput) PublicKey() pulumi.StringOutput

Specifies the imported OpenSSH-formatted public key. Changing this parameter will create a new resource.

func (KeypairOutput) Region

func (o KeypairOutput) Region() pulumi.StringOutput

Specifies the region in which to create the keypair resource. If omitted, the provider-level region will be used. Changing this parameter will create a new resource.

func (KeypairOutput) Scope

func (o KeypairOutput) Scope() pulumi.StringOutput

Specifies the scope of key pair. The options are as follows: - **account**: Tenant-level, available to all users under the same account. - **user**: User-level, only available to that user.

func (KeypairOutput) ToKeypairOutput

func (o KeypairOutput) ToKeypairOutput() KeypairOutput

func (KeypairOutput) ToKeypairOutputWithContext

func (o KeypairOutput) ToKeypairOutputWithContext(ctx context.Context) KeypairOutput

type KeypairState

type KeypairState struct {
	// The key pair creation time.
	CreatedAt pulumi.StringPtrInput
	// Specifies the description of key pair.
	Description pulumi.StringPtrInput
	// Specifies encryption mode if manages the private key by HuaweiCloud.
	// The options are as follows:
	// - **default**: The default encryption mode. Applicable to sites where KMS is not deployed.
	// - **kms**: KMS encryption mode.
	EncryptionType pulumi.StringPtrInput
	// Fingerprint information about an key pair.
	Fingerprint pulumi.StringPtrInput
	// Whether the private key is managed by HuaweiCloud.
	IsManaged pulumi.BoolPtrInput
	// Specifies the path of the created private key.
	// The private key file (**.pem**) is created only after the resource is created.
	// Changing this parameter will create a new resource.
	KeyFile pulumi.StringPtrInput
	// Specifies the KMS key name to encrypt private keys.
	// It's mandatory when the `encryptionType` is `kms`. Changing this parameter will create a new resource.
	KmsKeyName pulumi.StringPtrInput
	// Specifies a unique name for the keypair. The name can contain a maximum of 64
	// characters, including letters, digits, underscores (_) and hyphens (-).
	// Changing this parameter will create a new resource.
	Name pulumi.StringPtrInput
	// Specifies the imported OpenSSH-formatted public key.
	// Changing this parameter will create a new resource.
	PublicKey pulumi.StringPtrInput
	// Specifies the region in which to create the keypair resource. If omitted, the
	// provider-level region will be used. Changing this parameter will create a new resource.
	Region pulumi.StringPtrInput
	// Specifies the scope of key pair. The options are as follows:
	// - **account**: Tenant-level, available to all users under the same account.
	// - **user**: User-level, only available to that user.
	Scope pulumi.StringPtrInput
}

func (KeypairState) ElementType

func (KeypairState) ElementType() reflect.Type

type LookupKeyArgs

type LookupKeyArgs struct {
	// Identification of a Master Key. The value "1" indicates a Default Master Key,
	// and the value "0" indicates a key. Changing this gets a new key.
	DefaultKeyFlag *string `pulumi:"defaultKeyFlag"`
	// - ID of a user domain for the key. Changing this gets a new key.
	DomainId *string `pulumi:"domainId"`
	// The enterprise project id of the kms key.
	EnterpriseProjectId *string `pulumi:"enterpriseProjectId"`
	// The alias in which to create the key. It is required when we create a new key.
	// Changing this gets the new key.
	KeyAlias *string `pulumi:"keyAlias"`
	// The description of the key as viewed in Huawei console. Changing this gets a
	// new key.
	KeyDescription *string `pulumi:"keyDescription"`
	// The globally unique identifier for the key. Changing this gets the new key.
	KeyId *string `pulumi:"keyId"`
	// The state of a key. "1" indicates that the key is waiting to be activated.
	// "2" indicates that the key is enabled. "3" indicates that the key is disabled. "4" indicates that the key is scheduled
	// for deletion. Changing this gets a new key.
	KeyState *string `pulumi:"keyState"`
	// The region in which to obtain the keys. If omitted, the provider-level region will be
	// used.
	Region *string `pulumi:"region"`
}

A collection of arguments for invoking getKey.

type LookupKeyOutputArgs

type LookupKeyOutputArgs struct {
	// Identification of a Master Key. The value "1" indicates a Default Master Key,
	// and the value "0" indicates a key. Changing this gets a new key.
	DefaultKeyFlag pulumi.StringPtrInput `pulumi:"defaultKeyFlag"`
	// - ID of a user domain for the key. Changing this gets a new key.
	DomainId pulumi.StringPtrInput `pulumi:"domainId"`
	// The enterprise project id of the kms key.
	EnterpriseProjectId pulumi.StringPtrInput `pulumi:"enterpriseProjectId"`
	// The alias in which to create the key. It is required when we create a new key.
	// Changing this gets the new key.
	KeyAlias pulumi.StringPtrInput `pulumi:"keyAlias"`
	// The description of the key as viewed in Huawei console. Changing this gets a
	// new key.
	KeyDescription pulumi.StringPtrInput `pulumi:"keyDescription"`
	// The globally unique identifier for the key. Changing this gets the new key.
	KeyId pulumi.StringPtrInput `pulumi:"keyId"`
	// The state of a key. "1" indicates that the key is waiting to be activated.
	// "2" indicates that the key is enabled. "3" indicates that the key is disabled. "4" indicates that the key is scheduled
	// for deletion. Changing this gets a new key.
	KeyState pulumi.StringPtrInput `pulumi:"keyState"`
	// The region in which to obtain the keys. If omitted, the provider-level region will be
	// used.
	Region pulumi.StringPtrInput `pulumi:"region"`
}

A collection of arguments for invoking getKey.

func (LookupKeyOutputArgs) ElementType

func (LookupKeyOutputArgs) ElementType() reflect.Type

type LookupKeyResult

type LookupKeyResult struct {
	// Creation time (time stamp) of a key.
	CreationDate        string `pulumi:"creationDate"`
	DefaultKeyFlag      string `pulumi:"defaultKeyFlag"`
	DomainId            string `pulumi:"domainId"`
	EnterpriseProjectId string `pulumi:"enterpriseProjectId"`
	// Expiration time.
	ExpirationTime string `pulumi:"expirationTime"`
	// The provider-assigned unique ID for this managed resource.
	Id             string `pulumi:"id"`
	KeyAlias       string `pulumi:"keyAlias"`
	KeyDescription string `pulumi:"keyDescription"`
	KeyId          string `pulumi:"keyId"`
	KeyState       string `pulumi:"keyState"`
	Region         string `pulumi:"region"`
	// Indicates whether the key rotation is enabled or not.
	RotationEnabled bool `pulumi:"rotationEnabled"`
	// The key rotation interval. It's valid when rotation is enabled.
	RotationInterval int `pulumi:"rotationInterval"`
	// The total number of key rotations. It's valid when rotation is enabled.
	RotationNumber int `pulumi:"rotationNumber"`
	// Scheduled deletion time (time stamp) of a key.
	ScheduledDeletionDate string `pulumi:"scheduledDeletionDate"`
	// The key/value pairs to associate with the kms key.
	Tags map[string]string `pulumi:"tags"`
}

A collection of values returned by getKey.

func LookupKey

func LookupKey(ctx *pulumi.Context, args *LookupKeyArgs, opts ...pulumi.InvokeOption) (*LookupKeyResult, error)

Use this data source to get the ID of an available HuaweiCloud KMS key.

## Example Usage

```go package main

import (

"github.com/huaweicloud/pulumi-huaweicloud/sdk/go/huaweicloud/Dew"
"github.com/pulumi/pulumi-huaweicloud/sdk/go/huaweicloud/Dew"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"

)

func main() {
	pulumi.Run(func(ctx *pulumi.Context) error {
		_, err := Dew.GetKey(ctx, &dew.GetKeyArgs{
			DefaultKeyFlag: pulumi.StringRef("0"),
			DomainId:       pulumi.StringRef("b168fe00ff56492495a7d22974df2d0b"),
			KeyAlias:       pulumi.StringRef("test_key"),
			KeyDescription: pulumi.StringRef("test key description"),
			KeyId:          pulumi.StringRef("af650527-a0ff-4527-aef3-c493df1f3012"),
			KeyState:       pulumi.StringRef("2"),
		}, nil)
		if err != nil {
			return err
		}
		return nil
	})
}

```

type LookupKeyResultOutput

type LookupKeyResultOutput struct{ *pulumi.OutputState }

A collection of values returned by getKey.

func (LookupKeyResultOutput) CreationDate

func (o LookupKeyResultOutput) CreationDate() pulumi.StringOutput

Creation time (time stamp) of a key.

func (LookupKeyResultOutput) DefaultKeyFlag

func (o LookupKeyResultOutput) DefaultKeyFlag() pulumi.StringOutput

func (LookupKeyResultOutput) DomainId

func (LookupKeyResultOutput) ElementType

func (LookupKeyResultOutput) ElementType() reflect.Type

func (LookupKeyResultOutput) EnterpriseProjectId

func (o LookupKeyResultOutput) EnterpriseProjectId() pulumi.StringOutput

func (LookupKeyResultOutput) ExpirationTime

func (o LookupKeyResultOutput) ExpirationTime() pulumi.StringOutput

Expiration time.

func (LookupKeyResultOutput) Id

The provider-assigned unique ID for this managed resource.

func (LookupKeyResultOutput) KeyAlias

func (LookupKeyResultOutput) KeyDescription

func (o LookupKeyResultOutput) KeyDescription() pulumi.StringOutput

func (LookupKeyResultOutput) KeyId

func (LookupKeyResultOutput) KeyState

func (LookupKeyResultOutput) Region

func (LookupKeyResultOutput) RotationEnabled

func (o LookupKeyResultOutput) RotationEnabled() pulumi.BoolOutput

Indicates whether the key rotation is enabled or not.

func (LookupKeyResultOutput) RotationInterval

func (o LookupKeyResultOutput) RotationInterval() pulumi.IntOutput

The key rotation interval. It's valid when rotation is enabled.

func (LookupKeyResultOutput) RotationNumber

func (o LookupKeyResultOutput) RotationNumber() pulumi.IntOutput

The total number of key rotations. It's valid when rotation is enabled.

func (LookupKeyResultOutput) ScheduledDeletionDate

func (o LookupKeyResultOutput) ScheduledDeletionDate() pulumi.StringOutput

Scheduled deletion time (time stamp) of a key.

func (LookupKeyResultOutput) Tags

The key/value pairs to associate with the kms key.

func (LookupKeyResultOutput) ToLookupKeyResultOutput

func (o LookupKeyResultOutput) ToLookupKeyResultOutput() LookupKeyResultOutput

func (LookupKeyResultOutput) ToLookupKeyResultOutputWithContext

func (o LookupKeyResultOutput) ToLookupKeyResultOutputWithContext(ctx context.Context) LookupKeyResultOutput

type Secret

type Secret struct {
	pulumi.CustomResourceState

	// Time when the CSMS secrets created, in UTC format.
	CreateTime pulumi.StringOutput `pulumi:"createTime"`
	// The description of a secret.
	Description pulumi.StringPtrOutput `pulumi:"description"`
	KmsKeyId    pulumi.StringOutput    `pulumi:"kmsKeyId"`
	// The latest version id.
	LatestVersion pulumi.StringOutput `pulumi:"latestVersion"`
	// The secret name. The maximum length is 64 characters.
	// Only digits, letters, underscores(_), hyphens(-) and dots(.) are allowed.
	Name pulumi.StringOutput `pulumi:"name"`
	// The region in which to create the CSMS secrets.
	// If omitted, the provider-level region will be used. Changing this setting will create a new resource.
	Region pulumi.StringOutput `pulumi:"region"`
	// The secret ID in UUID format.
	SecretId pulumi.StringOutput `pulumi:"secretId"`
	// The plaintext of a secret in text format. The maximum size is 32 KB.
	SecretText pulumi.StringOutput `pulumi:"secretText"`
	// The CSMS secret status. Values can be: ENABLED, DISABLED, PENDING_DELETE and FROZEN.
	Status pulumi.StringOutput `pulumi:"status"`
	// The tags of a CSMS secrets, key/value pair format.
	Tags pulumi.StringMapOutput `pulumi:"tags"`
}

Manages CSMS(Cloud Secret Management Service) secrets within HuaweiCloud.

## Example Usage ### Encrypt Plaintext

```go package main

import (

"github.com/huaweicloud/pulumi-huaweicloud/sdk/go/huaweicloud/Dew"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"

)

func main() {
	pulumi.Run(func(ctx *pulumi.Context) error {
		_, err := Dew.NewSecret(ctx, "test1", &Dew.SecretArgs{
			SecretText: pulumi.String("this is a password"),
		})
		if err != nil {
			return err
		}
		return nil
	})
}

``` ### Encrypt JSON Data

```go package main

import (

"encoding/json"

"github.com/huaweicloud/pulumi-huaweicloud/sdk/go/huaweicloud/Dew"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"

)

func main() {
	pulumi.Run(func(ctx *pulumi.Context) error {
		tmpJSON0, err := json.Marshal(map[string]interface{}{
			"username": "admin",
			"password": "123456",
		})
		if err != nil {
			return err
		}
		json0 := string(tmpJSON0)
		_, err = Dew.NewSecret(ctx, "test2", &Dew.SecretArgs{
			SecretText: pulumi.String(json0),
		})
		if err != nil {
			return err
		}
		return nil
	})
}

```

## Import

CSMS secret can be imported using the ID and the name of secret, separated by a slash, e.g.

```sh

$ pulumi import huaweicloud:Dew/secret:Secret test 93cba7f5-550b-45dc-912e-277b3296fb27/test_secret

```

func GetSecret

func GetSecret(ctx *pulumi.Context,
	name string, id pulumi.IDInput, state *SecretState, opts ...pulumi.ResourceOption) (*Secret, error)

GetSecret gets an existing Secret resource's state with the given name, ID, and optional state properties that are used to uniquely qualify the lookup (nil if not required).

func NewSecret

func NewSecret(ctx *pulumi.Context,
	name string, args *SecretArgs, opts ...pulumi.ResourceOption) (*Secret, error)

NewSecret registers a new resource with the given unique name, arguments, and options.

func (*Secret) ElementType

func (*Secret) ElementType() reflect.Type

func (*Secret) ToSecretOutput

func (i *Secret) ToSecretOutput() SecretOutput

func (*Secret) ToSecretOutputWithContext

func (i *Secret) ToSecretOutputWithContext(ctx context.Context) SecretOutput

type SecretArgs

type SecretArgs struct {
	// The description of a secret.
	Description pulumi.StringPtrInput
	KmsKeyId    pulumi.StringPtrInput
	// The secret name. The maximum length is 64 characters.
	// Only digits, letters, underscores(_), hyphens(-) and dots(.) are allowed.
	Name pulumi.StringPtrInput
	// The region in which to create the CSMS secrets.
	// If omitted, the provider-level region will be used. Changing this setting will create a new resource.
	Region pulumi.StringPtrInput
	// The plaintext of a secret in text format. The maximum size is 32 KB.
	SecretText pulumi.StringInput
	// The tags of a CSMS secrets, key/value pair format.
	Tags pulumi.StringMapInput
}

The set of arguments for constructing a Secret resource.

func (SecretArgs) ElementType

func (SecretArgs) ElementType() reflect.Type

type SecretArray

type SecretArray []SecretInput

func (SecretArray) ElementType

func (SecretArray) ElementType() reflect.Type

func (SecretArray) ToSecretArrayOutput

func (i SecretArray) ToSecretArrayOutput() SecretArrayOutput

func (SecretArray) ToSecretArrayOutputWithContext

func (i SecretArray) ToSecretArrayOutputWithContext(ctx context.Context) SecretArrayOutput

type SecretArrayInput

type SecretArrayInput interface {
	pulumi.Input

	ToSecretArrayOutput() SecretArrayOutput
	ToSecretArrayOutputWithContext(context.Context) SecretArrayOutput
}

SecretArrayInput is an input type that accepts SecretArray and SecretArrayOutput values. You can construct a concrete instance of `SecretArrayInput` via:

SecretArray{ SecretArgs{...} }

type SecretArrayOutput

type SecretArrayOutput struct{ *pulumi.OutputState }

func (SecretArrayOutput) ElementType

func (SecretArrayOutput) ElementType() reflect.Type

func (SecretArrayOutput) Index

func (SecretArrayOutput) ToSecretArrayOutput

func (o SecretArrayOutput) ToSecretArrayOutput() SecretArrayOutput

func (SecretArrayOutput) ToSecretArrayOutputWithContext

func (o SecretArrayOutput) ToSecretArrayOutputWithContext(ctx context.Context) SecretArrayOutput

type SecretInput

type SecretInput interface {
	pulumi.Input

	ToSecretOutput() SecretOutput
	ToSecretOutputWithContext(ctx context.Context) SecretOutput
}

type SecretMap

type SecretMap map[string]SecretInput

func (SecretMap) ElementType

func (SecretMap) ElementType() reflect.Type

func (SecretMap) ToSecretMapOutput

func (i SecretMap) ToSecretMapOutput() SecretMapOutput

func (SecretMap) ToSecretMapOutputWithContext

func (i SecretMap) ToSecretMapOutputWithContext(ctx context.Context) SecretMapOutput

type SecretMapInput

type SecretMapInput interface {
	pulumi.Input

	ToSecretMapOutput() SecretMapOutput
	ToSecretMapOutputWithContext(context.Context) SecretMapOutput
}

SecretMapInput is an input type that accepts SecretMap and SecretMapOutput values. You can construct a concrete instance of `SecretMapInput` via:

SecretMap{ "key": SecretArgs{...} }

type SecretMapOutput

type SecretMapOutput struct{ *pulumi.OutputState }

func (SecretMapOutput) ElementType

func (SecretMapOutput) ElementType() reflect.Type

func (SecretMapOutput) MapIndex

func (SecretMapOutput) ToSecretMapOutput

func (o SecretMapOutput) ToSecretMapOutput() SecretMapOutput

func (SecretMapOutput) ToSecretMapOutputWithContext

func (o SecretMapOutput) ToSecretMapOutputWithContext(ctx context.Context) SecretMapOutput

type SecretOutput

type SecretOutput struct{ *pulumi.OutputState }

func (SecretOutput) CreateTime

func (o SecretOutput) CreateTime() pulumi.StringOutput

Time when the CSMS secrets created, in UTC format.

func (SecretOutput) Description

func (o SecretOutput) Description() pulumi.StringPtrOutput

The description of a secret.

func (SecretOutput) ElementType

func (SecretOutput) ElementType() reflect.Type

func (SecretOutput) KmsKeyId

func (o SecretOutput) KmsKeyId() pulumi.StringOutput

func (SecretOutput) LatestVersion

func (o SecretOutput) LatestVersion() pulumi.StringOutput

The latest version id.

func (SecretOutput) Name

func (o SecretOutput) Name() pulumi.StringOutput

The secret name. The maximum length is 64 characters. Only digits, letters, underscores(_), hyphens(-) and dots(.) are allowed.

func (SecretOutput) Region

func (o SecretOutput) Region() pulumi.StringOutput

The region in which to create the CSMS secrets. If omitted, the provider-level region will be used. Changing this setting will create a new resource.

func (SecretOutput) SecretId

func (o SecretOutput) SecretId() pulumi.StringOutput

The secret ID in UUID format.

func (SecretOutput) SecretText

func (o SecretOutput) SecretText() pulumi.StringOutput

The plaintext of a secret in text format. The maximum size is 32 KB.

func (SecretOutput) Status

func (o SecretOutput) Status() pulumi.StringOutput

The CSMS secret status. Values can be: ENABLED, DISABLED, PENDING_DELETE and FROZEN.

func (SecretOutput) Tags

The tags of a CSMS secrets, key/value pair format.

func (SecretOutput) ToSecretOutput

func (o SecretOutput) ToSecretOutput() SecretOutput

func (SecretOutput) ToSecretOutputWithContext

func (o SecretOutput) ToSecretOutputWithContext(ctx context.Context) SecretOutput

type SecretState

type SecretState struct {
	// Time when the CSMS secrets created, in UTC format.
	CreateTime pulumi.StringPtrInput
	// The description of a secret.
	Description pulumi.StringPtrInput
	KmsKeyId    pulumi.StringPtrInput
	// The latest version id.
	LatestVersion pulumi.StringPtrInput
	// The secret name. The maximum length is 64 characters.
	// Only digits, letters, underscores(_), hyphens(-) and dots(.) are allowed.
	Name pulumi.StringPtrInput
	// The region in which to create the CSMS secrets.
	// If omitted, the provider-level region will be used. Changing this setting will create a new resource.
	Region pulumi.StringPtrInput
	// The secret ID in UUID format.
	SecretId pulumi.StringPtrInput
	// The plaintext of a secret in text format. The maximum size is 32 KB.
	SecretText pulumi.StringPtrInput
	// The CSMS secret status. Values can be: ENABLED, DISABLED, PENDING_DELETE and FROZEN.
	Status pulumi.StringPtrInput
	// The tags of a CSMS secrets, key/value pair format.
	Tags pulumi.StringMapInput
}

func (SecretState) ElementType

func (SecretState) ElementType() reflect.Type

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL