Setting environment variables during Elastic Beanstalk deployment
Hello,
I am trying to deploy to Elastic Beanstalk using the new EBS deployment type and have the deployment process set the environment variables using a powershell script such as deploy.ps1 (which does not appear to be running)
I believe there is a way to specify in the deployment manifest to run some scripts but what I am not sure of is if this script will have access to the environment variables defined in the appveyor environment.
Thanks.
Comments are currently closed for this discussion. You can start a new one.
Keyboard shortcuts
Generic
? | Show this help |
---|---|
ESC | Blurs the current field |
Comment Form
r | Focus the comment reply box |
---|---|
^ + ↩ | Submit the comment |
You can use Command ⌘
instead of Control ^
on Mac
1 Posted by Ilya Finkelshte... on 14 Feb, 2019 06:29 PM
Hi Dario,
We certainly need more details to help.
Export YAML
button if you use UI) and deployment screenshot (if you use environment deployment)?Any other additional information to understand your problem is welcome. Feel free to make this thread private and remove all secrets from YAML or screenshots if any,
Ilya.
2 Posted by Dario Segura on 15 Feb, 2019 04:20 AM
Hi Ilya,
- By "new EBS deployment type" I was referring to the "Amazon Elastic Beanstalk" environment
- Yes, I am using the AppVeyor EBS deployment
- I am using the inline deployment
I am able to successfully deploy via the AppVeyor agent in other environments and the environment variables defined for the environment are available when deploy.ps1 runs but that does not appear to be the case for the AppVeyor EBS deployment.
Thanks,
Dario
3 Posted by Ilya Finkelshte... on 15 Feb, 2019 11:46 PM
Ah I see...
Those are different deployment providers:
deploy.ps1
script.awsdeploy.exe
does.If you want the same experience with AWS as you have with Deployment Agent environments, you can use AppVeyor Deployment agent on EC2 instances instead of using EBS. You can have agent baked into AMI or better install or update it when needed with AWS run command. We have quite a few customers using AppVeyor Deployment agent on EC2 instances so we can help you with scripting if you decide to go that route.
4 Posted by Dario Segura on 25 Feb, 2019 04:24 AM
Thanks Ilya,
Running the AppVeyor deployment agent on an EC2 is straight forward, I got that running without issues, what I am wondering is how to make things work better with Amazon Elastic Beanstalk.
When using the "Amazon Elastic Beanstalk" environment I can use all the settings such as environment name and application name but I still don't understand how I can use the Environment variables section. I am assuming if we can define environment variables for this type of environment is because they can be used when deploying to EBS but the question is how to access those values in EBS?
I do have a file called aws-windows-deployment-manifest.json that I am including in the zip file being deployed to EBS and in it I have a "postInstall" powershell script but again not sure if/how I can access the environment variables defined in AppVeyor for the environment.
Your help would be very appreciated.
Thanks,
Dario
5 Posted by Ilya Finkelshte... on 25 Feb, 2019 10:21 PM
Hi Dario,
Variables in "Environment" deployments are being used to substitute deployment provider settings, not to pass to the target machine. This substitution makes sense when calling deployment environment from the build. Also environment variables can be passed when calling deployment environment with API.
Please check those parts of documentation:
Agent deployment is different from other deployment environments because with it we have a control over target machine. In other cases we do not have such luxury so environment variables set in AppVeyor are not available on the target systems.
Did you look at settings required variables in EBS environment software settings as described here? Also how your "postInstall" powershell script is going to be called?
Ilya.
Ilya Finkelshteyn closed this discussion on 28 Apr, 2019 09:00 PM.