-
Notifications
You must be signed in to change notification settings - Fork 17
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Signed-off-by: junbo <68558268+junbo75@users.noreply.github.com>
- Loading branch information
Showing
37 changed files
with
241 additions
and
77 deletions.
There are no files selected for viewing
This file contains 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
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1 @@ | ||
2024.01 | ||
2024.01.01 |
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,55 @@ | ||
FROM public.ecr.aws/docker/library/python:3.9.16-slim | ||
|
||
WORKDIR /root | ||
|
||
RUN apt-get update && \ | ||
apt-get -y install \ | ||
curl \ | ||
tar \ | ||
unzip \ | ||
locales \ | ||
&& apt-get clean | ||
|
||
|
||
ENV DEBIAN_FRONTEND=noninteractive | ||
ENV LC_ALL="en_US.UTF-8" \ | ||
LC_CTYPE="en_US.UTF-8" \ | ||
LANG="en_US.UTF-8" | ||
|
||
RUN sed -i -e "s/# $LANG.*/$LANG UTF-8/" /etc/locale.gen \ | ||
&& locale-gen "en_US.UTF-8" \ | ||
&& dpkg-reconfigure locales | ||
|
||
# install aws cli | ||
RUN curl "https://awscli.amazonaws.com/awscli-exe-linux-x86_64.zip" -o "awscliv2.zip" && \ | ||
unzip -qq awscliv2.zip && \ | ||
./aws/install && \ | ||
rm -rf ./aws awscliv2.zip | ||
|
||
# install nvm and node | ||
RUN set -uex && \ | ||
apt-get update && \ | ||
apt-get install -y ca-certificates curl gnupg && \ | ||
mkdir -p /etc/apt/keyrings && \ | ||
curl -fsSL https://deb.nodesource.com/gpgkey/nodesource-repo.gpg.key \ | ||
| gpg --dearmor -o /etc/apt/keyrings/nodesource.gpg && \ | ||
NODE_MAJOR=18 && \ | ||
echo "deb [signed-by=/etc/apt/keyrings/nodesource.gpg] https://deb.nodesource.com/node_$NODE_MAJOR.x nodistro main" \ | ||
> /etc/apt/sources.list.d/nodesource.list && \ | ||
apt-get update && \ | ||
apt-get install nodejs -y | ||
|
||
# add all packaged artifacts to container | ||
ARG PUBLIC_ECR_TAG | ||
ENV PUBLIC_ECR_TAG=${PUBLIC_ECR_TAG} | ||
ADD all-*.tar.gz cfn_params_2_values.sh /root/.idea/downloads/ | ||
|
||
# install administrator app | ||
RUN mkdir -p /root/.idea/downloads/idea-administrator-${PUBLIC_ECR_TAG} && \ | ||
tar -xvf /root/.idea/downloads/idea-administrator-*.tar.gz -C /root/.idea/downloads/idea-administrator-${PUBLIC_ECR_TAG} && \ | ||
/bin/bash /root/.idea/downloads/idea-administrator-${PUBLIC_ECR_TAG}/install.sh && \ | ||
rm -rf /root/.idea/downloads/idea-administrator-${PUBLIC_ECR_TAG} | ||
|
||
CMD ["bash"] | ||
|
||
|
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,74 @@ | ||
#!/bin/bash | ||
|
||
aws_partition=${1} | ||
aws_region=${2} | ||
aws_account_id=${3} | ||
aws_dns_suffix=${4} | ||
cluster_name=${5} | ||
administrator_email=${6} | ||
ssh_key_pair_name=${7} | ||
client_ip1=${8} | ||
client_ip2=${9} | ||
vpc_id=${10} | ||
pub_subnets=${11} | ||
pvt_subnets=${12} | ||
storage_home_provider=${13} | ||
home_fs_id=${14} | ||
|
||
values_file="/root/.idea/clusters/${5}/${2}/values.yml" | ||
|
||
prt_subnets(){ | ||
for sn in $(echo $1| tr ',' ' ') | ||
do | ||
echo "- ${sn}" | ||
done | ||
} | ||
|
||
dir_name=$(dirname ${values_file}) | ||
|
||
mkdir -p ${dir_name} | ||
|
||
rm -f ${values_file} | ||
cat << EOF1 > ${values_file} | ||
_regenerate: false | ||
aws_partition: ${aws_partition} | ||
aws_region: ${aws_region} | ||
aws_account_id: ${aws_account_id} | ||
aws_dns_suffix: ${aws_dns_suffix} | ||
cluster_name: ${cluster_name} | ||
administrator_email: ${administrator_email} | ||
ssh_key_pair_name: ${ssh_key_pair_name} | ||
client_ip: | ||
- ${client_ip1} | ||
- ${client_ip2} | ||
alb_public: true | ||
use_vpc_endpoints: true | ||
directory_service_provider: aws_managed_activedirectory | ||
enable_aws_backup: true | ||
kms_key_type: aws-managed | ||
use_existing_vpc: true | ||
vpc_id: ${vpc_id} | ||
existing_resources: | ||
- subnets:public | ||
- subnets:private | ||
- shared-storage:home | ||
public_subnet_ids: | ||
EOF1 | ||
prt_subnets ${pub_subnets} >> ${values_file} | ||
cat << EOF2 >> ${values_file} | ||
private_subnet_ids: | ||
EOF2 | ||
prt_subnets ${pvt_subnets} >> ${values_file} | ||
cat << EOF3 >> ${values_file} | ||
storage_home_provider: ${storage_home_provider} | ||
use_existing_home_fs: true | ||
existing_home_fs_id: ${home_fs_id} | ||
enabled_modules: | ||
- metrics | ||
- virtual-desktop-controller | ||
- bastion-host | ||
metrics_provider: cloudwatch | ||
base_os: amazonlinux2 | ||
instance_type: m5.large | ||
volume_size: '200' | ||
EOF3 |
This file contains 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
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2,7 +2,7 @@ | |
colored | ||
ipaddress | ||
sanic==23.6.0 | ||
aws-cdk-lib==2.63.0 | ||
aws-cdk-lib==2.* | ||
cdk-nag | ||
prettytable | ||
defusedxml | ||
defusedxml |
This file contains 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
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
aws_cdk_version: 2.63.0 | ||
aws_cdk_version: 2.* | ||
node_version: 18.18.0 | ||
nvm_version: 0.39.0 | ||
python_version: 3.9.16 |
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
Oops, something went wrong.