2017-10-16 25 views
-1

運行terraform和等待需要很長時間。 所以我想運行它來排除需要最長時間執行的rds 或者我想只運行ec2資源。 有沒有辦法在terraform中做這樣的事情?我想運行Terraform排除特定資源

回答

2

您可以使用-target=resource這樣的:

terraform plan -target=module.mymodule.aws_instance.myinstance 
terraform apply -target=module.mymodule.aws_instance.myinstance 

terraform plan -target=aws_instance.myinstance 
terraform apply -target=aws_instance.myinstance 
+0

謝謝你的評論。我解決了它使用-target選項,你教我 – sukho

+0

沒問題,請接受這個答案,如果它幫助你。 –