Skip to content

Commit cc0b04b

Browse files
authored
chore: add integration test for VolumeConfiguration property (#722)
* Add integration test for VolumeConfiguration property * Update to include run-task-assign-public-IP
1 parent c65f737 commit cc0b04b

File tree

4 files changed

+135
-0
lines changed

4 files changed

+135
-0
lines changed

.github/workflows/test-workflow.yml

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -62,3 +62,29 @@ jobs:
6262
cluster: github-actions-deploy-task-def-integ-test
6363
wait-for-service-stability: true
6464
enable-ecs-managed-tags: true
65+
66+
- name: Deploy Amazon ECS task definition with ECS Service VolumeConfiguration
67+
uses: aws-actions/amazon-ecs-deploy-task-definition@0bad458c6aa901707e510cd05b797b05da075633
68+
with:
69+
task-definition: task-definition-volume-configuration.json
70+
service: github-actions-deploy-task-def-integ-test
71+
cluster: github-actions-deploy-task-def-integ-test
72+
wait-for-service-stability: true
73+
enable-ecs-managed-tags: true
74+
service-managed-ebs-volume-name: "ebs1"
75+
service-managed-ebs-volume: '{"filesystemType":"xfs","roleArn":"arn:aws:iam::${{secrets.AWS_ACCOUNT_ID}}:role/GitHubActionsVolumeConfigurationsEBSRole","encrypted":false,"sizeInGiB":30}'
76+
77+
- name: Deploy Amazon ECS task definition with one-off task and VolumeConfiguration
78+
uses: aws-actions/amazon-ecs-deploy-task-definition@0bad458c6aa901707e510cd05b797b05da075633
79+
with:
80+
task-definition: task-definition-volume-configuration.json
81+
cluster: github-actions-deploy-task-def-integ-test
82+
run-task: true
83+
enable-ecs-managed-tags: true
84+
run-task-subnets: subnet-e5604fce, subnet-fe9355b4, subnet-c49431bc, subnet-392f9b64
85+
run-task-security-groups: sg-067ebcde49c0f3ad8
86+
run-task-assign-public-IP: ENABLED
87+
run-task-managed-ebs-volume-name: "ebs1"
88+
run-task-managed-ebs-volume: '{"filesystemType":"xfs","roleArn":"arn:aws:iam::${{secrets.AWS_ACCOUNT_ID}}:role/GitHubActionsVolumeConfigurationsEBSRole","encrypted":false,"sizeInGiB":30}'
89+
run-task-started-by: "GitHub-Actions-EBS-Test"
90+
wait-for-task-stopped: true
Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
{
2+
"containerDefinitions": [
3+
{
4+
"memory": 32,
5+
"essential": true,
6+
"entryPoint": ["ping"],
7+
"name": "alpine_ping",
8+
"readonlyRootFilesystem": true,
9+
"image": "alpine:3.4",
10+
"command": [
11+
"-c",
12+
"4",
13+
"example.com"
14+
],
15+
"cpu": 16,
16+
"mountPoints": [
17+
{
18+
"sourceVolume": "ebs1",
19+
"containerPath": "/var/lib",
20+
"readOnly": false
21+
}
22+
]
23+
}
24+
],
25+
"memory": "512",
26+
"volumes": [
27+
{
28+
"name": "ebs1",
29+
"configuredAtLaunch": true
30+
}
31+
],
32+
"family": "github-actions-deploy-task-def-integ-tests-run-task-volume-config",
33+
"requiresCompatibilities": [
34+
"FARGATE"
35+
],
36+
"networkMode": "awsvpc",
37+
"cpu": "256"
38+
}
Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
1+
{
2+
"containerDefinitions": [
3+
{
4+
"entryPoint": [
5+
"sh",
6+
"-c"
7+
],
8+
"portMappings": [
9+
{
10+
"hostPort": 80,
11+
"protocol": "tcp",
12+
"containerPort": 80
13+
}
14+
],
15+
"command": [
16+
"/bin/sh -c \"echo '<html> <head> <title>Amazon ECS Sample App</title> <style>body {margin-top: 40px; background-color: #333;} </style> </head><body> <div style=color:white;text-align:center> <h1>Amazon ECS Sample App</h1> <h2>Congratulations!</h2> <p>Your application is now running on a container in Amazon ECS.</p> </div></body></html>' > /usr/local/apache2/htdocs/index.html && httpd-foreground\""
17+
],
18+
"cpu": 256,
19+
"memoryReservation": 512,
20+
"image": "httpd:2.4",
21+
"essential": true,
22+
"name": "sample-app",
23+
"mountPoints": [
24+
{
25+
"sourceVolume": "ebs1",
26+
"containerPath": "/var/lib",
27+
"readOnly": false
28+
}
29+
]
30+
}
31+
],
32+
"memory": "512",
33+
"volumes": [
34+
{
35+
"name": "ebs1",
36+
"configuredAtLaunch": true
37+
}
38+
],
39+
"family": "github-actions-deploy-task-def-integ-tests-volume-config",
40+
"requiresCompatibilities": [
41+
"FARGATE"
42+
],
43+
"networkMode": "awsvpc",
44+
"cpu": "256"
45+
}

test-workflow.yml

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -62,3 +62,29 @@ jobs:
6262
cluster: github-actions-deploy-task-def-integ-test
6363
wait-for-service-stability: true
6464
enable-ecs-managed-tags: true
65+
66+
- name: Deploy Amazon ECS task definition with ECS Service VolumeConfiguration
67+
uses: aws-actions/amazon-ecs-deploy-task-definition@v2
68+
with:
69+
task-definition: task-definition-volume-configuration.json
70+
service: github-actions-deploy-task-def-integ-test
71+
cluster: github-actions-deploy-task-def-integ-test
72+
wait-for-service-stability: true
73+
enable-ecs-managed-tags: true
74+
service-managed-ebs-volume-name: "ebs1"
75+
service-managed-ebs-volume: '{"filesystemType":"xfs","roleArn":"arn:aws:iam::${{secrets.AWS_ACCOUNT_ID}}:role/GitHubActionsVolumeConfigurationsEBSRole","encrypted":false,"sizeInGiB":30}'
76+
77+
- name: Deploy Amazon ECS task definition with one-off task and VolumeConfiguration
78+
uses: aws-actions/amazon-ecs-deploy-task-definition@v2
79+
with:
80+
task-definition: task-definition-volume-configuration.json
81+
cluster: github-actions-deploy-task-def-integ-test
82+
run-task: true
83+
enable-ecs-managed-tags: true
84+
run-task-subnets: subnet-e5604fce, subnet-fe9355b4, subnet-c49431bc, subnet-392f9b64
85+
run-task-security-groups: sg-067ebcde49c0f3ad8
86+
run-task-assign-public-IP: ENABLED
87+
run-task-managed-ebs-volume-name: "ebs1"
88+
run-task-managed-ebs-volume: '{"filesystemType":"xfs","roleArn":"arn:aws:iam::${{secrets.AWS_ACCOUNT_ID}}:role/GitHubActionsVolumeConfigurationsEBSRole","encrypted":false,"sizeInGiB":30}'
89+
run-task-started-by: "GitHub-Actions-EBS-Test"
90+
wait-for-task-stopped: true

0 commit comments

Comments
 (0)