티스토리 뷰
테라폼을 이용할 때 user_data의 변경이 없는 데도 replace 가 되면서 VM이 재생성 되는 경우가 있습니다.
이 문제가 발생하는 원인은 정확하게 찾지는 못했지만 테라폼의 버그 인 것으로 보입니다.
Hash for the new user_data in plan is incorrect and not the same one as apply · Issue #2627 · hashicorp/terraform
When using template_file for user_data in aws_instance, hash for the new user_data in plan always be the same one. (I have updated this issue to better describe the situation.) Step1 - Run plan (th...
github.com
Data sources forcing replacement even though nothing has changed
Hi @cbus-guy, It’s hard to guess what might be going on here without seeing more details, but I do have some general ideas about what can cause this sort of thing, so hopefully this will be useful in dealing with the problem. Terraform aims to read data
discuss.hashicorp.com
해결 방법
user_data 의 변경 사항이 없을 때 VM 재생성을 피하기 위해서 user_data 의 변경사항을 무시하는 옵션을 tf 파일에 추가하여 오류를 회피할 수 있습니다.
resource "openstack_compute_instance_v2" "compute-vm" {
...
user_data = "${file("vm-init.sh")}"
lifecycle {
ignore_changes = [user_data]
}
...
}
- Total
- Today
- Yesterday
- 하둡
- emr
- Hadoop
- yarn
- HDFS
- nodejs
- 오류
- 다이나믹
- bash
- build
- hbase
- SQL
- oozie
- 백준
- Python
- SPARK
- Tez
- HIVE
- ubuntu
- 하이브
- mysql
- AWS
- error
- 알고리즘
- S3
- 정올
- Linux
- java
- airflow
- 파이썬
일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
1 | ||||||
2 | 3 | 4 | 5 | 6 | 7 | 8 |
9 | 10 | 11 | 12 | 13 | 14 | 15 |
16 | 17 | 18 | 19 | 20 | 21 | 22 |
23 | 24 | 25 | 26 | 27 | 28 | 29 |
30 | 31 |