@glicogh/healthcare-cdk 0.1.70 → 0.1.71

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -6,8 +6,8 @@ sudo snap install --classic certbot
6
6
  sudo ln -s /snap/bin/certbot /usr/bin/certbot
7
7
 
8
8
  # sync SSL certificates from S3 bucket to local (if they exist)
9
- aws s3 cp s3://$public_bucket_name/ssl/ /etc/letsencrypt/live --recursive
10
- sudo chown -R ubuntu:ubuntu /etc/letsencrypt/live
9
+ aws s3 cp s3://$public_bucket_name/ssl/{{$serviceName}} /etc/letsencrypt --recursive
10
+ sudo chown -R ubuntu:ubuntu /etc/letsencrypt
11
11
 
12
12
  # install nginx
13
13
  sudo apt install curl gnupg2 ca-certificates lsb-release ubuntu-keyring -yq
@@ -50,10 +50,10 @@ sudo systemctl restart nginx
50
50
 
51
51
  # obtain SSL certificate (if it doesn't exist) and sync to S3 bucket.
52
52
  if [[ ! -f "/etc/letsencrypt/live/$api_gateway_domain_name/fullchain.pem" ]]; then
53
- sudo certbot certonly --nginx -d $api_gateway_domain_name --agree-tos --non-interactive -m mistabiggx@gmail.com --no-eff-email --quiet --deploy-hook "aws s3 sync /etc/letsencrypt/live s3://$public_bucket_name/ssl/"
53
+ sudo certbot certonly --nginx -d $api_gateway_domain_name --agree-tos --non-interactive -m mistabiggx@gmail.com --no-eff-email --quiet --deploy-hook "aws s3 sync /etc/letsencrypt s3://$public_bucket_name/ssl/{{serviceName}}/"
54
54
  fi
55
55
 
56
56
  # register SSL renewal cron
57
- certbot_cron_command="/usr/bin/certbot renew --deploy-hook \"aws s3 sync /etc/letsencrypt/live s3://$public_bucket_name/ssl/\" >> $logs_dir/{{serviceName}}-ssl-renewal.log"
57
+ certbot_cron_command="/usr/bin/certbot renew --deploy-hook \"aws s3 sync /etc/letsencrypt s3://$public_bucket_name/ssl/{{serviceName}}/\" >> $logs_dir/{{serviceName}}-ssl-renewal.log"
58
58
  certbot_cron_job="0 0,12 * * * $certbot_cron_command"
59
59
  ( ( crontab -l || true ) | ( grep -v -F "$certbot_cron_command" || true ) ; echo "$certbot_cron_job" ) | crontab -
@@ -6,8 +6,8 @@ sudo snap install --classic certbot
6
6
  sudo ln -s /snap/bin/certbot /usr/bin/certbot
7
7
 
8
8
  # sync SSL certificates from S3 bucket to local (if they exist)
9
- aws s3 cp s3://$public_bucket_name/ssl/ /etc/letsencrypt/live --recursive
10
- sudo chown -R ubuntu:ubuntu /etc/letsencrypt/live
9
+ aws s3 cp s3://$public_bucket_name/ssl/{{$serviceName}}/ /etc/letsencrypt --recursive
10
+ sudo chown -R ubuntu:ubuntu /etc/letsencrypt
11
11
 
12
12
  # install nginx
13
13
  sudo apt install curl gnupg2 ca-certificates lsb-release ubuntu-keyring -yq
@@ -49,10 +49,10 @@ sudo systemctl restart nginx
49
49
 
50
50
  # obtain SSL certificate (if it doesn't exist) and sync to S3 bucket
51
51
  if [[ ! -f "/etc/letsencrypt/live/$portal_domain_name/fullchain.pem" ]]; then
52
- sudo certbot certonly --nginx -d $portal_domain_name --agree-tos --non-interactive -m mistabiggx@gmail.com --no-eff-email --quiet --deploy-hook "aws s3 sync /etc/letsencrypt/live s3://$public_bucket_name/ssl/"
52
+ sudo certbot certonly --nginx -d $portal_domain_name --agree-tos --non-interactive -m mistabiggx@gmail.com --no-eff-email --quiet --deploy-hook "aws s3 sync /etc/letsencrypt s3://$public_bucket_name/ssl/{{serviceName}}/"
53
53
  fi
54
54
 
55
55
  # register SSL renewal cron
56
- certbot_cron_command="/usr/bin/certbot renew --deploy-hook \"aws s3 sync /etc/letsencrypt/live s3://$public_bucket_name/ssl/\" >> $logs_dir/{{serviceName}}-ssl-renewal.log"
56
+ certbot_cron_command="/usr/bin/certbot renew --deploy-hook \"aws s3 sync /etc/letsencrypt s3://$public_bucket_name/ssl/{{serviceName}}/\" >> $logs_dir/{{serviceName}}-ssl-renewal.log"
57
57
  certbot_cron_job="0 0,12 * * * $certbot_cron_command"
58
58
  ( ( crontab -l || true ) | ( grep -v -F "$certbot_cron_command" || true ) ; echo "$certbot_cron_job" ) | crontab -
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@glicogh/healthcare-cdk",
3
- "version": "0.1.70",
3
+ "version": "0.1.71",
4
4
  "description": "CDK automations",
5
5
  "bin": {
6
6
  "cdk": "bin/cdk.js"
@@ -6,8 +6,8 @@ sudo snap install --classic certbot
6
6
  sudo ln -s /snap/bin/certbot /usr/bin/certbot
7
7
 
8
8
  # sync SSL certificates from S3 bucket to local (if they exist)
9
- aws s3 cp s3://$public_bucket_name/ssl/ /etc/letsencrypt/live --recursive
10
- sudo chown -R ubuntu:ubuntu /etc/letsencrypt/live
9
+ aws s3 cp s3://$public_bucket_name/ssl/{{$serviceName}} /etc/letsencrypt --recursive
10
+ sudo chown -R ubuntu:ubuntu /etc/letsencrypt
11
11
 
12
12
  # install nginx
13
13
  sudo apt install curl gnupg2 ca-certificates lsb-release ubuntu-keyring -yq
@@ -50,10 +50,10 @@ sudo systemctl restart nginx
50
50
 
51
51
  # obtain SSL certificate (if it doesn't exist) and sync to S3 bucket.
52
52
  if [[ ! -f "/etc/letsencrypt/live/$api_gateway_domain_name/fullchain.pem" ]]; then
53
- sudo certbot certonly --nginx -d $api_gateway_domain_name --agree-tos --non-interactive -m mistabiggx@gmail.com --no-eff-email --quiet --deploy-hook "aws s3 sync /etc/letsencrypt/live s3://$public_bucket_name/ssl/"
53
+ sudo certbot certonly --nginx -d $api_gateway_domain_name --agree-tos --non-interactive -m mistabiggx@gmail.com --no-eff-email --quiet --deploy-hook "aws s3 sync /etc/letsencrypt s3://$public_bucket_name/ssl/{{serviceName}}/"
54
54
  fi
55
55
 
56
56
  # register SSL renewal cron
57
- certbot_cron_command="/usr/bin/certbot renew --deploy-hook \"aws s3 sync /etc/letsencrypt/live s3://$public_bucket_name/ssl/\" >> $logs_dir/{{serviceName}}-ssl-renewal.log"
57
+ certbot_cron_command="/usr/bin/certbot renew --deploy-hook \"aws s3 sync /etc/letsencrypt s3://$public_bucket_name/ssl/{{serviceName}}/\" >> $logs_dir/{{serviceName}}-ssl-renewal.log"
58
58
  certbot_cron_job="0 0,12 * * * $certbot_cron_command"
59
59
  ( ( crontab -l || true ) | ( grep -v -F "$certbot_cron_command" || true ) ; echo "$certbot_cron_job" ) | crontab -
@@ -6,8 +6,8 @@ sudo snap install --classic certbot
6
6
  sudo ln -s /snap/bin/certbot /usr/bin/certbot
7
7
 
8
8
  # sync SSL certificates from S3 bucket to local (if they exist)
9
- aws s3 cp s3://$public_bucket_name/ssl/ /etc/letsencrypt/live --recursive
10
- sudo chown -R ubuntu:ubuntu /etc/letsencrypt/live
9
+ aws s3 cp s3://$public_bucket_name/ssl/{{$serviceName}}/ /etc/letsencrypt --recursive
10
+ sudo chown -R ubuntu:ubuntu /etc/letsencrypt
11
11
 
12
12
  # install nginx
13
13
  sudo apt install curl gnupg2 ca-certificates lsb-release ubuntu-keyring -yq
@@ -49,10 +49,10 @@ sudo systemctl restart nginx
49
49
 
50
50
  # obtain SSL certificate (if it doesn't exist) and sync to S3 bucket
51
51
  if [[ ! -f "/etc/letsencrypt/live/$portal_domain_name/fullchain.pem" ]]; then
52
- sudo certbot certonly --nginx -d $portal_domain_name --agree-tos --non-interactive -m mistabiggx@gmail.com --no-eff-email --quiet --deploy-hook "aws s3 sync /etc/letsencrypt/live s3://$public_bucket_name/ssl/"
52
+ sudo certbot certonly --nginx -d $portal_domain_name --agree-tos --non-interactive -m mistabiggx@gmail.com --no-eff-email --quiet --deploy-hook "aws s3 sync /etc/letsencrypt s3://$public_bucket_name/ssl/{{serviceName}}/"
53
53
  fi
54
54
 
55
55
  # register SSL renewal cron
56
- certbot_cron_command="/usr/bin/certbot renew --deploy-hook \"aws s3 sync /etc/letsencrypt/live s3://$public_bucket_name/ssl/\" >> $logs_dir/{{serviceName}}-ssl-renewal.log"
56
+ certbot_cron_command="/usr/bin/certbot renew --deploy-hook \"aws s3 sync /etc/letsencrypt s3://$public_bucket_name/ssl/{{serviceName}}/\" >> $logs_dir/{{serviceName}}-ssl-renewal.log"
57
57
  certbot_cron_job="0 0,12 * * * $certbot_cron_command"
58
58
  ( ( crontab -l || true ) | ( grep -v -F "$certbot_cron_command" || true ) ; echo "$certbot_cron_job" ) | crontab -