alicloud.kms.ClientKey
Explore with Pulumi AI
Provides a KMS Client Key resource. Client key (of Application Access Point).
For information about KMS Client Key and how to use it, see What is Client Key.
NOTE: Available since v1.210.0.
Example Usage
Basic Usage
import * as pulumi from "@pulumi/pulumi";
import * as alicloud from "@pulumi/alicloud";
const config = new pulumi.Config();
const name = config.get("name") || "terraform-example";
const AAP0 = new alicloud.kms.ApplicationAccessPoint("AAP0", {
policies: ["aa"],
description: "aa",
applicationAccessPointName: name,
});
const _default = new alicloud.kms.ClientKey("default", {
aapName: AAP0.applicationAccessPointName,
password: "YouPassword123!",
notBefore: "2023-09-01T14:11:22Z",
notAfter: "2028-09-01T14:11:22Z",
privateKeyDataFile: "./private_key_data_file.txt",
});
import pulumi
import pulumi_alicloud as alicloud
config = pulumi.Config()
name = config.get("name")
if name is None:
name = "terraform-example"
aap0 = alicloud.kms.ApplicationAccessPoint("AAP0",
policies=["aa"],
description="aa",
application_access_point_name=name)
default = alicloud.kms.ClientKey("default",
aap_name=aap0.application_access_point_name,
password="YouPassword123!",
not_before="2023-09-01T14:11:22Z",
not_after="2028-09-01T14:11:22Z",
private_key_data_file="./private_key_data_file.txt")
package main
import (
"github.com/pulumi/pulumi-alicloud/sdk/v3/go/alicloud/kms"
"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, "")
name := "terraform-example"
if param := cfg.Get("name"); param != "" {
name = param
}
AAP0, err := kms.NewApplicationAccessPoint(ctx, "AAP0", &kms.ApplicationAccessPointArgs{
Policies: pulumi.StringArray{
pulumi.String("aa"),
},
Description: pulumi.String("aa"),
ApplicationAccessPointName: pulumi.String(name),
})
if err != nil {
return err
}
_, err = kms.NewClientKey(ctx, "default", &kms.ClientKeyArgs{
AapName: AAP0.ApplicationAccessPointName,
Password: pulumi.String("YouPassword123!"),
NotBefore: pulumi.String("2023-09-01T14:11:22Z"),
NotAfter: pulumi.String("2028-09-01T14:11:22Z"),
PrivateKeyDataFile: pulumi.String("./private_key_data_file.txt"),
})
if err != nil {
return err
}
return nil
})
}
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using AliCloud = Pulumi.AliCloud;
return await Deployment.RunAsync(() =>
{
var config = new Config();
var name = config.Get("name") ?? "terraform-example";
var AAP0 = new AliCloud.Kms.ApplicationAccessPoint("AAP0", new()
{
Policies = new[]
{
"aa",
},
Description = "aa",
ApplicationAccessPointName = name,
});
var @default = new AliCloud.Kms.ClientKey("default", new()
{
AapName = AAP0.ApplicationAccessPointName,
Password = "YouPassword123!",
NotBefore = "2023-09-01T14:11:22Z",
NotAfter = "2028-09-01T14:11:22Z",
PrivateKeyDataFile = "./private_key_data_file.txt",
});
});
package generated_program;
import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.alicloud.kms.ApplicationAccessPoint;
import com.pulumi.alicloud.kms.ApplicationAccessPointArgs;
import com.pulumi.alicloud.kms.ClientKey;
import com.pulumi.alicloud.kms.ClientKeyArgs;
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 config = ctx.config();
final var name = config.get("name").orElse("terraform-example");
var aAP0 = new ApplicationAccessPoint("AAP0", ApplicationAccessPointArgs.builder()
.policies("aa")
.description("aa")
.applicationAccessPointName(name)
.build());
var default_ = new ClientKey("default", ClientKeyArgs.builder()
.aapName(AAP0.applicationAccessPointName())
.password("YouPassword123!")
.notBefore("2023-09-01T14:11:22Z")
.notAfter("2028-09-01T14:11:22Z")
.privateKeyDataFile("./private_key_data_file.txt")
.build());
}
}
configuration:
name:
type: string
default: terraform-example
resources:
AAP0:
type: alicloud:kms:ApplicationAccessPoint
properties:
policies:
- aa
description: aa
applicationAccessPointName: ${name}
default:
type: alicloud:kms:ClientKey
properties:
aapName: ${AAP0.applicationAccessPointName}
password: YouPassword123!
notBefore: 2023-09-01T14:11:22Z
notAfter: 2028-09-01T14:11:22Z
privateKeyDataFile: ./private_key_data_file.txt
Create ClientKey Resource
Resources are created with functions called constructors. To learn more about declaring and configuring resources, see Resources.
Constructor syntax
new ClientKey(name: string, args: ClientKeyArgs, opts?: CustomResourceOptions);
@overload
def ClientKey(resource_name: str,
args: ClientKeyArgs,
opts: Optional[ResourceOptions] = None)
@overload
def ClientKey(resource_name: str,
opts: Optional[ResourceOptions] = None,
aap_name: Optional[str] = None,
password: Optional[str] = None,
not_after: Optional[str] = None,
not_before: Optional[str] = None,
private_key_data_file: Optional[str] = None)
func NewClientKey(ctx *Context, name string, args ClientKeyArgs, opts ...ResourceOption) (*ClientKey, error)
public ClientKey(string name, ClientKeyArgs args, CustomResourceOptions? opts = null)
public ClientKey(String name, ClientKeyArgs args)
public ClientKey(String name, ClientKeyArgs args, CustomResourceOptions options)
type: alicloud:kms:ClientKey
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 ClientKeyArgs
- 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 ClientKeyArgs
- 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 ClientKeyArgs
- The arguments to resource properties.
- opts ResourceOption
- Bag of options to control resource's behavior.
- name string
- The unique name of the resource.
- args ClientKeyArgs
- The arguments to resource properties.
- opts CustomResourceOptions
- Bag of options to control resource's behavior.
- name String
- The unique name of the resource.
- args ClientKeyArgs
- 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 clientKeyResource = new AliCloud.Kms.ClientKey("clientKeyResource", new()
{
AapName = "string",
Password = "string",
NotAfter = "string",
NotBefore = "string",
PrivateKeyDataFile = "string",
});
example, err := kms.NewClientKey(ctx, "clientKeyResource", &kms.ClientKeyArgs{
AapName: pulumi.String("string"),
Password: pulumi.String("string"),
NotAfter: pulumi.String("string"),
NotBefore: pulumi.String("string"),
PrivateKeyDataFile: pulumi.String("string"),
})
var clientKeyResource = new ClientKey("clientKeyResource", ClientKeyArgs.builder()
.aapName("string")
.password("string")
.notAfter("string")
.notBefore("string")
.privateKeyDataFile("string")
.build());
client_key_resource = alicloud.kms.ClientKey("clientKeyResource",
aap_name="string",
password="string",
not_after="string",
not_before="string",
private_key_data_file="string")
const clientKeyResource = new alicloud.kms.ClientKey("clientKeyResource", {
aapName: "string",
password: "string",
notAfter: "string",
notBefore: "string",
privateKeyDataFile: "string",
});
type: alicloud:kms:ClientKey
properties:
aapName: string
notAfter: string
notBefore: string
password: string
privateKeyDataFile: string
ClientKey Resource Properties
To learn more about resource properties and how to use them, see Inputs and Outputs in the Architecture and Concepts docs.
Inputs
The ClientKey resource accepts the following input properties:
- Aap
Name string - ClientKey's parent Application Access Point name.
- Password string
- To enhance security, set a password for the downloaded Client Key,When an application accesses KMS, you must use the ClientKey content and this password to initialize the SDK client.
- Not
After string - The ClientKey expiration time. Example: "2027-08-10 T08:03:30Z".
- Not
Before string - The valid start time of the ClientKey. Example: "2022-08-10 T08:03:30Z".
- Private
Key stringData File - The name of file that can save access key id and access key secret. Strongly suggest you to specified it when you creating access key, otherwise, you wouldn't get its secret ever.
- Aap
Name string - ClientKey's parent Application Access Point name.
- Password string
- To enhance security, set a password for the downloaded Client Key,When an application accesses KMS, you must use the ClientKey content and this password to initialize the SDK client.
- Not
After string - The ClientKey expiration time. Example: "2027-08-10 T08:03:30Z".
- Not
Before string - The valid start time of the ClientKey. Example: "2022-08-10 T08:03:30Z".
- Private
Key stringData File - The name of file that can save access key id and access key secret. Strongly suggest you to specified it when you creating access key, otherwise, you wouldn't get its secret ever.
- aap
Name String - ClientKey's parent Application Access Point name.
- password String
- To enhance security, set a password for the downloaded Client Key,When an application accesses KMS, you must use the ClientKey content and this password to initialize the SDK client.
- not
After String - The ClientKey expiration time. Example: "2027-08-10 T08:03:30Z".
- not
Before String - The valid start time of the ClientKey. Example: "2022-08-10 T08:03:30Z".
- private
Key StringData File - The name of file that can save access key id and access key secret. Strongly suggest you to specified it when you creating access key, otherwise, you wouldn't get its secret ever.
- aap
Name string - ClientKey's parent Application Access Point name.
- password string
- To enhance security, set a password for the downloaded Client Key,When an application accesses KMS, you must use the ClientKey content and this password to initialize the SDK client.
- not
After string - The ClientKey expiration time. Example: "2027-08-10 T08:03:30Z".
- not
Before string - The valid start time of the ClientKey. Example: "2022-08-10 T08:03:30Z".
- private
Key stringData File - The name of file that can save access key id and access key secret. Strongly suggest you to specified it when you creating access key, otherwise, you wouldn't get its secret ever.
- aap_
name str - ClientKey's parent Application Access Point name.
- password str
- To enhance security, set a password for the downloaded Client Key,When an application accesses KMS, you must use the ClientKey content and this password to initialize the SDK client.
- not_
after str - The ClientKey expiration time. Example: "2027-08-10 T08:03:30Z".
- not_
before str - The valid start time of the ClientKey. Example: "2022-08-10 T08:03:30Z".
- private_
key_ strdata_ file - The name of file that can save access key id and access key secret. Strongly suggest you to specified it when you creating access key, otherwise, you wouldn't get its secret ever.
- aap
Name String - ClientKey's parent Application Access Point name.
- password String
- To enhance security, set a password for the downloaded Client Key,When an application accesses KMS, you must use the ClientKey content and this password to initialize the SDK client.
- not
After String - The ClientKey expiration time. Example: "2027-08-10 T08:03:30Z".
- not
Before String - The valid start time of the ClientKey. Example: "2022-08-10 T08:03:30Z".
- private
Key StringData File - The name of file that can save access key id and access key secret. Strongly suggest you to specified it when you creating access key, otherwise, you wouldn't get its secret ever.
Outputs
All input properties are implicitly available as output properties. Additionally, the ClientKey resource produces the following output properties:
- Create
Time string - Create timestamp, e.g. "2022-08-10T08:03:30Z".
- Id string
- The provider-assigned unique ID for this managed resource.
- Create
Time string - Create timestamp, e.g. "2022-08-10T08:03:30Z".
- Id string
- The provider-assigned unique ID for this managed resource.
- create
Time String - Create timestamp, e.g. "2022-08-10T08:03:30Z".
- id String
- The provider-assigned unique ID for this managed resource.
- create
Time string - Create timestamp, e.g. "2022-08-10T08:03:30Z".
- id string
- The provider-assigned unique ID for this managed resource.
- create_
time str - Create timestamp, e.g. "2022-08-10T08:03:30Z".
- id str
- The provider-assigned unique ID for this managed resource.
- create
Time String - Create timestamp, e.g. "2022-08-10T08:03:30Z".
- id String
- The provider-assigned unique ID for this managed resource.
Look up Existing ClientKey Resource
Get an existing ClientKey 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?: ClientKeyState, opts?: CustomResourceOptions): ClientKey
@staticmethod
def get(resource_name: str,
id: str,
opts: Optional[ResourceOptions] = None,
aap_name: Optional[str] = None,
create_time: Optional[str] = None,
not_after: Optional[str] = None,
not_before: Optional[str] = None,
password: Optional[str] = None,
private_key_data_file: Optional[str] = None) -> ClientKey
func GetClientKey(ctx *Context, name string, id IDInput, state *ClientKeyState, opts ...ResourceOption) (*ClientKey, error)
public static ClientKey Get(string name, Input<string> id, ClientKeyState? state, CustomResourceOptions? opts = null)
public static ClientKey get(String name, Output<String> id, ClientKeyState state, CustomResourceOptions options)
Resource lookup is not supported in YAML
- name
- The unique name of the resulting resource.
- id
- The unique provider ID of the resource to lookup.
- state
- Any extra arguments used during the lookup.
- opts
- A bag of options that control this resource's behavior.
- resource_name
- The unique name of the resulting resource.
- id
- The unique provider ID of the resource to lookup.
- name
- The unique name of the resulting resource.
- id
- The unique provider ID of the resource to lookup.
- state
- Any extra arguments used during the lookup.
- opts
- A bag of options that control this resource's behavior.
- name
- The unique name of the resulting resource.
- id
- The unique provider ID of the resource to lookup.
- state
- Any extra arguments used during the lookup.
- opts
- A bag of options that control this resource's behavior.
- name
- The unique name of the resulting resource.
- id
- The unique provider ID of the resource to lookup.
- state
- Any extra arguments used during the lookup.
- opts
- A bag of options that control this resource's behavior.
- Aap
Name string - ClientKey's parent Application Access Point name.
- Create
Time string - Create timestamp, e.g. "2022-08-10T08:03:30Z".
- Not
After string - The ClientKey expiration time. Example: "2027-08-10 T08:03:30Z".
- Not
Before string - The valid start time of the ClientKey. Example: "2022-08-10 T08:03:30Z".
- Password string
- To enhance security, set a password for the downloaded Client Key,When an application accesses KMS, you must use the ClientKey content and this password to initialize the SDK client.
- Private
Key stringData File - The name of file that can save access key id and access key secret. Strongly suggest you to specified it when you creating access key, otherwise, you wouldn't get its secret ever.
- Aap
Name string - ClientKey's parent Application Access Point name.
- Create
Time string - Create timestamp, e.g. "2022-08-10T08:03:30Z".
- Not
After string - The ClientKey expiration time. Example: "2027-08-10 T08:03:30Z".
- Not
Before string - The valid start time of the ClientKey. Example: "2022-08-10 T08:03:30Z".
- Password string
- To enhance security, set a password for the downloaded Client Key,When an application accesses KMS, you must use the ClientKey content and this password to initialize the SDK client.
- Private
Key stringData File - The name of file that can save access key id and access key secret. Strongly suggest you to specified it when you creating access key, otherwise, you wouldn't get its secret ever.
- aap
Name String - ClientKey's parent Application Access Point name.
- create
Time String - Create timestamp, e.g. "2022-08-10T08:03:30Z".
- not
After String - The ClientKey expiration time. Example: "2027-08-10 T08:03:30Z".
- not
Before String - The valid start time of the ClientKey. Example: "2022-08-10 T08:03:30Z".
- password String
- To enhance security, set a password for the downloaded Client Key,When an application accesses KMS, you must use the ClientKey content and this password to initialize the SDK client.
- private
Key StringData File - The name of file that can save access key id and access key secret. Strongly suggest you to specified it when you creating access key, otherwise, you wouldn't get its secret ever.
- aap
Name string - ClientKey's parent Application Access Point name.
- create
Time string - Create timestamp, e.g. "2022-08-10T08:03:30Z".
- not
After string - The ClientKey expiration time. Example: "2027-08-10 T08:03:30Z".
- not
Before string - The valid start time of the ClientKey. Example: "2022-08-10 T08:03:30Z".
- password string
- To enhance security, set a password for the downloaded Client Key,When an application accesses KMS, you must use the ClientKey content and this password to initialize the SDK client.
- private
Key stringData File - The name of file that can save access key id and access key secret. Strongly suggest you to specified it when you creating access key, otherwise, you wouldn't get its secret ever.
- aap_
name str - ClientKey's parent Application Access Point name.
- create_
time str - Create timestamp, e.g. "2022-08-10T08:03:30Z".
- not_
after str - The ClientKey expiration time. Example: "2027-08-10 T08:03:30Z".
- not_
before str - The valid start time of the ClientKey. Example: "2022-08-10 T08:03:30Z".
- password str
- To enhance security, set a password for the downloaded Client Key,When an application accesses KMS, you must use the ClientKey content and this password to initialize the SDK client.
- private_
key_ strdata_ file - The name of file that can save access key id and access key secret. Strongly suggest you to specified it when you creating access key, otherwise, you wouldn't get its secret ever.
- aap
Name String - ClientKey's parent Application Access Point name.
- create
Time String - Create timestamp, e.g. "2022-08-10T08:03:30Z".
- not
After String - The ClientKey expiration time. Example: "2027-08-10 T08:03:30Z".
- not
Before String - The valid start time of the ClientKey. Example: "2022-08-10 T08:03:30Z".
- password String
- To enhance security, set a password for the downloaded Client Key,When an application accesses KMS, you must use the ClientKey content and this password to initialize the SDK client.
- private
Key StringData File - The name of file that can save access key id and access key secret. Strongly suggest you to specified it when you creating access key, otherwise, you wouldn't get its secret ever.
Import
KMS Client Key can be imported using the id, e.g.
$ pulumi import alicloud:kms/clientKey:ClientKey example <id>
Resource attributes such as password
, private_key_data_file
are not available for imported resources as this information cannot be read from the KMS API.
To learn more about importing existing cloud resources, see Importing resources.
Package Details
- Repository
- Alibaba Cloud pulumi/pulumi-alicloud
- License
- Apache-2.0
- Notes
- This Pulumi package is based on the
alicloud
Terraform Provider.