Mode:
Duration:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
package main
import "fmt"
type TerraformResource struct {
Name string
Type string
}
type TerraformState struct {
Resources int
}
type Module struct {
Name string
}
func applyInfrastructure(resource TerraformResource, state TerraformState, module Module) {
fmt.Println("Creating Resource:", resource.Name)
fmt.Println("Resource Type:", resource.Type)
fmt.Println("State Tracking Resources:", state.Resources)
fmt.Println("Using Module:", module.Name)
}
func main() {
resource := TerraformResource{
Name: "production-server",
Type: "AWS EC2",
}
state := TerraformState{
Resources: 5,
}
module := Module{
Name: "network-module",
}
applyInfrastructure(resource, state, module)
}Coding works best on desktop or with an external keyboard.