Class IAMRoleCredentialSupplierBuilder
- java.lang.Object
-
- com.logicaldoc.enterprise.storer.s3.IAMRoleCredentialSupplierBuilder
-
public class IAMRoleCredentialSupplierBuilder extends Object
Build SessionCredentials for JClouds Compute Service API with IAM Role. It is important that the EC2 machine is configured to use IMDSv2 and that is assigned to the IAM role. More informations here: https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/iam-roles-for-amazon-ec2.html and here: https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/configuring-instance-metadata-service.html
-
-
Constructor Summary
Constructors Constructor Description IAMRoleCredentialSupplierBuilder()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description org.jclouds.aws.domain.SessionCredentials
build()
org.jclouds.aws.domain.SessionCredentials
getCredentials()
String
getRoleName()
<E> E
isNotNull(E argument, String argName)
Tests if a string is not nullIAMRoleCredentialSupplierBuilder
withRoleName(String roleName)
-
-
-
Method Detail
-
withRoleName
public IAMRoleCredentialSupplierBuilder withRoleName(String roleName)
-
isNotNull
public <E> E isNotNull(E argument, String argName)
Tests if a string is not null- Type Parameters:
E
- type of the argument- Parameters:
argument
- the string tested to see if it is not nullargName
- the string name (used in message if an error is thrown)- Returns:
- the string argument that was tested
- Throws:
IllegalArgumentException
- if the string is null
-
getRoleName
public String getRoleName()
-
getCredentials
public org.jclouds.aws.domain.SessionCredentials getCredentials()
-
build
public org.jclouds.aws.domain.SessionCredentials build() throws IOException
- Throws:
IOException
-
-