This repository was archived by the owner on May 15, 2025. It is now read-only.
File tree Expand file tree Collapse file tree 1 file changed +16
-19
lines changed Expand file tree Collapse file tree 1 file changed +16
-19
lines changed Original file line number Diff line number Diff line change @@ -76,27 +76,22 @@ export const execContainer = async (
76
76
} ;
77
77
} ;
78
78
79
+ type TerraformStateResource = {
80
+ type : string ;
81
+ name : string ;
82
+ provider : string ;
83
+ instances : [ { attributes : Record < string , any > } ] ;
84
+ } ;
85
+
79
86
export interface TerraformState {
80
87
outputs : {
81
88
[ key : string ] : {
82
89
type : string ;
83
90
value : any ;
84
91
} ;
85
- }
86
- resources : [
87
- {
88
- type : string ;
89
- name : string ;
90
- provider : string ;
91
- instances : [
92
- {
93
- attributes : {
94
- [ key : string ] : any ;
95
- } ;
96
- } ,
97
- ] ;
98
- } ,
99
- ] ;
92
+ } ;
93
+
94
+ resources : [ TerraformStateResource , ...TerraformStateResource [ ] ] ;
100
95
}
101
96
102
97
export interface CoderScriptAttributes {
@@ -168,9 +163,11 @@ export const testRequiredVariables = (
168
163
// runTerraformApply runs terraform apply in the given directory
169
164
// with the given variables. It is fine to run in parallel with
170
165
// other instances of this function, as it uses a random state file.
171
- export const runTerraformApply = async (
166
+ export const runTerraformApply = async <
167
+ TVars extends Readonly < Record < string , string > > ,
168
+ > (
172
169
dir : string ,
173
- vars : Record < string , string > ,
170
+ vars : TVars ,
174
171
) : Promise < TerraformState > => {
175
172
const stateFile = `${ dir } /${ crypto . randomUUID ( ) } .tfstate` ;
176
173
const env = { } ;
@@ -221,5 +218,5 @@ export const createJSONResponse = (obj: object, statusCode = 200): Response => {
221
218
"Content-Type" : "application/json" ,
222
219
} ,
223
220
status : statusCode ,
224
- } )
225
- }
221
+ } ) ;
222
+ } ;
You can’t perform that action at this time.
0 commit comments