fix(infra): fix deploy doctor sed portability and ec2 describe-vpcs check#1311
Open
ShaanNarendran wants to merge 1 commit into
Open
fix(infra): fix deploy doctor sed portability and ec2 describe-vpcs check#1311ShaanNarendran wants to merge 1 commit into
ShaanNarendran wants to merge 1 commit into
Conversation
…heck Two bugs in deploy.sh causing false failures: 1. get_tfvar() used \s* which is not portable (BSD sed on macOS and some Linux distros do not support it). Replaced with [ ]*. 2. aws ec2 describe-vpcs does not support --max-results. The invalid parameter caused the command to fail, which the script misreported as a permissions error. Use --query instead.
Dependency Review✅ No vulnerabilities or license issues or OpenSSF Scorecard issues found.Scanned FilesNone |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Purpose / Description
Fixes two bugs in
deploy.shthat caused false-positive failures during the prod deployment validation:get_tfvar()regex used\s*which is not supported by BSD sed (macOS) or some minimal Linux environments. Values likeregion = "us-east-1"were not extracted, causing "region not set" errors even when set correctly.The EC2/VPC permission check used
aws ec2 describe-vpcs --max-results 1butdescribe-vpcsdoes not support--max-results. The invalid parameter caused the AWS CLI to error, which the script misreported as "Cannot access EC2/VPC (check IAM permissions)" even with AdministratorAccess.Fixes
Approach
\s*with[ ]*in sed for POSIX portability--max-results 1with--queryto validate EC2 access without unsupported flagsHow Has This Been Tested?
echo 'region = "us-east-1"' | sed 's/.*=[ ]*"\(.*\)"/\1/'outputsus-east-1Checklist