Added SSL cert generation and installation. Moved variables to ENV
All checks were successful
AWS Deploy on Push / build (push) Successful in 4m15s
All checks were successful
AWS Deploy on Push / build (push) Successful in 4m15s
This commit is contained in:
@@ -11,7 +11,15 @@ from aws_cdk import (
|
||||
from constructs import Construct
|
||||
|
||||
class IptvUpdaterStack(Stack):
|
||||
def __init__(self, scope: Construct, construct_id: str, **kwargs) -> None:
|
||||
def __init__(
|
||||
self,
|
||||
scope: Construct,
|
||||
construct_id: str,
|
||||
freedns_user: str,
|
||||
freedns_password: str,
|
||||
domain_name: str,
|
||||
**kwargs
|
||||
) -> None:
|
||||
super().__init__(scope, construct_id, **kwargs)
|
||||
|
||||
# Create VPC
|
||||
@@ -151,11 +159,20 @@ class IptvUpdaterStack(Stack):
|
||||
|
||||
# Creates a userdata object for Linux hosts
|
||||
userdata = ec2.UserData.for_linux()
|
||||
|
||||
# Add environment variables for acme.sh from parameters
|
||||
userdata.add_commands(
|
||||
f'export FREEDNS_User="{freedns_user}"',
|
||||
f'export FREEDNS_Password="{freedns_password}"',
|
||||
f'export DOMAIN_NAME="{domain_name}"'
|
||||
)
|
||||
|
||||
# Adds one or more commands to the userdata object.
|
||||
userdata.add_commands(
|
||||
f'echo "COGNITO_USER_POOL_ID={user_pool.user_pool_id}" >> /etc/environment',
|
||||
f'echo "COGNITO_CLIENT_ID={client.user_pool_client_id}" >> /etc/environment',
|
||||
f'echo "COGNITO_CLIENT_SECRET={client.user_pool_client_secret.to_string()}" >> /etc/environment'
|
||||
f'echo "COGNITO_CLIENT_SECRET={client.user_pool_client_secret.to_string()}" >> /etc/environment',
|
||||
f'echo "DOMAIN_NAME={domain_name}" >> /etc/environment'
|
||||
)
|
||||
userdata.add_commands(str(userdata_file, 'utf-8'))
|
||||
|
||||
|
||||
Reference in New Issue
Block a user