creocoder / yii2-flysystem

The Flysystem integration for the Yii framework.
Other
283 stars 76 forks source link

Support AWS S3 credentials from environment #35

Closed petrabarus closed 5 years ago

petrabarus commented 6 years ago

In the AwsS3Filesystem, key and secret are required attribute. When using S3 environment credentials for example from Instance Profile, credentials should not be provided.

http://docs.aws.amazon.com/aws-sdk-php/v3/guide/guide/configuration.html#credentials

If you do not provide a credentials option, the SDK will attempt to load credentials from your environment in the following order:

Load credentials from environment variables
Load credentials from a credentials ini file
Load credentials from an IAM instance profile.

Might want to consider removing key and secret check in the init() and adding attribute, let's say clientConfig.