2017-10-16 50 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

没问题,请接受这个答案,如果它帮助你。 –

相关问题