Open
Description
Does this documentation exist?
- This is new documentation
- This is an enhancement to existing documentation
Where would you expect to find this documentation?
- On terraform.io
- In the GoDoc for this module
- In this repo as a markdown file
- Somewhere else
Details
This documentation could appear in Acceptance Tests and provide details of the specific terraform
commands that are executed during a particular "test mode".
For example, if an acceptance test is set-up to use TestStep.Config
:
func TestAccExampleResource(t *testing.T) {
resource.Test(t, resource.TestCase{
PreCheck: func() { testAccPreCheck(t) },
ProtoV6ProviderFactories: testAccProtoV6ProviderFactories,
Steps: []resource.TestStep{
// Create and Read testing
{
Config: `resource "example_resource" "test" {
id = "one"
}`,
Check: resource.ComposeAggregateTestCheckFunc(
resource.TestCheckResourceAttr("example_resource.test", "configurable_attribute", "1.797693134862315"),
resource.TestCheckResourceAttr("example_resource.test", "id", "one"),
),
},
},
})
}
The following terraform
commands are executed during the course of the test:
terraform init
terraform plan
terraform apply
terraform show (state)
terraform plan
terraform show (plan)
terraform plan
terraform show (plan)
terraform show (state)
terraform destroy
Description
If the terraform
command calls are documented and include details as to which flags are supplied (e.g., -refresh-only
, -refresh=true|false
) this might be useful for provider developers who are writing acceptance tests and aid in the generation of a mental model of which commands are being called and how this relates to direct execution of Terraform commands.