@@ -517,7 +517,7 @@ func TestContext2Apply_mapVarBetweenModules(t *testing.T) {
517517 },
518518 })
519519
520- plan , diags := ctx .Plan (m , states .NewState (), DefaultPlanOpts )
520+ plan , diags := ctx .Plan (m , states .NewState (), SimplePlanOpts ( plans . NormalMode , testInputValuesUnset ( m . Module . Variables )) )
521521 assertNoErrors (t , diags )
522522
523523 state , diags := ctx .Apply (plan , m )
@@ -2262,7 +2262,7 @@ func TestContext2Apply_countVariable(t *testing.T) {
22622262 },
22632263 })
22642264
2265- plan , diags := ctx .Plan (m , states .NewState (), DefaultPlanOpts )
2265+ plan , diags := ctx .Plan (m , states .NewState (), SimplePlanOpts ( plans . NormalMode , testInputValuesUnset ( m . Module . Variables )) )
22662266 assertNoErrors (t , diags )
22672267
22682268 state , diags := ctx .Apply (plan , m )
@@ -2288,7 +2288,7 @@ func TestContext2Apply_countVariableRef(t *testing.T) {
22882288 },
22892289 })
22902290
2291- plan , diags := ctx .Plan (m , states .NewState (), DefaultPlanOpts )
2291+ plan , diags := ctx .Plan (m , states .NewState (), SimplePlanOpts ( plans . NormalMode , testInputValuesUnset ( m . Module . Variables )) )
22922292 assertNoErrors (t , diags )
22932293
22942294 state , diags := ctx .Apply (plan , m )
@@ -2327,7 +2327,7 @@ func TestContext2Apply_provisionerInterpCount(t *testing.T) {
23272327 Provisioners : provisioners ,
23282328 })
23292329
2330- plan , diags := ctx .Plan (m , states .NewState (), DefaultPlanOpts )
2330+ plan , diags := ctx .Plan (m , states .NewState (), SimplePlanOpts ( plans . NormalMode , testInputValuesUnset ( m . Module . Variables )) )
23312331 assertNoErrors (t , diags )
23322332
23332333 // We'll marshal and unmarshal the plan here, to ensure that we have
@@ -3682,7 +3682,7 @@ func TestContext2Apply_multiVarOrder(t *testing.T) {
36823682 },
36833683 })
36843684
3685- plan , diags := ctx .Plan (m , states .NewState (), DefaultPlanOpts )
3685+ plan , diags := ctx .Plan (m , states .NewState (), SimplePlanOpts ( plans . NormalMode , testInputValuesUnset ( m . Module . Variables )) )
36863686 assertNoErrors (t , diags )
36873687
36883688 state , diags := ctx .Apply (plan , m )
@@ -3713,7 +3713,7 @@ func TestContext2Apply_multiVarOrderInterp(t *testing.T) {
37133713 },
37143714 })
37153715
3716- plan , diags := ctx .Plan (m , states .NewState (), DefaultPlanOpts )
3716+ plan , diags := ctx .Plan (m , states .NewState (), SimplePlanOpts ( plans . NormalMode , testInputValuesUnset ( m . Module . Variables )) )
37173717 assertNoErrors (t , diags )
37183718
37193719 state , diags := ctx .Apply (plan , m )
@@ -4704,9 +4704,7 @@ func TestContext2Apply_provisionerDestroy(t *testing.T) {
47044704 },
47054705 })
47064706
4707- plan , diags := ctx .Plan (m , state , & PlanOpts {
4708- Mode : plans .DestroyMode ,
4709- })
4707+ plan , diags := ctx .Plan (m , state , SimplePlanOpts (plans .DestroyMode , testInputValuesUnset (m .Module .Variables )))
47104708 assertNoErrors (t , diags )
47114709
47124710 state , diags = ctx .Apply (plan , m )
@@ -4753,9 +4751,7 @@ func TestContext2Apply_provisionerDestroyFail(t *testing.T) {
47534751 },
47544752 })
47554753
4756- plan , diags := ctx .Plan (m , state , & PlanOpts {
4757- Mode : plans .DestroyMode ,
4758- })
4754+ plan , diags := ctx .Plan (m , state , SimplePlanOpts (plans .DestroyMode , testInputValuesUnset (m .Module .Variables )))
47594755 assertNoErrors (t , diags )
47604756
47614757 state , diags = ctx .Apply (plan , m )
@@ -5908,7 +5904,7 @@ func TestContext2Apply_destroyWithModuleVariableAndCountNested(t *testing.T) {
59085904 })
59095905
59105906 // First plan and apply a create operation
5911- plan , diags := ctx .Plan (m , states .NewState (), DefaultPlanOpts )
5907+ plan , diags := ctx .Plan (m , states .NewState (), SimplePlanOpts ( plans . NormalMode , testInputValuesUnset ( m . Module . Variables )) )
59125908 assertNoErrors (t , diags )
59135909
59145910 state , diags = ctx .Apply (plan , m )
@@ -5929,9 +5925,7 @@ func TestContext2Apply_destroyWithModuleVariableAndCountNested(t *testing.T) {
59295925 })
59305926
59315927 // First plan and apply a create operation
5932- plan , diags := ctx .Plan (m , state , & PlanOpts {
5933- Mode : plans .DestroyMode ,
5934- })
5928+ plan , diags := ctx .Plan (m , state , SimplePlanOpts (plans .DestroyMode , testInputValuesUnset (m .Module .Variables )))
59355929 if diags .HasErrors () {
59365930 t .Fatalf ("destroy plan err: %s" , diags .Err ())
59375931 }
@@ -7561,6 +7555,12 @@ func TestContext2Apply_vars(t *testing.T) {
75617555 Value : cty .StringVal ("us-east-1" ),
75627556 SourceType : ValueFromCaller ,
75637557 },
7558+ "bar" : & InputValue {
7559+ // This one is not explicitly set but that's okay because it
7560+ // has a declared default, which Terraform Core will use instead.
7561+ Value : cty .NilVal ,
7562+ SourceType : ValueFromCaller ,
7563+ },
75647564 "test_list" : & InputValue {
75657565 Value : cty .ListVal ([]cty.Value {
75667566 cty .StringVal ("Hello" ),
@@ -7876,7 +7876,7 @@ func TestContext2Apply_issue7824(t *testing.T) {
78767876 },
78777877 })
78787878
7879- plan , diags := ctx .Plan (m , states .NewState (), DefaultPlanOpts )
7879+ plan , diags := ctx .Plan (m , states .NewState (), SimplePlanOpts ( plans . NormalMode , testInputValuesUnset ( m . Module . Variables )) )
78807880 if diags .HasErrors () {
78817881 t .Fatalf ("err: %s" , diags .Err ())
78827882 }
@@ -7932,7 +7932,7 @@ func TestContext2Apply_issue5254(t *testing.T) {
79327932 },
79337933 })
79347934
7935- plan , diags := ctx .Plan (m , states .NewState (), DefaultPlanOpts )
7935+ plan , diags := ctx .Plan (m , states .NewState (), SimplePlanOpts ( plans . NormalMode , testInputValuesUnset ( m . Module . Variables )) )
79367936 if diags .HasErrors () {
79377937 t .Fatalf ("err: %s" , diags .Err ())
79387938 }
@@ -7951,7 +7951,7 @@ func TestContext2Apply_issue5254(t *testing.T) {
79517951 },
79527952 })
79537953
7954- plan , diags = ctx .Plan (m , state , DefaultPlanOpts )
7954+ plan , diags = ctx .Plan (m , state , SimplePlanOpts ( plans . NormalMode , testInputValuesUnset ( m . Module . Variables )) )
79557955 if diags .HasErrors () {
79567956 t .Fatalf ("err: %s" , diags .Err ())
79577957 }
@@ -8845,7 +8845,7 @@ func TestContext2Apply_plannedInterpolatedCount(t *testing.T) {
88458845 Providers : Providers ,
88468846 })
88478847
8848- plan , diags := ctx .Plan (m , state , DefaultPlanOpts )
8848+ plan , diags := ctx .Plan (m , state , SimplePlanOpts ( plans . NormalMode , testInputValuesUnset ( m . Module . Variables )) )
88498849 if diags .HasErrors () {
88508850 t .Fatalf ("plan failed: %s" , diags .Err ())
88518851 }
@@ -8904,9 +8904,7 @@ func TestContext2Apply_plannedDestroyInterpolatedCount(t *testing.T) {
89048904 Providers : providers ,
89058905 })
89068906
8907- plan , diags := ctx .Plan (m , state , & PlanOpts {
8908- Mode : plans .DestroyMode ,
8909- })
8907+ plan , diags := ctx .Plan (m , state , SimplePlanOpts (plans .DestroyMode , testInputValuesUnset (m .Module .Variables )))
89108908 if diags .HasErrors () {
89118909 t .Fatalf ("plan failed: %s" , diags .Err ())
89128910 }
@@ -9674,7 +9672,7 @@ func TestContext2Apply_plannedConnectionRefs(t *testing.T) {
96749672 Hooks : []Hook {hook },
96759673 })
96769674
9677- plan , diags := ctx .Plan (m , states .NewState (), DefaultPlanOpts )
9675+ plan , diags := ctx .Plan (m , states .NewState (), SimplePlanOpts ( plans . NormalMode , testInputValuesUnset ( m . Module . Variables )) )
96789676 diags .HasErrors ()
96799677 if diags .HasErrors () {
96809678 t .Fatalf ("diags: %s" , diags .Err ())
@@ -11687,7 +11685,7 @@ resource "test_resource" "foo" {
1168711685 },
1168811686 })
1168911687
11690- plan , diags := ctx .Plan (m , states .NewState (), DefaultPlanOpts )
11688+ plan , diags := ctx .Plan (m , states .NewState (), SimplePlanOpts ( plans . NormalMode , testInputValuesUnset ( m . Module . Variables )) )
1169111689 assertNoErrors (t , diags )
1169211690
1169311691 state , diags := ctx .Apply (plan , m )
@@ -11702,7 +11700,7 @@ resource "test_resource" "foo" {
1170211700 },
1170311701 })
1170411702
11705- plan , diags = ctx .Plan (m , state , DefaultPlanOpts )
11703+ plan , diags = ctx .Plan (m , state , SimplePlanOpts ( plans . NormalMode , testInputValuesUnset ( m . Module . Variables )) )
1170611704 assertNoErrors (t , diags )
1170711705
1170811706 state , diags = ctx .Apply (plan , m )
@@ -11720,6 +11718,7 @@ resource "test_resource" "foo" {
1172011718 plan , diags = ctx .Plan (m , state , & PlanOpts {
1172111719 Mode : plans .NormalMode ,
1172211720 SetVariables : InputValues {
11721+ "sensitive_id" : & InputValue {Value : cty .NilVal },
1172311722 "sensitive_var" : & InputValue {
1172411723 Value : cty .StringVal ("bar" ),
1172511724 },
@@ -11759,7 +11758,7 @@ resource "test_resource" "foo" {
1175911758 },
1176011759 })
1176111760
11762- plan , diags := ctx .Plan (m , states .NewState (), DefaultPlanOpts )
11761+ plan , diags := ctx .Plan (m , states .NewState (), SimplePlanOpts ( plans . NormalMode , testInputValuesUnset ( m . Module . Variables )) )
1176311762 if diags .HasErrors () {
1176411763 t .Fatalf ("plan errors: %s" , diags .Err ())
1176511764 }
@@ -11904,7 +11903,7 @@ resource "test_resource" "foo" {
1190411903 )
1190511904 })
1190611905
11907- plan , diags := ctx .Plan (m , state , DefaultPlanOpts )
11906+ plan , diags := ctx .Plan (m , state , SimplePlanOpts ( plans . NormalMode , testInputValuesUnset ( m . Module . Variables )) )
1190811907 assertNoErrors (t , diags )
1190911908
1191011909 addr := mustResourceInstanceAddr ("test_resource.foo" )
@@ -11954,7 +11953,7 @@ resource "test_resource" "foo" {
1195411953 // but this seems rather suspicious and we should ideally figure out what
1195511954 // this test was originally intending to do and make it do that.
1195611955 oldPlan := plan
11957- _ , diags = ctx2 .Plan (m2 , state , DefaultPlanOpts )
11956+ _ , diags = ctx2 .Plan (m2 , state , SimplePlanOpts ( plans . NormalMode , testInputValuesUnset ( m . Module . Variables )) )
1195811957 assertNoErrors (t , diags )
1195911958 stateWithoutSensitive , diags := ctx .Apply (oldPlan , m )
1196011959 assertNoErrors (t , diags )
@@ -12206,7 +12205,7 @@ func TestContext2Apply_dataSensitive(t *testing.T) {
1220612205 },
1220712206 })
1220812207
12209- plan , diags := ctx .Plan (m , states .NewState (), DefaultPlanOpts )
12208+ plan , diags := ctx .Plan (m , states .NewState (), SimplePlanOpts ( plans . NormalMode , testInputValuesUnset ( m . Module . Variables )) )
1221012209 if diags .HasErrors () {
1221112210 t .Fatalf ("diags: %s" , diags .Err ())
1221212211 } else {
0 commit comments