Skip to content

armgit / core

Public Imported from GitHub
0

100% open-source IoT Platform - Integrate your devices, add intelligence, build custom apps

CI/CD: Minor update (#788)

Rich Turner1108e3006934
diff --git a/.ci_cd/aws/refresh_ssh_whitelist.sh b/.ci_cd/aws/refresh_ssh_whitelist.sh
index 48cf4c93a..6b8c8de61 100644
--- a/.ci_cd/aws/refresh_ssh_whitelist.sh
+++ b/.ci_cd/aws/refresh_ssh_whitelist.sh
@@ -19,6 +19,7 @@ fi
OUS=$1
AWS_ACCOUNT_NAMES=$2
AWS_ACCOUNT_IDS=$3
+AWS_ROLE_NAME="developers-access"
ACCOUNT_PROFILE="--profile github-da"
echo "Attempting to set the SSH whitelist for the specified account(s)"
@@ -59,6 +60,7 @@ SSH_LIST=$(aws ssm get-parameters-by-path --path "/SSH-Whitelist" --query "Param
IFS=$' \t'
for AWS_ACCOUNT_ID in $AWS_ACCOUNT_IDS; do
+
# Update github-da profile with ARN for AWS_ACCOUNT_ID
source "${awsDir}set_github-da_account_arn.sh"
diff --git a/.ci_cd/aws/ssh_whitelist.sh b/.ci_cd/aws/ssh_whitelist.sh
index c9d7267ff..8bde9ce06 100644
--- a/.ci_cd/aws/ssh_whitelist.sh
+++ b/.ci_cd/aws/ssh_whitelist.sh
@@ -31,7 +31,11 @@ if [ -n "$CIDR" ]; then
exit 1
fi
- aws ec2 authorize-security-group-ingress --group-id $SGID --ip-permissions "IpProtocol=tcp,FromPort=22,ToPort=22,IpRanges=[{CidrIp=$CIDR,Description=$DESCRIPTION}]" $PROFILE
+ if [[ "$CIDR" == *":"* ]]; then
+ aws ec2 authorize-security-group-ingress --group-id $SGID --ip-permissions "IpProtocol=tcp,FromPort=22,ToPort=22,Ipv6Ranges=[{CidrIpv6=$CIDR,Description=$DESCRIPTION}]" $PROFILE
+ else
+ aws ec2 authorize-security-group-ingress --group-id $SGID --ip-permissions "IpProtocol=tcp,FromPort=22,ToPort=22,IpRanges=[{CidrIp=$CIDR,Description=$DESCRIPTION}]" $PROFILE
+ fi
if [ $? -ne 0 ]; then
echo "SSH Access failed might not be able to SSH into host(s)"