thephalcons / amazonwebservicesbundle Goto Github PK
View Code? Open in Web Editor NEWA Symfony 2 Bundle for interfacing with Amazon Web Services (AWS) using latest aws-sdk-php
A Symfony 2 Bundle for interfacing with Amazon Web Services (AWS) using latest aws-sdk-php
Hi,
having a problem with the writing of css and other assets. JS write randomly, still some files missing, even though they are in the log, css shows up in the log, the files aren't uploaded at all:
23:46:11 [file+] s3://test-bucket/dev/css/c13bbc9_style_1.css
any clues?
I am trying to install - when I run bin/vendors install I get:
[Symfony\Component\Config\Definition\Exception\InvalidConfigurationException]
The child node "key" at path "cybernox_amazon_web_services" must be configured.
Anybody else see this?
Hello, I try to upgrade my symfony project 2.8 to 3.4 and I got this error :
`In XmlFileLoader.php line 386:
Unable to parse file "E:\wamp\www\my-project.com\vendor\thephalcons\amazon-webservices-bundle\AmazonWebServicesBundle\DependencyInjection/../Resources/config\aws_config.xml".
In XmlUtils.php line 101:
[ERROR 1866] Element '{http://symfony.com/schema/dic/services}service', attribute 'factory-service': The attribute 'factory-service' is not allowed. (in file:/E:/wamp/www/my-project.com/ - line 35, column 0)
[ERROR 1866] Element '{http://symfony.com/schema/dic/services}service', attribute 'factory-method': The attribute 'factory-method' is not allowed. (in file:/E:/wamp/www/my-project.com/ - line 35, column 0)
`
Any issue ?
Thanks
Hi,
can you please include local dynamodb support?
It would require a base_url parameter passed to the options, http://docs.aws.amazon.com/amazondynamodb/latest/developerguide/Tools.DynamoDBLocal.html
and would be a huge score for unit testing and sandboxing.
Thanks.
Thanks for the great bundle! In commit fdd2c35 you broke the aws sdk (see s3 for example). The aws classes expect a secret_key as an option and it was renamed. Also, can you add a default credential from parsed config:
class AmazonWebServices
{
private $parameters = null;
public function __construct(array $parameters)
{
$this->parameters = $parameters;
$this->parameters['secret_key'] = $parameters['secret'];
\CFCredentials::set(array(
'runtime' => array_merge($parameters, array('secret_key' => $parameters['secret'])),
'@default' => 'runtime'
));
}
}
Yesterday we had an issue where our infrastructure was scaling up but the application deployment was not able to complete because our vendor install was breaking on the install of your bundle. We were getting an error because it was trying to install your bundle from the tag "stable" as had been specified in our composer.lock (since this was production).
Did you delete a tag?
I was able to recover by regenerating the composer.lock in our application, but it caused a several hour outage on our application.
Hi
I'd like to know if you plan to update to the new AWS SDK
https://github.com/aws/aws-sdk-php
Thanks
Hi,
good work on the bundle first of all, the cdn setup is comprehensive and easy to follow. One problem I ran into trying to upload my assets to S3 is their content type. All assets should have different content types but they turn out to have
application/octet-stream
which is a problem, becase the browser doesn't interpret them correctly and keeps generating errors. Any way to remedy this?
Thanks
first of all, thanks for the bundle, it seems quite nice!
I think that in step 1a of your installation you forgot to add the target=amazonwebservices/aws-sdk-for-php because your bundle is expecting it here.
Installed Cybernox bundle and set up configuration in parameters.yml and config.yml.
In config.yml the settings are as follows:
cybernox_amazon_web_services:
key: %aws_key%
secret: %aws_secret%
default_cache_config: apc
enable_extensions: true
certificate_authority: false
disable_auto_config: false
The bundle is configured correctly and is working in development environment but the same is not working on server.
I get this error when I try to clear the cache: The parameter "cybernox_amazon_web_services.enable_extensions" must be defined.
Is there a override for this extension somewhere?
Can you add support for Amazon Route 53?
Hi,
I was receiving:
The attribute 'factory-service' is not allowed.
From:
aws_config.yml
aws_service.yml
This relates to changes in version 2.7 that are now deprecated in Symfony3.
To fix:
<service id="aws_service" class="AwsService" factory-service="aws_factory" factory-method="get" abstract="true">
<argument type="service" id="aws"/>
</service>
Needs to be changed to:
<service id="aws_service" class="AwsService" abstract="true">
<factory service="aws_factory" method="get"/>
<argument type="service" id="aws"/>
</service>
I was going to fork and PR but I think this might cause some BC breaks of Symfony <2.7.
Cheers
Chris
How do you define the aws_cloudfront_private_key_pem parameter since parameters.ini cannot be multi-lined? I think that yaml files might have support like so possibly:
aws_cloudfront_private_key_pem: |
same param
same param
Anyways we should clear that up in the document. And I'm stuck :)
I am getting a bunch of Failed to determine HOME directory after trying "sh: 1: cd: can't cd to ~" (exit code 2)
in my error logs.
Seems to be originating from sdk.class.php at Line 1484. Is this something to do with the way the Bundle configures amazon's sdk configuration?
Hello everyone,
I'm having an issue, i'm trying to upload a file to an amazon s3 server.
$pdf=$rootdir . '/../web/uploads/pdf/'.$reference.'.pdf';
$s3 = $this->container->get('aws_s3');
$bucket = 'my-bucket';
$headers = $s3->get_object_headers($bucket, $pdf);
var_dump($headers->header['content-type']);
$response = $s3->update_object($bucket, $pdf, array(
'acl' => AmazonS3::ACL_PUBLIC,
'headers' => array(
'Content-Encoding' => 'UTF-8'
),
'meta' => array(
'Cache-Control' => 'Public',
'Max-Age' => '604800',
),
));
var_dump($response->isOK());
But always send me this error:
Warning: Cannot unset offset in a non-array variable in /root/dir/to/my/vendor/amazonwebservices/aws-sdk-for-php/services/s3.class.php line 1881
What i'm doing wrong? i take the example from here : http://docs.aws.amazon.com/AWSSDKforPHP/latest/#m=AmazonS3/update_object
Hope someone could help me.
Hi !
There is a feature described in the README :
Automatically uses [IAM Instance Profile Credentials][aws-iam-credentials] on configured Amazon EC2 instances.
But i can see in doc/todo.md file :
4.Using credentials from environment variables, credentials profiles or env provider[...]
so i suppose this feature isn't effective after all.
In the PHPDoc of the AwsClient constructor we can see :
(Aws\Credentials\CredentialsInterface|array|bool|callable) [...] If no credentials are provided, the SDK will attempt to load them from the environment.
So instead of use
$this->sdk = new Sdk(
array(
'region' => $this->getRegion(),
// use specific aws sdk php version or latest version if not defined
'version' => ($this->getVersion() != ' ' ) ? $this->getVersion() : 'latest',
'credentials' => CredentialProvider::env()
)
);
suggested in doc/todo.md, we should use :
$options = array(
'region' => $this->getRegion(),
// use specific aws sdk php version or latest version if not defined
'version' => ($this->getVersion() !== '') ? $this->getVersion() : 'latest',
);
if ($this->getKey() !== '' && $this->getSecret() !== '') {
$options['credentials'] = new Credentials($this->getKey(), $this->getSecret());
}
$this->sdk = new Sdk($options);
Hope this could help.
Hello I see a dependence with bundle "deprecated"
Any solution ?
When installing the Bundle I get the following error:
AnnotationException: [Semantical Error] The annotation "@array" in method Cybernox\AmazonWebServicesBundle\AmazonWebServices::__construct() was never imported. Did you maybe forget to add a "use" statement for this annotation?
The only way I was able to resolve this was to remove line 25 from AmazonWebServices.php
Hello,
I still have the error Failed to determine HOME directory after trying "sh: 1: cd: can't cd to ~" (exit code 2)
even if I set disable_auto_config:true
in config.yml
.
If think the line
// DependencyInjection/CybernoxAmazonWebServicesExtension.php Line 41
define('AWS_DISABLE_CONFIG_AUTO_DISCOVERY', TRUE);
is not executed as soon as the cache has been created.
NOTE : I temporaly correct the error in doing
$ touch vendor/amazonwebservices/aws-sdk-for-php/config.inc.php
The CFLoader class responsible for autoloading AWS classes makes some assumptions that are breaking in our app. I suggest we unregister this autoloader and provide our own using MapClassLoader.
Can you add a new autoloader to fix the aws default and refactor init logic from sdk.class.php?
I need add in the Cybernox\AmazonWebServicesBundle\StreamWrapper\StreamWrapper file the header parameters.
In the function buildHeadersForContent I need adde the following header:
$headers['Cache-Control'] = "max-age=2592000";
private function buildHeadersForContent($content)
{
$path = tempnam(sys_get_temp_dir(), 's3_mime_type');
file_put_contents($path, $content);
$headers = array();
//My custom header
$headers['Cache-Control'] = "max-age=2592000";
if($this->isFileGzipped($path)){
$headers['Content-Encoding'] = "gzip";
}
unlink($path);
return $headers;
}
How I can do this without modifying the bundle? Is there any option?
Thanks.
[Symfony\Component\DependencyInjection\Exception\InvalidArgumentException]
Unable to parse file "/home/tle/sites/paha-backend/vendor/thephalcons/amazon-webservices-bundle/AmazonWebServicesBundle/DependencyInjection/../Resources/config/aws_config.xml".
[InvalidArgumentException]
[ERROR 1866] Element '{http://symfony.com/schema/dic/services}service', attribute 'factory-service': The attribute 'factory-service' is not allowed. (in /home/tle/sites/paha-backend/ - line 35, column 0)
[ERROR 1866] Element '{http://symfony.com/schema/dic/services}service', attribute 'factory-method': The attribute 'factory-method' is not allowed. (in /home/tle/sites/paha-backend/ - line 35, column 0)
And same comes from aws_service.xml file too
Hi,
I sucsessfully configured CloudFront CDN on http site based on your guide https://github.com/Cybernox/AmazonWebServicesBundle/blob/master/Resources/doc/cdn.md it's works fine without a problem. then I move it for https site stoped working. could you help me to sortout this.
Thanks!
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.