Skip to content

Commit c027ab4

Browse files
remove language experiment, this is guarded by being in an alpha release
1 parent 48e7eed commit c027ab4

File tree

3 files changed

+0
-42
lines changed

3 files changed

+0
-42
lines changed

internal/experiments/experiment.go

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,13 +25,11 @@ const (
2525
PreconditionsPostconditions = Experiment("preconditions_postconditions")
2626
EphemeralValues = Experiment("ephemeral_values")
2727
UnknownInstances = Experiment("unknown_instances")
28-
Actions = Experiment("actions")
2928
)
3029

3130
func init() {
3231
// Each experiment constant defined above must be registered here as either
3332
// a current or a concluded experiment.
34-
registerCurrentExperiment(Actions)
3533
registerConcludedExperiment(UnknownInstances, "Unknown instances are being rolled into a larger feature for deferring unready resources and modules.")
3634
registerConcludedExperiment(VariableValidation, "Custom variable validation can now be used by default, without enabling an experiment.")
3735
registerConcludedExperiment(VariableValidationCrossRef, "Input variable validation rules may now refer to other objects in the same module without enabling any experiment.")

internal/terraform/context_plan_actions_test.go

Lines changed: 0 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,6 @@ func TestContextPlan_actions(t *testing.T) {
3535
"unreferenced": {
3636
module: map[string]string{
3737
"main.tf": `
38-
terraform { experiments = [actions] }
3938
action "test_unlinked" "hello" {}
4039
`,
4140
},
@@ -45,7 +44,6 @@ action "test_unlinked" "hello" {}
4544
"invalid config": {
4645
module: map[string]string{
4746
"main.tf": `
48-
terraform { experiments = [actions] }
4947
action "test_unlinked" "hello" {
5048
config {
5149
unknown_attr = "value"
@@ -71,7 +69,6 @@ action "test_unlinked" "hello" {
7169
"before_create triggered": {
7270
module: map[string]string{
7371
"main.tf": `
74-
terraform { experiments = [actions] }
7572
action "test_unlinked" "hello" {}
7673
resource "test_object" "a" {
7774
lifecycle {
@@ -89,7 +86,6 @@ resource "test_object" "a" {
8986
"after_create triggered": {
9087
module: map[string]string{
9188
"main.tf": `
92-
terraform { experiments = [actions] }
9389
action "test_unlinked" "hello" {}
9490
resource "test_object" "a" {
9591
lifecycle {
@@ -107,7 +103,6 @@ resource "test_object" "a" {
107103
"before_update triggered - on create": {
108104
module: map[string]string{
109105
"main.tf": `
110-
terraform { experiments = [actions] }
111106
action "test_unlinked" "hello" {}
112107
resource "test_object" "a" {
113108
lifecycle {
@@ -125,7 +120,6 @@ resource "test_object" "a" {
125120
"after_update triggered - on create": {
126121
module: map[string]string{
127122
"main.tf": `
128-
terraform { experiments = [actions] }
129123
action "test_unlinked" "hello" {}
130124
resource "test_object" "a" {
131125
lifecycle {
@@ -143,7 +137,6 @@ resource "test_object" "a" {
143137
"before_update triggered - on update": {
144138
module: map[string]string{
145139
"main.tf": `
146-
terraform { experiments = [actions] }
147140
action "test_unlinked" "hello" {}
148141
resource "test_object" "a" {
149142
lifecycle {
@@ -168,7 +161,6 @@ resource "test_object" "a" {
168161
"after_update triggered - on update": {
169162
module: map[string]string{
170163
"main.tf": `
171-
terraform { experiments = [actions] }
172164
action "test_unlinked" "hello" {}
173165
resource "test_object" "a" {
174166
lifecycle {
@@ -193,7 +185,6 @@ resource "test_object" "a" {
193185
"before_update triggered - on replace": {
194186
module: map[string]string{
195187
"main.tf": `
196-
terraform { experiments = [actions] }
197188
action "test_unlinked" "hello" {}
198189
resource "test_object" "a" {
199190
lifecycle {
@@ -219,7 +210,6 @@ resource "test_object" "a" {
219210
"after_update triggered - on replace": {
220211
module: map[string]string{
221212
"main.tf": `
222-
terraform { experiments = [actions] }
223213
action "test_unlinked" "hello" {}
224214
resource "test_object" "a" {
225215
lifecycle {
@@ -245,7 +235,6 @@ resource "test_object" "a" {
245235
"action for_each": {
246236
module: map[string]string{
247237
"main.tf": `
248-
terraform { experiments = [actions] }
249238
action "test_unlinked" "hello" {
250239
for_each = toset(["a", "b"])
251240
@@ -269,7 +258,6 @@ resource "test_object" "a" {
269258
"action for_each with auto-expansion": {
270259
module: map[string]string{
271260
"main.tf": `
272-
terraform { experiments = [actions] }
273261
action "test_unlinked" "hello" {
274262
for_each = toset(["a", "b"])
275263
@@ -293,7 +281,6 @@ resource "test_object" "a" {
293281
"action count": {
294282
module: map[string]string{
295283
"main.tf": `
296-
terraform { experiments = [actions] }
297284
action "test_unlinked" "hello" {
298285
count = 2
299286
@@ -318,7 +305,6 @@ resource "test_object" "a" {
318305
"action count with auto-expansion": {
319306
module: map[string]string{
320307
"main.tf": `
321-
terraform { experiments = [actions] }
322308
action "test_unlinked" "hello" {
323309
count = 2
324310
@@ -343,7 +329,6 @@ resource "test_object" "a" {
343329
"action for_each invalid access": {
344330
module: map[string]string{
345331
"main.tf": `
346-
terraform { experiments = [actions] }
347332
action "test_unlinked" "hello" {
348333
for_each = toset(["a", "b"])
349334
@@ -374,7 +359,6 @@ resource "test_object" "a" {
374359
"action count invalid access": {
375360
module: map[string]string{
376361
"main.tf": `
377-
terraform { experiments = [actions] }
378362
action "test_unlinked" "hello" {
379363
count = 2
380364
@@ -405,7 +389,6 @@ resource "test_object" "a" {
405389
"expanded resource - unexpanded action": {
406390
module: map[string]string{
407391
"main.tf": `
408-
terraform { experiments = [actions] }
409392
action "test_unlinked" "hello" {}
410393
resource "test_object" "a" {
411394
count = 2
@@ -425,7 +408,6 @@ resource "test_object" "a" {
425408
toBeImplemented: true, // TODO: Not sure why this panics
426409
module: map[string]string{
427410
"main.tf": `
428-
terraform { experiments = [actions] }
429411
action "test_unlinked" "hello" {
430412
count = 2
431413
@@ -451,7 +433,6 @@ resource "test_object" "a" {
451433
"transitive dependencies": {
452434
module: map[string]string{
453435
"main.tf": `
454-
terraform { experiments = [actions] }
455436
resource "test_object" "a" {
456437
name = "a"
457438
}
@@ -477,7 +458,6 @@ resource "test_object" "b" {
477458
"expanded transitive dependencies": {
478459
module: map[string]string{
479460
"main.tf": `
480-
terraform { experiments = [actions] }
481461
resource "test_object" "a" {
482462
name = "a"
483463
}
@@ -529,7 +509,6 @@ resource "test_object" "e" {
529509
"failing actions cancel next ones": {
530510
module: map[string]string{
531511
"main.tf": `
532-
terraform { experiments = [actions] }
533512
action "test_unlinked" "failure" {}
534513
resource "test_object" "a" {
535514
lifecycle {
@@ -564,7 +543,6 @@ resource "test_object" "a" {
564543
"actions cant be accessed in resources": {
565544
module: map[string]string{
566545
"main.tf": `
567-
terraform { experiments = [actions] }
568546
action "test_unlinked" "my_action" {
569547
config {
570548
attr = "value"
@@ -589,7 +567,6 @@ resource "test_object" "a" {
589567
"actions cant be accessed in outputs": {
590568
module: map[string]string{
591569
"main.tf": `
592-
terraform { experiments = [actions] }
593570
action "test_unlinked" "my_action" {
594571
config {
595572
attr = "value"
@@ -621,7 +598,6 @@ output "my_output2" {
621598
"destroy run": {
622599
module: map[string]string{
623600
"main.tf": `
624-
terraform { experiments = [actions] }
625601
action "test_unlinked" "hello" {}
626602
resource "test_object" "a" {
627603
lifecycle {
@@ -642,7 +618,6 @@ resource "test_object" "a" {
642618
"destroying expanded node": {
643619
module: map[string]string{
644620
"main.tf": `
645-
terraform { experiments = [actions] }
646621
action "test_unlinked" "hello" {}
647622
resource "test_object" "a" {
648623
count = 2

internal/terraform/node_action.go

Lines changed: 0 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -4,12 +4,9 @@
44
package terraform
55

66
import (
7-
"fmt"
8-
97
"github.com/hashicorp/terraform/internal/addrs"
108
"github.com/hashicorp/terraform/internal/configs"
119
"github.com/hashicorp/terraform/internal/dag"
12-
"github.com/hashicorp/terraform/internal/experiments"
1310
"github.com/hashicorp/terraform/internal/lang/langrefs"
1411
"github.com/hashicorp/terraform/internal/providers"
1512
"github.com/hashicorp/terraform/internal/tfdiags"
@@ -97,18 +94,6 @@ func (n *nodeExpandActionDeclaration) DynamicExpand(ctx EvalContext) (*Graph, tf
9794

9895
// Check if the actions language experiment is enabled for this module.
9996
moduleCtx := evalContextForModuleInstance(ctx, module)
100-
allowActions := moduleCtx.LanguageExperimentActive(experiments.Actions)
101-
if !allowActions {
102-
summary := fmt.Sprintf("Actions experiment not enabled for module %s", module)
103-
if module.IsRoot() {
104-
summary = "Actions experiment not enabled"
105-
}
106-
return nil, diags.Append(tfdiags.Sourceless(
107-
tfdiags.Error,
108-
summary,
109-
"The actions experiment must be enabled in order to use actions in your configuration. You can enable it by adding a terraform { experiments = [actions] } block to your configuration.",
110-
))
111-
}
11297

11398
// recordActionData is responsible for informing the expander of what
11499
// repetition mode this resource has, which allows expander.ExpandResource

0 commit comments

Comments
 (0)