Interface AwsIamServiceIdentityConfiguration
- All Superinterfaces:
ResolvableServiceIdentityConfiguration
This includes the IAM ARN and optionally, static credentials (access key, secret key, and
session token). If credentials are provided, they will be used to construct a AwsIamServiceIdentityCredential; otherwise, the AWS default credential provider chain is used.
-
Method Summary
Modifier and TypeMethodDescriptionOptional AWS access key ID associated with the IAM identity.default Optional<org.apache.polaris.core.identity.credential.AwsIamServiceIdentityCredential> asServiceIdentityCredential(org.apache.polaris.core.secrets.SecretReference secretReference) Converts this configuration into aAwsIamServiceIdentityCredentialwith actual AWS credentials.default Optional<org.apache.polaris.core.admin.model.AwsIamServiceIdentityInfo> Returns theAwsIamServiceIdentityInfomodel containing only the IAM ARN.default software.amazon.awssdk.auth.credentials.AwsCredentialsProviderConstructs anAwsCredentialsProviderbased on the configured access key, secret key, and session token.Returns the default AWS IAM service identity configuration.default org.apache.polaris.core.identity.ServiceIdentityTypegetType()Returns the type of service identity represented by this configuration, which is alwaysServiceIdentityType.AWS_IAM.iamArn()The IAM role or user ARN representing the service identity.Optional AWS secret access key associated with the IAM identity.Optional AWS session token associated with the IAM identity.
-
Method Details
-
iamArn
String iamArn()The IAM role or user ARN representing the service identity. If not provided, Polaris won't surface it in the catalog identity. -
accessKeyId
Optional AWS access key ID associated with the IAM identity. If not provided, the AWS default credential chain will be used. -
secretAccessKey
Optional AWS secret access key associated with the IAM identity. If not provided, the AWS default credential chain will be used. -
sessionToken
Optional AWS session token associated with the IAM identity. If not provided, the AWS default credential chain will be used. -
getType
default org.apache.polaris.core.identity.ServiceIdentityType getType()Returns the type of service identity represented by this configuration, which is alwaysServiceIdentityType.AWS_IAM.- Specified by:
getTypein interfaceResolvableServiceIdentityConfiguration- Returns:
- the AWS IAM service identity type
-
asServiceIdentityInfoModel
default Optional<org.apache.polaris.core.admin.model.AwsIamServiceIdentityInfo> asServiceIdentityInfoModel()Returns theAwsIamServiceIdentityInfomodel containing only the IAM ARN.This method is lightweight and does not construct AWS credential providers. It should be used for API responses where only identity metadata is needed.
- Specified by:
asServiceIdentityInfoModelin interfaceResolvableServiceIdentityConfiguration- Returns:
- the service identity info model, or empty if the IAM ARN is not configured
-
asServiceIdentityCredential
default Optional<org.apache.polaris.core.identity.credential.AwsIamServiceIdentityCredential> asServiceIdentityCredential(@Nonnull org.apache.polaris.core.secrets.SecretReference secretReference) Converts this configuration into aAwsIamServiceIdentityCredentialwith actual AWS credentials.Creates a credential object containing the configured IAM ARN and AWS credentials provider. The credentials provider is constructed based on whether static credentials (access key, secret key, session token) are configured or whether to use the default AWS credential chain.
This method should only be called when credentials are actually needed for authentication.
- Specified by:
asServiceIdentityCredentialin interfaceResolvableServiceIdentityConfiguration- Parameters:
secretReference- the secret reference to associate with this credential- Returns:
- the service identity credential
-
awsCredentialsProvider
@Nonnull default software.amazon.awssdk.auth.credentials.AwsCredentialsProvider awsCredentialsProvider()Constructs anAwsCredentialsProviderbased on the configured access key, secret key, and session token. If the access key and secret key are provided, a static credentials provider is created; otherwise, the default credentials provider chain is used.- Returns:
- the constructed AWS credentials provider
-
defaultConfiguration
Returns the default AWS IAM service identity configuration.This configuration is used only when the default realm (
DEFAULT_REALM_KEY) has no explicit service identity configuration. It uses the AWS default credential provider chain to obtain credentials from the environment (e.g., environment variables, EC2 instance metadata, ECS task metadata, etc.) without requiring an explicit IAM ARN.- Returns:
- the default AWS IAM service identity configuration
-