質問編集履歴

1

Taskdef.jsonとappsepcの追加

2022/07/27 10:40

投稿

Nero1129
Nero1129

スコア130

test CHANGED
File without changes
test CHANGED
@@ -13,4 +13,63 @@
13
13
  基本的に管理はTerraformで行っております。
14
14
  AppSpecでTerraformで反映させたタスク定義を元に、新たなタスク定義を上書きするなどの方法があれば教えていただきたいです。
15
15
 
16
+ ### コード
17
+ ```taskdef.json
18
+ {
19
+ "executionRoleArn": "省略",
20
+ "containerDefinitions": [
21
+ {
22
+ "logConfiguration": {
23
+ "logDriver": "awslogs",
24
+ "options": {
25
+ "awslogs-group": "ecs",
26
+ "awslogs-region": "ap-northeast-1",
27
+ "awslogs-stream-prefix": "ecs"
28
+ }
29
+ },
30
+ "portMappings": [省略],
31
+ "command": [省略],
32
+ "cpu": 省略,
33
+ "environment": [省略],
34
+ "mountPoints": [],
35
+ "secrets": [
36
+ {
37
+ "valueFrom": "arn:aws:ssm:ap-northeast-1:9999999999999:parameter/DB_URL",
38
+ "name": "DATABASE_HOST"
39
+ },
40
+ {
41
+ "valueFrom": "arn:aws:ssm:ap-northeast-1:9999999999999:parameter/DB_PASSWORD",
42
+ "name": "DATABASE_PASSWORD"
43
+ },
44
+ {
45
+ "valueFrom": "arn:aws:ssm:ap-northeast-1:9999999999999:parameter/DB_USERNAME",
46
+ "name": "DATABASE_USER"
47
+ }
48
+ ],
49
+ "memory": 省略,
50
+ "volumesFrom": [],
51
+ "image": "<IMAGE1_NAME>",
52
+ "name": "省略"
53
+ }
54
+ ],
55
+ "placementConstraints": [],
56
+ "memory": "省略",
57
+ "taskRoleArn": "省略",
58
+ "family": "default",
59
+ "networkMode": "awsvpc",
60
+ "cpu": "省略",
61
+ "volumes": []
62
+ }
63
+ ```
16
64
 
65
+ ```appspec.yml
66
+ version: 0.0
67
+ Resources:
68
+ - TargetService:
69
+ Type: AWS::ECS::Service
70
+ Properties:
71
+ TaskDefinition: <TASK_DEFINITION>
72
+ LoadBalancerInfo:
73
+ ContainerName: "省略"
74
+ ContainerPort: 80
75
+ ```