@@ -464,6 +464,13 @@ The IAM access token is added to each outbound request in the `Authorization` he
464464The default value of this property is ` http://169.254.169.254 ` . However, if the VPC Instance Metadata Service is configured
465465with the HTTP Secure Protocol setting (` https ` ), then you should configure this property to be ` https://api.metadata.cloud.ibm.com ` .
466466
467+ - serviceVersion: (optional) The VPC Instance Metadata Service version to use.
468+ The default value is ` 2022-03-01 ` . When set to ` 2025-08-26 ` , the authenticator will use the new API paths
469+ (` /identity/v1/token ` and ` /identity/v1/iam_tokens ` ) instead of the legacy paths.
470+
471+ - tokenLifetime: (optional) The lifetime (in seconds) of the instance identity token.
472+ The default value is ` 300 ` seconds. This property can only be configured programmatically (not via environment variables).
473+
467474Usage Notes:
4684751 . At most one of ` iamProfileCrn ` or ` iamProfileId ` may be specified. The specified value must map
469476to a trusted IAM profile that has been linked to the compute resource (virtual server instance).
@@ -491,12 +498,27 @@ ExampleService service = new ExampleService(ExampleService.DEFAULT_SERVICE_NAME,
491498// 'service' can now be used to invoke operations.
492499```
493500
501+ To use the new service version with custom token lifetime:
502+ ``` java
503+ // Create the authenticator with new service version.
504+ VpcInstanceAuthenticator authenticator = new VpcInstanceAuthenticator .Builder ()
505+ .serviceVersion(" 2025-08-26" )
506+ .tokenLifetime(600 )
507+ .build();
508+ ```
509+
494510### Configuration example
495511External configuration:
496512```
497513export EXAMPLE_SERVICE_AUTH_TYPE=vpc
498514export EXAMPLE_SERVICE_IAM_PROFILE_CRN=crn:iam-profile-123
499515```
516+ To use the new service version:
517+ ```
518+ export EXAMPLE_SERVICE_AUTH_TYPE=vpc
519+ export EXAMPLE_SERVICE_IAM_PROFILE_CRN=crn:iam-profile-123
520+ export EXAMPLE_SERVICE_VPC_IMS_VERSION=2025-08-26
521+ ```
500522Application code:
501523``` java
502524import <sdk_base_package>.ExampleService.v1.ExampleService ;
0 commit comments