Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Credentials must be an instance of Aws\Credentials\CredentialsInterface #4

Open
Levon770 opened this issue Aug 29, 2022 · 2 comments
Open
Assignees
Labels
documentation Improvements or additions to documentation

Comments

@Levon770
Copy link

Configuring like in readme throws error

'components' => [
    // ...
    's3' => [
        'class' => 'frostealth\yii2\aws\s3\Service',
        'credentials' => [ // Aws\Credentials\CredentialsInterface|array|callable
            'key' => 'my-key',
            'secret' => 'my-secret',
        ],
        'region' => 'my-region',
        'defaultBucket' => 'my-bucket',
        'defaultAcl' => 'public-read',
    ],
    // ...
],
Credentials must be an instance of Aws\Credentials\CredentialsInterface

Based on this, the config should be

'components' => [
    // ...
    's3' => [
        'class' => 'frostealth\yii2\aws\s3\Service',
        'credentials' => new Aws\Credentials\Credentials('my-key',  'my-secret'),
        'region' => 'my-region',
        'defaultBucket' => 'my-bucket',
        'defaultAcl' => 'public-read',
    ],
    // ...
],
@Levon770
Copy link
Author

issue also reported at main repository (frostealth/yii2-aws-s3)
frostealth#49

@bpanatta
Copy link
Member

Thanks @Levon770 this might be due to the upgrade of the aws libraries, I will updated the docs on it.

Also, I'd recommend attaching up a IAM role to your EC2 instance and removing this credential parameter (as stated below that piece of code in the docs).

@bpanatta bpanatta self-assigned this Aug 29, 2022
@bpanatta bpanatta added the documentation Improvements or additions to documentation label Aug 29, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
documentation Improvements or additions to documentation
Projects
None yet
Development

No branches or pull requests

2 participants