aws / aws-toolkit-visual-studio

AWS Toolkit for Visual Studio - a plugin to interact with AWS
https://aws.amazon.com/visualstudio/
Apache License 2.0
111 stars 29 forks source link

Environment Configuration Options Missing from 'Publish To AWS' for Elastic Beanstalk #398

Open Pelias2525 opened 9 months ago

Pelias2525 commented 9 months ago

Describe the bug There are numerous configuration options missing from 'Publish to AWS' for Elastic Beanstalk that require the environment be completely rebuilt or, when an initial deployment fails, leaves the user unable to reconfigure the environment via the Console to remedy if the environment is not in a 'Ready' state. It would be helpful if these options were available in the AWS Toolkit UI when initially configuring an environment 1) Load Balancer Options: these changes require the recreation of a load balancer and therefore a new environment to change and aren't currently available in the AWS Toolkit UI

To Reproduce 1) Publish an Elastic Beanstalk environment through the 'Publish to AWS' context menu. During configuration, if you need to configure your Load Balancer to be internal or shared, you cannot. If you try to change these settings through the console you receive the error: Updating Load Balancer listener named: arn:aws:elasticloadbalancing:xxxxx failed Reason: Resource handler returned message: "The following target groups cannot be associated with more than one load balancer: arn:aws:elasticloadbalancingxxxx (Service: ElasticLoadBalancingV2, Status Code: 400,..)" (HandlerErrorCode: ServiceLimitExceeded). Currently if you need these options you can't use the tool. 2) Publish an Elastic Beanstalk environment through the 'Publish to AWS' context menu. If there are any errors with the application deployment the environment configuration will complete, but the environment will be in a Severe state since the health check fails. At that point the only diagnostics to determine the root cause would be in the application logs. However, you cannot turn on Cloudwatch log streaming in the Console because the application is not in a 'Ready' state. In my case there was a dll that didn't work on the linux deployment and caused the application to fail during loading.

Expected behavior These settings are available through the 'Publish to AWS' UI since they directly impact the user's ability to configure the initial environment.

Development System (please complete the following information):

rbbarad commented 8 months ago

Hi @Pelias2525, this is great feedback - thanks for bringing this to our attention. We are investigating this further

Pelias2525 commented 8 months ago

Appreciated. Also, if your goal is to completely replace the 'Publish to AWS Elastic Beanstalk (Legacy)' UI, there needs to be a way to deploy an application to an existing environment not created through the "Publish to AWS" UI. The legacy tooling can see existing environments and allows you to publish to them. Without adding this, no one will be able to migrate to the new tooling because they've already invested the time / infrastructure to create their environments and it's an unrealistic expectation to have your userbase recreate the environments they're currently publishing to.

rbbarad commented 8 months ago

Hi @Pelias2525, I'd like to understand a bit more about the nature of your deployments. Are you using Publish to AWS to curate the ideal development environment, or are you using it to update your Production environment?

Pelias2525 commented 8 months ago

I'm looking at migrating my EC2 / IIS .Net sites to Elastic Beanstalk. AWS Toolkit is a large factor in determining the feasibility of such a migration. Currently I cannot use the Publish to AWS functionality, because I need to specify a shared load balancer, which is not offered by that UI. That forces me to create each Beanstalk environment through the Console (which is fine). However, after doing so, I still can't use the Publish to AWS functionality, since environments set up through the Console do not appear in the Publish To AWS UI. I can see the Console-created Environments using the Legacy UI, which would work fine if it will continue to be supported. However, I know it's AWS' intention to remove the Legacy UI at some point. I am extremely concerned about the possibility of migrating my sites over to Elastic Beanstalk and at some point in the future being left in a situation where the Legacy tooling is removed and it's replacement (Publish to AWS) does not provide the ability to publish to the environments that I will have configured through the Console.

rbbarad commented 8 months ago

Ah I see - thanks for that context. The Toolkit is intended for use while developing and iterating within a development environment. We don't recommend using the Toolkit to deploy systems to productions (aka "click-ops"). Our guidance is to use infrastructure as code approaches like the CDK or CloudFormation to manage production level systems.

While the Toolkit doesn't help with this today, the Deploy Tool CLI can help set you up with a CDK project, which can be used for subsequent deployments, even from CI/CD systems. More details are available at https://aws.github.io/aws-dotnet-deploy/docs/deployment-projects/

Pelias2525 commented 8 months ago

I can appreciate that different sized organizations have different needs for controlling their environments and that there can be value in Infrastructure as Code. From my understanding, if you want a high level of control over your environments you use IaC with Elastic Container Service and control every level of minutia.

On it's front page, Elastic Beanstalk is advertised as "AWS Elastic Beanstalk deploys web applications so that you can focus on your business." When I search for 'ASP.Net Core Elastic Beanstalk', I get this walkthrough from AWS showing how to deploy to Elastic Beanstalk using AWS Toolkit and the 'Publish to AWS' feature. In the AWS Tutorial for Deploying ASP.NET Applications to Elastic Beanstalk it states "If you use Visual Studio to develop your application, you can also use the AWS Toolkit for Visual Studio to deploy changes, manage your Elastic Beanstalk environments, and manage other AWS resources."

I want to use AWS Toolkit to deploy my code to Elastic Beanstalk as advertised. I'm fine if the toolkit wants to add functionality, but as of right now: 1) It doesn't sync with configuration changes made to the environment through other means 2) It doesn't contain the core features needed to stand up an environment (for me, those items I outlined at the start of my ticket) 3) It doesn't allow me to deploy my code to an existing environment 4) It apparently isn't recommended for publishing to production systems

Before I go to the trouble of rearchitecting, I would like assurance from AWS that the toolkit will remain the tool that it is advertised to be. If that's the Legacy UI, then fine, but don't take it away in 2 years without a viable alternative after I've already committed to using it. Please advise. Thank you.

saurabhajmera commented 8 months ago

Our goal is to add additional capabilities to Publish to AWS experience to bring it to feature parity with the legacy Publish to Elastic Beanstalk experience. Once we have a better alternative to the legacy Publish to Elastic Beanstalk experience, we will announce a removal date for the Publish to Elastic Beanstalk experience.

As a reminder, the Publish to AWS and Publish to Elastic Beanstalk features are not intended for production deployments. Instead, we suggest using CDK or CloudFormation. See this reply from rbbarad for more details.

Pelias2525 commented 8 months ago

Appreciated. Please consider adding those items described in my original bug report, so that I can use the Publish to AWS experience as intended. Please also keep in mind that much of the value of the AWS Toolkit is to provide a UI mechanism within Visual Studio to automate deployments to Beanstalk Environments without having to setup command line interactions or reconfigure environments in every deployment. Not every user has their source code within an AWS hosted repository, nor needs the overhead of configuring the CDK / CloudFormation for simple use cases. Thank You.