Package software.amazon.awssdk.profiles
Class ProfileFile
java.lang.Object
software.amazon.awssdk.profiles.ProfileFile
Provides programmatic access to the contents of an AWS configuration profile file.
AWS configuration profiles allow you to share multiple sets of AWS security credentials between different tools such as the
AWS SDK for Java and the AWS CLI.
For more information on setting up AWS configuration profiles, see: http://docs.aws.amazon.com/cli/latest/userguide/cli-chap-getting-started.html
A profile file can be created with builder()
and merged with other profiles files with aggregator()
. By
default, the SDK will use the defaultProfileFile()
when that behavior hasn't been explicitly overridden.
-
Nested Class Summary
Modifier and TypeClassDescriptionstatic final class
A mechanism for merging multipleProfileFile
s together into a single file.static interface
A builder for aProfileFile
.static enum
The supported types of profile files. -
Field Summary
-
Method Summary
Modifier and TypeMethodDescriptionstatic ProfileFile.Aggregator
Create a builder that can merge multipleProfileFile
s together.static ProfileFile.Builder
builder()
Create a builder for aProfileFile
.static ProfileFile
Get the default profile file, using the credentials file from "~/.aws/credentials", the config file from "~/.aws/config" and the "default" profile.boolean
getSection
(String sectionName, String sectionTitle) int
hashCode()
Retrieve the profile from this file with the given name.profiles()
Retrieve an unmodifiable collection including all of the profiles in this file.toString()
-
Field Details
-
PROFILES_SECTION_TITLE
- See Also:
-
-
Method Details
-
getSection
-
builder
Create a builder for aProfileFile
. -
aggregator
Create a builder that can merge multipleProfileFile
s together. -
defaultProfileFile
Get the default profile file, using the credentials file from "~/.aws/credentials", the config file from "~/.aws/config" and the "default" profile. This default behavior can be customized using theProfileFileSystemSetting.AWS_SHARED_CREDENTIALS_FILE
,ProfileFileSystemSetting.AWS_CONFIG_FILE
andProfileFileSystemSetting.AWS_PROFILE
settings or by specifying a different profile file and profile name.The file is read each time this method is invoked.
-
profile
Retrieve the profile from this file with the given name.- Parameters:
profileName
- The name of the profile that should be retrieved from this file.- Returns:
- The profile, if available.
-
profiles
Retrieve an unmodifiable collection including all of the profiles in this file.- Returns:
- An unmodifiable collection of the profiles in this file, keyed by profile name.
-
toString
-
equals
-
hashCode
public int hashCode()
-