aws / aws/aws-toolkit-visual-studio
'Publish to AWS' randomly changes recently deployed VPC but user cannot edit it back
- Dominant language
- No language data
- Stars
- 135
- Forks
- 37
- PR merge metrics
- No merged PRs in 30d
Description
**Describe the bug**
Visual Studio 2022 (build 17.7.10). Randomly, the toolkit prevents the push of a container to the ECS service due to a mismatch in the vpc and security group, but the toolkit is trying to deploy to AWS default VPC despite it being told not to. Yet the configuration cannot be edited by AWS Toolkit for VS 2022 to fix it.
**To Reproduce**
Steps to reproduce the behavior when it happens. Note, randomly stops working.
1. Right click on the project in solution explorer.
2. Click on "Publish to AWS"
3. Select an already present configuration from the "Recently deployed" section
4. Click Publish
5. The error, if it appears will claim the security group is not part of the VPC,
Despite is having worked countless times before, this is caused because VPC has randomly changed to the default VPC, without the default option being selected, The VPC also cannot be edited in this configuration, to reset it to the correct VPC, which has the appropriate SG in it.
**Expected behavior**
Expect to be able to edit the configuration to set the VPC
**Computer (please complete the following information):**
- Windows Version: 10
- Visual Studio Version: 17.7.1 (VS2022)
- AWS Toolkit for Visual Studio Version: 1.42.0.0
**Additional context**
Log shows:
`ECS Service Security Groups
---> System.Exception: One or more publish settings are not valid. Adjust the configuration and try again.
ECS Service Security Groups`
** Screenshot explanation **

Note, the VPC specified by the AWS Toolkit is incorrect here. This was an old default which does not exist now and was never used for this. Yet this somehow wants to connect to it and it cannot be changed through the interface. The .aws profile files make absolutely no difference. It still comes back with the error.
Contributor guide
Research direction
Start with the Visual Studio "Publish to AWS" flow, especially the "Recently deployed" configuration path, and reproduce the VPC and security-group mismatch while reviewing the publish log. Done means an existing configuration can be edited to select the intended VPC and publishing the ECS service no longer uses the AWS default VPC unexpectedly.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- aws
- Domain
- cloud, infrastructure
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100