josmo / drone-elastic-beanstalk

Drone plugin for deploying to AWS Elastic Beanstalk
Apache License 2.0
4 stars 11 forks source link

Invalid paramter #7

Closed clanstyles closed 8 years ago

clanstyles commented 8 years ago

InvalidParameterCombination: Unable to download from S3 location (Bucket: XXX Key: XXX). Reason: Not Found

the same account has access to both ELB and S3 via policy.

deploy:
  elastic_beanstalk:
    access_key: [account key]
    secret_key: [account secret key]
    region: us-west-2
    version_label: v1
    bucket_name: [env's bucket name]
    application: [env name]
    bucket_key: [account secret key]
tboerger commented 8 years ago

I can't verify that as I'm not using elastic beanstalk

tboerger commented 8 years ago

But the error looks like wrong configuration

clanstyles commented 8 years ago

That's what I though. I assume the bucket key is the same as the account's secret key? I'm giving a user access via IAM to EBS and S3

j commented 8 years ago

I'm getting this error too. @clanstyles did you figure this out?

j commented 8 years ago

@tboerger I don't think this implementation of using EB is even correct or near feature complete. Why is it in the Drone docs?

clanstyles commented 8 years ago

It's not. From what I can tell you don't need a secret key for the bucket if the account also has access. I think this was changed a while back with the IAM stuff. You use access_key/secret_key with a user that has access and you should be able to upload. I tried setting a blank secret_key and @tboerger requires one.

I tried to make a fix for it. It was really hard to get drone to give my account permission to test and then write the test itself. You have to push changes and I think I had an issue with the Docker container. Eventually I gave up it's just too much of a hassle. I wish it did work though.

j commented 8 years ago

The bucket key isn't supposed to be a secret key. It's an "S3 bucket key", as in the uploaded file that should exist in S3.. however, I'd think the deployment process (this plugin), should be uploading the file and setting the key, then telling EB to update using that file.

Better yet, drone is all "dockerized", and it would be great to simply be able to upload trigger a container publish, then after the publish, just simply notify EB to pull the latest image that was uploaded (using Docker in EB).

j commented 8 years ago

i.e. http://cloudavail.com/2014/10/26/elasticbeanstalk-docker/

clanstyles commented 8 years ago

Was there any movement on this?

tboerger commented 8 years ago

Was there any movement on this?

No, because I'm not able to reproduce any issue. As far as I know this plugins works like expected. As already said above, the bucket key is not a secret key as you can see here

j commented 8 years ago

@clanstyles i gave up on this. seems like a lot of the drone deploy plugins are just name squatting. stick with docker hub pushing then deploying from the new image

tboerger commented 8 years ago

@joshdvir you are really using this plugin, can you say something to this issue?

joshdvir commented 8 years ago

@tboerger, @clanstyles, @j this is how I do it:

first I upload the zip file to S3 using this:

publish: s3: acl: private region: [AWS region] bucket: [s3 bucket name] access_key: [account key] secret_key: [account secret key] source: [local zip file] target: [target zip to be in s3 bucket]

after the file has been uploaded to S3 this creates a version in EB and update the environment.

deploy: elastic_beanstalk: access_key: [account key] secret_key: [account secret key] region: [AWS region] application: [EB application name] version_label: [application version name] bucket_name: [s3 bucket name] bucket_key: [target zip in s3 bucket] environment_name: [EB environment name] environment_update: true

as you can see the bucket key is the path to the zip file inside the S3 bucket and not the account key. I'm using this plugin daily let me know if you have anymore questions.

tboerger commented 8 years ago

Thanks for this clarification. Should we rename this variable? With a fallback to the old name of course

joshdvir commented 8 years ago

@tboerger there is no need to rename the variable, it takes the same conventions as in Dockerrun.aws.json file which is being using in Elastic Beanstalk, it should stay the same.

tboerger commented 8 years ago

Ok, than I will close this issue as it strongly looks like wrong usage of the plugin.

Aabhusan commented 4 years ago

when i am trying to deploy in the elastic beanstalk it say s3 not found although i have create an s3 bucket. my .drone.yml code is this

kind: pipeline type: docker name: default

steps:

name: deploy to elastic beanstalk image: pelotech/drone-elastic-beanstalk settings: access_key: from_secret: aws_access_key secret_key: from_secret: aws_secret_key region: ap-southeast-2 application: drone ci tester version_label: v1 description: Deployed with DroneCI bucket: drone-node-test bucket_key: from_secret: aws_access_key and the logs says:

image

Aabhusan commented 4 years ago

@joshdvir Can you please help me with this?

josmo commented 4 years ago

@Aabhusan at first glance and looking at the error it looks like it's not finding the s3 object.

Looking at your config, I'm guessing it's because you're using the aws access key for the bucket key (from the secret) but that needs to be the actual object that's being deployed.

access_key and access_secret are for auth bucket and bucket_key are for the location of the s3 item