diff --git a/cloudformation/lib/api.js b/cloudformation/lib/api.js index 307c89c..2a8663b 100644 --- a/cloudformation/lib/api.js +++ b/cloudformation/lib/api.js @@ -158,6 +158,7 @@ const Resources = { Environment: [ { Name: 'StackName', Value: cf.stackName }, { Name: 'MANAGEMENT_PASSWORD', Value: cf.sub('{{resolve:secretsmanager:${AWS::StackName}/api/secret:SecretString::AWSCURRENT}}') }, + { Name: 'FORCE_NEW_CONFIG', Value: cf.ref('ForceNewConfig') }, { Name: 'AWS_DEFAULT_REGION', Value: cf.region } ], LogConfiguration: { @@ -384,6 +385,12 @@ export default cf.merge({ AllowedValues: ['true', 'false'], Default: 'false' }, + ForceNewConfig: { + Description: 'Force a blank config file - permanently deleting current config', + Type: 'String', + AllowedValues: ['true', 'false'], + Default: 'false' + }, SSLCertificateIdentifier: { Description: 'ACM SSL Certificate for HTTP Protocol', Type: 'String' diff --git a/start b/start index 6650b49..453f78c 100755 --- a/start +++ b/start @@ -9,6 +9,10 @@ set -euo pipefail echo "Contents:" ls /opt/mediamtx/ +if [[ ${FORCE_NEW_CONFIG} == "true" ]]; then + rm /opt/mediamtx/mediamtx.yml || true +fi + # Copy EFS Persisted certs to Let's Encrypt Dir if [ ! -f "/opt/mediamtx/mediamtx.yml" ]; then echo "NO CONFIG FOUND"