diff --git a/coderd/database/dbauthz/dbauthz_test.go b/coderd/database/dbauthz/dbauthz_test.go index ae5c3dbd8f..f6a37dfbe0 100644 --- a/coderd/database/dbauthz/dbauthz_test.go +++ b/coderd/database/dbauthz/dbauthz_test.go @@ -891,9 +891,9 @@ func (s *MethodTestSuite) TestOrganization() { } _, err := db.InsertPreset(context.Background(), insertPresetParams) require.NoError(s.T(), err) - check.Args(insertPresetParams).Asserts(rbac.ResourceTemplate, policy.ActionCreate) + check.Args(insertPresetParams).Asserts(rbac.ResourceSystem, policy.ActionCreate) })) - s.Run("InsertPreset", s.Subtest(func(db database.Store, check *expects) { + s.Run("InsertPresetParameters", s.Subtest(func(db database.Store, check *expects) { org := dbgen.Organization(s.T(), db, database.Organization{}) user := dbgen.User(s.T(), db, database.User{}) template := dbgen.Template(s.T(), db, database.Template{ @@ -932,7 +932,7 @@ func (s *MethodTestSuite) TestOrganization() { } _, err = db.InsertPresetParameters(context.Background(), insertPresetParametersParams) require.NoError(s.T(), err) - check.Args(insertPresetParametersParams).Asserts(rbac.ResourceTemplate, policy.ActionCreate) + check.Args(insertPresetParametersParams).Asserts(rbac.ResourceSystem, policy.ActionCreate) })) s.Run("DeleteOrganizationMember", s.Subtest(func(db database.Store, check *expects) { o := dbgen.Organization(s.T(), db, database.Organization{}) diff --git a/coderd/database/dbmock/dbmock.go b/coderd/database/dbmock/dbmock.go index de0b97a2b5..dc316879eb 100644 --- a/coderd/database/dbmock/dbmock.go +++ b/coderd/database/dbmock/dbmock.go @@ -2017,48 +2017,48 @@ func (mr *MockStoreMockRecorder) GetParameterSchemasByJobID(ctx, jobID any) *gom } // GetPresetByWorkspaceBuildID mocks base method. -func (m *MockStore) GetPresetByWorkspaceBuildID(arg0 context.Context, arg1 uuid.UUID) (database.TemplateVersionPreset, error) { +func (m *MockStore) GetPresetByWorkspaceBuildID(ctx context.Context, workspaceBuildID uuid.UUID) (database.TemplateVersionPreset, error) { m.ctrl.T.Helper() - ret := m.ctrl.Call(m, "GetPresetByWorkspaceBuildID", arg0, arg1) + ret := m.ctrl.Call(m, "GetPresetByWorkspaceBuildID", ctx, workspaceBuildID) ret0, _ := ret[0].(database.TemplateVersionPreset) ret1, _ := ret[1].(error) return ret0, ret1 } // GetPresetByWorkspaceBuildID indicates an expected call of GetPresetByWorkspaceBuildID. -func (mr *MockStoreMockRecorder) GetPresetByWorkspaceBuildID(arg0, arg1 any) *gomock.Call { +func (mr *MockStoreMockRecorder) GetPresetByWorkspaceBuildID(ctx, workspaceBuildID any) *gomock.Call { mr.mock.ctrl.T.Helper() - return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetPresetByWorkspaceBuildID", reflect.TypeOf((*MockStore)(nil).GetPresetByWorkspaceBuildID), arg0, arg1) + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetPresetByWorkspaceBuildID", reflect.TypeOf((*MockStore)(nil).GetPresetByWorkspaceBuildID), ctx, workspaceBuildID) } // GetPresetParametersByTemplateVersionID mocks base method. -func (m *MockStore) GetPresetParametersByTemplateVersionID(arg0 context.Context, arg1 uuid.UUID) ([]database.TemplateVersionPresetParameter, error) { +func (m *MockStore) GetPresetParametersByTemplateVersionID(ctx context.Context, templateVersionID uuid.UUID) ([]database.TemplateVersionPresetParameter, error) { m.ctrl.T.Helper() - ret := m.ctrl.Call(m, "GetPresetParametersByTemplateVersionID", arg0, arg1) + ret := m.ctrl.Call(m, "GetPresetParametersByTemplateVersionID", ctx, templateVersionID) ret0, _ := ret[0].([]database.TemplateVersionPresetParameter) ret1, _ := ret[1].(error) return ret0, ret1 } // GetPresetParametersByTemplateVersionID indicates an expected call of GetPresetParametersByTemplateVersionID. -func (mr *MockStoreMockRecorder) GetPresetParametersByTemplateVersionID(arg0, arg1 any) *gomock.Call { +func (mr *MockStoreMockRecorder) GetPresetParametersByTemplateVersionID(ctx, templateVersionID any) *gomock.Call { mr.mock.ctrl.T.Helper() - return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetPresetParametersByTemplateVersionID", reflect.TypeOf((*MockStore)(nil).GetPresetParametersByTemplateVersionID), arg0, arg1) + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetPresetParametersByTemplateVersionID", reflect.TypeOf((*MockStore)(nil).GetPresetParametersByTemplateVersionID), ctx, templateVersionID) } // GetPresetsByTemplateVersionID mocks base method. -func (m *MockStore) GetPresetsByTemplateVersionID(arg0 context.Context, arg1 uuid.UUID) ([]database.GetPresetsByTemplateVersionIDRow, error) { +func (m *MockStore) GetPresetsByTemplateVersionID(ctx context.Context, templateVersionID uuid.UUID) ([]database.GetPresetsByTemplateVersionIDRow, error) { m.ctrl.T.Helper() - ret := m.ctrl.Call(m, "GetPresetsByTemplateVersionID", arg0, arg1) + ret := m.ctrl.Call(m, "GetPresetsByTemplateVersionID", ctx, templateVersionID) ret0, _ := ret[0].([]database.GetPresetsByTemplateVersionIDRow) ret1, _ := ret[1].(error) return ret0, ret1 } // GetPresetsByTemplateVersionID indicates an expected call of GetPresetsByTemplateVersionID. -func (mr *MockStoreMockRecorder) GetPresetsByTemplateVersionID(arg0, arg1 any) *gomock.Call { +func (mr *MockStoreMockRecorder) GetPresetsByTemplateVersionID(ctx, templateVersionID any) *gomock.Call { mr.mock.ctrl.T.Helper() - return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetPresetsByTemplateVersionID", reflect.TypeOf((*MockStore)(nil).GetPresetsByTemplateVersionID), arg0, arg1) + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetPresetsByTemplateVersionID", reflect.TypeOf((*MockStore)(nil).GetPresetsByTemplateVersionID), ctx, templateVersionID) } // GetPreviousTemplateVersion mocks base method. @@ -4097,33 +4097,33 @@ func (mr *MockStoreMockRecorder) InsertOrganizationMember(ctx, arg any) *gomock. } // InsertPreset mocks base method. -func (m *MockStore) InsertPreset(arg0 context.Context, arg1 database.InsertPresetParams) (database.TemplateVersionPreset, error) { +func (m *MockStore) InsertPreset(ctx context.Context, arg database.InsertPresetParams) (database.TemplateVersionPreset, error) { m.ctrl.T.Helper() - ret := m.ctrl.Call(m, "InsertPreset", arg0, arg1) + ret := m.ctrl.Call(m, "InsertPreset", ctx, arg) ret0, _ := ret[0].(database.TemplateVersionPreset) ret1, _ := ret[1].(error) return ret0, ret1 } // InsertPreset indicates an expected call of InsertPreset. -func (mr *MockStoreMockRecorder) InsertPreset(arg0, arg1 any) *gomock.Call { +func (mr *MockStoreMockRecorder) InsertPreset(ctx, arg any) *gomock.Call { mr.mock.ctrl.T.Helper() - return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "InsertPreset", reflect.TypeOf((*MockStore)(nil).InsertPreset), arg0, arg1) + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "InsertPreset", reflect.TypeOf((*MockStore)(nil).InsertPreset), ctx, arg) } // InsertPresetParameters mocks base method. -func (m *MockStore) InsertPresetParameters(arg0 context.Context, arg1 database.InsertPresetParametersParams) ([]database.TemplateVersionPresetParameter, error) { +func (m *MockStore) InsertPresetParameters(ctx context.Context, arg database.InsertPresetParametersParams) ([]database.TemplateVersionPresetParameter, error) { m.ctrl.T.Helper() - ret := m.ctrl.Call(m, "InsertPresetParameters", arg0, arg1) + ret := m.ctrl.Call(m, "InsertPresetParameters", ctx, arg) ret0, _ := ret[0].([]database.TemplateVersionPresetParameter) ret1, _ := ret[1].(error) return ret0, ret1 } // InsertPresetParameters indicates an expected call of InsertPresetParameters. -func (mr *MockStoreMockRecorder) InsertPresetParameters(arg0, arg1 any) *gomock.Call { +func (mr *MockStoreMockRecorder) InsertPresetParameters(ctx, arg any) *gomock.Call { mr.mock.ctrl.T.Helper() - return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "InsertPresetParameters", reflect.TypeOf((*MockStore)(nil).InsertPresetParameters), arg0, arg1) + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "InsertPresetParameters", reflect.TypeOf((*MockStore)(nil).InsertPresetParameters), ctx, arg) } // InsertProvisionerJob mocks base method. diff --git a/coderd/presets_test.go b/coderd/presets_test.go new file mode 100644 index 0000000000..a14d8dd50d --- /dev/null +++ b/coderd/presets_test.go @@ -0,0 +1,56 @@ +package coderd_test + +import ( + "context" + "testing" + + "github.com/stretchr/testify/require" + + "github.com/coder/coder/v2/coderd/coderdtest" + "github.com/coder/coder/v2/coderd/database" + "github.com/coder/coder/v2/coderd/database/dbauthz" + "github.com/coder/coder/v2/coderd/httpmw" + "github.com/coder/coder/v2/coderd/rbac" +) + +func TestTemplateVersionPresets(t *testing.T) { + t.Parallel() + + ctx := context.Background() + + client, db := coderdtest.NewWithDatabase(t, &coderdtest.Options{IncludeProvisionerDaemon: true}) + user := coderdtest.CreateFirstUser(t, client) + version := coderdtest.CreateTemplateVersion(t, client, user.OrganizationID, nil) + + // nolint:gocritic // This is a test + provisionerCtx := dbauthz.AsProvisionerd(ctx) + + preset, err := db.InsertPreset(provisionerCtx, database.InsertPresetParams{ + Name: "My Preset", + TemplateVersionID: version.ID, + }) + require.NoError(t, err) + _, err = db.InsertPresetParameters(provisionerCtx, database.InsertPresetParametersParams{ + TemplateVersionPresetID: preset.ID, + Names: []string{"preset_param1", "preset_param2"}, + Values: []string{"A1B2C3", "D4E5F6"}, + }) + require.NoError(t, err) + + userSubject, _, err := httpmw.UserRBACSubject(ctx, db, user.UserID, rbac.ScopeAll) + require.NoError(t, err) + userCtx := dbauthz.As(ctx, userSubject) + + presets, err := client.TemplateVersionPresets(userCtx, version.ID) + require.NoError(t, err) + require.Equal(t, 1, len(presets)) + require.Equal(t, "My Preset", presets[0].Name) + + presetParams, err := client.TemplateVersionPresetParameters(userCtx, version.ID) + require.NoError(t, err) + require.Equal(t, 2, len(presetParams)) + require.Equal(t, "preset_param1", presetParams[0].Name) + require.Equal(t, "A1B2C3", presetParams[0].Value) + require.Equal(t, "preset_param2", presetParams[1].Name) + require.Equal(t, "D4E5F6", presetParams[1].Value) +} diff --git a/coderd/provisionerdserver/provisionerdserver.go b/coderd/provisionerdserver/provisionerdserver.go index 42694667e0..0830b19f80 100644 --- a/coderd/provisionerdserver/provisionerdserver.go +++ b/coderd/provisionerdserver/provisionerdserver.go @@ -1340,35 +1340,9 @@ func (s *server) CompleteJob(ctx context.Context, completed *proto.CompletedJob) } } - for _, preset := range jobType.TemplateImport.Presets { - s.Logger.Info(ctx, "inserting template import job preset", - slog.F("job_id", job.ID.String()), - slog.F("preset_name", preset.Name), - ) - - dbPreset, err := s.Database.InsertPreset(ctx, database.InsertPresetParams{ - TemplateVersionID: input.TemplateVersionID, - Name: preset.Name, - CreatedAt: s.timeNow(), - }) - if err != nil { - return nil, xerrors.Errorf("insert preset: %w", err) - } - - var presetParameterNames []string - var presetParameterValues []string - for _, parameter := range preset.Parameters { - presetParameterNames = append(presetParameterNames, parameter.Name) - presetParameterValues = append(presetParameterValues, parameter.Value) - } - _, err = s.Database.InsertPresetParameters(ctx, database.InsertPresetParametersParams{ - TemplateVersionPresetID: dbPreset.ID, - Names: presetParameterNames, - Values: presetParameterValues, - }) - if err != nil { - return nil, xerrors.Errorf("insert preset parameters: %w", err) - } + err = InsertWorkspacePresetsAndParameters(ctx, s.Logger, s.Database, jobID, input.TemplateVersionID, jobType.TemplateImport.Presets, s.timeNow()) + if err != nil { + return nil, xerrors.Errorf("insert workspace presets and parameters: %w", err) } var completedError sql.NullString @@ -1840,6 +1814,46 @@ func InsertWorkspaceModule(ctx context.Context, db database.Store, jobID uuid.UU return nil } +func InsertWorkspacePresetsAndParameters(ctx context.Context, logger slog.Logger, db database.Store, jobID uuid.UUID, templateVersionID uuid.UUID, protoPresets []*sdkproto.Preset, t time.Time) error { + for _, preset := range protoPresets { + logger.Info(ctx, "inserting template import job preset", + slog.F("job_id", jobID.String()), + slog.F("preset_name", preset.Name), + ) + if err := InsertWorkspacePresetAndParameters(ctx, db, templateVersionID, preset, t); err != nil { + return xerrors.Errorf("insert workspace preset: %w", err) + } + } + return nil +} + +func InsertWorkspacePresetAndParameters(ctx context.Context, db database.Store, templateVersionID uuid.UUID, protoPreset *sdkproto.Preset, t time.Time) error { + dbPreset, err := db.InsertPreset(ctx, database.InsertPresetParams{ + TemplateVersionID: templateVersionID, + Name: protoPreset.Name, + CreatedAt: t, + }) + if err != nil { + return xerrors.Errorf("insert preset: %w", err) + } + + var presetParameterNames []string + var presetParameterValues []string + for _, parameter := range protoPreset.Parameters { + presetParameterNames = append(presetParameterNames, parameter.Name) + presetParameterValues = append(presetParameterValues, parameter.Value) + } + _, err = db.InsertPresetParameters(ctx, database.InsertPresetParametersParams{ + TemplateVersionPresetID: dbPreset.ID, + Names: presetParameterNames, + Values: presetParameterValues, + }) + if err != nil { + return xerrors.Errorf("insert preset parameters: %w", err) + } + return nil +} + func InsertWorkspaceResource(ctx context.Context, db database.Store, jobID uuid.UUID, transition database.WorkspaceTransition, protoResource *sdkproto.Resource, snapshot *telemetry.Snapshot) error { resource, err := db.InsertWorkspaceResource(ctx, database.InsertWorkspaceResourceParams{ ID: uuid.New(), diff --git a/coderd/provisionerdserver/provisionerdserver_test.go b/coderd/provisionerdserver/provisionerdserver_test.go index ced591d7cc..cb3933dbe7 100644 --- a/coderd/provisionerdserver/provisionerdserver_test.go +++ b/coderd/provisionerdserver/provisionerdserver_test.go @@ -30,6 +30,7 @@ import ( "github.com/coder/coder/v2/coderd/database" "github.com/coder/coder/v2/coderd/database/dbgen" "github.com/coder/coder/v2/coderd/database/dbmem" + "github.com/coder/coder/v2/coderd/database/dbtestutil" "github.com/coder/coder/v2/coderd/database/dbtime" "github.com/coder/coder/v2/coderd/database/pubsub" "github.com/coder/coder/v2/coderd/externalauth" @@ -1708,6 +1709,155 @@ func TestCompleteJob(t *testing.T) { }) } +func TestInsertWorkspacePresetsAndParameters(t *testing.T) { + t.Parallel() + + type testCase struct { + name string + givenPresets []*sdkproto.Preset + } + + testCases := []testCase{ + { + name: "no presets", + }, + { + name: "one preset with no parameters", + givenPresets: []*sdkproto.Preset{ + { + Name: "preset1", + }, + }, + }, + { + name: "one preset with multiple parameters", + givenPresets: []*sdkproto.Preset{ + { + Name: "preset1", + Parameters: []*sdkproto.PresetParameter{ + { + Name: "param1", + Value: "value1", + }, + { + Name: "param2", + Value: "value2", + }, + }, + }, + }, + }, + { + name: "multiple presets with parameters", + givenPresets: []*sdkproto.Preset{ + { + Name: "preset1", + Parameters: []*sdkproto.PresetParameter{ + { + Name: "param1", + Value: "value1", + }, + { + Name: "param2", + Value: "value2", + }, + }, + }, + { + Name: "preset2", + Parameters: []*sdkproto.PresetParameter{ + { + Name: "param3", + Value: "value3", + }, + { + Name: "param4", + Value: "value4", + }, + }, + }, + }, + }, + } + + for _, c := range testCases { + c := c + t.Run(c.name, func(t *testing.T) { + t.Parallel() + + ctx := context.Background() + logger := testutil.Logger(t) + db, ps := dbtestutil.NewDB(t) + org := dbgen.Organization(t, db, database.Organization{}) + user := dbgen.User(t, db, database.User{}) + job := dbgen.ProvisionerJob(t, db, ps, database.ProvisionerJob{ + Type: database.ProvisionerJobTypeWorkspaceBuild, + OrganizationID: org.ID, + }) + templateVersion := dbgen.TemplateVersion(t, db, database.TemplateVersion{ + JobID: job.ID, + OrganizationID: org.ID, + CreatedBy: user.ID, + }) + + err := provisionerdserver.InsertWorkspacePresetsAndParameters( + ctx, + logger, + db, + job.ID, + templateVersion.ID, + c.givenPresets, + time.Now(), + ) + require.NoError(t, err) + + gotPresets, err := db.GetPresetsByTemplateVersionID(ctx, templateVersion.ID) + require.NoError(t, err) + require.Len(t, gotPresets, len(c.givenPresets)) + + for _, givenPreset := range c.givenPresets { + foundMatch := false + for _, gotPreset := range gotPresets { + if givenPreset.Name == gotPreset.Name { + foundMatch = true + break + } + } + require.True(t, foundMatch, "preset %s not found in parameters", givenPreset.Name) + } + + gotPresetParameters, err := db.GetPresetParametersByTemplateVersionID(ctx, templateVersion.ID) + require.NoError(t, err) + + for _, givenPreset := range c.givenPresets { + for _, givenParameter := range givenPreset.Parameters { + foundMatch := false + for _, gotParameter := range gotPresetParameters { + nameMatches := givenParameter.Name == gotParameter.Name + valueMatches := givenParameter.Value == gotParameter.Value + + // ensure that preset parameters are matched to the correct preset: + var gotPreset database.GetPresetsByTemplateVersionIDRow + for _, preset := range gotPresets { + if preset.ID == gotParameter.TemplateVersionPresetID { + gotPreset = preset + break + } + } + presetMatches := gotPreset.Name == givenPreset.Name + + if nameMatches && valueMatches && presetMatches { + foundMatch = true + break + } + } + require.True(t, foundMatch, "preset parameter %s not found in presets", givenParameter.Name) + } + } + }) + } +} + func TestInsertWorkspaceResource(t *testing.T) { t.Parallel() ctx := context.Background() diff --git a/go.mod b/go.mod index 95f3bb44c2..ca15ea8d31 100644 --- a/go.mod +++ b/go.mod @@ -1,6 +1,6 @@ module github.com/coder/coder/v2 -go 1.22.8 +go 1.22.9 // Required until a v3 of chroma is created to lazily initialize all XML files. // None of our dependencies seem to use the registries anyways, so this @@ -93,7 +93,7 @@ require ( github.com/coder/quartz v0.1.2 github.com/coder/retry v1.5.1 github.com/coder/serpent v0.10.0 - github.com/coder/terraform-provider-coder v1.0.4 + github.com/coder/terraform-provider-coder v1.0.5-0.20250131073245-5b9a30ca496b github.com/coder/websocket v1.8.12 github.com/coder/wgtunnel v0.1.13-0.20240522110300-ade90dfb2da0 github.com/coreos/go-oidc/v3 v3.12.0 @@ -130,7 +130,7 @@ require ( github.com/hashicorp/go-multierror v1.1.1 github.com/hashicorp/go-reap v0.0.0-20170704170343-bf58d8a43e7b github.com/hashicorp/go-version v1.7.0 - github.com/hashicorp/hc-install v0.9.0 + github.com/hashicorp/hc-install v0.9.1 github.com/hashicorp/terraform-config-inspect v0.0.0-20211115214459-90acf1ca460f github.com/hashicorp/terraform-json v0.24.0 github.com/hashicorp/yamux v0.1.2 @@ -187,7 +187,7 @@ require ( go4.org/netipx v0.0.0-20230728180743-ad4cb58a6516 golang.org/x/crypto v0.32.0 golang.org/x/exp v0.0.0-20240808152545-0cdaa3abc0fa - golang.org/x/mod v0.22.0 + golang.org/x/mod v0.23.0 golang.org/x/net v0.34.0 golang.org/x/oauth2 v0.25.0 golang.org/x/sync v0.10.0 @@ -228,7 +228,7 @@ require ( github.com/Microsoft/go-winio v0.6.2 // indirect github.com/Nvveen/Gotty v0.0.0-20120604004816-cd527374f1e5 // indirect github.com/OneOfOne/xxhash v1.2.8 // indirect - github.com/ProtonMail/go-crypto v1.1.0-alpha.2 // indirect + github.com/ProtonMail/go-crypto v1.1.3 // indirect github.com/agext/levenshtein v1.2.3 // indirect github.com/agnivade/levenshtein v1.2.0 // indirect github.com/akutz/memconn v0.1.0 // indirect @@ -325,9 +325,9 @@ require ( github.com/hashicorp/hcl v1.0.1-vault-5 // indirect github.com/hashicorp/hcl/v2 v2.23.0 github.com/hashicorp/logutils v1.0.0 // indirect - github.com/hashicorp/terraform-plugin-go v0.25.0 // indirect + github.com/hashicorp/terraform-plugin-go v0.26.0 // indirect github.com/hashicorp/terraform-plugin-log v0.9.0 // indirect - github.com/hashicorp/terraform-plugin-sdk/v2 v2.35.0 // indirect + github.com/hashicorp/terraform-plugin-sdk/v2 v2.36.0 // indirect github.com/hdevalence/ed25519consensus v0.1.0 // indirect github.com/illarion/gonotify v1.0.1 // indirect github.com/insomniacslk/dhcp v0.0.0-20231206064809-8c70d406f6d2 // indirect @@ -414,7 +414,7 @@ require ( github.com/yashtewari/glob-intersection v0.2.0 // indirect github.com/yuin/goldmark v1.7.8 // indirect github.com/yuin/goldmark-emoji v1.0.4 // indirect - github.com/zclconf/go-cty v1.16.0 + github.com/zclconf/go-cty v1.16.2 github.com/zeebo/errs v1.3.0 // indirect go.opentelemetry.io/auto/sdk v1.1.0 // indirect go.opentelemetry.io/contrib v1.19.0 // indirect diff --git a/go.sum b/go.sum index afb90aa07f..f60250d2e0 100644 --- a/go.sum +++ b/go.sum @@ -64,8 +64,8 @@ github.com/Nvveen/Gotty v0.0.0-20120604004816-cd527374f1e5 h1:TngWCqHvy9oXAN6lEV github.com/Nvveen/Gotty v0.0.0-20120604004816-cd527374f1e5/go.mod h1:lmUJ/7eu/Q8D7ML55dXQrVaamCz2vxCfdQBasLZfHKk= github.com/OneOfOne/xxhash v1.2.8 h1:31czK/TI9sNkxIKfaUfGlU47BAxQ0ztGgd9vPyqimf8= github.com/OneOfOne/xxhash v1.2.8/go.mod h1:eZbhyaAYD41SGSSsnmcpxVoRiQ/MPUTjUdIIOT9Um7Q= -github.com/ProtonMail/go-crypto v1.1.0-alpha.2 h1:bkyFVUP+ROOARdgCiJzNQo2V2kiB97LyUpzH9P6Hrlg= -github.com/ProtonMail/go-crypto v1.1.0-alpha.2/go.mod h1:rA3QumHc/FZ8pAHreoekgiAbzpNsfQAosU5td4SnOrE= +github.com/ProtonMail/go-crypto v1.1.3 h1:nRBOetoydLeUb4nHajyO2bKqMLfWQ/ZPwkXqXxPxCFk= +github.com/ProtonMail/go-crypto v1.1.3/go.mod h1:rA3QumHc/FZ8pAHreoekgiAbzpNsfQAosU5td4SnOrE= github.com/acarl005/stripansi v0.0.0-20180116102854-5a71ef0e047d h1:licZJFw2RwpHMqeKTCYkitsPqHNxTmd4SNR5r94FGM8= github.com/acarl005/stripansi v0.0.0-20180116102854-5a71ef0e047d/go.mod h1:asat636LX7Bqt5lYEZ27JNDcqxfjdBQuJ/MM4CN/Lzo= github.com/adrg/xdg v0.5.0 h1:dDaZvhMXatArP1NPHhnfaQUqWBLBsmx1h1HXQdMoFCY= @@ -244,8 +244,8 @@ github.com/coder/tailscale v1.1.1-0.20250129014916-8086c871eae6 h1:prDIwUcsSEKbs github.com/coder/tailscale v1.1.1-0.20250129014916-8086c871eae6/go.mod h1:1ggFFdHTRjPRu9Yc1yA7nVHBYB50w9Ce7VIXNqcW6Ko= github.com/coder/terraform-config-inspect v0.0.0-20250107175719-6d06d90c630e h1:JNLPDi2P73laR1oAclY6jWzAbucf70ASAvf5mh2cME0= github.com/coder/terraform-config-inspect v0.0.0-20250107175719-6d06d90c630e/go.mod h1:Gz/z9Hbn+4KSp8A2FBtNszfLSdT2Tn/uAKGuVqqWmDI= -github.com/coder/terraform-provider-coder v1.0.4 h1:MJldCvykIQzzqBVUDjCJpPyqvKelAAHrtJKfIIx4Qxo= -github.com/coder/terraform-provider-coder v1.0.4/go.mod h1:dQ1e/IccUxnmh/1bXTA3PopSoBkHMyWT6EkdBw8Lx6Y= +github.com/coder/terraform-provider-coder v1.0.5-0.20250131073245-5b9a30ca496b h1:Z9ssmlGrbf+mRIiyRzQj1P6vH8drKOqgzeTG6D0Ldjg= +github.com/coder/terraform-provider-coder v1.0.5-0.20250131073245-5b9a30ca496b/go.mod h1:dQ1e/IccUxnmh/1bXTA3PopSoBkHMyWT6EkdBw8Lx6Y= github.com/coder/websocket v1.8.12 h1:5bUXkEPPIbewrnkU8LTCLVaxi4N4J8ahufH2vlo4NAo= github.com/coder/websocket v1.8.12/go.mod h1:LNVeNrXQZfe5qhS9ALED3uA+l5pPqvwXg3CKoDBB2gs= github.com/coder/wgtunnel v0.1.13-0.20240522110300-ade90dfb2da0 h1:C2/eCr+r0a5Auuw3YOiSyLNHkdMtyCZHPFBx7syN4rk= @@ -539,26 +539,26 @@ github.com/hashicorp/go-version v1.7.0/go.mod h1:fltr4n8CU8Ke44wwGCBoEymUuxUHl09 github.com/hashicorp/golang-lru v1.0.2 h1:dV3g9Z/unq5DpblPpw+Oqcv4dU/1omnb4Ok8iPY6p1c= github.com/hashicorp/golang-lru/v2 v2.0.7 h1:a+bsQ5rvGLjzHuww6tVxozPZFVghXaHOwFs4luLUK2k= github.com/hashicorp/golang-lru/v2 v2.0.7/go.mod h1:QeFd9opnmA6QUJc5vARoKUSoFhyfM2/ZepoAG6RGpeM= -github.com/hashicorp/hc-install v0.9.0 h1:2dIk8LcvANwtv3QZLckxcjyF5w8KVtiMxu6G6eLhghE= -github.com/hashicorp/hc-install v0.9.0/go.mod h1:+6vOP+mf3tuGgMApVYtmsnDoKWMDcFXeTxCACYZ8SFg= +github.com/hashicorp/hc-install v0.9.1 h1:gkqTfE3vVbafGQo6VZXcy2v5yoz2bE0+nhZXruCuODQ= +github.com/hashicorp/hc-install v0.9.1/go.mod h1:pWWvN/IrfeBK4XPeXXYkL6EjMufHkCK5DvwxeLKuBf0= github.com/hashicorp/hcl v1.0.1-vault-5 h1:kI3hhbbyzr4dldA8UdTb7ZlVVlI2DACdCfz31RPDgJM= github.com/hashicorp/hcl v1.0.1-vault-5/go.mod h1:XYhtn6ijBSAj6n4YqAaf7RBPS4I06AItNorpy+MoQNM= github.com/hashicorp/hcl/v2 v2.23.0 h1:Fphj1/gCylPxHutVSEOf2fBOh1VE4AuLV7+kbJf3qos= github.com/hashicorp/hcl/v2 v2.23.0/go.mod h1:62ZYHrXgPoX8xBnzl8QzbWq4dyDsDtfCRgIq1rbJEvA= github.com/hashicorp/logutils v1.0.0 h1:dLEQVugN8vlakKOUE3ihGLTZJRB4j+M2cdTm/ORI65Y= github.com/hashicorp/logutils v1.0.0/go.mod h1:QIAnNjmIWmVIIkWDTG1z5v++HQmx9WQRO+LraFDTW64= -github.com/hashicorp/terraform-exec v0.21.0 h1:uNkLAe95ey5Uux6KJdua6+cv8asgILFVWkd/RG0D2XQ= -github.com/hashicorp/terraform-exec v0.21.0/go.mod h1:1PPeMYou+KDUSSeRE9szMZ/oHf4fYUmB923Wzbq1ICg= +github.com/hashicorp/terraform-exec v0.22.0 h1:G5+4Sz6jYZfRYUCg6eQgDsqTzkNXV+fP8l+uRmZHj64= +github.com/hashicorp/terraform-exec v0.22.0/go.mod h1:bjVbsncaeh8jVdhttWYZuBGj21FcYw6Ia/XfHcNO7lQ= github.com/hashicorp/terraform-json v0.24.0 h1:rUiyF+x1kYawXeRth6fKFm/MdfBS6+lW4NbeATsYz8Q= github.com/hashicorp/terraform-json v0.24.0/go.mod h1:Nfj5ubo9xbu9uiAoZVBsNOjvNKB66Oyrvtit74kC7ow= -github.com/hashicorp/terraform-plugin-go v0.25.0 h1:oi13cx7xXA6QciMcpcFi/rwA974rdTxjqEhXJjbAyks= -github.com/hashicorp/terraform-plugin-go v0.25.0/go.mod h1:+SYagMYadJP86Kvn+TGeV+ofr/R3g4/If0O5sO96MVw= +github.com/hashicorp/terraform-plugin-go v0.26.0 h1:cuIzCv4qwigug3OS7iKhpGAbZTiypAfFQmw8aE65O2M= +github.com/hashicorp/terraform-plugin-go v0.26.0/go.mod h1:+CXjuLDiFgqR+GcrM5a2E2Kal5t5q2jb0E3D57tTdNY= github.com/hashicorp/terraform-plugin-log v0.9.0 h1:i7hOA+vdAItN1/7UrfBqBwvYPQ9TFvymaRGZED3FCV0= github.com/hashicorp/terraform-plugin-log v0.9.0/go.mod h1:rKL8egZQ/eXSyDqzLUuwUYLVdlYeamldAHSxjUFADow= -github.com/hashicorp/terraform-plugin-sdk/v2 v2.35.0 h1:wyKCCtn6pBBL46c1uIIBNUOWlNfYXfXpVo16iDyLp8Y= -github.com/hashicorp/terraform-plugin-sdk/v2 v2.35.0/go.mod h1:B0Al8NyYVr8Mp/KLwssKXG1RqnTk7FySqSn4fRuLNgw= -github.com/hashicorp/terraform-registry-address v0.2.3 h1:2TAiKJ1A3MAkZlH1YI/aTVcLZRu7JseiXNRHbOAyoTI= -github.com/hashicorp/terraform-registry-address v0.2.3/go.mod h1:lFHA76T8jfQteVfT7caREqguFrW3c4MFSPhZB7HHgUM= +github.com/hashicorp/terraform-plugin-sdk/v2 v2.36.0 h1:7/iejAPyCRBhqAg3jOx+4UcAhY0A+Sg8B+0+d/GxSfM= +github.com/hashicorp/terraform-plugin-sdk/v2 v2.36.0/go.mod h1:TiQwXAjFrgBf5tg5rvBRz8/ubPULpU0HjSaVi5UoJf8= +github.com/hashicorp/terraform-registry-address v0.2.4 h1:JXu/zHB2Ymg/TGVCRu10XqNa4Sh2bWcqCNyKWjnCPJA= +github.com/hashicorp/terraform-registry-address v0.2.4/go.mod h1:tUNYTVyCtU4OIGXXMDp7WNcJ+0W1B4nmstVDgHMjfAU= github.com/hashicorp/terraform-svchost v0.1.1 h1:EZZimZ1GxdqFRinZ1tpJwVxxt49xc/S52uzrw4x0jKQ= github.com/hashicorp/terraform-svchost v0.1.1/go.mod h1:mNsjQfZyf/Jhz35v6/0LWcv26+X7JPS+buii2c9/ctc= github.com/hashicorp/yamux v0.1.2 h1:XtB8kyFOyHXYVFnwT5C3+Bdo8gArse7j2AQ0DA0Uey8= @@ -969,8 +969,8 @@ github.com/yuin/goldmark-emoji v1.0.4 h1:vCwMkPZSNefSUnOW2ZKRUjBSD5Ok3W78IXhGxxA github.com/yuin/goldmark-emoji v1.0.4/go.mod h1:tTkZEbwu5wkPmgTcitqddVxY9osFZiavD+r4AzQrh1U= github.com/yusufpapurcu/wmi v1.2.4 h1:zFUKzehAFReQwLys1b/iSMl+JQGSCSjtVqQn9bBrPo0= github.com/yusufpapurcu/wmi v1.2.4/go.mod h1:SBZ9tNy3G9/m5Oi98Zks0QjeHVDvuK0qfxQmPyzfmi0= -github.com/zclconf/go-cty v1.16.0 h1:xPKEhst+BW5D0wxebMZkxgapvOE/dw7bFTlgSc9nD6w= -github.com/zclconf/go-cty v1.16.0/go.mod h1:VvMs5i0vgZdhYawQNq5kePSpLAoz8u1xvZgrPIxfnZE= +github.com/zclconf/go-cty v1.16.2 h1:LAJSwc3v81IRBZyUVQDUdZ7hs3SYs9jv0eZJDWHD/70= +github.com/zclconf/go-cty v1.16.2/go.mod h1:VvMs5i0vgZdhYawQNq5kePSpLAoz8u1xvZgrPIxfnZE= github.com/zclconf/go-cty-debug v0.0.0-20240509010212-0d6042c53940 h1:4r45xpDWB6ZMSMNJFMOjqrGHynW3DIBuR2H9j0ug+Mo= github.com/zclconf/go-cty-debug v0.0.0-20240509010212-0d6042c53940/go.mod h1:CmBdvvj3nqzfzJ6nTCIwDTPZ56aVGvDrmztiO5g3qrM= github.com/zclconf/go-cty-yaml v1.1.0 h1:nP+jp0qPHv2IhUVqmQSzjvqAWcObN0KBkUl2rWBdig0= @@ -1061,8 +1061,8 @@ golang.org/x/mod v0.3.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= golang.org/x/mod v0.4.2/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= golang.org/x/mod v0.6.0-dev.0.20220419223038-86c51ed26bb4/go.mod h1:jJ57K6gSWd91VN4djpZkiMVwK6gcyfeH4XE8wZrZaV4= golang.org/x/mod v0.8.0/go.mod h1:iBbtSCu2XBx23ZKBPSOrRkjjQPZFPuis4dIYUhu/chs= -golang.org/x/mod v0.22.0 h1:D4nJWe9zXqHOmWqj4VMOJhvzj7bEZg4wEYa759z1pH4= -golang.org/x/mod v0.22.0/go.mod h1:6SkKJ3Xj0I0BrPOZoBy3bdMptDDU9oJrpohJ3eWZ1fY= +golang.org/x/mod v0.23.0 h1:Zb7khfcRGKk+kqfxFaP5tZqCnDZMjC5VtUBs87Hr6QM= +golang.org/x/mod v0.23.0/go.mod h1:6SkKJ3Xj0I0BrPOZoBy3bdMptDDU9oJrpohJ3eWZ1fY= golang.org/x/net v0.0.0-20190404232315-eb5bcb51f2a3/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= golang.org/x/net v0.0.0-20190620200207-3b0461eec859/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= golang.org/x/net v0.0.0-20200226121028-0de0cce0169b/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= diff --git a/provisioner/terraform/resources_test.go b/provisioner/terraform/resources_test.go index 1ff3794979..241d44ebe7 100644 --- a/provisioner/terraform/resources_test.go +++ b/provisioner/terraform/resources_test.go @@ -35,6 +35,7 @@ func TestConvertResources(t *testing.T) { type testCase struct { resources []*proto.Resource parameters []*proto.RichParameter + Presets []*proto.Preset externalAuthProviders []*proto.ExternalAuthProviderResource } @@ -776,6 +777,86 @@ func TestConvertResources(t *testing.T) { }}, }}, }, + "presets": { + resources: []*proto.Resource{{ + Name: "dev", + Type: "null_resource", + Agents: []*proto.Agent{{ + Name: "dev", + OperatingSystem: "windows", + Architecture: "arm64", + Auth: &proto.Agent_Token{}, + ConnectionTimeoutSeconds: 120, + DisplayApps: &displayApps, + }}, + }}, + parameters: []*proto.RichParameter{{ + Name: "First parameter from child module", + Type: "string", + Description: "First parameter from child module", + Mutable: true, + DefaultValue: "abcdef", + }, { + Name: "Second parameter from child module", + Type: "string", + Description: "Second parameter from child module", + Mutable: true, + DefaultValue: "ghijkl", + }, { + Name: "First parameter from module", + Type: "string", + Description: "First parameter from module", + Mutable: true, + DefaultValue: "abcdef", + }, { + Name: "Second parameter from module", + Type: "string", + Description: "Second parameter from module", + Mutable: true, + DefaultValue: "ghijkl", + }, { + Name: "Sample", + Type: "string", + Description: "blah blah", + DefaultValue: "ok", + }}, + Presets: []*proto.Preset{{ + Name: "My First Project", + Parameters: []*proto.PresetParameter{{ + Name: "Sample", + Value: "A1B2C3", + // Advice from Danny: + // This is Terraform functionality. We don't have to test it explicitly. + // Sas: We still at some point need to document it. + // TODO (sasswart): Decide how to support presetting coder parameters from external modules + // Options are: + // * Set outputs with the parameter names and refer to those in the preset + // * set presets in the child module (won't work because we don't support merging presets) + // * hard coder parameter names + // }, { + // Name: "First parameter from module", + // Value: "A1B2C3", + // }, { + // Name: "First parameter from child module", + // Value: "A1B2C3", + }}, + }}, + }, + // TODO (sasswart): Decide how to test sad paths. + // Do we just introduce an expectedErr in the testcase? + // Methinks yes + // "presets-without-parameters": { + // resources: []*proto.Resource{{ + // Name: "dev", + // Type: "null_resource", + // }}, + // }, + // "presets-with-invalid-parameters": { + // resources: []*proto.Resource{{ + // Name: "dev", + // Type: "null_resource", + // }}, + // }, } { folderName := folderName expected := expected @@ -856,6 +937,8 @@ func TestConvertResources(t *testing.T) { require.Equal(t, expectedNoMetadataMap, resourcesMap) require.ElementsMatch(t, expected.externalAuthProviders, state.ExternalAuthProviders) + + require.ElementsMatch(t, expected.Presets, state.Presets) }) t.Run("Provision", func(t *testing.T) { @@ -899,6 +982,8 @@ func TestConvertResources(t *testing.T) { require.NoError(t, err) require.Equal(t, expectedMap, resourcesMap) require.ElementsMatch(t, expected.externalAuthProviders, state.ExternalAuthProviders) + + require.ElementsMatch(t, expected.Presets, state.Presets) }) }) } diff --git a/provisioner/terraform/testdata/calling-module/calling-module.tfplan.json b/provisioner/terraform/testdata/calling-module/calling-module.tfplan.json index 6be5318da7..e3237c2a8c 100644 --- a/provisioner/terraform/testdata/calling-module/calling-module.tfplan.json +++ b/provisioner/terraform/testdata/calling-module/calling-module.tfplan.json @@ -21,7 +21,6 @@ "motd_file": null, "order": null, "os": "linux", - "resources_monitoring": [], "shutdown_script": null, "startup_script": null, "startup_script_behavior": "non-blocking", @@ -30,7 +29,6 @@ "sensitive_values": { "display_apps": [], "metadata": [], - "resources_monitoring": [], "token": true } } @@ -93,7 +91,6 @@ "motd_file": null, "order": null, "os": "linux", - "resources_monitoring": [], "shutdown_script": null, "startup_script": null, "startup_script_behavior": "non-blocking", @@ -104,14 +101,12 @@ "id": true, "init_script": true, "metadata": [], - "resources_monitoring": [], "token": true }, "before_sensitive": false, "after_sensitive": { "display_apps": [], "metadata": [], - "resources_monitoring": [], "token": true } } @@ -259,7 +254,7 @@ ] } ], - "timestamp": "2025-01-29T22:47:46Z", + "timestamp": "2025-02-06T07:28:26Z", "applyable": true, "complete": true, "errored": false diff --git a/provisioner/terraform/testdata/calling-module/calling-module.tfstate.json b/provisioner/terraform/testdata/calling-module/calling-module.tfstate.json index 73aeed2d3a..0ad2ea5f83 100644 --- a/provisioner/terraform/testdata/calling-module/calling-module.tfstate.json +++ b/provisioner/terraform/testdata/calling-module/calling-module.tfstate.json @@ -26,17 +26,16 @@ } ], "env": null, - "id": "14f0eb08-1bdb-4d48-ab20-e06584ee5b68", + "id": "64433843-18f6-4f77-8f4f-f4f0eeaa67e2", "init_script": "", "metadata": [], "motd_file": null, "order": null, "os": "linux", - "resources_monitoring": [], "shutdown_script": null, "startup_script": null, "startup_script_behavior": "non-blocking", - "token": "454fffe5-3c59-4a9e-80a0-0d1644ce3b24", + "token": "d109220e-5f54-4971-90d6-0761a77c653e", "troubleshooting_url": null }, "sensitive_values": { @@ -44,7 +43,6 @@ {} ], "metadata": [], - "resources_monitoring": [], "token": true } } @@ -68,7 +66,7 @@ "outputs": { "script": "" }, - "random": "8389680299908922676" + "random": "1425989887898282436" }, "sensitive_values": { "inputs": {}, @@ -83,7 +81,7 @@ "provider_name": "registry.terraform.io/hashicorp/null", "schema_version": 0, "values": { - "id": "8124127383117450432", + "id": "7833850527819665042", "triggers": null }, "sensitive_values": {}, diff --git a/provisioner/terraform/testdata/chaining-resources/chaining-resources.tfplan.json b/provisioner/terraform/testdata/chaining-resources/chaining-resources.tfplan.json index 9f2b1d3736..b5aa139dc1 100644 --- a/provisioner/terraform/testdata/chaining-resources/chaining-resources.tfplan.json +++ b/provisioner/terraform/testdata/chaining-resources/chaining-resources.tfplan.json @@ -21,7 +21,6 @@ "motd_file": null, "order": null, "os": "linux", - "resources_monitoring": [], "shutdown_script": null, "startup_script": null, "startup_script_behavior": "non-blocking", @@ -30,7 +29,6 @@ "sensitive_values": { "display_apps": [], "metadata": [], - "resources_monitoring": [], "token": true } }, @@ -83,7 +81,6 @@ "motd_file": null, "order": null, "os": "linux", - "resources_monitoring": [], "shutdown_script": null, "startup_script": null, "startup_script_behavior": "non-blocking", @@ -94,14 +91,12 @@ "id": true, "init_script": true, "metadata": [], - "resources_monitoring": [], "token": true }, "before_sensitive": false, "after_sensitive": { "display_apps": [], "metadata": [], - "resources_monitoring": [], "token": true } } @@ -204,7 +199,7 @@ ] } }, - "timestamp": "2025-01-29T22:47:48Z", + "timestamp": "2025-02-06T07:28:26Z", "applyable": true, "complete": true, "errored": false diff --git a/provisioner/terraform/testdata/chaining-resources/chaining-resources.tfstate.json b/provisioner/terraform/testdata/chaining-resources/chaining-resources.tfstate.json index fc6241b86e..2c8a2ddb67 100644 --- a/provisioner/terraform/testdata/chaining-resources/chaining-resources.tfstate.json +++ b/provisioner/terraform/testdata/chaining-resources/chaining-resources.tfstate.json @@ -26,17 +26,16 @@ } ], "env": null, - "id": "038d5038-be85-4609-bde3-56b7452e4386", + "id": "8092bd1c-099b-4ca8-8dc1-03e1c8687300", "init_script": "", "metadata": [], "motd_file": null, "order": null, "os": "linux", - "resources_monitoring": [], "shutdown_script": null, "startup_script": null, "startup_script_behavior": "non-blocking", - "token": "e570d762-5584-4192-a474-be9e137b2f09", + "token": "1492d9de-d682-4966-b98e-d3e387823458", "troubleshooting_url": null }, "sensitive_values": { @@ -44,7 +43,6 @@ {} ], "metadata": [], - "resources_monitoring": [], "token": true } }, @@ -56,7 +54,7 @@ "provider_name": "registry.terraform.io/hashicorp/null", "schema_version": 0, "values": { - "id": "690495753077748083", + "id": "8792052167088454384", "triggers": null }, "sensitive_values": {}, @@ -73,7 +71,7 @@ "provider_name": "registry.terraform.io/hashicorp/null", "schema_version": 0, "values": { - "id": "3238567980725122951", + "id": "8664046372417778228", "triggers": null }, "sensitive_values": {}, diff --git a/provisioner/terraform/testdata/conflicting-resources/conflicting-resources.tfplan.json b/provisioner/terraform/testdata/conflicting-resources/conflicting-resources.tfplan.json index f5218d0c65..1d18f36a91 100644 --- a/provisioner/terraform/testdata/conflicting-resources/conflicting-resources.tfplan.json +++ b/provisioner/terraform/testdata/conflicting-resources/conflicting-resources.tfplan.json @@ -21,7 +21,6 @@ "motd_file": null, "order": null, "os": "linux", - "resources_monitoring": [], "shutdown_script": null, "startup_script": null, "startup_script_behavior": "non-blocking", @@ -30,7 +29,6 @@ "sensitive_values": { "display_apps": [], "metadata": [], - "resources_monitoring": [], "token": true } }, @@ -83,7 +81,6 @@ "motd_file": null, "order": null, "os": "linux", - "resources_monitoring": [], "shutdown_script": null, "startup_script": null, "startup_script_behavior": "non-blocking", @@ -94,14 +91,12 @@ "id": true, "init_script": true, "metadata": [], - "resources_monitoring": [], "token": true }, "before_sensitive": false, "after_sensitive": { "display_apps": [], "metadata": [], - "resources_monitoring": [], "token": true } } @@ -204,7 +199,7 @@ ] } }, - "timestamp": "2025-01-29T22:47:50Z", + "timestamp": "2025-02-06T07:28:26Z", "applyable": true, "complete": true, "errored": false diff --git a/provisioner/terraform/testdata/conflicting-resources/conflicting-resources.tfstate.json b/provisioner/terraform/testdata/conflicting-resources/conflicting-resources.tfstate.json index 44bca5b6ab..c2bbebdc80 100644 --- a/provisioner/terraform/testdata/conflicting-resources/conflicting-resources.tfstate.json +++ b/provisioner/terraform/testdata/conflicting-resources/conflicting-resources.tfstate.json @@ -26,17 +26,16 @@ } ], "env": null, - "id": "be15a1b3-f041-4471-9dec-9784c68edb26", + "id": "f2f20308-2d37-4f79-b773-26427b2d6b88", "init_script": "", "metadata": [], "motd_file": null, "order": null, "os": "linux", - "resources_monitoring": [], "shutdown_script": null, "startup_script": null, "startup_script_behavior": "non-blocking", - "token": "df2580ad-59cc-48fb-bb21-40a8be5a5a66", + "token": "7c634c45-9a0c-494c-9469-d78253487973", "troubleshooting_url": null }, "sensitive_values": { @@ -44,7 +43,6 @@ {} ], "metadata": [], - "resources_monitoring": [], "token": true } }, @@ -56,7 +54,7 @@ "provider_name": "registry.terraform.io/hashicorp/null", "schema_version": 0, "values": { - "id": "9103672483967127580", + "id": "5416219352181334882", "triggers": null }, "sensitive_values": {}, @@ -72,7 +70,7 @@ "provider_name": "registry.terraform.io/hashicorp/null", "schema_version": 0, "values": { - "id": "4372402015997897970", + "id": "5511965030506979192", "triggers": null }, "sensitive_values": {}, diff --git a/provisioner/terraform/testdata/display-apps-disabled/display-apps-disabled.tfplan.json b/provisioner/terraform/testdata/display-apps-disabled/display-apps-disabled.tfplan.json index 826ba9da95..d9317007be 100644 --- a/provisioner/terraform/testdata/display-apps-disabled/display-apps-disabled.tfplan.json +++ b/provisioner/terraform/testdata/display-apps-disabled/display-apps-disabled.tfplan.json @@ -30,7 +30,6 @@ "motd_file": null, "order": null, "os": "linux", - "resources_monitoring": [], "shutdown_script": null, "startup_script": null, "startup_script_behavior": "non-blocking", @@ -41,7 +40,6 @@ {} ], "metadata": [], - "resources_monitoring": [], "token": true } }, @@ -91,7 +89,6 @@ "motd_file": null, "order": null, "os": "linux", - "resources_monitoring": [], "shutdown_script": null, "startup_script": null, "startup_script_behavior": "non-blocking", @@ -104,7 +101,6 @@ "id": true, "init_script": true, "metadata": [], - "resources_monitoring": [], "token": true }, "before_sensitive": false, @@ -113,7 +109,6 @@ {} ], "metadata": [], - "resources_monitoring": [], "token": true } } @@ -203,7 +198,7 @@ ] } }, - "timestamp": "2025-01-29T22:47:53Z", + "timestamp": "2025-02-06T07:28:26Z", "applyable": true, "complete": true, "errored": false diff --git a/provisioner/terraform/testdata/display-apps-disabled/display-apps-disabled.tfstate.json b/provisioner/terraform/testdata/display-apps-disabled/display-apps-disabled.tfstate.json index 1948baf713..6a36c31a23 100644 --- a/provisioner/terraform/testdata/display-apps-disabled/display-apps-disabled.tfstate.json +++ b/provisioner/terraform/testdata/display-apps-disabled/display-apps-disabled.tfstate.json @@ -26,17 +26,16 @@ } ], "env": null, - "id": "398e27d3-10cc-4522-9144-34658eedad0e", + "id": "5a27b716-6b53-46ad-94fb-6ff0a7fb5028", "init_script": "", "metadata": [], "motd_file": null, "order": null, "os": "linux", - "resources_monitoring": [], "shutdown_script": null, "startup_script": null, "startup_script_behavior": "non-blocking", - "token": "33068dbe-54d7-45eb-bfe5-87a9756802e2", + "token": "ce7268ac-92f8-4889-8341-64aa6c411844", "troubleshooting_url": null }, "sensitive_values": { @@ -44,7 +43,6 @@ {} ], "metadata": [], - "resources_monitoring": [], "token": true } }, @@ -56,7 +54,7 @@ "provider_name": "registry.terraform.io/hashicorp/null", "schema_version": 0, "values": { - "id": "5682617535476100233", + "id": "682773674388598502", "triggers": null }, "sensitive_values": {}, diff --git a/provisioner/terraform/testdata/display-apps/display-apps.tfplan.json b/provisioner/terraform/testdata/display-apps/display-apps.tfplan.json index 9172849c34..490c0c01ae 100644 --- a/provisioner/terraform/testdata/display-apps/display-apps.tfplan.json +++ b/provisioner/terraform/testdata/display-apps/display-apps.tfplan.json @@ -30,7 +30,6 @@ "motd_file": null, "order": null, "os": "linux", - "resources_monitoring": [], "shutdown_script": null, "startup_script": null, "startup_script_behavior": "non-blocking", @@ -41,7 +40,6 @@ {} ], "metadata": [], - "resources_monitoring": [], "token": true } }, @@ -91,7 +89,6 @@ "motd_file": null, "order": null, "os": "linux", - "resources_monitoring": [], "shutdown_script": null, "startup_script": null, "startup_script_behavior": "non-blocking", @@ -104,7 +101,6 @@ "id": true, "init_script": true, "metadata": [], - "resources_monitoring": [], "token": true }, "before_sensitive": false, @@ -113,7 +109,6 @@ {} ], "metadata": [], - "resources_monitoring": [], "token": true } } @@ -203,7 +198,7 @@ ] } }, - "timestamp": "2025-01-29T22:47:52Z", + "timestamp": "2025-02-06T07:28:26Z", "applyable": true, "complete": true, "errored": false diff --git a/provisioner/terraform/testdata/display-apps/display-apps.tfstate.json b/provisioner/terraform/testdata/display-apps/display-apps.tfstate.json index 88e4d0f768..de4ad59e80 100644 --- a/provisioner/terraform/testdata/display-apps/display-apps.tfstate.json +++ b/provisioner/terraform/testdata/display-apps/display-apps.tfstate.json @@ -26,17 +26,16 @@ } ], "env": null, - "id": "810cdd01-a27d-442f-9e69-bdaecced8a59", + "id": "52c95fc8-4d53-479c-8368-87f329b84bf7", "init_script": "", "metadata": [], "motd_file": null, "order": null, "os": "linux", - "resources_monitoring": [], "shutdown_script": null, "startup_script": null, "startup_script_behavior": "non-blocking", - "token": "fade1b71-d52b-4ef2-bb05-961f7795bab9", + "token": "326a8bd5-1673-4bdf-beee-66c644b45088", "troubleshooting_url": null }, "sensitive_values": { @@ -44,7 +43,6 @@ {} ], "metadata": [], - "resources_monitoring": [], "token": true } }, @@ -56,7 +54,7 @@ "provider_name": "registry.terraform.io/hashicorp/null", "schema_version": 0, "values": { - "id": "5174735461860530782", + "id": "2940668912954669921", "triggers": null }, "sensitive_values": {}, diff --git a/provisioner/terraform/testdata/external-auth-providers/external-auth-providers.tfplan.json b/provisioner/terraform/testdata/external-auth-providers/external-auth-providers.tfplan.json index 654ce7464a..0a0902576e 100644 --- a/provisioner/terraform/testdata/external-auth-providers/external-auth-providers.tfplan.json +++ b/provisioner/terraform/testdata/external-auth-providers/external-auth-providers.tfplan.json @@ -21,7 +21,6 @@ "motd_file": null, "order": null, "os": "linux", - "resources_monitoring": [], "shutdown_script": null, "startup_script": null, "startup_script_behavior": "non-blocking", @@ -30,7 +29,6 @@ "sensitive_values": { "display_apps": [], "metadata": [], - "resources_monitoring": [], "token": true } }, @@ -71,7 +69,6 @@ "motd_file": null, "order": null, "os": "linux", - "resources_monitoring": [], "shutdown_script": null, "startup_script": null, "startup_script_behavior": "non-blocking", @@ -82,14 +79,12 @@ "id": true, "init_script": true, "metadata": [], - "resources_monitoring": [], "token": true }, "before_sensitive": false, "after_sensitive": { "display_apps": [], "metadata": [], - "resources_monitoring": [], "token": true } } @@ -227,7 +222,7 @@ ] } }, - "timestamp": "2025-01-29T22:47:55Z", + "timestamp": "2025-02-06T07:28:26Z", "applyable": true, "complete": true, "errored": false diff --git a/provisioner/terraform/testdata/external-auth-providers/external-auth-providers.tfstate.json b/provisioner/terraform/testdata/external-auth-providers/external-auth-providers.tfstate.json index 733c9dd3ac..f232546ce6 100644 --- a/provisioner/terraform/testdata/external-auth-providers/external-auth-providers.tfstate.json +++ b/provisioner/terraform/testdata/external-auth-providers/external-auth-providers.tfstate.json @@ -54,17 +54,16 @@ } ], "env": null, - "id": "7ead336b-d366-4991-b38d-bdb8b9333ae9", + "id": "0be614e7-c8c1-4821-97c2-1cc3dec6744b", "init_script": "", "metadata": [], "motd_file": null, "order": null, "os": "linux", - "resources_monitoring": [], "shutdown_script": null, "startup_script": null, "startup_script_behavior": "non-blocking", - "token": "a3d2c620-f065-4b29-ae58-370292e787d4", + "token": "de9d4b55-2735-47b4-b091-260dcb1be4cb", "troubleshooting_url": null }, "sensitive_values": { @@ -72,7 +71,6 @@ {} ], "metadata": [], - "resources_monitoring": [], "token": true } }, @@ -84,7 +82,7 @@ "provider_name": "registry.terraform.io/hashicorp/null", "schema_version": 0, "values": { - "id": "3060850815800759131", + "id": "6479999379045576610", "triggers": null }, "sensitive_values": {}, diff --git a/provisioner/terraform/testdata/instance-id/instance-id.tfplan.json b/provisioner/terraform/testdata/instance-id/instance-id.tfplan.json index 04e6c6f009..b0a45acab9 100644 --- a/provisioner/terraform/testdata/instance-id/instance-id.tfplan.json +++ b/provisioner/terraform/testdata/instance-id/instance-id.tfplan.json @@ -21,7 +21,6 @@ "motd_file": null, "order": null, "os": "linux", - "resources_monitoring": [], "shutdown_script": null, "startup_script": null, "startup_script_behavior": "non-blocking", @@ -30,7 +29,6 @@ "sensitive_values": { "display_apps": [], "metadata": [], - "resources_monitoring": [], "token": true } }, @@ -83,7 +81,6 @@ "motd_file": null, "order": null, "os": "linux", - "resources_monitoring": [], "shutdown_script": null, "startup_script": null, "startup_script_behavior": "non-blocking", @@ -94,14 +91,12 @@ "id": true, "init_script": true, "metadata": [], - "resources_monitoring": [], "token": true }, "before_sensitive": false, "after_sensitive": { "display_apps": [], "metadata": [], - "resources_monitoring": [], "token": true } } @@ -224,7 +219,7 @@ ] } ], - "timestamp": "2025-01-29T22:47:57Z", + "timestamp": "2025-02-06T07:28:26Z", "applyable": true, "complete": true, "errored": false diff --git a/provisioner/terraform/testdata/instance-id/instance-id.tfstate.json b/provisioner/terraform/testdata/instance-id/instance-id.tfstate.json index e884830606..bda8532f11 100644 --- a/provisioner/terraform/testdata/instance-id/instance-id.tfstate.json +++ b/provisioner/terraform/testdata/instance-id/instance-id.tfstate.json @@ -26,17 +26,16 @@ } ], "env": null, - "id": "c6e99a38-f10b-4242-a7c6-bd9186008b9d", + "id": "c4dfe556-bda2-4c46-921d-877a9f6362a5", "init_script": "", "metadata": [], "motd_file": null, "order": null, "os": "linux", - "resources_monitoring": [], "shutdown_script": null, "startup_script": null, "startup_script_behavior": "non-blocking", - "token": "ecddacca-df83-4dd2-b6cb-71f439e9e5f5", + "token": "0cd5fb29-059b-490d-a8d9-d2b6daa86dfe", "troubleshooting_url": null }, "sensitive_values": { @@ -44,7 +43,6 @@ {} ], "metadata": [], - "resources_monitoring": [], "token": true } }, @@ -56,8 +54,8 @@ "provider_name": "registry.terraform.io/coder/coder", "schema_version": 0, "values": { - "agent_id": "c6e99a38-f10b-4242-a7c6-bd9186008b9d", - "id": "0ed215f9-07b0-455f-828d-faee5f63ea93", + "agent_id": "c4dfe556-bda2-4c46-921d-877a9f6362a5", + "id": "6d9e9e65-c9ff-47de-a733-541a36d9d039", "instance_id": "example" }, "sensitive_values": {}, @@ -73,7 +71,7 @@ "provider_name": "registry.terraform.io/hashicorp/null", "schema_version": 0, "values": { - "id": "1340003819945612525", + "id": "1151295831746427704", "triggers": null }, "sensitive_values": {}, diff --git a/provisioner/terraform/testdata/mapped-apps/mapped-apps.tfplan.json b/provisioner/terraform/testdata/mapped-apps/mapped-apps.tfplan.json index 7dd1dc173f..90a6d64eca 100644 --- a/provisioner/terraform/testdata/mapped-apps/mapped-apps.tfplan.json +++ b/provisioner/terraform/testdata/mapped-apps/mapped-apps.tfplan.json @@ -21,7 +21,6 @@ "motd_file": null, "order": null, "os": "linux", - "resources_monitoring": [], "shutdown_script": null, "startup_script": null, "startup_script_behavior": "non-blocking", @@ -30,7 +29,6 @@ "sensitive_values": { "display_apps": [], "metadata": [], - "resources_monitoring": [], "token": true } }, @@ -123,7 +121,6 @@ "motd_file": null, "order": null, "os": "linux", - "resources_monitoring": [], "shutdown_script": null, "startup_script": null, "startup_script_behavior": "non-blocking", @@ -134,14 +131,12 @@ "id": true, "init_script": true, "metadata": [], - "resources_monitoring": [], "token": true }, "before_sensitive": false, "after_sensitive": { "display_apps": [], "metadata": [], - "resources_monitoring": [], "token": true } } @@ -326,7 +321,7 @@ ] } ], - "timestamp": "2025-01-29T22:47:59Z", + "timestamp": "2025-02-06T07:28:26Z", "applyable": true, "complete": true, "errored": false diff --git a/provisioner/terraform/testdata/mapped-apps/mapped-apps.tfstate.json b/provisioner/terraform/testdata/mapped-apps/mapped-apps.tfstate.json index fb32d22e2c..8108f3b038 100644 --- a/provisioner/terraform/testdata/mapped-apps/mapped-apps.tfstate.json +++ b/provisioner/terraform/testdata/mapped-apps/mapped-apps.tfstate.json @@ -26,17 +26,16 @@ } ], "env": null, - "id": "18098e15-2e8b-4c83-9362-0823834ae628", + "id": "81df047e-38db-4717-a08d-79822c7f9631", "init_script": "", "metadata": [], "motd_file": null, "order": null, "os": "linux", - "resources_monitoring": [], "shutdown_script": null, "startup_script": null, "startup_script_behavior": "non-blocking", - "token": "59691c9e-bf9e-4c93-9768-ba3582c68727", + "token": "9aa50425-529d-4948-b301-47d00140bbf2", "troubleshooting_url": null }, "sensitive_values": { @@ -44,7 +43,6 @@ {} ], "metadata": [], - "resources_monitoring": [], "token": true } }, @@ -57,14 +55,14 @@ "provider_name": "registry.terraform.io/coder/coder", "schema_version": 1, "values": { - "agent_id": "18098e15-2e8b-4c83-9362-0823834ae628", + "agent_id": "81df047e-38db-4717-a08d-79822c7f9631", "command": null, "display_name": "app1", "external": false, "healthcheck": [], "hidden": false, "icon": null, - "id": "8f031ab5-e051-4eff-9f7e-233f5825c3fd", + "id": "701538ed-7f91-4fa7-b55f-a2389bfc7b0b", "open_in": "slim-window", "order": null, "share": "owner", @@ -88,14 +86,14 @@ "provider_name": "registry.terraform.io/coder/coder", "schema_version": 1, "values": { - "agent_id": "18098e15-2e8b-4c83-9362-0823834ae628", + "agent_id": "81df047e-38db-4717-a08d-79822c7f9631", "command": null, "display_name": "app2", "external": false, "healthcheck": [], "hidden": false, "icon": null, - "id": "5462894e-7fdc-4fd0-8715-7829e53efea2", + "id": "df262f25-b224-4598-8f2e-e7d1ddb252d4", "open_in": "slim-window", "order": null, "share": "owner", @@ -118,7 +116,7 @@ "provider_name": "registry.terraform.io/hashicorp/null", "schema_version": 0, "values": { - "id": "2699316377754222096", + "id": "3545091168208360820", "triggers": null }, "sensitive_values": {}, diff --git a/provisioner/terraform/testdata/multiple-agents-multiple-apps/multiple-agents-multiple-apps.tfplan.json b/provisioner/terraform/testdata/multiple-agents-multiple-apps/multiple-agents-multiple-apps.tfplan.json index 69600fed24..997caf079e 100644 --- a/provisioner/terraform/testdata/multiple-agents-multiple-apps/multiple-agents-multiple-apps.tfplan.json +++ b/provisioner/terraform/testdata/multiple-agents-multiple-apps/multiple-agents-multiple-apps.tfplan.json @@ -21,7 +21,6 @@ "motd_file": null, "order": null, "os": "linux", - "resources_monitoring": [], "shutdown_script": null, "startup_script": null, "startup_script_behavior": "non-blocking", @@ -30,7 +29,6 @@ "sensitive_values": { "display_apps": [], "metadata": [], - "resources_monitoring": [], "token": true } }, @@ -51,7 +49,6 @@ "motd_file": null, "order": null, "os": "linux", - "resources_monitoring": [], "shutdown_script": null, "startup_script": null, "startup_script_behavior": "non-blocking", @@ -60,7 +57,6 @@ "sensitive_values": { "display_apps": [], "metadata": [], - "resources_monitoring": [], "token": true } }, @@ -196,7 +192,6 @@ "motd_file": null, "order": null, "os": "linux", - "resources_monitoring": [], "shutdown_script": null, "startup_script": null, "startup_script_behavior": "non-blocking", @@ -207,14 +202,12 @@ "id": true, "init_script": true, "metadata": [], - "resources_monitoring": [], "token": true }, "before_sensitive": false, "after_sensitive": { "display_apps": [], "metadata": [], - "resources_monitoring": [], "token": true } } @@ -240,7 +233,6 @@ "motd_file": null, "order": null, "os": "linux", - "resources_monitoring": [], "shutdown_script": null, "startup_script": null, "startup_script_behavior": "non-blocking", @@ -251,14 +243,12 @@ "id": true, "init_script": true, "metadata": [], - "resources_monitoring": [], "token": true }, "before_sensitive": false, "after_sensitive": { "display_apps": [], "metadata": [], - "resources_monitoring": [], "token": true } } @@ -573,19 +563,19 @@ }, "relevant_attributes": [ { - "resource": "coder_agent.dev1", + "resource": "coder_agent.dev2", "attribute": [ "id" ] }, { - "resource": "coder_agent.dev2", + "resource": "coder_agent.dev1", "attribute": [ "id" ] } ], - "timestamp": "2025-01-29T22:48:03Z", + "timestamp": "2025-02-06T07:28:26Z", "applyable": true, "complete": true, "errored": false diff --git a/provisioner/terraform/testdata/multiple-agents-multiple-apps/multiple-agents-multiple-apps.tfstate.json b/provisioner/terraform/testdata/multiple-agents-multiple-apps/multiple-agents-multiple-apps.tfstate.json index db2617701b..99580bd9d5 100644 --- a/provisioner/terraform/testdata/multiple-agents-multiple-apps/multiple-agents-multiple-apps.tfstate.json +++ b/provisioner/terraform/testdata/multiple-agents-multiple-apps/multiple-agents-multiple-apps.tfstate.json @@ -26,17 +26,16 @@ } ], "env": null, - "id": "00794e64-40d3-43df-885a-4b1cc5f5b965", + "id": "358f434c-9056-4c2a-96cf-dd273e62a2f4", "init_script": "", "metadata": [], "motd_file": null, "order": null, "os": "linux", - "resources_monitoring": [], "shutdown_script": null, "startup_script": null, "startup_script_behavior": "non-blocking", - "token": "7c0a6e5e-dd2c-46e4-a5f5-f71aae7515c3", + "token": "c3f886c0-c942-46f2-807f-1e6c38524191", "troubleshooting_url": null }, "sensitive_values": { @@ -44,7 +43,6 @@ {} ], "metadata": [], - "resources_monitoring": [], "token": true } }, @@ -70,17 +68,16 @@ } ], "env": null, - "id": "1b8ddc14-25c2-4eab-b282-71b12d45de73", + "id": "decbcebe-ce0f-46ed-81cd-366651275bdc", "init_script": "", "metadata": [], "motd_file": null, "order": null, "os": "linux", - "resources_monitoring": [], "shutdown_script": null, "startup_script": null, "startup_script_behavior": "non-blocking", - "token": "39497aa1-11a1-40c0-854d-554c2e27ef77", + "token": "51f8f7fc-ec89-4500-b292-29386cf85245", "troubleshooting_url": null }, "sensitive_values": { @@ -88,7 +85,6 @@ {} ], "metadata": [], - "resources_monitoring": [], "token": true } }, @@ -100,14 +96,14 @@ "provider_name": "registry.terraform.io/coder/coder", "schema_version": 1, "values": { - "agent_id": "00794e64-40d3-43df-885a-4b1cc5f5b965", + "agent_id": "358f434c-9056-4c2a-96cf-dd273e62a2f4", "command": null, "display_name": null, "external": false, "healthcheck": [], "hidden": false, "icon": null, - "id": "c9cf036f-5fd9-408a-8c28-90cde4c5b0cf", + "id": "07e9147a-8ef2-4160-afbc-f3f7d1c06fad", "open_in": "slim-window", "order": null, "share": "owner", @@ -130,7 +126,7 @@ "provider_name": "registry.terraform.io/coder/coder", "schema_version": 1, "values": { - "agent_id": "00794e64-40d3-43df-885a-4b1cc5f5b965", + "agent_id": "358f434c-9056-4c2a-96cf-dd273e62a2f4", "command": null, "display_name": null, "external": false, @@ -143,7 +139,7 @@ ], "hidden": false, "icon": null, - "id": "e40999b2-8ceb-4e35-962b-c0b7b95c8bc8", + "id": "47b6572e-4ce6-4b8c-b2bc-5b1bfaa6c6c3", "open_in": "slim-window", "order": null, "share": "owner", @@ -168,14 +164,14 @@ "provider_name": "registry.terraform.io/coder/coder", "schema_version": 1, "values": { - "agent_id": "1b8ddc14-25c2-4eab-b282-71b12d45de73", + "agent_id": "decbcebe-ce0f-46ed-81cd-366651275bdc", "command": null, "display_name": null, "external": false, "healthcheck": [], "hidden": false, "icon": null, - "id": "4e61c245-271a-41e1-9a37-2badf68bf5cd", + "id": "3218f83a-486c-4d32-9dff-bcc502a06057", "open_in": "slim-window", "order": null, "share": "owner", @@ -198,7 +194,7 @@ "provider_name": "registry.terraform.io/hashicorp/null", "schema_version": 0, "values": { - "id": "7796235346668423309", + "id": "6789549112713389367", "triggers": null }, "sensitive_values": {}, @@ -214,7 +210,7 @@ "provider_name": "registry.terraform.io/hashicorp/null", "schema_version": 0, "values": { - "id": "8353198974918613541", + "id": "4753479913925883652", "triggers": null }, "sensitive_values": {}, diff --git a/provisioner/terraform/testdata/multiple-agents-multiple-envs/multiple-agents-multiple-envs.tfplan.json b/provisioner/terraform/testdata/multiple-agents-multiple-envs/multiple-agents-multiple-envs.tfplan.json index da3f19c548..2356e902bb 100644 --- a/provisioner/terraform/testdata/multiple-agents-multiple-envs/multiple-agents-multiple-envs.tfplan.json +++ b/provisioner/terraform/testdata/multiple-agents-multiple-envs/multiple-agents-multiple-envs.tfplan.json @@ -21,7 +21,6 @@ "motd_file": null, "order": null, "os": "linux", - "resources_monitoring": [], "shutdown_script": null, "startup_script": null, "startup_script_behavior": "non-blocking", @@ -30,7 +29,6 @@ "sensitive_values": { "display_apps": [], "metadata": [], - "resources_monitoring": [], "token": true } }, @@ -51,7 +49,6 @@ "motd_file": null, "order": null, "os": "linux", - "resources_monitoring": [], "shutdown_script": null, "startup_script": null, "startup_script_behavior": "non-blocking", @@ -60,7 +57,6 @@ "sensitive_values": { "display_apps": [], "metadata": [], - "resources_monitoring": [], "token": true } }, @@ -152,7 +148,6 @@ "motd_file": null, "order": null, "os": "linux", - "resources_monitoring": [], "shutdown_script": null, "startup_script": null, "startup_script_behavior": "non-blocking", @@ -163,14 +158,12 @@ "id": true, "init_script": true, "metadata": [], - "resources_monitoring": [], "token": true }, "before_sensitive": false, "after_sensitive": { "display_apps": [], "metadata": [], - "resources_monitoring": [], "token": true } } @@ -196,7 +189,6 @@ "motd_file": null, "order": null, "os": "linux", - "resources_monitoring": [], "shutdown_script": null, "startup_script": null, "startup_script_behavior": "non-blocking", @@ -207,14 +199,12 @@ "id": true, "init_script": true, "metadata": [], - "resources_monitoring": [], "token": true }, "before_sensitive": false, "after_sensitive": { "display_apps": [], "metadata": [], - "resources_monitoring": [], "token": true } } @@ -482,7 +472,7 @@ ] } ], - "timestamp": "2025-01-29T22:48:05Z", + "timestamp": "2025-02-06T07:28:26Z", "applyable": true, "complete": true, "errored": false diff --git a/provisioner/terraform/testdata/multiple-agents-multiple-envs/multiple-agents-multiple-envs.tfstate.json b/provisioner/terraform/testdata/multiple-agents-multiple-envs/multiple-agents-multiple-envs.tfstate.json index 6b2f13b3e8..160f263e1f 100644 --- a/provisioner/terraform/testdata/multiple-agents-multiple-envs/multiple-agents-multiple-envs.tfstate.json +++ b/provisioner/terraform/testdata/multiple-agents-multiple-envs/multiple-agents-multiple-envs.tfstate.json @@ -26,17 +26,16 @@ } ], "env": null, - "id": "f1398cbc-4e67-4a0e-92b7-15dc33221872", + "id": "cd64c74f-5861-4733-b7dc-a01fbe892431", "init_script": "", "metadata": [], "motd_file": null, "order": null, "os": "linux", - "resources_monitoring": [], "shutdown_script": null, "startup_script": null, "startup_script_behavior": "non-blocking", - "token": "acbbabee-e370-4aba-b876-843fb10201e8", + "token": "98f0d5fc-182e-49c3-8e20-7fb228f63a3e", "troubleshooting_url": null }, "sensitive_values": { @@ -44,7 +43,6 @@ {} ], "metadata": [], - "resources_monitoring": [], "token": true } }, @@ -70,17 +68,16 @@ } ], "env": null, - "id": "ea44429d-fc3c-4ea6-ba23-a997dc66cad8", + "id": "a3e3ec9b-0695-4b8b-a32b-fb55021ee96a", "init_script": "", "metadata": [], "motd_file": null, "order": null, "os": "linux", - "resources_monitoring": [], "shutdown_script": null, "startup_script": null, "startup_script_behavior": "non-blocking", - "token": "51fea695-82dd-4ccd-bf25-2c55a82b4851", + "token": "6892aa3e-0411-4b59-9bee-785b905fdba2", "troubleshooting_url": null }, "sensitive_values": { @@ -88,7 +85,6 @@ {} ], "metadata": [], - "resources_monitoring": [], "token": true } }, @@ -100,8 +96,8 @@ "provider_name": "registry.terraform.io/coder/coder", "schema_version": 1, "values": { - "agent_id": "f1398cbc-4e67-4a0e-92b7-15dc33221872", - "id": "f8f7b3f7-5c4b-47b9-959e-32d2044329e3", + "agent_id": "cd64c74f-5861-4733-b7dc-a01fbe892431", + "id": "911d7e12-7c8e-436f-abc3-ee53df6422b1", "name": "ENV_1", "value": "Env 1" }, @@ -118,8 +114,8 @@ "provider_name": "registry.terraform.io/coder/coder", "schema_version": 1, "values": { - "agent_id": "f1398cbc-4e67-4a0e-92b7-15dc33221872", - "id": "b7171d98-09c9-4bc4-899d-4b7343cd86ca", + "agent_id": "cd64c74f-5861-4733-b7dc-a01fbe892431", + "id": "68417a79-e829-4577-86a5-2a282a420fd9", "name": "ENV_2", "value": "Env 2" }, @@ -136,8 +132,8 @@ "provider_name": "registry.terraform.io/coder/coder", "schema_version": 1, "values": { - "agent_id": "ea44429d-fc3c-4ea6-ba23-a997dc66cad8", - "id": "84021f25-1736-4884-8e5c-553e9c1f6fa6", + "agent_id": "a3e3ec9b-0695-4b8b-a32b-fb55021ee96a", + "id": "32a80778-1c3c-444a-947a-6eef729de65e", "name": "ENV_3", "value": "Env 3" }, @@ -154,7 +150,7 @@ "provider_name": "registry.terraform.io/hashicorp/null", "schema_version": 0, "values": { - "id": "4901314428677246063", + "id": "7492908688673175566", "triggers": null }, "sensitive_values": {}, @@ -170,7 +166,7 @@ "provider_name": "registry.terraform.io/hashicorp/null", "schema_version": 0, "values": { - "id": "3203010350140581146", + "id": "1959061390178382235", "triggers": null }, "sensitive_values": {}, diff --git a/provisioner/terraform/testdata/multiple-agents-multiple-scripts/multiple-agents-multiple-scripts.tfplan.json b/provisioner/terraform/testdata/multiple-agents-multiple-scripts/multiple-agents-multiple-scripts.tfplan.json index 7724005431..4e7bc71746 100644 --- a/provisioner/terraform/testdata/multiple-agents-multiple-scripts/multiple-agents-multiple-scripts.tfplan.json +++ b/provisioner/terraform/testdata/multiple-agents-multiple-scripts/multiple-agents-multiple-scripts.tfplan.json @@ -21,7 +21,6 @@ "motd_file": null, "order": null, "os": "linux", - "resources_monitoring": [], "shutdown_script": null, "startup_script": null, "startup_script_behavior": "non-blocking", @@ -30,7 +29,6 @@ "sensitive_values": { "display_apps": [], "metadata": [], - "resources_monitoring": [], "token": true } }, @@ -51,7 +49,6 @@ "motd_file": null, "order": null, "os": "linux", - "resources_monitoring": [], "shutdown_script": null, "startup_script": null, "startup_script_behavior": "non-blocking", @@ -60,7 +57,6 @@ "sensitive_values": { "display_apps": [], "metadata": [], - "resources_monitoring": [], "token": true } }, @@ -173,7 +169,6 @@ "motd_file": null, "order": null, "os": "linux", - "resources_monitoring": [], "shutdown_script": null, "startup_script": null, "startup_script_behavior": "non-blocking", @@ -184,14 +179,12 @@ "id": true, "init_script": true, "metadata": [], - "resources_monitoring": [], "token": true }, "before_sensitive": false, "after_sensitive": { "display_apps": [], "metadata": [], - "resources_monitoring": [], "token": true } } @@ -217,7 +210,6 @@ "motd_file": null, "order": null, "os": "linux", - "resources_monitoring": [], "shutdown_script": null, "startup_script": null, "startup_script_behavior": "non-blocking", @@ -228,14 +220,12 @@ "id": true, "init_script": true, "metadata": [], - "resources_monitoring": [], "token": true }, "before_sensitive": false, "after_sensitive": { "display_apps": [], "metadata": [], - "resources_monitoring": [], "token": true } } @@ -521,19 +511,19 @@ }, "relevant_attributes": [ { - "resource": "coder_agent.dev2", + "resource": "coder_agent.dev1", "attribute": [ "id" ] }, { - "resource": "coder_agent.dev1", + "resource": "coder_agent.dev2", "attribute": [ "id" ] } ], - "timestamp": "2025-01-29T22:48:08Z", + "timestamp": "2025-02-06T07:28:26Z", "applyable": true, "complete": true, "errored": false diff --git a/provisioner/terraform/testdata/multiple-agents-multiple-scripts/multiple-agents-multiple-scripts.tfstate.json b/provisioner/terraform/testdata/multiple-agents-multiple-scripts/multiple-agents-multiple-scripts.tfstate.json index c5db3c24d2..6c91cd73a6 100644 --- a/provisioner/terraform/testdata/multiple-agents-multiple-scripts/multiple-agents-multiple-scripts.tfstate.json +++ b/provisioner/terraform/testdata/multiple-agents-multiple-scripts/multiple-agents-multiple-scripts.tfstate.json @@ -26,17 +26,16 @@ } ], "env": null, - "id": "bd762939-8952-4ac7-a9e5-618ec420b518", + "id": "ee4b0276-a97b-4b6b-8cd3-2819c6a67aa6", "init_script": "", "metadata": [], "motd_file": null, "order": null, "os": "linux", - "resources_monitoring": [], "shutdown_script": null, "startup_script": null, "startup_script_behavior": "non-blocking", - "token": "f86127e8-2852-4c02-9f07-c376ec04318f", + "token": "6a41a636-d2d2-44cf-9c3e-548478f06e19", "troubleshooting_url": null }, "sensitive_values": { @@ -44,7 +43,6 @@ {} ], "metadata": [], - "resources_monitoring": [], "token": true } }, @@ -70,17 +68,16 @@ } ], "env": null, - "id": "60244093-3c9d-4655-b34f-c4713f7001c1", + "id": "bd327d5e-3632-4d42-af81-cadf99aad2b5", "init_script": "", "metadata": [], "motd_file": null, "order": null, "os": "linux", - "resources_monitoring": [], "shutdown_script": null, "startup_script": null, "startup_script_behavior": "non-blocking", - "token": "cad61f70-873f-440c-ad1c-9d34be2e19c4", + "token": "4ce115b1-7bab-440a-9136-025321a4b0c8", "troubleshooting_url": null }, "sensitive_values": { @@ -88,7 +85,6 @@ {} ], "metadata": [], - "resources_monitoring": [], "token": true } }, @@ -100,11 +96,11 @@ "provider_name": "registry.terraform.io/coder/coder", "schema_version": 1, "values": { - "agent_id": "bd762939-8952-4ac7-a9e5-618ec420b518", + "agent_id": "ee4b0276-a97b-4b6b-8cd3-2819c6a67aa6", "cron": null, "display_name": "Foobar Script 1", "icon": null, - "id": "b34b6cd5-e85d-41c8-ad92-eaaceb2404cb", + "id": "de8c8a6c-e85f-41fb-afa2-d5ac623a4fae", "log_path": null, "run_on_start": true, "run_on_stop": false, @@ -125,11 +121,11 @@ "provider_name": "registry.terraform.io/coder/coder", "schema_version": 1, "values": { - "agent_id": "bd762939-8952-4ac7-a9e5-618ec420b518", + "agent_id": "ee4b0276-a97b-4b6b-8cd3-2819c6a67aa6", "cron": null, "display_name": "Foobar Script 2", "icon": null, - "id": "d6f4e24c-3023-417d-b9be-4c83dbdf4802", + "id": "3cb68229-11fd-4828-951c-e18d3c20a81d", "log_path": null, "run_on_start": true, "run_on_stop": false, @@ -150,11 +146,11 @@ "provider_name": "registry.terraform.io/coder/coder", "schema_version": 1, "values": { - "agent_id": "60244093-3c9d-4655-b34f-c4713f7001c1", + "agent_id": "bd327d5e-3632-4d42-af81-cadf99aad2b5", "cron": null, "display_name": "Foobar Script 3", "icon": null, - "id": "a19e9106-5eb5-4941-b6ae-72a7724efdf0", + "id": "54976735-7900-4be8-9cfa-4b1bbd2dd0b6", "log_path": null, "run_on_start": true, "run_on_stop": false, @@ -175,7 +171,7 @@ "provider_name": "registry.terraform.io/hashicorp/null", "schema_version": 0, "values": { - "id": "8576645433635584827", + "id": "1999609760128298126", "triggers": null }, "sensitive_values": {}, @@ -191,7 +187,7 @@ "provider_name": "registry.terraform.io/hashicorp/null", "schema_version": 0, "values": { - "id": "1280398780322015606", + "id": "1520359202312470236", "triggers": null }, "sensitive_values": {}, diff --git a/provisioner/terraform/testdata/multiple-agents/multiple-agents.tfplan.json b/provisioner/terraform/testdata/multiple-agents/multiple-agents.tfplan.json index 201e09ad76..4091204d51 100644 --- a/provisioner/terraform/testdata/multiple-agents/multiple-agents.tfplan.json +++ b/provisioner/terraform/testdata/multiple-agents/multiple-agents.tfplan.json @@ -21,7 +21,6 @@ "motd_file": null, "order": null, "os": "linux", - "resources_monitoring": [], "shutdown_script": null, "startup_script": null, "startup_script_behavior": "non-blocking", @@ -30,7 +29,6 @@ "sensitive_values": { "display_apps": [], "metadata": [], - "resources_monitoring": [], "token": true } }, @@ -51,7 +49,6 @@ "motd_file": "/etc/motd", "order": null, "os": "darwin", - "resources_monitoring": [], "shutdown_script": "echo bye bye", "startup_script": null, "startup_script_behavior": "non-blocking", @@ -60,7 +57,6 @@ "sensitive_values": { "display_apps": [], "metadata": [], - "resources_monitoring": [], "token": true } }, @@ -81,7 +77,6 @@ "motd_file": null, "order": null, "os": "windows", - "resources_monitoring": [], "shutdown_script": null, "startup_script": null, "startup_script_behavior": "blocking", @@ -90,7 +85,6 @@ "sensitive_values": { "display_apps": [], "metadata": [], - "resources_monitoring": [], "token": true } }, @@ -111,7 +105,6 @@ "motd_file": null, "order": null, "os": "linux", - "resources_monitoring": [], "shutdown_script": null, "startup_script": null, "startup_script_behavior": "non-blocking", @@ -120,7 +113,6 @@ "sensitive_values": { "display_apps": [], "metadata": [], - "resources_monitoring": [], "token": true } }, @@ -161,7 +153,6 @@ "motd_file": null, "order": null, "os": "linux", - "resources_monitoring": [], "shutdown_script": null, "startup_script": null, "startup_script_behavior": "non-blocking", @@ -172,14 +163,12 @@ "id": true, "init_script": true, "metadata": [], - "resources_monitoring": [], "token": true }, "before_sensitive": false, "after_sensitive": { "display_apps": [], "metadata": [], - "resources_monitoring": [], "token": true } } @@ -205,7 +194,6 @@ "motd_file": "/etc/motd", "order": null, "os": "darwin", - "resources_monitoring": [], "shutdown_script": "echo bye bye", "startup_script": null, "startup_script_behavior": "non-blocking", @@ -216,14 +204,12 @@ "id": true, "init_script": true, "metadata": [], - "resources_monitoring": [], "token": true }, "before_sensitive": false, "after_sensitive": { "display_apps": [], "metadata": [], - "resources_monitoring": [], "token": true } } @@ -249,7 +235,6 @@ "motd_file": null, "order": null, "os": "windows", - "resources_monitoring": [], "shutdown_script": null, "startup_script": null, "startup_script_behavior": "blocking", @@ -260,14 +245,12 @@ "id": true, "init_script": true, "metadata": [], - "resources_monitoring": [], "token": true }, "before_sensitive": false, "after_sensitive": { "display_apps": [], "metadata": [], - "resources_monitoring": [], "token": true } } @@ -293,7 +276,6 @@ "motd_file": null, "order": null, "os": "linux", - "resources_monitoring": [], "shutdown_script": null, "startup_script": null, "startup_script_behavior": "non-blocking", @@ -304,14 +286,12 @@ "id": true, "init_script": true, "metadata": [], - "resources_monitoring": [], "token": true }, "before_sensitive": false, "after_sensitive": { "display_apps": [], "metadata": [], - "resources_monitoring": [], "token": true } } @@ -451,7 +431,7 @@ ] } }, - "timestamp": "2025-01-29T22:48:01Z", + "timestamp": "2025-02-06T07:28:26Z", "applyable": true, "complete": true, "errored": false diff --git a/provisioner/terraform/testdata/multiple-agents/multiple-agents.tfstate.json b/provisioner/terraform/testdata/multiple-agents/multiple-agents.tfstate.json index 53335cffd6..9e2ddad560 100644 --- a/provisioner/terraform/testdata/multiple-agents/multiple-agents.tfstate.json +++ b/provisioner/terraform/testdata/multiple-agents/multiple-agents.tfstate.json @@ -26,17 +26,16 @@ } ], "env": null, - "id": "215a9369-35c9-4abe-b1c0-3eb3ab1c1922", + "id": "c063caac-e0f7-40eb-8b1e-e9b653d5753d", "init_script": "", "metadata": [], "motd_file": null, "order": null, "os": "linux", - "resources_monitoring": [], "shutdown_script": null, "startup_script": null, "startup_script_behavior": "non-blocking", - "token": "3fdd733c-b02e-4d81-a032-7c8d7ee3dcd8", + "token": "3e420343-27a9-49da-9851-d434d34a6d53", "troubleshooting_url": null }, "sensitive_values": { @@ -44,7 +43,6 @@ {} ], "metadata": [], - "resources_monitoring": [], "token": true } }, @@ -70,17 +68,16 @@ } ], "env": null, - "id": "b79acfba-d148-4940-80aa-0c72c037a3ed", + "id": "952eddec-f95e-4401-aee6-ba7b9f1f4f40", "init_script": "", "metadata": [], "motd_file": "/etc/motd", "order": null, "os": "darwin", - "resources_monitoring": [], "shutdown_script": "echo bye bye", "startup_script": null, "startup_script_behavior": "non-blocking", - "token": "e841a152-a794-4b05-9818-95e7440d402d", + "token": "23253e29-9acc-4602-a8b9-e66b2a75af61", "troubleshooting_url": null }, "sensitive_values": { @@ -88,7 +85,6 @@ {} ], "metadata": [], - "resources_monitoring": [], "token": true } }, @@ -114,17 +110,16 @@ } ], "env": null, - "id": "4e863395-523b-443a-83c2-ab27e42a06b2", + "id": "24e9cc27-7115-4ad5-a3e8-77b143be2d30", "init_script": "", "metadata": [], "motd_file": null, "order": null, "os": "windows", - "resources_monitoring": [], "shutdown_script": null, "startup_script": null, "startup_script_behavior": "blocking", - "token": "ee0a5e1d-879e-4bff-888e-6cf94533f0bd", + "token": "13a353ce-da86-4015-a6d0-c5926cd0374c", "troubleshooting_url": "https://coder.com/troubleshoot" }, "sensitive_values": { @@ -132,7 +127,6 @@ {} ], "metadata": [], - "resources_monitoring": [], "token": true } }, @@ -158,17 +152,16 @@ } ], "env": null, - "id": "611c43f5-fa8f-4641-9b5c-a58a8945caa1", + "id": "3d83fed1-7aed-4240-9c0b-3afbbcfb6fa2", "init_script": "", "metadata": [], "motd_file": null, "order": null, "os": "linux", - "resources_monitoring": [], "shutdown_script": null, "startup_script": null, "startup_script_behavior": "non-blocking", - "token": "2d2669c7-6385-4ce8-8948-e4b24db45132", + "token": "9a31e16d-9c15-4dba-accf-a037d17741be", "troubleshooting_url": null }, "sensitive_values": { @@ -176,7 +169,6 @@ {} ], "metadata": [], - "resources_monitoring": [], "token": true } }, @@ -188,7 +180,7 @@ "provider_name": "registry.terraform.io/hashicorp/null", "schema_version": 0, "values": { - "id": "5237006672454822031", + "id": "1754313482916802938", "triggers": null }, "sensitive_values": {}, diff --git a/provisioner/terraform/testdata/multiple-apps/multiple-apps.tfplan.json b/provisioner/terraform/testdata/multiple-apps/multiple-apps.tfplan.json index d5d555e057..16d2119977 100644 --- a/provisioner/terraform/testdata/multiple-apps/multiple-apps.tfplan.json +++ b/provisioner/terraform/testdata/multiple-apps/multiple-apps.tfplan.json @@ -21,7 +21,6 @@ "motd_file": null, "order": null, "os": "linux", - "resources_monitoring": [], "shutdown_script": null, "startup_script": null, "startup_script_behavior": "non-blocking", @@ -30,7 +29,6 @@ "sensitive_values": { "display_apps": [], "metadata": [], - "resources_monitoring": [], "token": true } }, @@ -154,7 +152,6 @@ "motd_file": null, "order": null, "os": "linux", - "resources_monitoring": [], "shutdown_script": null, "startup_script": null, "startup_script_behavior": "non-blocking", @@ -165,14 +162,12 @@ "id": true, "init_script": true, "metadata": [], - "resources_monitoring": [], "token": true }, "before_sensitive": false, "after_sensitive": { "display_apps": [], "metadata": [], - "resources_monitoring": [], "token": true } } @@ -445,7 +440,7 @@ ] } ], - "timestamp": "2025-01-29T22:48:10Z", + "timestamp": "2025-02-06T07:28:26Z", "applyable": true, "complete": true, "errored": false diff --git a/provisioner/terraform/testdata/multiple-apps/multiple-apps.tfstate.json b/provisioner/terraform/testdata/multiple-apps/multiple-apps.tfstate.json index 9bad983044..6dd5ae33d3 100644 --- a/provisioner/terraform/testdata/multiple-apps/multiple-apps.tfstate.json +++ b/provisioner/terraform/testdata/multiple-apps/multiple-apps.tfstate.json @@ -26,17 +26,16 @@ } ], "env": null, - "id": "cae4d590-8332-45b6-9453-e0151ca4f219", + "id": "054b161e-afd2-4783-a5b3-e926149361f3", "init_script": "", "metadata": [], "motd_file": null, "order": null, "os": "linux", - "resources_monitoring": [], "shutdown_script": null, "startup_script": null, "startup_script_behavior": "non-blocking", - "token": "6db086ba-440b-4e66-8803-80e021cda61a", + "token": "4d658a7b-6bdb-4b8d-a689-cbe3d5a3d95e", "troubleshooting_url": null }, "sensitive_values": { @@ -44,7 +43,6 @@ {} ], "metadata": [], - "resources_monitoring": [], "token": true } }, @@ -56,14 +54,14 @@ "provider_name": "registry.terraform.io/coder/coder", "schema_version": 1, "values": { - "agent_id": "cae4d590-8332-45b6-9453-e0151ca4f219", + "agent_id": "054b161e-afd2-4783-a5b3-e926149361f3", "command": null, "display_name": null, "external": false, "healthcheck": [], "hidden": false, "icon": null, - "id": "64803468-4ec4-49fe-beb7-e65eaf8e01ca", + "id": "15a4a26b-a880-4bdd-aa1a-1c023dc699c3", "open_in": "slim-window", "order": null, "share": "owner", @@ -86,7 +84,7 @@ "provider_name": "registry.terraform.io/coder/coder", "schema_version": 1, "values": { - "agent_id": "cae4d590-8332-45b6-9453-e0151ca4f219", + "agent_id": "054b161e-afd2-4783-a5b3-e926149361f3", "command": null, "display_name": null, "external": false, @@ -99,7 +97,7 @@ ], "hidden": false, "icon": null, - "id": "df3f07ab-1796-41c9-8e7d-b957dca031d4", + "id": "13804972-c155-47bf-9fc2-81421523eebf", "open_in": "slim-window", "order": null, "share": "owner", @@ -124,14 +122,14 @@ "provider_name": "registry.terraform.io/coder/coder", "schema_version": 1, "values": { - "agent_id": "cae4d590-8332-45b6-9453-e0151ca4f219", + "agent_id": "054b161e-afd2-4783-a5b3-e926149361f3", "command": null, "display_name": null, "external": false, "healthcheck": [], "hidden": false, "icon": null, - "id": "fdb06774-4140-42ef-989b-12b98254b27c", + "id": "2744abcb-51db-43cf-a2e3-61dcbd8d896a", "open_in": "slim-window", "order": null, "share": "owner", @@ -154,7 +152,7 @@ "provider_name": "registry.terraform.io/hashicorp/null", "schema_version": 0, "values": { - "id": "8206837964247342986", + "id": "4930273725392327631", "triggers": null }, "sensitive_values": {}, diff --git a/provisioner/terraform/testdata/presets/external-module/child-external-module/main.tf b/provisioner/terraform/testdata/presets/external-module/child-external-module/main.tf new file mode 100644 index 0000000000..ac6f4c621a --- /dev/null +++ b/provisioner/terraform/testdata/presets/external-module/child-external-module/main.tf @@ -0,0 +1,28 @@ +terraform { + required_providers { + coder = { + source = "coder/coder" + version = "0.22.0" + } + docker = { + source = "kreuzwerker/docker" + version = "~> 2.22" + } + } +} + +data "coder_parameter" "child_first_parameter_from_module" { + name = "First parameter from child module" + mutable = true + type = "string" + description = "First parameter from child module" + default = "abcdef" +} + +data "coder_parameter" "child_second_parameter_from_module" { + name = "Second parameter from child module" + mutable = true + type = "string" + description = "Second parameter from child module" + default = "ghijkl" +} diff --git a/provisioner/terraform/testdata/presets/external-module/main.tf b/provisioner/terraform/testdata/presets/external-module/main.tf new file mode 100644 index 0000000000..55e942ec24 --- /dev/null +++ b/provisioner/terraform/testdata/presets/external-module/main.tf @@ -0,0 +1,32 @@ +terraform { + required_providers { + coder = { + source = "coder/coder" + version = "0.22.0" + } + docker = { + source = "kreuzwerker/docker" + version = "~> 2.22" + } + } +} + +module "this_is_external_child_module" { + source = "./child-external-module" +} + +data "coder_parameter" "first_parameter_from_module" { + name = "First parameter from module" + mutable = true + type = "string" + description = "First parameter from module" + default = "abcdef" +} + +data "coder_parameter" "second_parameter_from_module" { + name = "Second parameter from module" + mutable = true + type = "string" + description = "Second parameter from module" + default = "ghijkl" +} diff --git a/provisioner/terraform/testdata/presets/presets.tf b/provisioner/terraform/testdata/presets/presets.tf new file mode 100644 index 0000000000..cb372930d4 --- /dev/null +++ b/provisioner/terraform/testdata/presets/presets.tf @@ -0,0 +1,39 @@ +terraform { + required_providers { + coder = { + source = "coder/coder" + version = "0.22.0" + } + } +} + +module "this_is_external_module" { + source = "./external-module" +} + +data "coder_parameter" "sample" { + name = "Sample" + type = "string" + description = "blah blah" + default = "ok" +} + +data "coder_workspace_preset" "MyFirstProject" { + name = "My First Project" + parameters = { + (data.coder_parameter.sample.name) = "A1B2C3" + # TODO (sasswart): Add support for parameters from external modules + # (data.coder_parameter.first_parameter_from_module.name) = "A1B2C3" + # (data.coder_parameter.child_first_parameter_from_module.name) = "A1B2C3" + } +} + +resource "coder_agent" "dev" { + os = "windows" + arch = "arm64" +} + +resource "null_resource" "dev" { + depends_on = [coder_agent.dev] +} + diff --git a/provisioner/terraform/testdata/presets/presets.tfplan.dot b/provisioner/terraform/testdata/presets/presets.tfplan.dot new file mode 100644 index 0000000000..bc545095b9 --- /dev/null +++ b/provisioner/terraform/testdata/presets/presets.tfplan.dot @@ -0,0 +1,45 @@ +digraph { + compound = "true" + newrank = "true" + subgraph "root" { + "[root] coder_agent.dev (expand)" [label = "coder_agent.dev", shape = "box"] + "[root] data.coder_parameter.sample (expand)" [label = "data.coder_parameter.sample", shape = "box"] + "[root] data.coder_workspace_preset.MyFirstProject (expand)" [label = "data.coder_workspace_preset.MyFirstProject", shape = "box"] + "[root] module.this_is_external_module.data.coder_parameter.first_parameter_from_module (expand)" [label = "module.this_is_external_module.data.coder_parameter.first_parameter_from_module", shape = "box"] + "[root] module.this_is_external_module.data.coder_parameter.second_parameter_from_module (expand)" [label = "module.this_is_external_module.data.coder_parameter.second_parameter_from_module", shape = "box"] + "[root] module.this_is_external_module.module.this_is_external_child_module.data.coder_parameter.child_first_parameter_from_module (expand)" [label = "module.this_is_external_module.module.this_is_external_child_module.data.coder_parameter.child_first_parameter_from_module", shape = "box"] + "[root] module.this_is_external_module.module.this_is_external_child_module.data.coder_parameter.child_second_parameter_from_module (expand)" [label = "module.this_is_external_module.module.this_is_external_child_module.data.coder_parameter.child_second_parameter_from_module", shape = "box"] + "[root] null_resource.dev (expand)" [label = "null_resource.dev", shape = "box"] + "[root] provider[\"registry.terraform.io/coder/coder\"]" [label = "provider[\"registry.terraform.io/coder/coder\"]", shape = "diamond"] + "[root] provider[\"registry.terraform.io/hashicorp/null\"]" [label = "provider[\"registry.terraform.io/hashicorp/null\"]", shape = "diamond"] + "[root] coder_agent.dev (expand)" -> "[root] provider[\"registry.terraform.io/coder/coder\"]" + "[root] data.coder_parameter.sample (expand)" -> "[root] provider[\"registry.terraform.io/coder/coder\"]" + "[root] data.coder_workspace_preset.MyFirstProject (expand)" -> "[root] data.coder_parameter.sample (expand)" + "[root] module.this_is_external_module (close)" -> "[root] module.this_is_external_module.data.coder_parameter.first_parameter_from_module (expand)" + "[root] module.this_is_external_module (close)" -> "[root] module.this_is_external_module.data.coder_parameter.second_parameter_from_module (expand)" + "[root] module.this_is_external_module (close)" -> "[root] module.this_is_external_module.module.this_is_external_child_module (close)" + "[root] module.this_is_external_module.data.coder_parameter.first_parameter_from_module (expand)" -> "[root] module.this_is_external_module (expand)" + "[root] module.this_is_external_module.data.coder_parameter.first_parameter_from_module (expand)" -> "[root] provider[\"registry.terraform.io/coder/coder\"]" + "[root] module.this_is_external_module.data.coder_parameter.second_parameter_from_module (expand)" -> "[root] module.this_is_external_module (expand)" + "[root] module.this_is_external_module.data.coder_parameter.second_parameter_from_module (expand)" -> "[root] provider[\"registry.terraform.io/coder/coder\"]" + "[root] module.this_is_external_module.module.this_is_external_child_module (close)" -> "[root] module.this_is_external_module.module.this_is_external_child_module.data.coder_parameter.child_first_parameter_from_module (expand)" + "[root] module.this_is_external_module.module.this_is_external_child_module (close)" -> "[root] module.this_is_external_module.module.this_is_external_child_module.data.coder_parameter.child_second_parameter_from_module (expand)" + "[root] module.this_is_external_module.module.this_is_external_child_module (expand)" -> "[root] module.this_is_external_module (expand)" + "[root] module.this_is_external_module.module.this_is_external_child_module.data.coder_parameter.child_first_parameter_from_module (expand)" -> "[root] module.this_is_external_module.module.this_is_external_child_module (expand)" + "[root] module.this_is_external_module.module.this_is_external_child_module.data.coder_parameter.child_first_parameter_from_module (expand)" -> "[root] provider[\"registry.terraform.io/coder/coder\"]" + "[root] module.this_is_external_module.module.this_is_external_child_module.data.coder_parameter.child_second_parameter_from_module (expand)" -> "[root] module.this_is_external_module.module.this_is_external_child_module (expand)" + "[root] module.this_is_external_module.module.this_is_external_child_module.data.coder_parameter.child_second_parameter_from_module (expand)" -> "[root] provider[\"registry.terraform.io/coder/coder\"]" + "[root] null_resource.dev (expand)" -> "[root] coder_agent.dev (expand)" + "[root] null_resource.dev (expand)" -> "[root] provider[\"registry.terraform.io/hashicorp/null\"]" + "[root] provider[\"registry.terraform.io/coder/coder\"] (close)" -> "[root] coder_agent.dev (expand)" + "[root] provider[\"registry.terraform.io/coder/coder\"] (close)" -> "[root] data.coder_workspace_preset.MyFirstProject (expand)" + "[root] provider[\"registry.terraform.io/coder/coder\"] (close)" -> "[root] module.this_is_external_module.data.coder_parameter.first_parameter_from_module (expand)" + "[root] provider[\"registry.terraform.io/coder/coder\"] (close)" -> "[root] module.this_is_external_module.data.coder_parameter.second_parameter_from_module (expand)" + "[root] provider[\"registry.terraform.io/coder/coder\"] (close)" -> "[root] module.this_is_external_module.module.this_is_external_child_module.data.coder_parameter.child_first_parameter_from_module (expand)" + "[root] provider[\"registry.terraform.io/coder/coder\"] (close)" -> "[root] module.this_is_external_module.module.this_is_external_child_module.data.coder_parameter.child_second_parameter_from_module (expand)" + "[root] provider[\"registry.terraform.io/hashicorp/null\"] (close)" -> "[root] null_resource.dev (expand)" + "[root] root" -> "[root] module.this_is_external_module (close)" + "[root] root" -> "[root] provider[\"registry.terraform.io/coder/coder\"] (close)" + "[root] root" -> "[root] provider[\"registry.terraform.io/hashicorp/null\"] (close)" + } +} diff --git a/provisioner/terraform/testdata/presets/presets.tfplan.json b/provisioner/terraform/testdata/presets/presets.tfplan.json new file mode 100644 index 0000000000..6ee4b6705c --- /dev/null +++ b/provisioner/terraform/testdata/presets/presets.tfplan.json @@ -0,0 +1,504 @@ +{ + "format_version": "1.2", + "terraform_version": "1.9.8", + "planned_values": { + "root_module": { + "resources": [ + { + "address": "coder_agent.dev", + "mode": "managed", + "type": "coder_agent", + "name": "dev", + "provider_name": "registry.terraform.io/coder/coder", + "schema_version": 1, + "values": { + "arch": "arm64", + "auth": "token", + "connection_timeout": 120, + "dir": null, + "env": null, + "metadata": [], + "motd_file": null, + "order": null, + "os": "windows", + "shutdown_script": null, + "startup_script": null, + "startup_script_behavior": "non-blocking", + "troubleshooting_url": null + }, + "sensitive_values": { + "display_apps": [], + "metadata": [], + "token": true + } + }, + { + "address": "null_resource.dev", + "mode": "managed", + "type": "null_resource", + "name": "dev", + "provider_name": "registry.terraform.io/hashicorp/null", + "schema_version": 0, + "values": { + "triggers": null + }, + "sensitive_values": {} + } + ] + } + }, + "resource_changes": [ + { + "address": "coder_agent.dev", + "mode": "managed", + "type": "coder_agent", + "name": "dev", + "provider_name": "registry.terraform.io/coder/coder", + "change": { + "actions": [ + "create" + ], + "before": null, + "after": { + "arch": "arm64", + "auth": "token", + "connection_timeout": 120, + "dir": null, + "env": null, + "metadata": [], + "motd_file": null, + "order": null, + "os": "windows", + "shutdown_script": null, + "startup_script": null, + "startup_script_behavior": "non-blocking", + "troubleshooting_url": null + }, + "after_unknown": { + "display_apps": true, + "id": true, + "init_script": true, + "metadata": [], + "token": true + }, + "before_sensitive": false, + "after_sensitive": { + "display_apps": [], + "metadata": [], + "token": true + } + } + }, + { + "address": "null_resource.dev", + "mode": "managed", + "type": "null_resource", + "name": "dev", + "provider_name": "registry.terraform.io/hashicorp/null", + "change": { + "actions": [ + "create" + ], + "before": null, + "after": { + "triggers": null + }, + "after_unknown": { + "id": true + }, + "before_sensitive": false, + "after_sensitive": {} + } + } + ], + "prior_state": { + "format_version": "1.0", + "terraform_version": "1.9.8", + "values": { + "root_module": { + "resources": [ + { + "address": "data.coder_parameter.sample", + "mode": "data", + "type": "coder_parameter", + "name": "sample", + "provider_name": "registry.terraform.io/coder/coder", + "schema_version": 0, + "values": { + "default": "ok", + "description": "blah blah", + "display_name": null, + "ephemeral": false, + "icon": null, + "id": "1e5ebd18-fd9e-435e-9b85-d5dded4b2d69", + "mutable": false, + "name": "Sample", + "option": null, + "optional": true, + "order": null, + "type": "string", + "validation": [], + "value": "ok" + }, + "sensitive_values": { + "validation": [] + } + }, + { + "address": "data.coder_workspace_preset.MyFirstProject", + "mode": "data", + "type": "coder_workspace_preset", + "name": "MyFirstProject", + "provider_name": "registry.terraform.io/coder/coder", + "schema_version": 0, + "values": { + "id": "My First Project", + "name": "My First Project", + "parameters": { + "Sample": "A1B2C3" + } + }, + "sensitive_values": { + "parameters": {} + } + } + ], + "child_modules": [ + { + "resources": [ + { + "address": "module.this_is_external_module.data.coder_parameter.first_parameter_from_module", + "mode": "data", + "type": "coder_parameter", + "name": "first_parameter_from_module", + "provider_name": "registry.terraform.io/coder/coder", + "schema_version": 0, + "values": { + "default": "abcdef", + "description": "First parameter from module", + "display_name": null, + "ephemeral": false, + "icon": null, + "id": "600375fe-cb06-4d7d-92b6-8e2c93d4d9dd", + "mutable": true, + "name": "First parameter from module", + "option": null, + "optional": true, + "order": null, + "type": "string", + "validation": [], + "value": "abcdef" + }, + "sensitive_values": { + "validation": [] + } + }, + { + "address": "module.this_is_external_module.data.coder_parameter.second_parameter_from_module", + "mode": "data", + "type": "coder_parameter", + "name": "second_parameter_from_module", + "provider_name": "registry.terraform.io/coder/coder", + "schema_version": 0, + "values": { + "default": "ghijkl", + "description": "Second parameter from module", + "display_name": null, + "ephemeral": false, + "icon": null, + "id": "c58f2ba6-9db3-49aa-8795-33fdb18f3e67", + "mutable": true, + "name": "Second parameter from module", + "option": null, + "optional": true, + "order": null, + "type": "string", + "validation": [], + "value": "ghijkl" + }, + "sensitive_values": { + "validation": [] + } + } + ], + "address": "module.this_is_external_module", + "child_modules": [ + { + "resources": [ + { + "address": "module.this_is_external_module.module.this_is_external_child_module.data.coder_parameter.child_first_parameter_from_module", + "mode": "data", + "type": "coder_parameter", + "name": "child_first_parameter_from_module", + "provider_name": "registry.terraform.io/coder/coder", + "schema_version": 0, + "values": { + "default": "abcdef", + "description": "First parameter from child module", + "display_name": null, + "ephemeral": false, + "icon": null, + "id": "7d212d9b-f6cb-4611-989e-4512d4f86c10", + "mutable": true, + "name": "First parameter from child module", + "option": null, + "optional": true, + "order": null, + "type": "string", + "validation": [], + "value": "abcdef" + }, + "sensitive_values": { + "validation": [] + } + }, + { + "address": "module.this_is_external_module.module.this_is_external_child_module.data.coder_parameter.child_second_parameter_from_module", + "mode": "data", + "type": "coder_parameter", + "name": "child_second_parameter_from_module", + "provider_name": "registry.terraform.io/coder/coder", + "schema_version": 0, + "values": { + "default": "ghijkl", + "description": "Second parameter from child module", + "display_name": null, + "ephemeral": false, + "icon": null, + "id": "6f71825d-4332-4f1c-a8d9-8bc118fa6a45", + "mutable": true, + "name": "Second parameter from child module", + "option": null, + "optional": true, + "order": null, + "type": "string", + "validation": [], + "value": "ghijkl" + }, + "sensitive_values": { + "validation": [] + } + } + ], + "address": "module.this_is_external_module.module.this_is_external_child_module" + } + ] + } + ] + } + } + }, + "configuration": { + "provider_config": { + "coder": { + "name": "coder", + "full_name": "registry.terraform.io/coder/coder", + "version_constraint": "0.22.0" + }, + "module.this_is_external_module:docker": { + "name": "docker", + "full_name": "registry.terraform.io/kreuzwerker/docker", + "version_constraint": "~> 2.22", + "module_address": "module.this_is_external_module" + }, + "null": { + "name": "null", + "full_name": "registry.terraform.io/hashicorp/null" + } + }, + "root_module": { + "resources": [ + { + "address": "coder_agent.dev", + "mode": "managed", + "type": "coder_agent", + "name": "dev", + "provider_config_key": "coder", + "expressions": { + "arch": { + "constant_value": "arm64" + }, + "os": { + "constant_value": "windows" + } + }, + "schema_version": 1 + }, + { + "address": "null_resource.dev", + "mode": "managed", + "type": "null_resource", + "name": "dev", + "provider_config_key": "null", + "schema_version": 0, + "depends_on": [ + "coder_agent.dev" + ] + }, + { + "address": "data.coder_parameter.sample", + "mode": "data", + "type": "coder_parameter", + "name": "sample", + "provider_config_key": "coder", + "expressions": { + "default": { + "constant_value": "ok" + }, + "description": { + "constant_value": "blah blah" + }, + "name": { + "constant_value": "Sample" + }, + "type": { + "constant_value": "string" + } + }, + "schema_version": 0 + }, + { + "address": "data.coder_workspace_preset.MyFirstProject", + "mode": "data", + "type": "coder_workspace_preset", + "name": "MyFirstProject", + "provider_config_key": "coder", + "expressions": { + "name": { + "constant_value": "My First Project" + }, + "parameters": { + "references": [ + "data.coder_parameter.sample.name", + "data.coder_parameter.sample" + ] + } + }, + "schema_version": 0 + } + ], + "module_calls": { + "this_is_external_module": { + "source": "./external-module", + "module": { + "resources": [ + { + "address": "data.coder_parameter.first_parameter_from_module", + "mode": "data", + "type": "coder_parameter", + "name": "first_parameter_from_module", + "provider_config_key": "coder", + "expressions": { + "default": { + "constant_value": "abcdef" + }, + "description": { + "constant_value": "First parameter from module" + }, + "mutable": { + "constant_value": true + }, + "name": { + "constant_value": "First parameter from module" + }, + "type": { + "constant_value": "string" + } + }, + "schema_version": 0 + }, + { + "address": "data.coder_parameter.second_parameter_from_module", + "mode": "data", + "type": "coder_parameter", + "name": "second_parameter_from_module", + "provider_config_key": "coder", + "expressions": { + "default": { + "constant_value": "ghijkl" + }, + "description": { + "constant_value": "Second parameter from module" + }, + "mutable": { + "constant_value": true + }, + "name": { + "constant_value": "Second parameter from module" + }, + "type": { + "constant_value": "string" + } + }, + "schema_version": 0 + } + ], + "module_calls": { + "this_is_external_child_module": { + "source": "./child-external-module", + "module": { + "resources": [ + { + "address": "data.coder_parameter.child_first_parameter_from_module", + "mode": "data", + "type": "coder_parameter", + "name": "child_first_parameter_from_module", + "provider_config_key": "coder", + "expressions": { + "default": { + "constant_value": "abcdef" + }, + "description": { + "constant_value": "First parameter from child module" + }, + "mutable": { + "constant_value": true + }, + "name": { + "constant_value": "First parameter from child module" + }, + "type": { + "constant_value": "string" + } + }, + "schema_version": 0 + }, + { + "address": "data.coder_parameter.child_second_parameter_from_module", + "mode": "data", + "type": "coder_parameter", + "name": "child_second_parameter_from_module", + "provider_config_key": "coder", + "expressions": { + "default": { + "constant_value": "ghijkl" + }, + "description": { + "constant_value": "Second parameter from child module" + }, + "mutable": { + "constant_value": true + }, + "name": { + "constant_value": "Second parameter from child module" + }, + "type": { + "constant_value": "string" + } + }, + "schema_version": 0 + } + ] + } + } + } + } + } + } + } + }, + "timestamp": "2025-02-06T07:28:26Z", + "applyable": true, + "complete": true, + "errored": false +} diff --git a/provisioner/terraform/testdata/presets/presets.tfstate.dot b/provisioner/terraform/testdata/presets/presets.tfstate.dot new file mode 100644 index 0000000000..bc545095b9 --- /dev/null +++ b/provisioner/terraform/testdata/presets/presets.tfstate.dot @@ -0,0 +1,45 @@ +digraph { + compound = "true" + newrank = "true" + subgraph "root" { + "[root] coder_agent.dev (expand)" [label = "coder_agent.dev", shape = "box"] + "[root] data.coder_parameter.sample (expand)" [label = "data.coder_parameter.sample", shape = "box"] + "[root] data.coder_workspace_preset.MyFirstProject (expand)" [label = "data.coder_workspace_preset.MyFirstProject", shape = "box"] + "[root] module.this_is_external_module.data.coder_parameter.first_parameter_from_module (expand)" [label = "module.this_is_external_module.data.coder_parameter.first_parameter_from_module", shape = "box"] + "[root] module.this_is_external_module.data.coder_parameter.second_parameter_from_module (expand)" [label = "module.this_is_external_module.data.coder_parameter.second_parameter_from_module", shape = "box"] + "[root] module.this_is_external_module.module.this_is_external_child_module.data.coder_parameter.child_first_parameter_from_module (expand)" [label = "module.this_is_external_module.module.this_is_external_child_module.data.coder_parameter.child_first_parameter_from_module", shape = "box"] + "[root] module.this_is_external_module.module.this_is_external_child_module.data.coder_parameter.child_second_parameter_from_module (expand)" [label = "module.this_is_external_module.module.this_is_external_child_module.data.coder_parameter.child_second_parameter_from_module", shape = "box"] + "[root] null_resource.dev (expand)" [label = "null_resource.dev", shape = "box"] + "[root] provider[\"registry.terraform.io/coder/coder\"]" [label = "provider[\"registry.terraform.io/coder/coder\"]", shape = "diamond"] + "[root] provider[\"registry.terraform.io/hashicorp/null\"]" [label = "provider[\"registry.terraform.io/hashicorp/null\"]", shape = "diamond"] + "[root] coder_agent.dev (expand)" -> "[root] provider[\"registry.terraform.io/coder/coder\"]" + "[root] data.coder_parameter.sample (expand)" -> "[root] provider[\"registry.terraform.io/coder/coder\"]" + "[root] data.coder_workspace_preset.MyFirstProject (expand)" -> "[root] data.coder_parameter.sample (expand)" + "[root] module.this_is_external_module (close)" -> "[root] module.this_is_external_module.data.coder_parameter.first_parameter_from_module (expand)" + "[root] module.this_is_external_module (close)" -> "[root] module.this_is_external_module.data.coder_parameter.second_parameter_from_module (expand)" + "[root] module.this_is_external_module (close)" -> "[root] module.this_is_external_module.module.this_is_external_child_module (close)" + "[root] module.this_is_external_module.data.coder_parameter.first_parameter_from_module (expand)" -> "[root] module.this_is_external_module (expand)" + "[root] module.this_is_external_module.data.coder_parameter.first_parameter_from_module (expand)" -> "[root] provider[\"registry.terraform.io/coder/coder\"]" + "[root] module.this_is_external_module.data.coder_parameter.second_parameter_from_module (expand)" -> "[root] module.this_is_external_module (expand)" + "[root] module.this_is_external_module.data.coder_parameter.second_parameter_from_module (expand)" -> "[root] provider[\"registry.terraform.io/coder/coder\"]" + "[root] module.this_is_external_module.module.this_is_external_child_module (close)" -> "[root] module.this_is_external_module.module.this_is_external_child_module.data.coder_parameter.child_first_parameter_from_module (expand)" + "[root] module.this_is_external_module.module.this_is_external_child_module (close)" -> "[root] module.this_is_external_module.module.this_is_external_child_module.data.coder_parameter.child_second_parameter_from_module (expand)" + "[root] module.this_is_external_module.module.this_is_external_child_module (expand)" -> "[root] module.this_is_external_module (expand)" + "[root] module.this_is_external_module.module.this_is_external_child_module.data.coder_parameter.child_first_parameter_from_module (expand)" -> "[root] module.this_is_external_module.module.this_is_external_child_module (expand)" + "[root] module.this_is_external_module.module.this_is_external_child_module.data.coder_parameter.child_first_parameter_from_module (expand)" -> "[root] provider[\"registry.terraform.io/coder/coder\"]" + "[root] module.this_is_external_module.module.this_is_external_child_module.data.coder_parameter.child_second_parameter_from_module (expand)" -> "[root] module.this_is_external_module.module.this_is_external_child_module (expand)" + "[root] module.this_is_external_module.module.this_is_external_child_module.data.coder_parameter.child_second_parameter_from_module (expand)" -> "[root] provider[\"registry.terraform.io/coder/coder\"]" + "[root] null_resource.dev (expand)" -> "[root] coder_agent.dev (expand)" + "[root] null_resource.dev (expand)" -> "[root] provider[\"registry.terraform.io/hashicorp/null\"]" + "[root] provider[\"registry.terraform.io/coder/coder\"] (close)" -> "[root] coder_agent.dev (expand)" + "[root] provider[\"registry.terraform.io/coder/coder\"] (close)" -> "[root] data.coder_workspace_preset.MyFirstProject (expand)" + "[root] provider[\"registry.terraform.io/coder/coder\"] (close)" -> "[root] module.this_is_external_module.data.coder_parameter.first_parameter_from_module (expand)" + "[root] provider[\"registry.terraform.io/coder/coder\"] (close)" -> "[root] module.this_is_external_module.data.coder_parameter.second_parameter_from_module (expand)" + "[root] provider[\"registry.terraform.io/coder/coder\"] (close)" -> "[root] module.this_is_external_module.module.this_is_external_child_module.data.coder_parameter.child_first_parameter_from_module (expand)" + "[root] provider[\"registry.terraform.io/coder/coder\"] (close)" -> "[root] module.this_is_external_module.module.this_is_external_child_module.data.coder_parameter.child_second_parameter_from_module (expand)" + "[root] provider[\"registry.terraform.io/hashicorp/null\"] (close)" -> "[root] null_resource.dev (expand)" + "[root] root" -> "[root] module.this_is_external_module (close)" + "[root] root" -> "[root] provider[\"registry.terraform.io/coder/coder\"] (close)" + "[root] root" -> "[root] provider[\"registry.terraform.io/hashicorp/null\"] (close)" + } +} diff --git a/provisioner/terraform/testdata/presets/presets.tfstate.json b/provisioner/terraform/testdata/presets/presets.tfstate.json new file mode 100644 index 0000000000..c85a1ed6ee --- /dev/null +++ b/provisioner/terraform/testdata/presets/presets.tfstate.json @@ -0,0 +1,235 @@ +{ + "format_version": "1.0", + "terraform_version": "1.9.8", + "values": { + "root_module": { + "resources": [ + { + "address": "data.coder_parameter.sample", + "mode": "data", + "type": "coder_parameter", + "name": "sample", + "provider_name": "registry.terraform.io/coder/coder", + "schema_version": 0, + "values": { + "default": "ok", + "description": "blah blah", + "display_name": null, + "ephemeral": false, + "icon": null, + "id": "2919245a-ab45-4d7e-8b12-eab87c8dae93", + "mutable": false, + "name": "Sample", + "option": null, + "optional": true, + "order": null, + "type": "string", + "validation": [], + "value": "ok" + }, + "sensitive_values": { + "validation": [] + } + }, + { + "address": "data.coder_workspace_preset.MyFirstProject", + "mode": "data", + "type": "coder_workspace_preset", + "name": "MyFirstProject", + "provider_name": "registry.terraform.io/coder/coder", + "schema_version": 0, + "values": { + "id": "My First Project", + "name": "My First Project", + "parameters": { + "Sample": "A1B2C3" + } + }, + "sensitive_values": { + "parameters": {} + } + }, + { + "address": "coder_agent.dev", + "mode": "managed", + "type": "coder_agent", + "name": "dev", + "provider_name": "registry.terraform.io/coder/coder", + "schema_version": 1, + "values": { + "arch": "arm64", + "auth": "token", + "connection_timeout": 120, + "dir": null, + "display_apps": [ + { + "port_forwarding_helper": true, + "ssh_helper": true, + "vscode": true, + "vscode_insiders": false, + "web_terminal": true + } + ], + "env": null, + "id": "409b5e6b-e062-4597-9d52-e1b9995fbcbc", + "init_script": "", + "metadata": [], + "motd_file": null, + "order": null, + "os": "windows", + "shutdown_script": null, + "startup_script": null, + "startup_script_behavior": "non-blocking", + "token": "4ffba3f0-5f6f-4c81-8cc7-1e85f9585e26", + "troubleshooting_url": null + }, + "sensitive_values": { + "display_apps": [ + {} + ], + "metadata": [], + "token": true + } + }, + { + "address": "null_resource.dev", + "mode": "managed", + "type": "null_resource", + "name": "dev", + "provider_name": "registry.terraform.io/hashicorp/null", + "schema_version": 0, + "values": { + "id": "5205838407378573477", + "triggers": null + }, + "sensitive_values": {}, + "depends_on": [ + "coder_agent.dev" + ] + } + ], + "child_modules": [ + { + "resources": [ + { + "address": "module.this_is_external_module.data.coder_parameter.first_parameter_from_module", + "mode": "data", + "type": "coder_parameter", + "name": "first_parameter_from_module", + "provider_name": "registry.terraform.io/coder/coder", + "schema_version": 0, + "values": { + "default": "abcdef", + "description": "First parameter from module", + "display_name": null, + "ephemeral": false, + "icon": null, + "id": "754b099d-7ee7-4716-83fa-cd9afc746a1f", + "mutable": true, + "name": "First parameter from module", + "option": null, + "optional": true, + "order": null, + "type": "string", + "validation": [], + "value": "abcdef" + }, + "sensitive_values": { + "validation": [] + } + }, + { + "address": "module.this_is_external_module.data.coder_parameter.second_parameter_from_module", + "mode": "data", + "type": "coder_parameter", + "name": "second_parameter_from_module", + "provider_name": "registry.terraform.io/coder/coder", + "schema_version": 0, + "values": { + "default": "ghijkl", + "description": "Second parameter from module", + "display_name": null, + "ephemeral": false, + "icon": null, + "id": "0a4e4511-d8bd-47b9-bb7a-ffddd09c7da4", + "mutable": true, + "name": "Second parameter from module", + "option": null, + "optional": true, + "order": null, + "type": "string", + "validation": [], + "value": "ghijkl" + }, + "sensitive_values": { + "validation": [] + } + } + ], + "address": "module.this_is_external_module", + "child_modules": [ + { + "resources": [ + { + "address": "module.this_is_external_module.module.this_is_external_child_module.data.coder_parameter.child_first_parameter_from_module", + "mode": "data", + "type": "coder_parameter", + "name": "child_first_parameter_from_module", + "provider_name": "registry.terraform.io/coder/coder", + "schema_version": 0, + "values": { + "default": "abcdef", + "description": "First parameter from child module", + "display_name": null, + "ephemeral": false, + "icon": null, + "id": "1c981b95-6d26-4222-96e8-6552e43ecb51", + "mutable": true, + "name": "First parameter from child module", + "option": null, + "optional": true, + "order": null, + "type": "string", + "validation": [], + "value": "abcdef" + }, + "sensitive_values": { + "validation": [] + } + }, + { + "address": "module.this_is_external_module.module.this_is_external_child_module.data.coder_parameter.child_second_parameter_from_module", + "mode": "data", + "type": "coder_parameter", + "name": "child_second_parameter_from_module", + "provider_name": "registry.terraform.io/coder/coder", + "schema_version": 0, + "values": { + "default": "ghijkl", + "description": "Second parameter from child module", + "display_name": null, + "ephemeral": false, + "icon": null, + "id": "f4667b4c-217f-494d-9811-7f8b58913c43", + "mutable": true, + "name": "Second parameter from child module", + "option": null, + "optional": true, + "order": null, + "type": "string", + "validation": [], + "value": "ghijkl" + }, + "sensitive_values": { + "validation": [] + } + } + ], + "address": "module.this_is_external_module.module.this_is_external_child_module" + } + ] + } + ] + } + } +} diff --git a/provisioner/terraform/testdata/resource-metadata-duplicate/resource-metadata-duplicate.tfplan.json b/provisioner/terraform/testdata/resource-metadata-duplicate/resource-metadata-duplicate.tfplan.json index 6354226c4c..05b7ec2cf5 100644 --- a/provisioner/terraform/testdata/resource-metadata-duplicate/resource-metadata-duplicate.tfplan.json +++ b/provisioner/terraform/testdata/resource-metadata-duplicate/resource-metadata-duplicate.tfplan.json @@ -30,7 +30,6 @@ "motd_file": null, "order": null, "os": "linux", - "resources_monitoring": [], "shutdown_script": null, "startup_script": null, "startup_script_behavior": "non-blocking", @@ -41,7 +40,6 @@ "metadata": [ {} ], - "resources_monitoring": [], "token": true } }, @@ -147,7 +145,6 @@ "motd_file": null, "order": null, "os": "linux", - "resources_monitoring": [], "shutdown_script": null, "startup_script": null, "startup_script_behavior": "non-blocking", @@ -160,7 +157,6 @@ "metadata": [ {} ], - "resources_monitoring": [], "token": true }, "before_sensitive": false, @@ -169,7 +165,6 @@ "metadata": [ {} ], - "resources_monitoring": [], "token": true } } @@ -431,7 +426,7 @@ ] } ], - "timestamp": "2025-01-29T22:48:14Z", + "timestamp": "2025-02-06T07:28:26Z", "applyable": true, "complete": true, "errored": false diff --git a/provisioner/terraform/testdata/resource-metadata-duplicate/resource-metadata-duplicate.tfstate.json b/provisioner/terraform/testdata/resource-metadata-duplicate/resource-metadata-duplicate.tfstate.json index 82eed92f36..32e8bcbdcc 100644 --- a/provisioner/terraform/testdata/resource-metadata-duplicate/resource-metadata-duplicate.tfstate.json +++ b/provisioner/terraform/testdata/resource-metadata-duplicate/resource-metadata-duplicate.tfstate.json @@ -26,7 +26,7 @@ } ], "env": null, - "id": "b3257d67-247c-4fc6-92a8-fc997501a0e1", + "id": "233e324a-4c1b-490b-9439-ed996b476cf5", "init_script": "", "metadata": [ { @@ -41,11 +41,10 @@ "motd_file": null, "order": null, "os": "linux", - "resources_monitoring": [], "shutdown_script": null, "startup_script": null, "startup_script_behavior": "non-blocking", - "token": "ac3563fb-3069-4919-b076-6687c765772b", + "token": "1f12022b-bcef-4bfd-b07d-d3ad488da0a2", "troubleshooting_url": null }, "sensitive_values": { @@ -55,7 +54,6 @@ "metadata": [ {} ], - "resources_monitoring": [], "token": true } }, @@ -70,7 +68,7 @@ "daily_cost": 29, "hide": true, "icon": "/icon/server.svg", - "id": "fcd81afa-64ad-45e3-b000-31d1b19df922", + "id": "63496838-bc47-449a-b1fe-0135ad8e1759", "item": [ { "is_null": false, @@ -85,7 +83,7 @@ "value": "" } ], - "resource_id": "8033209281634385030" + "resource_id": "1166169950293623087" }, "sensitive_values": { "item": [ @@ -109,7 +107,7 @@ "daily_cost": 20, "hide": true, "icon": "/icon/server.svg", - "id": "186819f3-a92f-4785-9ee4-d79f57711f63", + "id": "fc15b16c-6a70-4875-8a21-cca3aa9ec21a", "item": [ { "is_null": false, @@ -118,7 +116,7 @@ "value": "world" } ], - "resource_id": "8033209281634385030" + "resource_id": "1166169950293623087" }, "sensitive_values": { "item": [ @@ -138,7 +136,7 @@ "provider_name": "registry.terraform.io/hashicorp/null", "schema_version": 0, "values": { - "id": "8033209281634385030", + "id": "1166169950293623087", "triggers": null }, "sensitive_values": {}, diff --git a/provisioner/terraform/testdata/resource-metadata/resource-metadata.tfplan.json b/provisioner/terraform/testdata/resource-metadata/resource-metadata.tfplan.json index fd252c9adb..6377191478 100644 --- a/provisioner/terraform/testdata/resource-metadata/resource-metadata.tfplan.json +++ b/provisioner/terraform/testdata/resource-metadata/resource-metadata.tfplan.json @@ -30,7 +30,6 @@ "motd_file": null, "order": null, "os": "linux", - "resources_monitoring": [], "shutdown_script": null, "startup_script": null, "startup_script_behavior": "non-blocking", @@ -41,7 +40,6 @@ "metadata": [ {} ], - "resources_monitoring": [], "token": true } }, @@ -134,7 +132,6 @@ "motd_file": null, "order": null, "os": "linux", - "resources_monitoring": [], "shutdown_script": null, "startup_script": null, "startup_script_behavior": "non-blocking", @@ -147,7 +144,6 @@ "metadata": [ {} ], - "resources_monitoring": [], "token": true }, "before_sensitive": false, @@ -156,7 +152,6 @@ "metadata": [ {} ], - "resources_monitoring": [], "token": true } } @@ -383,7 +378,7 @@ ] } ], - "timestamp": "2025-01-29T22:48:12Z", + "timestamp": "2025-02-06T07:28:26Z", "applyable": true, "complete": true, "errored": false diff --git a/provisioner/terraform/testdata/resource-metadata/resource-metadata.tfstate.json b/provisioner/terraform/testdata/resource-metadata/resource-metadata.tfstate.json index a0838cc561..96667cb142 100644 --- a/provisioner/terraform/testdata/resource-metadata/resource-metadata.tfstate.json +++ b/provisioner/terraform/testdata/resource-metadata/resource-metadata.tfstate.json @@ -26,7 +26,7 @@ } ], "env": null, - "id": "066d91d2-860a-4a44-9443-9eaf9315729b", + "id": "9ca8533d-2f72-497c-8ecc-b4ce7ed7c00e", "init_script": "", "metadata": [ { @@ -41,11 +41,10 @@ "motd_file": null, "order": null, "os": "linux", - "resources_monitoring": [], "shutdown_script": null, "startup_script": null, "startup_script_behavior": "non-blocking", - "token": "9b6cc6dd-0e02-489f-b651-7a01804c406f", + "token": "d86a54a7-bd70-4d8d-90b1-10fde02f5bcf", "troubleshooting_url": null }, "sensitive_values": { @@ -55,7 +54,6 @@ "metadata": [ {} ], - "resources_monitoring": [], "token": true } }, @@ -70,7 +68,7 @@ "daily_cost": 29, "hide": true, "icon": "/icon/server.svg", - "id": "fa791d91-9718-420e-9fa8-7a02e7af1563", + "id": "5dfed2fe-d39c-4bf1-9234-d153d43c205f", "item": [ { "is_null": false, @@ -97,7 +95,7 @@ "value": "squirrel" } ], - "resource_id": "2710066198333857753" + "resource_id": "3677336873960413975" }, "sensitive_values": { "item": [ @@ -120,7 +118,7 @@ "provider_name": "registry.terraform.io/hashicorp/null", "schema_version": 0, "values": { - "id": "2710066198333857753", + "id": "3677336873960413975", "triggers": null }, "sensitive_values": {}, diff --git a/provisioner/terraform/testdata/rich-parameters-order/rich-parameters-order.tfplan.json b/provisioner/terraform/testdata/rich-parameters-order/rich-parameters-order.tfplan.json index 95fb198c1e..06fb504fb5 100644 --- a/provisioner/terraform/testdata/rich-parameters-order/rich-parameters-order.tfplan.json +++ b/provisioner/terraform/testdata/rich-parameters-order/rich-parameters-order.tfplan.json @@ -21,7 +21,6 @@ "motd_file": null, "order": null, "os": "windows", - "resources_monitoring": [], "shutdown_script": null, "startup_script": null, "startup_script_behavior": "non-blocking", @@ -30,7 +29,6 @@ "sensitive_values": { "display_apps": [], "metadata": [], - "resources_monitoring": [], "token": true } }, @@ -71,7 +69,6 @@ "motd_file": null, "order": null, "os": "windows", - "resources_monitoring": [], "shutdown_script": null, "startup_script": null, "startup_script_behavior": "non-blocking", @@ -82,14 +79,12 @@ "id": true, "init_script": true, "metadata": [], - "resources_monitoring": [], "token": true }, "before_sensitive": false, "after_sensitive": { "display_apps": [], "metadata": [], - "resources_monitoring": [], "token": true } } @@ -135,7 +130,7 @@ "display_name": null, "ephemeral": false, "icon": null, - "id": "e8485920-025a-4c2c-b018-722f61b64347", + "id": "678e4104-cd99-40d4-86e0-5244028860de", "mutable": false, "name": "Example", "option": null, @@ -162,7 +157,7 @@ "display_name": null, "ephemeral": false, "icon": null, - "id": "6156655b-f893-4eba-914e-e87414f4bf7e", + "id": "22b1d84d-7c1d-47d0-b789-6a8d07ea926d", "mutable": false, "name": "Sample", "option": null, @@ -268,7 +263,7 @@ ] } }, - "timestamp": "2025-01-29T22:48:18Z", + "timestamp": "2025-02-06T07:28:26Z", "applyable": true, "complete": true, "errored": false diff --git a/provisioner/terraform/testdata/rich-parameters-order/rich-parameters-order.tfstate.json b/provisioner/terraform/testdata/rich-parameters-order/rich-parameters-order.tfstate.json index 2cc48c837a..9c68c8d660 100644 --- a/provisioner/terraform/testdata/rich-parameters-order/rich-parameters-order.tfstate.json +++ b/provisioner/terraform/testdata/rich-parameters-order/rich-parameters-order.tfstate.json @@ -17,7 +17,7 @@ "display_name": null, "ephemeral": false, "icon": null, - "id": "4b774ce8-1e9f-4721-8a14-05efd3eb2dab", + "id": "b8460866-87f5-4e31-824e-6d0c48dbcc79", "mutable": false, "name": "Example", "option": null, @@ -44,7 +44,7 @@ "display_name": null, "ephemeral": false, "icon": null, - "id": "447ae720-c046-452e-8d2c-1b5d4060b798", + "id": "61920fa1-8186-40a6-9e0f-8cbca91985a9", "mutable": false, "name": "Sample", "option": null, @@ -80,17 +80,16 @@ } ], "env": null, - "id": "b8d637c2-a19c-479c-b3e2-374f15ce37c3", + "id": "adb01e5b-ebc5-488a-ae46-79d99bd6310f", "init_script": "", "metadata": [], "motd_file": null, "order": null, "os": "windows", - "resources_monitoring": [], "shutdown_script": null, "startup_script": null, "startup_script_behavior": "non-blocking", - "token": "52ce8a0d-12c9-40b5-9f86-dc6240b98d5f", + "token": "ca3400c8-5759-4ffe-b335-368737690d93", "troubleshooting_url": null }, "sensitive_values": { @@ -98,7 +97,6 @@ {} ], "metadata": [], - "resources_monitoring": [], "token": true } }, @@ -110,7 +108,7 @@ "provider_name": "registry.terraform.io/hashicorp/null", "schema_version": 0, "values": { - "id": "769369130050936586", + "id": "7469573159164897550", "triggers": null }, "sensitive_values": {}, diff --git a/provisioner/terraform/testdata/rich-parameters-validation/rich-parameters-validation.tfplan.json b/provisioner/terraform/testdata/rich-parameters-validation/rich-parameters-validation.tfplan.json index 691c168418..6d98cba649 100644 --- a/provisioner/terraform/testdata/rich-parameters-validation/rich-parameters-validation.tfplan.json +++ b/provisioner/terraform/testdata/rich-parameters-validation/rich-parameters-validation.tfplan.json @@ -21,7 +21,6 @@ "motd_file": null, "order": null, "os": "windows", - "resources_monitoring": [], "shutdown_script": null, "startup_script": null, "startup_script_behavior": "non-blocking", @@ -30,7 +29,6 @@ "sensitive_values": { "display_apps": [], "metadata": [], - "resources_monitoring": [], "token": true } }, @@ -71,7 +69,6 @@ "motd_file": null, "order": null, "os": "windows", - "resources_monitoring": [], "shutdown_script": null, "startup_script": null, "startup_script_behavior": "non-blocking", @@ -82,14 +79,12 @@ "id": true, "init_script": true, "metadata": [], - "resources_monitoring": [], "token": true }, "before_sensitive": false, "after_sensitive": { "display_apps": [], "metadata": [], - "resources_monitoring": [], "token": true } } @@ -135,7 +130,7 @@ "display_name": null, "ephemeral": true, "icon": null, - "id": "30116bcb-f109-4807-be06-666a60b6cbb2", + "id": "0db9ef7c-02fe-43cf-8654-1bedc26f9fcb", "mutable": true, "name": "number_example", "option": null, @@ -162,7 +157,7 @@ "display_name": null, "ephemeral": false, "icon": null, - "id": "755395f4-d163-4b90-a8f4-e7ae24e17dd0", + "id": "ef93145f-722a-4c24-8e7f-f94fc8327188", "mutable": false, "name": "number_example_max", "option": null, @@ -201,7 +196,7 @@ "display_name": null, "ephemeral": false, "icon": null, - "id": "dec9fa47-a252-4eb7-868b-10d0fe7bad57", + "id": "4561c132-1925-4612-8456-7ddbc8d1a1a8", "mutable": false, "name": "number_example_max_zero", "option": null, @@ -240,7 +235,7 @@ "display_name": null, "ephemeral": false, "icon": null, - "id": "57107f82-107b-484d-8491-0787f051dca7", + "id": "b102d78f-a86b-4457-a643-505a59710008", "mutable": false, "name": "number_example_min", "option": null, @@ -279,7 +274,7 @@ "display_name": null, "ephemeral": false, "icon": null, - "id": "c21a61f4-26e0-49bb-99c8-56240433c21b", + "id": "ad756fd0-ac71-4be8-87a3-ca7462d44a6b", "mutable": false, "name": "number_example_min_max", "option": null, @@ -318,7 +313,7 @@ "display_name": null, "ephemeral": false, "icon": null, - "id": "4894f5cc-f4e6-4a86-bdfa-36c9d3f8f1a3", + "id": "918bb8b5-ef2f-4bf6-9c65-bee901131d5d", "mutable": false, "name": "number_example_min_zero", "option": null, @@ -550,7 +545,7 @@ ] } }, - "timestamp": "2025-01-29T22:48:20Z", + "timestamp": "2025-02-06T07:28:26Z", "applyable": true, "complete": true, "errored": false diff --git a/provisioner/terraform/testdata/rich-parameters-validation/rich-parameters-validation.tfstate.json b/provisioner/terraform/testdata/rich-parameters-validation/rich-parameters-validation.tfstate.json index 1ad55291de..f127b8e73b 100644 --- a/provisioner/terraform/testdata/rich-parameters-validation/rich-parameters-validation.tfstate.json +++ b/provisioner/terraform/testdata/rich-parameters-validation/rich-parameters-validation.tfstate.json @@ -17,7 +17,7 @@ "display_name": null, "ephemeral": true, "icon": null, - "id": "9b5bb411-bfe5-471a-8f2d-9fcc8c17b616", + "id": "56a3b2a7-479b-41f5-a99b-f51a850ac8c2", "mutable": true, "name": "number_example", "option": null, @@ -44,7 +44,7 @@ "display_name": null, "ephemeral": false, "icon": null, - "id": "2ebaf3ec-9272-48f4-981d-09485ae7960e", + "id": "bf19a33e-4b16-4b86-bbf8-cb76c952ce71", "mutable": false, "name": "number_example_max", "option": null, @@ -83,7 +83,7 @@ "display_name": null, "ephemeral": false, "icon": null, - "id": "d05a833c-d0ca-4f22-8b80-40851c111b61", + "id": "d25e4b3a-f630-4da0-840f-1b823e336155", "mutable": false, "name": "number_example_max_zero", "option": null, @@ -122,7 +122,7 @@ "display_name": null, "ephemeral": false, "icon": null, - "id": "de0cd614-72b3-4404-80a1-e3c780823fc9", + "id": "6fde8249-13f5-4c8e-b9cb-2a1db8d3ff11", "mutable": false, "name": "number_example_min", "option": null, @@ -161,7 +161,7 @@ "display_name": null, "ephemeral": false, "icon": null, - "id": "66eae3e1-9bb5-44f8-8f15-2b400628d0e7", + "id": "8a21c092-2d4a-412a-a0bb-61f20b67b9b0", "mutable": false, "name": "number_example_min_max", "option": null, @@ -200,7 +200,7 @@ "display_name": null, "ephemeral": false, "icon": null, - "id": "d24d37f9-5a91-4c7f-9915-bfc10f6d353d", + "id": "916a9318-6082-4ace-a196-20d78621aa9a", "mutable": false, "name": "number_example_min_zero", "option": null, @@ -248,17 +248,16 @@ } ], "env": null, - "id": "81170f06-8f49-43fb-998f-dc505a29632c", + "id": "327d3049-be5e-4a37-98f1-b6591fb86104", "init_script": "", "metadata": [], "motd_file": null, "order": null, "os": "windows", - "resources_monitoring": [], "shutdown_script": null, "startup_script": null, "startup_script_behavior": "non-blocking", - "token": "f8433068-1acc-4225-94c0-725f86cdc002", + "token": "0de65cf4-bb12-4daa-b75b-422eb9c6f3b1", "troubleshooting_url": null }, "sensitive_values": { @@ -266,7 +265,6 @@ {} ], "metadata": [], - "resources_monitoring": [], "token": true } }, @@ -278,7 +276,7 @@ "provider_name": "registry.terraform.io/hashicorp/null", "schema_version": 0, "values": { - "id": "3641782836917385715", + "id": "4847948730203176710", "triggers": null }, "sensitive_values": {}, diff --git a/provisioner/terraform/testdata/rich-parameters/rich-parameters.tfplan.json b/provisioner/terraform/testdata/rich-parameters/rich-parameters.tfplan.json index 387be7249d..068cc549a7 100644 --- a/provisioner/terraform/testdata/rich-parameters/rich-parameters.tfplan.json +++ b/provisioner/terraform/testdata/rich-parameters/rich-parameters.tfplan.json @@ -21,7 +21,6 @@ "motd_file": null, "order": null, "os": "windows", - "resources_monitoring": [], "shutdown_script": null, "startup_script": null, "startup_script_behavior": "non-blocking", @@ -30,7 +29,6 @@ "sensitive_values": { "display_apps": [], "metadata": [], - "resources_monitoring": [], "token": true } }, @@ -71,7 +69,6 @@ "motd_file": null, "order": null, "os": "windows", - "resources_monitoring": [], "shutdown_script": null, "startup_script": null, "startup_script_behavior": "non-blocking", @@ -82,14 +79,12 @@ "id": true, "init_script": true, "metadata": [], - "resources_monitoring": [], "token": true }, "before_sensitive": false, "after_sensitive": { "display_apps": [], "metadata": [], - "resources_monitoring": [], "token": true } } @@ -135,7 +130,7 @@ "display_name": null, "ephemeral": false, "icon": null, - "id": "72f11f9b-8c7f-4e4a-a207-f080b114862b", + "id": "18a679bf-c1f9-4056-b5ec-1401587efcaf", "mutable": false, "name": "Example", "option": [ @@ -179,7 +174,7 @@ "display_name": null, "ephemeral": false, "icon": null, - "id": "b154b8a7-d31f-46f7-b876-e5bfdf50950c", + "id": "a15920af-2f38-4cba-a26f-97492b58d853", "mutable": false, "name": "number_example", "option": null, @@ -206,7 +201,7 @@ "display_name": null, "ephemeral": false, "icon": null, - "id": "8199f88e-8b73-4385-bbb2-315182f753ef", + "id": "7fdb781f-ad42-4cbf-88f2-b8014a4f1b9e", "mutable": false, "name": "number_example_max_zero", "option": null, @@ -245,7 +240,7 @@ "display_name": null, "ephemeral": false, "icon": null, - "id": "110c995d-46d7-4277-8f57-a3d3d42733c3", + "id": "b1284628-4b51-4fb5-9bd6-d4b46895e73a", "mutable": false, "name": "number_example_min_max", "option": null, @@ -284,7 +279,7 @@ "display_name": null, "ephemeral": false, "icon": null, - "id": "e7a1f991-48a8-44c5-8a5c-597db8539cb7", + "id": "24062c56-f326-4bab-893f-eb6bd99d9d0e", "mutable": false, "name": "number_example_min_zero", "option": null, @@ -323,7 +318,7 @@ "display_name": null, "ephemeral": false, "icon": null, - "id": "27d12cdf-da7e-466b-907a-4824920305da", + "id": "ea1e26d1-dd66-41af-b1f9-b50220db3dc6", "mutable": false, "name": "Sample", "option": null, @@ -354,7 +349,7 @@ "display_name": null, "ephemeral": false, "icon": null, - "id": "1242389a-5061-482a-8274-410174fb3fc0", + "id": "91236b71-4966-4cdc-8d3c-39d706180779", "mutable": true, "name": "First parameter from module", "option": null, @@ -381,7 +376,7 @@ "display_name": null, "ephemeral": false, "icon": null, - "id": "72418f70-4e3c-400f-9a7d-bf3467598deb", + "id": "6ae5570d-ef16-4bdf-a46b-0025b197f2fa", "mutable": true, "name": "Second parameter from module", "option": null, @@ -413,7 +408,7 @@ "display_name": null, "ephemeral": false, "icon": null, - "id": "9b4b60d8-21bb-4d52-910a-536355e9a85f", + "id": "7b0cbc7c-c11b-4902-98d4-4b4354978e05", "mutable": true, "name": "First parameter from child module", "option": null, @@ -440,7 +435,7 @@ "display_name": null, "ephemeral": false, "icon": null, - "id": "4edca123-07bf-4409-ad40-ed26f93beb5f", + "id": "2b4e1132-77ef-4871-9ffe-f51d188d9821", "mutable": true, "name": "Second parameter from child module", "option": null, @@ -793,7 +788,7 @@ } } }, - "timestamp": "2025-01-29T22:48:16Z", + "timestamp": "2025-02-06T07:28:26Z", "applyable": true, "complete": true, "errored": false diff --git a/provisioner/terraform/testdata/rich-parameters/rich-parameters.tfstate.json b/provisioner/terraform/testdata/rich-parameters/rich-parameters.tfstate.json index 0c8abfa386..688552edfd 100644 --- a/provisioner/terraform/testdata/rich-parameters/rich-parameters.tfstate.json +++ b/provisioner/terraform/testdata/rich-parameters/rich-parameters.tfstate.json @@ -17,7 +17,7 @@ "display_name": null, "ephemeral": false, "icon": null, - "id": "7298c15e-11c8-4a9e-a2ef-044dbc44d519", + "id": "4d2ee311-d55d-4222-b78c-8573531f141a", "mutable": false, "name": "Example", "option": [ @@ -61,7 +61,7 @@ "display_name": null, "ephemeral": false, "icon": null, - "id": "a0dda000-20cb-42a7-9f83-1a1de0876e48", + "id": "558025fd-1456-4f1f-b876-f4466e1df6a6", "mutable": false, "name": "number_example", "option": null, @@ -88,7 +88,7 @@ "display_name": null, "ephemeral": false, "icon": null, - "id": "82a297b9-bbcb-4807-9de3-7217953dc6b0", + "id": "0b65aa73-27c7-47d9-9281-7604545c3f6d", "mutable": false, "name": "number_example_max_zero", "option": null, @@ -127,7 +127,7 @@ "display_name": null, "ephemeral": false, "icon": null, - "id": "ae1c376b-e28b-456a-b36e-125b3bc6d938", + "id": "4d817bbd-d8d7-413b-b7d9-5bffdb3b6f15", "mutable": false, "name": "number_example_min_max", "option": null, @@ -166,7 +166,7 @@ "display_name": null, "ephemeral": false, "icon": null, - "id": "57573ac3-5610-4887-b269-376071867eb5", + "id": "654efe81-8678-4425-b19e-0436cc4a460e", "mutable": false, "name": "number_example_min_zero", "option": null, @@ -205,7 +205,7 @@ "display_name": null, "ephemeral": false, "icon": null, - "id": "0e08645d-0105-49ef-b278-26cdc30a826c", + "id": "8e6d963f-186c-4eea-863e-e6f492d09b98", "mutable": false, "name": "Sample", "option": null, @@ -241,17 +241,16 @@ } ], "env": null, - "id": "c5c402bd-215b-487f-862f-eca25fe88a72", + "id": "0832e1d0-6ee5-4f00-89c2-ead6d781734d", "init_script": "", "metadata": [], "motd_file": null, "order": null, "os": "windows", - "resources_monitoring": [], "shutdown_script": null, "startup_script": null, "startup_script_behavior": "non-blocking", - "token": "b70d10f3-90bc-4abd-8cd9-b11da843954a", + "token": "e51c05f1-e69c-4489-951a-b18cc28dfc8e", "troubleshooting_url": null }, "sensitive_values": { @@ -259,7 +258,6 @@ {} ], "metadata": [], - "resources_monitoring": [], "token": true } }, @@ -271,7 +269,7 @@ "provider_name": "registry.terraform.io/hashicorp/null", "schema_version": 0, "values": { - "id": "8544034527967282476", + "id": "7215235512764323226", "triggers": null }, "sensitive_values": {}, @@ -296,7 +294,7 @@ "display_name": null, "ephemeral": false, "icon": null, - "id": "68ae438d-7194-4f5b-adeb-9c74059d9888", + "id": "c3ae0239-9c8d-4d71-b7cf-858f7f93da00", "mutable": true, "name": "First parameter from module", "option": null, @@ -323,7 +321,7 @@ "display_name": null, "ephemeral": false, "icon": null, - "id": "32f0f7f3-26a5-4023-a4e6-d9436cfe8cb4", + "id": "5fdf8d8d-b4b3-4703-9d37-e235a337b0f6", "mutable": true, "name": "Second parameter from module", "option": null, @@ -355,7 +353,7 @@ "display_name": null, "ephemeral": false, "icon": null, - "id": "5235636a-3319-47ae-8879-b62f9ee9c5aa", + "id": "3903f4a3-89e8-47be-ad6d-7d1953f73e9d", "mutable": true, "name": "First parameter from child module", "option": null, @@ -382,7 +380,7 @@ "display_name": null, "ephemeral": false, "icon": null, - "id": "54fa94ff-3048-457d-8de2-c182f6287c8d", + "id": "06e55c81-1797-4240-9887-a0ad9fee1ee3", "mutable": true, "name": "Second parameter from child module", "option": null,