You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: examples/templates/ecs-container/README.md
+2-72Lines changed: 2 additions & 72 deletions
Original file line number
Diff line number
Diff line change
@@ -6,86 +6,16 @@ tags: [cloud, aws]
6
6
7
7
# aws-ecs
8
8
9
-
This is a sample template for running a Coder workspace on ECS.
10
-
11
-
## Required permissions / policy
12
-
13
-
The following sample policy allows Coder to create EC2 instances and modify
14
-
instances provisioned by Coder:
15
-
16
-
```json
17
-
{
18
-
"Version": "2012-10-17",
19
-
"Statement": [
20
-
{
21
-
"Sid": "VisualEditor0",
22
-
"Effect": "Allow",
23
-
"Action": [
24
-
"ec2:GetDefaultCreditSpecification",
25
-
"ec2:DescribeIamInstanceProfileAssociations",
26
-
"ec2:DescribeTags",
27
-
"ec2:CreateTags",
28
-
"ec2:RunInstances",
29
-
"ec2:DescribeInstanceCreditSpecifications",
30
-
"ec2:DescribeImages",
31
-
"ec2:ModifyDefaultCreditSpecification",
32
-
"ec2:DescribeVolumes"
33
-
],
34
-
"Resource": "*"
35
-
},
36
-
{
37
-
"Sid": "CoderResources",
38
-
"Effect": "Allow",
39
-
"Action": [
40
-
"ec2:DescribeInstances",
41
-
"ec2:DescribeInstanceAttribute",
42
-
"ec2:UnmonitorInstances",
43
-
"ec2:TerminateInstances",
44
-
"ec2:StartInstances",
45
-
"ec2:StopInstances",
46
-
"ec2:DeleteTags",
47
-
"ec2:MonitorInstances",
48
-
"ec2:CreateTags",
49
-
"ec2:RunInstances",
50
-
"ec2:ModifyInstanceAttribute",
51
-
"ec2:ModifyInstanceCreditSpecification"
52
-
],
53
-
"Resource": "arn:aws:ec2:*:*:instance/*",
54
-
"Condition": {
55
-
"StringEquals": {
56
-
"aws:ResourceTag/Coder_Provisioned": "true"
57
-
}
58
-
}
59
-
}
60
-
]
61
-
}
62
-
```
63
-
64
-
Additionally, the `AmazonEC2ContainerServiceforEC2Role` managed policy should be
65
-
attached to the container instance IAM role, otherwise you will receive an error
66
-
when creating the ECS cluster.
67
-
68
-
This is represented as the `iam_instance_role` argument of the `launch_template`
69
-
resource. Please see the [AWS documentation for configuring this instance role](https://docs.aws.amazon.com/AmazonECS/latest/developerguide/instance_IAM_role.html#instance-iam-role-verify).
9
+
This is a sample template for running a Coder workspace on ECS. It assumes there
10
+
is a pre-existing ECS cluster with EC2-based compute to host the workspace.
70
11
71
12
## Architecture
72
13
73
14
This workspace is built using the following AWS resources:
74
15
75
-
- Launch template - this defines the EC2 instance(s) to host the container
76
-
- Auto-scaling group - EC2 auto-scaling group configuration
77
-
- ECS cluster - logical grouping of containers to be run in ECS
78
-
- Capacity provider - ECS-specific resource that ties in the auto-scaling group
79
16
- Task definition - the container definition, includes the image, command, volume(s)
80
17
- ECS service - manages the task definition
81
18
82
-
## User data
83
-
84
-
This template includes a two-part user data configuration, represented as the
85
-
`cloudinit_config` data source. There is an ECS-specific user data definition,
86
-
which is required for the EC2 instances to join the ECS cluster. Additionally, the
87
-
Coder user data (defined in the `locals` block) is needed to stop/start the instance(s).
88
-
89
19
## code-server
90
20
91
21
`code-server` is installed via the `startup_script` argument in the `coder_agent`
0 commit comments