@Override
    public CsmConfiguration getConfiguration() {
        String profileName = getProfileName();

        BasicProfile profile = getProfile(profileName);
        if (profile == null) {
            throw new SdkClientException(String.format("Could not find the '%s' profile!",
                        profileName));
        }

        String enabled = profile.getPropertyValue(CSM_ENABLED_PROPERTY);

        if (enabled == null) {
            throw new SdkClientException(String.format("The '%s' profile does not define all the"
                                                       + " required properties!", profileName));
        }

        String host = profile.getPropertyValue(CSM_HOST_PROPERTY);
        host = host == null ? DEFAULT_AWS_CSM_HOST : host;
        String port = profile.getPropertyValue(CSM_PORT_PROPERTY);
        String clientId = profile.getPropertyValue(CSM_CLIENT_ID_PROPERTY);
        clientId = clientId == null ? DEFAULT_AWS_CSM_CLIENT_ID : clientId;

        try {
            int portNumber = port == null ? DEFAULT_AWS_CSM_PORT : Integer.parseInt(port);

            return CsmConfiguration.builder()
                    .withEnabled(Boolean.parseBoolean(enabled))
                    .withHost(host)
                    .withPort(portNumber)
                    .withClientId(clientId)
                    .build();
        } catch (Exception e) {
            throw new SdkClientException(String.format("Unable to load configuration from the '%s'"
                        + " profile!", profileName), e);
        }
    }
Create an instance that loads the configuration from the given profile
name and config file location.

@param profileName The name of the profile.
@param configFileLocationProvider The provider to use to locate the
config file.
aws-java-sdk-core/src/main/java/com/amazonaws/monitoring/ProfileCsmConfigurationProvider.java