@@ -52,6 +52,69 @@ can't guarantee that exactly these actions will be performed if
5252"terraform apply" is subsequently run.
5353`
5454
55+ const planOnlyOutputChangesSuccessResult0_12 = `
56+ Refreshing Terraform state in-memory prior to plan...
57+ The refreshed state will be used to calculate this plan, but will not be
58+ persisted to local or remote state storage.
59+
60+ data.terraform_remote_state.teams_platform_development: Refreshing state...
61+ google_project.my_project: Refreshing state...
62+ aws_iam_policy.datadog_aws_integration: Refreshing state...
63+ aws_iam_user.teams_terraform: Refreshing state...
64+ aws_iam_role.datadog_aws_integration: Refreshing state...
65+ google_project_services.my_project: Refreshing state...
66+ google_bigquery_dataset.gateway_access_log: Refreshing state...
67+ aws_iam_role_policy_attachment.datadog_aws_integration: Refreshing state...
68+ google_logging_project_sink.gateway_access_log_bigquery_sink: Refreshing state...
69+ google_project_iam_member.gateway_access_log_bigquery_sink_writer_is_bigquery_data_editor: Refreshing state...
70+ google_dns_managed_zone.tfnotifyapps_com: Refreshing state...
71+ google_dns_record_set.dev_tfnotifyapps_com: Refreshing state...
72+
73+ ------------------------------------------------------------------------
74+
75+ An execution plan has been generated and is shown below.
76+ Resource actions are indicated with the following symbols:
77+ + create
78+
79+ Terraform will perform the following actions:
80+
81+ Plan: 0 to add, 0 to change, 0 to destroy.
82+
83+ Changes to Outputs:
84+ + aws_instance_name = "my-instance"
85+
86+ ------------------------------------------------------------------------
87+
88+ Note: You didn't specify an "-out" parameter to save this plan, so Terraform
89+ can't guarantee that exactly these actions will be performed if
90+ "terraform apply" is subsequently run.
91+ `
92+
93+ const planOnlyOutputChangesSuccessResult0_15 = `
94+ null_resource.this: Refreshing state... [id=6068603774747257119]
95+
96+ Changes to Outputs:
97+ + test = 42
98+
99+ You can apply this plan to save these new output values to the Terraform
100+ state, without changing any real infrastructure.
101+
102+ ─────────────────────────────────────────────────────────────────────────────
103+
104+ Note: You didn't use the -out option to save this plan, so Terraform can't
105+ guarantee to take exactly these actions if you run "terraform apply" now.
106+ `
107+
108+ const planOnlyOutputChangesSuccessInAutomationResult = `
109+ null_resource.this: Refreshing state... [id=6068603774747257119]
110+
111+ Changes to Outputs:
112+ + test = 42
113+
114+ You can apply this plan to save these new output values to the Terraform
115+ state, without changing any real infrastructure.
116+ `
117+
55118const planFailureResult = `
56119xxxxxxxxx
57120xxxxxxxxx
@@ -351,6 +414,60 @@ func TestPlanParserParse(t *testing.T) {
351414Plan: 1 to add, 0 to change, 0 to destroy.` ,
352415 },
353416 },
417+ {
418+ name : "plan output changes only pattern 0.12" ,
419+ body : planOnlyOutputChangesSuccessResult0_12 ,
420+ result : ParseResult {
421+ Result : "Plan: 0 to add, 0 to change, 0 to destroy." ,
422+ HasAddOrUpdateOnly : true ,
423+ HasDestroy : false ,
424+ HasNoChanges : false ,
425+ HasPlanError : false ,
426+ ExitCode : 0 ,
427+ Error : nil ,
428+ ChangedResult : `
429+ Plan: 0 to add, 0 to change, 0 to destroy.
430+
431+ Changes to Outputs:
432+ + aws_instance_name = "my-instance"` ,
433+ },
434+ },
435+ {
436+ name : "plan output changes only pattern 0.15" ,
437+ body : planOnlyOutputChangesSuccessResult0_15 ,
438+ result : ParseResult {
439+ Result : "Only Outputs will be changed." ,
440+ HasAddOrUpdateOnly : true ,
441+ HasDestroy : false ,
442+ HasNoChanges : false ,
443+ HasPlanError : false ,
444+ ExitCode : 0 ,
445+ Error : nil ,
446+ ChangedResult : `Changes to Outputs:
447+ + test = 42
448+
449+ You can apply this plan to save these new output values to the Terraform
450+ state, without changing any real infrastructure.` ,
451+ },
452+ },
453+ {
454+ name : "plan output changes only pattern with TF_IN_AUTOMATION" ,
455+ body : planOnlyOutputChangesSuccessInAutomationResult ,
456+ result : ParseResult {
457+ Result : "Only Outputs will be changed." ,
458+ HasAddOrUpdateOnly : true ,
459+ HasDestroy : false ,
460+ HasNoChanges : false ,
461+ HasPlanError : false ,
462+ ExitCode : 0 ,
463+ Error : nil ,
464+ ChangedResult : `Changes to Outputs:
465+ + test = 42
466+
467+ You can apply this plan to save these new output values to the Terraform
468+ state, without changing any real infrastructure.` ,
469+ },
470+ },
354471 {
355472 name : "no stdin" ,
356473 body : "" ,
0 commit comments