24 lines
1.1 KiB
Java
24 lines
1.1 KiB
Java
package com.muyu.instance;
|
||
|
||
/**
|
||
* @author gxb
|
||
* @description TODO
|
||
* @date 2024-04-13 12:40
|
||
*/
|
||
public class ClientConfig {
|
||
|
||
public static com.aliyun.ecs20140526.Client createClient() throws Exception {
|
||
// 工程代码泄露可能会导致 AccessKey 泄露,并威胁账号下所有资源的安全性。以下代码示例仅供参考。
|
||
// 建议使用更安全的 STS 方式,更多鉴权访问方式请参见:https://help.aliyun.com/document_detail/378657.html。
|
||
com.aliyun.teaopenapi.models.Config config = new com.aliyun.teaopenapi.models.Config()
|
||
// 必填,请确保代码运行环境设置了环境变量 ALIBABA_CLOUD_ACCESS_KEY_ID。
|
||
.setAccessKeyId("LTAI5tS15R28wsYmgZ8uZonR")
|
||
// 必填,请确保代码运行环境设置了环境变量 ALIBABA_CLOUD_ACCESS_KEY_SECRET。
|
||
.setAccessKeySecret("ETEMZeUhPSb1M6d0kR0XVBaIkzshqB");
|
||
// Endpoint 请参考 https://api.aliyun.com/product/Ecs
|
||
config.endpoint = "ecs.cn-shanghai.aliyuncs.com";
|
||
return new com.aliyun.ecs20140526.Client(config);
|
||
}
|
||
|
||
}
|