1개 답변
- 최신
- 최다 투표
- 가장 많은 댓글
1
Hello.
When you set "command" to "apply" in the "run" block, AWS resources are actually created.
https://developer.hashicorp.com/terraform/language/tests
If using terraform test creates ephemeral resources, will it be created on my account and what name would it be using once it's created?
I tried it with an S3 bucket and it uses the resource name defined in Terraform code.
It looks like the resource is created within my AWS account.
관련 콘텐츠
- AWS 공식업데이트됨 5달 전
Thanks for trying that out. What would happen then if the resource is already existing when you run the test. Would it "run" and update the existing resource and then revert once test is done?
When I tested an S3 bucket, when there was a resource with the same name, an error occurred like when creating a normal S3 bucket. I think an error will probably occur for AWS resources that cannot be created if the resource name is duplicated. Therefore, if you do not want to affect existing AWS resources, I think it is better to set "command" to "plan" in the "run" block.