All Products
Search
Document Center

Key Management Service:RAM secret plug-in

Last Updated:Sep 15, 2026

After you host the AccessKey of a RAM user in KMS, you can install the RAM secret plug-in. When you use Alibaba Cloud SDKs, reference the RAM secret name to obtain the AccessKey for API authentication, without the need to know the AccessKey details or whether it is rotated. This topic describes the working principle, installation, and usage of the RAM secret plug-in.

Working principle

The RAM secret plug-in retrieves the RAM secret value from KMS based on the secret name and caches the value in the memory of the application. When the application uses an Alibaba Cloud SDK, the plug-in uses the cached AccessKey to send requests to cloud services.

When the cached AccessKey becomes invalid due to secret rotation, the RAM secret plug-in immediately retrieves the new secret from KMS and refreshes the local cache. Then, based on the error retry behavior that you configured, the plug-in retries the cloud service API request by using the latest RAM secret. By default, the RAM secret plug-in determines that the AccessKey is invalid based on the InvalidAccessKeyId and InvalidAccessKeyId.NotFound error codes in the cloud service API response.

Supported Alibaba Cloud SDKs

KMS provides RAM secret plug-ins for the Alibaba Cloud SDKs listed in the following tables.

Important

The RAM secret plug-in must be developed separately for each Alibaba Cloud SDK. If the RAM secret plug-in cannot meet your requirements, use the Secrets Manager Client or Alibaba Cloud SDK. For more information about each SDK, see SDK references. You can also contact technical support for assistance.

Java SDK (Java 8 and later only)

Alibaba Cloud SDK

RAM secret plug-in module

Alibaba Cloud SDK for Java (V2.0)

aliyun-java-tea-openapi-sdk-managed-credentials-provider

Alibaba Cloud SDK for Java (V1.0)

aliyun-java-sdk-managed-credentials-provider

OSS Java SDK V1

aliyun-oss-java-sdk-managed-credentials-provider

Message Queue for Apache RocketMQ TCP Protocol Java SDK

ons-client-managed-credentials-provider

Python SDK

Alibaba Cloud SDK

RAM secret plug-in module

Description

Alibaba Cloud SDK for Python (V1.0)

aliyun-openapi-python-sdk-managed-credentials-provider

Only V1.0 is supported. V2.0 is not supported. For V2.0, use the Secrets Manager Client or Alibaba Cloud SDK.

OSS Python SDK

aliyun-oss-python-sdk-managed-credentials-provider

None.

Go SDK

Important

The Go secret plug-in does not automatically retry when an InvalidAccessKeyId error occurs. Automatically rotated secrets can obtain new secrets through the scheduled refresh mechanism (every 6 hours). If you need to rotate secrets manually, make sure the rotation window is at least 12 hours to avoid task interruptions caused by expired credentials. For more information, see How do I resolve credential expiration after the Go RAM plug-in reports the InvalidAccessKeyId error?.

Alibaba Cloud SDK

RAM secret plug-in module

Description

Alibaba Cloud SDK for Go (V1.0)

alibaba-cloud-sdk-go-managed-credentials-provider

Only V1.0 is supported. V2.0 is not supported. For V2.0, use the Secrets Manager Client or Alibaba Cloud SDK.

OSS Go SDK

aliyun-oss-go-sdk-managed-credentials-provider

None.

Step 1: Create access credentials

Scenario 1: Obtain credential values through a shared gateway

The network type is Internet or VPC. Access credentials support ECS instance RAM roles and ClientKeys.

ECS instance RAM role

An ECS instance RAM role allows you to obtain a temporary access credential (STS token) from within an ECS instance to call KMS API operations, without needing to configure an AccessKey pair.

For more information, see Instance RAM roles.

  1. Log on to the RAM console and create a RAM role for a trusted Alibaba Cloud service.

    • Trusted Entity Type: Select Elastic Compute Service.

    • Trusted entity: Select Elastic Compute Service (ECS).

  2. Grant the RAM role permissions to access KMS.

    • Method 1: Configure an identity-based policy

      In the Actions column of the RAM role, click Grant Permission to attach a built-in system permission policy for KMS to the RAM role. For more information about the system permission policies for KMS, see System policies for KMS.

      Note

      You can also create custom permission policies. For more information, see Create a custom policy.

    • Method 2: Configure a resource-based policy

      KMS supports resource-based policies that grant access permissions for individual keys and secrets. You can use these policies to control which Alibaba Cloud accounts, RAM users, and RAM roles can manage or use KMS keys and secrets. For more information, see Key policies and Secret policies.

  3. Log on to the ECS console and attach the RAM role to an ECS instance.

ClientKey

  1. Log on to the Key Management Service console. In the top navigation bar, select a region. In the left-side navigation pane, choose Application Access > Multi-Cloud Access (formerly AAP).

  2. (Optional) Create a network rule.

    Note

    Configuring a network rule to restrict access by source IP address is optional. However, we recommend configuring one for better security.

    1. Click the Network Access Rules tab and then click Create Network Access Rule.

    2. In the Create Network Access Rule panel, set Network Type to Public, enter the Allowed Source IP Addresses, and click OK.

  3. Create a permission policy.

    1. Click the Policies tab and then click Create Policy.

    2. In the Create Policy panel, configure the parameters for the shared gateway as described below, and then click OK.

      1. Scope: Shared KMS Gateway

      2. Accessible Resources: Select the secrets you want to access.

      3. (Optional) Network Access Rules: Select the network rule created in the previous step.

  4. Create an application access point (AAP).

    1. Click the Application Access tab and then click Create AAP.

    2. In the Create AAP panel, set Mode to Standard Creation, and then configure the parameters as described below.

      Parameter

      Description

      Authentication Method

      Select ClientKey.

      Encryption Password

      Enter an 8- to 64-character string that contains digits, letters, and special characters: ~!@#$%^&*?_-.

      Validity Period

      Important

      We recommend setting the validity period to one year to reduce the risk of ClientKey leaks. Be sure to rotate the ClientKey before it expires to avoid service interruptions. For more information, see Rotate a ClientKey.

      Policies

      Select the permission policy that you created in the previous step.

    3. Click OK. The browser automatically downloads the ClientKey. The ClientKey includes the following files:

      • Credential (ClientKeyContent): The default filename is clientKey_****.json.

      • Credential password (ClientKeyPassword): The default filename is clientKey_****_Password.txt.

Scenario 2: Obtain credential values through a dedicated gateway (not recommended)

The network type is KMS private network. Access credentials support only ClientKeys.

You can create a ClientKey by using either Quick Create or Standard Create mode. For more information about ClientKeys, see Application access points and Create an application access point.

  • Method 1: Quick Create

    This method is convenient and efficient, making it suitable for rapid testing and development. The access credential created this way has full access to all resources in the KMS instance.

    1. Log on to the Key Management Service console. In the top navigation bar, select a region. In the left-side navigation pane, choose Application Access > Multi-Cloud Access (formerly AAP).

    2. On the Application Access tab, click Create AAP. In the Create AAP panel, configure the parameters.

      Parameter

      Description

      Mode

      Select Quick Creation.

      Scope (KMS Instance)

      Select the KMS instance that your application needs to access.

      Application Access Point Name

      Enter a name for the application access point.

      Authentication Method

      This is set to ClientKey and cannot be changed.

      Default Permission Policy

      The value is key/* secret/* and cannot be changed. This means the application can access all keys and secrets in the specified KMS instance.

    3. Click OK. The browser automatically downloads the ClientKey. The ClientKey includes the following files:

      • Credential (ClientKeyContent): The default filename is clientKey_****.json.

      • Credential password (ClientKeyPassword): The default filename is clientKey_****_Password.txt.

  • Method 2: Standard Create

    If you need to configure fine-grained access permissions for resources, we recommend that you use the Standard Create method.

    1. Follow the Standard Create instructions in Create an application access point to create a ClientKey for accessing the dedicated gateway. The key parameters are described below:

      1. When configuring network rules, select Private for the network type.

      2. When you configure the scope of the permission rule, select the corresponding KMS Instance ID.

    2. After creation, your browser automatically downloads the ClientKey, which includes:

      • Credential (ClientKeyContent): The file is named clientKey_****.json by default.

      • Credential password (ClientKeyPassword): The file is named clientKey_****_Password.txt by default.

Step 2: Configure the runtime parameters of the RAM secret plug-in through a configuration file

The RAM secret plug-in supports only configuration files for configuring runtime parameters. You need to create a configuration file (managed_credentials_providers.properties) in the runtime directory of the application and add content to the configuration file based on different authentication methods.

Note

If your application cannot automatically read the managed_credentials_providers.properties file, refer to the code examples and set the configuration file path in the code.

ECS instance RAM role

The following code shows the content of the configuration file.

credentials_type=ecs_ram_role
## The name of the ECS RAM role.
credentials_role_name=#credentials_role_name#
## The region of the associated KMS service.
cache_client_region_id=[{"regionId":"#regionId#"}]

ClientKey (shared gateway)

Obtain the credential value through the KMS shared gateway endpoint. The following code shows the content of the configuration file.

## The type of the access credential.
credentials_type=client_key

## The password for reading the ClientKey: supports reading from an environment variable or a file.
## The credential password: the credential password (ClientKeyPassword) saved when creating the Client Key in the AAP.
client_key_password_from_env_variable=#your client key private key password environment variable name#
client_key_password_from_file_path=#your client key private key password file path#

# The path to the Client Key file.
# The Client Key file: the application identity credential content (ClientKeyContent) downloaded when creating the Client Key in the AAP.
# The default filename after download is ClientKey_******.json.
client_key_private_key_path=#your client key private key file path#

## The region of the associated KMS service.
cache_client_region_id=[{"regionId":"#regionId#"}]

ClientKey (dedicated gateway)

Obtain the credential value through the KMS dedicated gateway endpoint. The following code shows the content of the configuration file.

  • Method 1: Configure the path of the ClientKey credential password (clientKey_****_Password.txt) file for the SDK to read.

    cache_client_dkms_config_info=[{"regionId":"<your dkms regionId>","endpoint":"<your dkms endpoint>","passwordFromFilePath":"< your password file path >","clientKeyFile":"<your Client Key file path>","ignoreSslCerts":false,"caFilePath":"<your CA certificate file path>"}]
  • Method 2: Directly configure the ClientKey credential password (ClientKeyPassword) content

    Warning

    First, store the credential password (ClientKeyPassword), that is, the content in clientKey_****_Password.txt, in a custom environment variable (such as clientKeyPassword_content).

    cache_client_dkms_config_info=[{"regionId":"<your dkms regionId>","endpoint":"<your dkms endpoint>","passwordFromEnvVariable":"<YOUR_PASSWORD_ENV_VARIABLE>","clientKeyFile":"<your ClientKey file path>","ignoreSslCerts":false,"caFilePath":"<your CA certificate file path>"}]

Step 3: Use the RAM secret plug-in in Alibaba Cloud SDKs

Java

Alibaba Cloud SDK for Java (V2.0)

Java 9+ compatibility

Because this plug-in relies on CGLIB for dynamic class proxying, you may encounter the java.lang.reflect.InaccessibleObjectException error when running the program on Java 9 or later.

Add the following JVM parameters when starting the application to allow CGLIB to access restricted APIs:

--add-opens java.base/java.lang=ALL-UNNAMED

For example, when running the program from the command line:

java --add-opens java.base/java.lang=ALL-UNNAMED -jar your-application.jar

If you are running the program in an IDE (such as IntelliJ IDEA or Eclipse), add this parameter to the VM options.

  1. Add the RAM secret plug-in to your project through Maven.

    <dependency>
        <groupId>com.aliyun</groupId>
        <artifactId>aliyun-java-tea-openapi-sdk-managed-credentials-provider</artifactId>
        <version>[1.3.5,]</version>
    </dependency>
    Note

    We recommend that you install the latest version of the plug-in. For more information, see source code.

  2. Obtain the Alibaba Cloud SDK for Java client and call cloud services. The following example uses the ECS DescribeInstances API.

    1. Add the ECS cloud server ecs20140526 dependency.

      <dependency>
          <groupId>com.aliyun</groupId>
          <artifactId>ecs20140526</artifactId>
          <version>7.1.0</version>
      </dependency>
    2. Call the DescribeInstances API operation.

      import com.aliyun.ecs20140526.Client;
      import com.aliyun.ecs20140526.models.DescribeInstancesResponse;
      import com.aliyun.kms.secretsmanager.plugin.tea.openapi.ProxyClientCreator;
      import com.google.gson.Gson;
      
      public class AliyunTeaOpenApiProviderSample {
      
          public static void main(String[] args) throws Exception {
              // Step 1: Specify the name of the hosted secret (the secret name created in KMS).
              String secretName = "your-secret-name";
      
              /*
                If the application cannot read the default configuration file (managed_credentials_providers.properties)
                from the classpath and executable JAR file,
                or if you need to customize the configuration file name, you can call the following code to set a custom configuration file
                and read it in the following order:
                1. "your-config-name" absolute path + filename, which reads the file under the absolute path.
                2. "your-config-name" filename only, which first reads the configuration file under the classpath, then the configuration file in the executable JAR file.
              */
              //ConfigLoader.setConfigName("your-config-name");
      
              // Step 2: Configure the OpenAPI client.
              com.aliyun.teaopenapi.models.Config config = new com.aliyun.teaopenapi.models.Config();
              config.endpoint = "your-product-endpoint"; // Replace with the actual cloud service endpoint.
      
              // Step 3: Create a client instance.
              Client client = ProxyClientCreator.createClient(config, Client.class, secretName);
      
              // Step 4: Call the cloud service API.
              com.aliyun.ecs20140526.models.DescribeInstancesRequest request = new com.aliyun.ecs20140526.models.DescribeInstancesRequest();
              request.setRegionId("cn-hangzhou"); // Set the region ID.
              DescribeInstancesResponse response = client.describeInstances(request);
      
              // Step 5: Print the result.
              System.out.println(new Gson().toJson(response.getBody()));
          }
      }

Alibaba Cloud SDK for Java (V1.0)

  1. Add the RAM secret plug-in to your project through Maven.

    <dependency>
       <groupId>com.aliyun</groupId>
       <artifactId>aliyun-java-sdk-core</artifactId>
       <version>[4.3.2,5.0.0]</version>
    </dependency>
    <dependency>
      <groupId>com.aliyun</groupId>
      <artifactId>aliyun-java-sdk-core-managed-credentials-provider</artifactId>
      <version>[1.3.1,]</version>
    </dependency>
    Note

    We recommend that you install the latest version of the plug-in. For more information, see source code.

  2. Obtain the Alibaba Cloud SDK for Java client and call cloud services.

    The following example uses the ECS DescribeInstanceStatus API.

    1. Add the ECS cloud server aliyun-java-sdk-ecs dependency.

      <dependency>
        <groupId>com.aliyun</groupId>
        <artifactId>aliyun-java-sdk-ecs</artifactId>
        <version>5.11.20</version>
      </dependency>
    2. Call the DescribeInstanceStatus API operation.

      import com.aliyuncs.IAcsClient;
      import com.aliyuncs.ecs.model.v20140526.DescribeInstanceStatusRequest;
      import com.aliyuncs.ecs.model.v20140526.DescribeInstanceStatusResponse;
      import com.aliyun.kms.secretsmanager.plugin.sdkcore.ProxyAcsClient;
      import com.aliyuncs.exceptions.ClientException;
      import com.aliyuncs.exceptions.ServerException;
      
      public class AliyunSdkProviderSample {
          public static void main(String[]args) {
              String secretName="******";
              /*
                If the application cannot read the default configuration file (managed_credentials_providers.properties)
                from the classpath and executable JAR file,
                or if you need to customize the configuration file name, you can call the following code to set a custom configuration file
                and read it in the following order:
                1. "your-config-name" absolute path + filename, which reads the file under the absolute path.
                2. "your-config-name" filename only, which first reads the configuration file under the classpath, then the configuration file in the executable JAR file.
              */
              //ConfigLoader.setConfigName("your-config-name");
              
              // 1. Obtain the ACSClient by using aliyun-java-sdk-managed-credentials-provider.
              IAcsClient client = null;
              try {
                  client = new ProxyAcsClient("<the regionId of ECS>", secretName);
              } catch (ClientException e) {
                   e.printStackTrace();
               }
              // 2. Call the ECS OpenAPI to implement business functions.
              DescribeInstanceStatusRequest request = new DescribeInstanceStatusRequest();
              DescribeInstanceStatusResponse response;
              try {
                   response = client.getAcsResponse(request);
              } catch (ServerException e) {
                   e.printStackTrace();
               } catch (ClientException e) {
                   e.printStackTrace();
               }
              // 3. Release the plug-in resources by closing the client.
              client.shutdown();
          }
      }

Use in OSS SDK

  1. Add the RAM secret plug-in to your project through Maven.

    <dependency>
        <groupId>com.aliyun</groupId>
        <artifactId>aliyun-java-sdk-core</artifactId>
        <version>4.5.17</version>
    </dependency>
    <dependency>
    <groupId>com.aliyun.oss</groupId>
    <artifactId>aliyun-sdk-oss</artifactId>
    <version>[2.1.0,3.10.2]</version>
    <exclusions>
        <exclusion>
            <groupId>com.aliyun</groupId>
            <artifactId>aliyun-java-sdk-kms</artifactId>
        </exclusion>
    </exclusions>
    </dependency>
    <dependency>
    <groupId>com.aliyun</groupId>
    <artifactId>aliyun-sdk-oss-managed-credentials-provider</artifactId>
    <version>[1.3.1,]</version>
    </dependency>
    Note

    We recommend that you install the latest version of the plug-in. For more information, see source code.

  2. Obtain the OSS Java SDK client and call cloud services. The following example uses OSS listBuckets.

    import com.aliyun.kms.secretsmanager.plugin.oss.ProxyOSSClientBuilder;
    import com.aliyun.oss.OSS;
    import com.aliyun.oss.model.Bucket;
    
    import java.util.List;
    
    public class OssProviderSample {
    
        public static void main(String[] args) throws Exception {
            String secretName = "******";
            String endpoint = "https://oss-cn-hangzhou.aliyuncs.com";
    
            /*
              If the application cannot read the default configuration file (managed_credentials_providers.properties)
              from the classpath and executable JAR file,
              or if you need to customize the configuration file name, you can call the following code to set a custom configuration file
              and read it in the following order:
              1. "your-config-name" absolute path + filename, which reads the file under the absolute path.
              2. "your-config-name" filename only, which first reads the configuration file under the classpath, then the configuration file in the executable JAR file.
            */
            //ConfigLoader.setConfigName("your-config-name");
    
            // Obtain the OSS client.
            OSS ossClient = new ProxyOSSClientBuilder().build(endpoint, secretName);
    
    
            // The following is the business code: call Alibaba Cloud OSS services to implement business functions.
            List<Bucket> buckets = ossClient.listBuckets();
            for (Bucket bucket : buckets) {
                if (bucket != null) {
                    // ...
                }
            }
    
            // Release the plug-in resources by closing the client.
            ossClient.shutdown();
        }
    
    }

Python

Alibaba Cloud SDK for Python (V1.0)

  1. Run the pip command to add the RAM secret plug-in to your project.

    pip install aliyun-openapi-python-sdk-managed-credentials-provider
    Note

    Make sure the plug-in version is 0.1.0 or later. For more information, see source code.

  2. Obtain the Alibaba Cloud SDK for Python client and call cloud services.

    from aliyun_sdk_secretsmanager_sdk_core_plugin.proxy_acs_client import ProxyAcsClient
    
       region="cn-hangzhou"
       secretName="******"
    
       # 1. Obtain the ACSClient.
       client = ProxyAcsClient(region_id=region, secret_name=secretName )
    
       # 2. Business code: use the client to call Alibaba Cloud services without code changes.
       ...
    
       # 3. Release the plug-in resources by closing the client.
       client.shutdown()

OSS Python SDK

  1. Run the pip command to add the RAM secret plug-in to your project.

    pip install aliyun-oss-python-sdk-managed-credentials-provider
    Note

    Make sure the plug-in version is 0.1.0 or later. For more information, see source code.

  2. Obtain the Alibaba Cloud OSS Python SDK client and call cloud services.

    from aliyun_sdk_secretsmanager_oss_plugin.proxy_bucket import ProxyBucket
    from itertools import islice
    
    endpoint = "******"
    secret_name ="******"
    bucket_name = "******"
    bucket = ProxyBucket(secret_name=secret_name, endpoint=endpoint, bucket_name=bucket_name)
    objects = bucket.list_objects()
    for b in islice(objects.object_list, 10):
        print(b.key)
    bucket.shutdown()

Go

Alibaba Cloud SDK for Go (V1.0)

  1. Install the RAM secret plug-in for Alibaba Cloud SDK for Go.

    Important
    • We recommend that you install the latest version of the plug-in. For more information, see source code.

    • For Go, the version of alibaba-cloud-sdk-go that the RAM secret plug-in depends on must be earlier than v1.63.0. Check and confirm the version in the go.mod file of the plug-in to avoid potential compatibility issues.

    • Method 1: Use go.mod to manage your dependencies.

      Add the following content to the go.mod file to install the dependency.

      require (
          github.com/aliyun/aliyun-sdk-managed-credentials-providers-go/aliyun-sdk-managed-credentials-providers/alibaba-cloud-sdk-go-managed-credentials-provider vX.X.X
      )
    • Method 2: Use the go get command to obtain the remote code package.

      go get -u github.com/aliyun/aliyun-sdk-mxanaged-credentials-providers-go/aliyun-sdk-managed-credentials-providers/alibaba-cloud-sdk-go-managed-credentials-provider
  2. Obtain the Alibaba Cloud SDK for Go client and call cloud services.

    The following example uses the ECS DescribeInstances API.

    package sample
    
    import (
        "fmt"
        "github.com/aliyun/alibaba-cloud-sdk-go/services/ecs"
        sdkcoreprovider "github.com/aliyun/aliyun-sdk-managed-credentials-providers-go/aliyun-sdk-managed-credentials-providers/alibaba-cloud-sdk-go-managed-credentials-provider/sdk"
    )
    
    func main() {
        secretName := "********"
        regionId := "cn-hangzhou"
    
        client, err := sdkcoreprovider.GetClient(&ecs.Client{}, regionId, secretName)
        if err != nil {
            fmt.Println(err)
            return
        }
        ecsClient := client.(*ecs.Client)
    
        request := ecs.CreateDescribeInstancesRequest()
        instancesResponse, err := ecsClient.DescribeInstances(request)
        if err != nil {
            fmt.Println(err)
            return
        }
    
        for _, instance := range instancesResponse.Instances.Instance {
            // do something with instance
        }
    }

OSS Go SDK

  1. Install the RAM secret plug-in for OSS Go SDK.

    Important
    • We recommend that you install the latest version of the plug-in. For more information, see source code.

    • For Go, the version of alibaba-cloud-sdk-go that the RAM secret plug-in depends on must be earlier than v1.63.0. Check and confirm the version in the go.mod file of the plug-in to avoid potential compatibility issues.

    • Method 1: Use go.mod to manage your dependencies.

      Add the following content to the go.mod file to install the dependency.

      require (
          github.com/aliyun/aliyun-sdk-managed-credentials-providers-go/aliyun-sdk-managed-credentials-providers/aliyun-oss-go-sdk-managed-credentials-provider vX.X.X
      )
    • Method 2: Use the go get command to obtain the remote code package.

      go get -u github.com/aliyun/aliyun-sdk-managed-credentials-providers-go/aliyun-sdk-managed-credentials-providers/aliyun-oss-go-sdk-managed-credentials-provider
  2. Obtain the Alibaba Cloud OSS Go SDK client and call cloud services.

    package sample
    
    import (
        "fmt"
        ossprovider "aliyun-oss-go-sdk-managed-credentials-provider/sdk"
    )
    
    func main() {
        secretName := "********"
        endpoint := "https://oss-cn-hangzhou.aliyuncs.com"
    
        // Obtain the proxy OSS client.
        client, err := ossprovider.New(endpoint, secretName)
        if err != nil {
            fmt.Println(err)
            return
        }
    
        result, err := client.ListBuckets()
        if err != nil {
            fmt.Println(err)
            return
        }
        for _, bucket := range result.Buckets {
            // Business code.
        }
    
        // Release the plug-in resources by closing the client.
        client.Shutdown()
    }

FAQ

How do I resolve credential expiration after the Go RAM plug-in reports the InvalidAccessKeyId error?

  • Cause:

    • The Go secret plug-in does not automatically retry when an InvalidAccessKeyId error occurs.

    • If a short rotation window (such as 10 minutes) that is less than 6 hours is set during manual rotation, the client AccessKey may become invalid before the local cache is refreshed.

  • Solution

    1. Wait for automatic refresh: Automatically rotated secrets can obtain new secrets through the scheduled refresh mechanism (the interval is 6 hours).

    2. Immediate refresh: When a credential expires, catch the exception and call the sdk.RefreshSecretInfo(secretName) method to manually refresh the RAM secret.

    3. Scheduled refresh: Set up a scheduled task to call sdk.RefreshSecretInfo(secretName) at a custom frequency to refresh the RAM secret, ensuring that the new secret is obtained before the current one expires.

    4. Adjust the rotation window: For manual rotation of RAM secrets, we recommend that you set the rotation window to more than 12 hours.