diff --git a/command/format_plan.go b/command/format_plan.go index 84f7d89e75..7846f0e8ce 100644 --- a/command/format_plan.go +++ b/command/format_plan.go @@ -96,6 +96,17 @@ func formatPlanModuleExpand( color = "green" symbol = "+" oldValues = false + + // If we're "creating" a data resource then we'll present it + // to the user as a "read" operation, so it's clear that this + // operation won't change anything outside of the Terraform state. + // Unfortunately by the time we get here we only have the name + // to work with, so we need to cheat and exploit knowledge of the + // naming scheme for data resources. + if strings.HasPrefix(name, "data.") { + symbol = "<=" + color = "cyan" + } case terraform.DiffDestroy: color = "red" symbol = "-" diff --git a/command/plan.go b/command/plan.go index 5582ddf4f4..f1294b05f6 100644 --- a/command/plan.go +++ b/command/plan.go @@ -219,7 +219,7 @@ The Terraform execution plan has been generated and is shown below. Resources are shown in alphabetical order for quick scanning. Green resources will be created (or destroyed and then created if an existing resource exists), yellow resources are being changed in-place, and red resources -will be destroyed. +will be destroyed. Cyan entries are data sources to be read. Note: You didn't specify an "-out" parameter to save this plan, so when "apply" is called, Terraform can't guarantee this is what will execute. @@ -230,7 +230,7 @@ The Terraform execution plan has been generated and is shown below. Resources are shown in alphabetical order for quick scanning. Green resources will be created (or destroyed and then created if an existing resource exists), yellow resources are being changed in-place, and red resources -will be destroyed. +will be destroyed. Cyan entries are data sources to be read. Your plan was also saved to the path below. Call the "apply" subcommand with this plan file and Terraform will exactly execute this execution