Coder Social home page Coder Social logo

amazonwebservicesbundle's People

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

amazonwebservicesbundle's Issues

Files randomly not writing into s3 via wrapper

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?

Installation InvalidConfigurationException

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?

Upgrade to Symfony 3.4 Service not allowed

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

Renaming secret_key to secret breaks AWS classes

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'
    ));
}

}

Trouble installing in production

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.

Wrong content setting on files uploaded to s3 via stream wrapper

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

step 1a of installation seems incorrect.

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.

Issue setting enable_extension in config.yml Symfony2 on server

Installed Cybernox bundle and set up configuration in parameters.yml and config.yml.
In config.yml the settings are as follows:

Amazon Web Services Configuration

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?

Symfony3 Factory Configuration

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

aws_cloudfront_private_key_pem cannot be multi-line

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 :)

Failed to determine HOME directory after trying....

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?

Cant use the upload of the s3 service

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.

IAM Instance Profile Credentials and Amazon EC2 instances.

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.

Array Annotation Error

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

disable_auto_config and cache

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

Implement MapClassLoader instead of relying on AWS SDK

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?

Add header in the s3 S3StreamWrapper

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.

Multiple issues within Symfony 3

 [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

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.