Skip to content

AWS SDK for Yii2 - Use Amazon Web Services in your Yii2 project

License

Notifications You must be signed in to change notification settings

chrisc0/yii2-aws-sdk

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

17 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

AWS SDK for Yii2 - Use Amazon Web Services in your Yii2 project

This extension provides the AWS SDK integration for the Yii2 framework

Latest Stable Version Total Downloads Latest Unstable Version License

Installation

The preferred way to install this extension is through composer.

Either run

php composer.phar require --prefer-dist fedemotta/yii2-aws-sdk "*"

or add

"fedemotta/yii2-aws-sdk": "*"

to the require section of your composer.json file.

Usage

To use this extension, simply add the following code in your application configuration:

return [
    //....
    'components' => [
        'awssdk' => [
            'class' => 'fedemotta/awssdk/AwsSdk',
            'key' => 'yourkey',
            'secret' => 'yoursecret',
            'region' => 'yourregion',
        ],
    ],
];

Getting all balancer names from AWS:

$awssdk = Yii::$app->awssdk->getAwsSdk();
$elb = $awssdk->get('elasticloadbalancing');
$load_balancers = $elb->describeLoadBalancers()->toArray();
if (isset($load_balancers['LoadBalancerDescriptions'])){
    foreach ($load_balancers['LoadBalancerDescriptions'] as $balancer){
        if (isset($balancer['LoadBalancerName'])){ 
            echo $balancer['LoadBalancerName'];
        }
    }
}

About

AWS SDK for Yii2 - Use Amazon Web Services in your Yii2 project

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages

  • PHP 100.0%