Skip to content

chore: add integration test for VolumeConfiguration property #722

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Jan 30, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
26 changes: 26 additions & 0 deletions .github/workflows/test-workflow.yml
Original file line number Diff line number Diff line change
Expand Up @@ -62,3 +62,29 @@ jobs:
cluster: github-actions-deploy-task-def-integ-test
wait-for-service-stability: true
enable-ecs-managed-tags: true

- name: Deploy Amazon ECS task definition with ECS Service VolumeConfiguration
uses: aws-actions/amazon-ecs-deploy-task-definition@0bad458c6aa901707e510cd05b797b05da075633
with:
task-definition: task-definition-volume-configuration.json
service: github-actions-deploy-task-def-integ-test
cluster: github-actions-deploy-task-def-integ-test
wait-for-service-stability: true
enable-ecs-managed-tags: true
service-managed-ebs-volume-name: "ebs1"
service-managed-ebs-volume: '{"filesystemType":"xfs","roleArn":"arn:aws:iam::${{secrets.AWS_ACCOUNT_ID}}:role/GitHubActionsVolumeConfigurationsEBSRole","encrypted":false,"sizeInGiB":30}'

- name: Deploy Amazon ECS task definition with one-off task and VolumeConfiguration
uses: aws-actions/amazon-ecs-deploy-task-definition@0bad458c6aa901707e510cd05b797b05da075633
with:
task-definition: task-definition-volume-configuration.json
cluster: github-actions-deploy-task-def-integ-test
run-task: true
enable-ecs-managed-tags: true
run-task-subnets: subnet-e5604fce, subnet-fe9355b4, subnet-c49431bc, subnet-392f9b64
run-task-security-groups: sg-067ebcde49c0f3ad8
run-task-assign-public-IP: ENABLED
run-task-managed-ebs-volume-name: "ebs1"
run-task-managed-ebs-volume: '{"filesystemType":"xfs","roleArn":"arn:aws:iam::${{secrets.AWS_ACCOUNT_ID}}:role/GitHubActionsVolumeConfigurationsEBSRole","encrypted":false,"sizeInGiB":30}'
run-task-started-by: "GitHub-Actions-EBS-Test"
wait-for-task-stopped: true
38 changes: 38 additions & 0 deletions task-definition-run-task-volume-configuration.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
{
"containerDefinitions": [
{
"memory": 32,
"essential": true,
"entryPoint": ["ping"],
"name": "alpine_ping",
"readonlyRootFilesystem": true,
"image": "alpine:3.4",
"command": [
"-c",
"4",
"example.com"
],
"cpu": 16,
"mountPoints": [
{
"sourceVolume": "ebs1",
"containerPath": "/var/lib",
"readOnly": false
}
]
}
],
"memory": "512",
"volumes": [
{
"name": "ebs1",
"configuredAtLaunch": true
}
],
"family": "github-actions-deploy-task-def-integ-tests-run-task-volume-config",
"requiresCompatibilities": [
"FARGATE"
],
"networkMode": "awsvpc",
"cpu": "256"
}
45 changes: 45 additions & 0 deletions task-definition-volume-configuration.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
{
"containerDefinitions": [
{
"entryPoint": [
"sh",
"-c"
],
"portMappings": [
{
"hostPort": 80,
"protocol": "tcp",
"containerPort": 80
}
],
"command": [
"/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\""
],
"cpu": 256,
"memoryReservation": 512,
"image": "httpd:2.4",
"essential": true,
"name": "sample-app",
"mountPoints": [
{
"sourceVolume": "ebs1",
"containerPath": "/var/lib",
"readOnly": false
}
]
}
],
"memory": "512",
"volumes": [
{
"name": "ebs1",
"configuredAtLaunch": true
}
],
"family": "github-actions-deploy-task-def-integ-tests-volume-config",
"requiresCompatibilities": [
"FARGATE"
],
"networkMode": "awsvpc",
"cpu": "256"
}
26 changes: 26 additions & 0 deletions test-workflow.yml
Original file line number Diff line number Diff line change
Expand Up @@ -62,3 +62,29 @@ jobs:
cluster: github-actions-deploy-task-def-integ-test
wait-for-service-stability: true
enable-ecs-managed-tags: true

- name: Deploy Amazon ECS task definition with ECS Service VolumeConfiguration
uses: aws-actions/amazon-ecs-deploy-task-definition@v2
with:
task-definition: task-definition-volume-configuration.json
service: github-actions-deploy-task-def-integ-test
cluster: github-actions-deploy-task-def-integ-test
wait-for-service-stability: true
enable-ecs-managed-tags: true
service-managed-ebs-volume-name: "ebs1"
service-managed-ebs-volume: '{"filesystemType":"xfs","roleArn":"arn:aws:iam::${{secrets.AWS_ACCOUNT_ID}}:role/GitHubActionsVolumeConfigurationsEBSRole","encrypted":false,"sizeInGiB":30}'

- name: Deploy Amazon ECS task definition with one-off task and VolumeConfiguration
uses: aws-actions/amazon-ecs-deploy-task-definition@v2
with:
task-definition: task-definition-volume-configuration.json
cluster: github-actions-deploy-task-def-integ-test
run-task: true
enable-ecs-managed-tags: true
run-task-subnets: subnet-e5604fce, subnet-fe9355b4, subnet-c49431bc, subnet-392f9b64
run-task-security-groups: sg-067ebcde49c0f3ad8
run-task-assign-public-IP: ENABLED
run-task-managed-ebs-volume-name: "ebs1"
run-task-managed-ebs-volume: '{"filesystemType":"xfs","roleArn":"arn:aws:iam::${{secrets.AWS_ACCOUNT_ID}}:role/GitHubActionsVolumeConfigurationsEBSRole","encrypted":false,"sizeInGiB":30}'
run-task-started-by: "GitHub-Actions-EBS-Test"
wait-for-task-stopped: true