m6web / aws-bundle
Bundle Client AWS
Installs: 61 477
Dependents: 0
Suggesters: 0
Security: 0
Stars: 3
Watchers: 49
Forks: 1
Open Issues: 0
Requires
- php: >=5.4
- aws/aws-sdk-php: ~2.6
- symfony/dependency-injection: ^2.8 || ^3.0
Requires (Dev)
- atoum/atoum-bundle: dev-master
- m6web/coke: ~2.1
- m6web/symfony2-coding-standard: ~3.3
Suggests
- doctrine/cache: 1.3.0
README
Aws client as a Symfony Service
⚠ This bundle is deprecated
Please use the official AWS Symfony bundle instead.
configure your AWS user credentials and services
Reference guide of AWS configuration services. See AWS Configuration reference
m6_web_aws
:-
credentials
: # List of AWS user credentialsdefault
: Name of AWS userkey
: "azerty" [optional] Your AWS user's access key ID. See AWS access keyssecret
: "1337" [optional] Your AWS user's secret access key. See AWS access keysregion
: "us-west-2" [optional] Region name (e.g., 'us-east-1', 'us-west-1', 'us-west-2', 'eu-west-1', etc.)scheme
: [optional] URI Scheme of the base URL (e.g.. 'https', 'http') used when base_url is not supplied.base_url
: [optional] Allows you to specify a custom endpoint instead of having the SDK build one automatically from the region and scheme.signature
: [optional]signature_service
: [optional] Alias of signature.service. The signature service scope for Signature V4. See Setting a custom endpointsignature_region
: [optional] Alias of signature.region. The signature region scope for Signature V4. See Setting a custom endpointcurl_options
: [optional] Alias of curl.optionsrequest_options
: [optional] Alias of request.optionscommand_params
: [optional] Alias of command.params
ops
: # Another AWS userkey
: ...secret
:region
:
-
clients
:6cloud_cdn
:credential
: "default" [optional] AWS user nameservice
: "S3" [required] AWS service Alias (see below)region
: "us-west-1" [optional] Override region name.
-
s3
:buckets
:dev
: Name of the bucket (use to define service name)name
: "s3-bucket-name" Real name of the bucketclient
: "6cloud_cdn" Client name defined above
-
sqs
:dev
: Name of the sqs config (use to define service name)client
: "sqs_client" Client name defined above
-
sts
:dev
: Name of the sts config (use to define service name)client
: "sts_client" Client name defined above
-
dynamodb
:dev
: Name of the clientclient
: "6cloud_cdn" Client name defined above
-
Aliases for AWS Services :
(case sensitive)
- AutoScaling
- CloudFormation
- CloudFront
- cloudfront (version : 2012-05-05)
- CloudSearch
- cloudsearch (version : 2011-02-01)
- CloudTrail
- CloudWatch
- DataPipeline
- DirectConnect
- DynamoDb
- dynamodb (version: 2011-12-05)
- Ec2
- ElastiCache
- ElasticBeanstalk
- ElasticLoadBalancing
- ElasticTranscoder
- Emr
- Glacier
- Kinesis
- Iam
- ImportExport
- OpsWorks
- Rds
- Redshift
- Route53
- S3
- SimpleDb
- Ses
- Sns
- Sqs
- StorageGateway
- Sts
- Support
- Swf
SQS Example
$client = $this->getContainer()->get('m6web_aws.sqs.workers');
$queue = $client->getQueue('queue_test');
for ($i=0; $i<100; $i++) {
echo $client->sendMessage($queue, "hello world $i") . "\n";
}
$i = 0;
while($messages = $client->receiveMessage($queue, 10)) {
foreach($messages as $message) {
echo $message['Body'] . "... ";
if ($client->deleteMessage($queue, $message['ReceiptHandle'])) {
echo "OK\n";
$i++;
} else echo "ERROR\n";
}
}
echo"\n===> READ : $i\n";
STS Example
$client = $this->getContainer()->get('m6web_aws.sts.m6');
$sessionToken = $client->getSessionToken();
$credentials = $client->createCredentials($sessionToken);
echo "Key : " . $credentials->getSecretKey() . "\n";
echo "Token : " . $credentials->getSecurityToken() . "\n";
DataCollector
DataCollector is enabled by defaut.
To disable :
m6_web_aws:
disable_data_collector: true
Unit tests :
composer install
./bin/atoum