Skip to content

support efs file system #36

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
Mar 6, 2025
Merged
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
32 changes: 32 additions & 0 deletions master_deploy.sh
Original file line number Diff line number Diff line change
Expand Up @@ -261,6 +261,19 @@ volumeupdate() {
let volcount=volcount+1
}

efsvolumeupdate() {
volname=$1
sourcepath=$2
mountpath=$3
filesystemid=$4
#volumes update
template=$(echo $template | jq --arg volname $volname --arg sourcepath $sourcepath --arg volcount $volcount --arg filesystemid $filesystemid '.volumes[$volcount |tonumber] |= .+ { name: $volname, efsVolumeConfiguration: { fileSystemId: $filesystemid, rootDirectory: $sourcepath } }')
#mount point update
template=$(echo $template | jq --arg volname $volname --arg mountpath $mountpath --arg volcount $volcount '.containerDefinitions[0].mountPoints[$volcount |tonumber] |= .+ { sourceVolume: $volname, containerPath: $mountpath }')

let volcount=volcount+1
}

ECS_Container_HealthCheck_integ() {
HealthCheckCmd="$1"

Expand Down Expand Up @@ -447,6 +460,25 @@ ECS_template_create_register() {
log "ECS volumes are mapped"
fi

#efs volume update
if [ -z $AWS_ECS_VOLUMES_EFS ];
then
echo "No ECS EFS volume mapping defined"
else
Buffer_volumes=$(echo $AWS_ECS_VOLUMES_EFS | sed 's/,/ /g')
for v1 in $Buffer_volumes;
do
volname=$( echo $v1 | cut -d ':' -f 1 )
sourcepath=$( echo $v1 | cut -d ':' -f 2 )
mountpath=$( echo $v1 | cut -d ':' -f 3 )
filesystemid=$( echo $v1 | cut -d ':' -f 4 )
#mntpermission=$( echo $v1 | cut -d ':' -f 4 )
#volumeupdate $volname $sourcepath $mountpath $mntpermission fileSystemId
efsvolumeupdate $volname $sourcepath $mountpath $filesystemid
done
log "ECS EFS volumes are mapped"
fi

#Container health check update
if [ -z "$AWS_ECS_CONTAINER_HEALTH_CMD" ];
then
Expand Down