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
package main
import "fmt"
type TaskDefinition struct {
Name string
Image string
CPU string
Memory string
}
type ECSService struct {
Name string
Tasks int
}
func deployService(service ECSService, task TaskDefinition) {
fmt.Println("Deploying ECS Service:", service.Name)
fmt.Println("Running Tasks:", service.Tasks)
fmt.Println("Container Image:", task.Image)
fmt.Println("CPU:", task.CPU)
fmt.Println("Memory:", task.Memory)
}
func main() {
task := TaskDefinition{
Name: "backend-task",
Image: "my-go-api:v1",
CPU: "512 units",
Memory: "1GB",
}
service := ECSService{
Name: "api-service",
Tasks: 3,
}
deployService(service, task)
}Coding works best on desktop or with an external keyboard.