getCallerIdentity

Use this data source to get the access to the effective Account ID, User ID, and ARN in which this provider is authorized.

Example Usage

package generated_program;
import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.aws.AwsFunctions;
import com.pulumi.aws.inputs.GetCallerIdentityArgs;
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 current = AwsFunctions.getCallerIdentity();
ctx.export("accountId", current.applyValue(getCallerIdentityResult -> getCallerIdentityResult.accountId()));
ctx.export("callerArn", current.applyValue(getCallerIdentityResult -> getCallerIdentityResult.arn()));
ctx.export("callerUser", current.applyValue(getCallerIdentityResult -> getCallerIdentityResult.userId()));
}
}

Return

A collection of values returned by getCallerIdentity.

Parameters

argument

A collection of arguments for invoking getCallerIdentity.


Return

A collection of values returned by getCallerIdentity.

See also

Parameters

id

Account ID number of the account that owns or contains the calling entity.


Return

A collection of values returned by getCallerIdentity.

See also

Parameters

argument

Builder for com.pulumi.aws.kotlin.inputs.GetCallerIdentityPlainArgs.