@@ -208,8 +208,8 @@ resource "aws_eip" "main" {
208208}
209209
210210# Generate instances.yml from template
211- resource "local_file " "instances_config" {
212- sensitive_content = templatefile (" ${ path . module } /instances.yml.tpl" , {
211+ resource "local_sensitive_file " "instances_config" {
212+ content = templatefile (" ${ path . module } /instances.yml.tpl" , {
213213 monitoring_instances = var.monitoring_instances
214214 enable_demo_db = var.enable_demo_db
215215 })
@@ -219,7 +219,7 @@ resource "local_file" "instances_config" {
219219# Deploy instances.yml to EC2 when config changes
220220resource "terraform_data" "deploy_config" {
221221 triggers_replace = {
222- config_hash = local_file .instances_config.content_md5
222+ config_hash = local_sensitive_file .instances_config.content_md5
223223 }
224224
225225 depends_on = [aws_instance . main , aws_volume_attachment . data ]
@@ -228,7 +228,7 @@ resource "terraform_data" "deploy_config" {
228228 inline = [
229229 " if ! sudo test -f /home/postgres_ai/postgres_ai/postgres_ai; then echo 'Skipping - installation not complete'; exit 0; fi" ,
230230 " cat > /tmp/instances.yml << 'EOF'" ,
231- local_file . instances_config . content ,
231+ local_sensitive_file . instances_config . content ,
232232 " EOF" ,
233233 " sudo mv /tmp/instances.yml /home/postgres_ai/postgres_ai/instances.yml" ,
234234 " sudo chown postgres_ai:postgres_ai /home/postgres_ai/postgres_ai/instances.yml" ,
0 commit comments