Skip to content

Commit 873ebec

Browse files
Thheinen/efs accesspoints (#2783)
* Add EFS access point support (aws-parallelcluster#2337) * Added configs for access points Signed-off-by: Thomas Heinen <[email protected]> --------- Signed-off-by: Thomas Heinen <[email protected]> Co-authored-by: Thomas Heinen <[email protected]>
1 parent 26b55b3 commit 873ebec

File tree

6 files changed

+15
-1
lines changed

6 files changed

+15
-1
lines changed

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ This file is used to list changes made in each version of the AWS ParallelCluste
99
**ENHANCEMENTS**
1010
- Allow custom actions on login nodes.
1111
- Allow DCV connection on login nodes.
12+
- Add new attribute `efs_access_point_ids` to specify optional EFS access points for the mounts
1213

1314
**BUG FIXES**
1415
- Fix EFA kmod installation with RHEL 8.10 or newer.

cookbooks/aws-parallelcluster-environment/attributes/environment.rb

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,7 @@
3737
default['cluster']['efs_fs_ids'] = ''
3838
default['cluster']['efs_encryption_in_transits'] = ''
3939
default['cluster']['efs_iam_authorizations'] = ''
40+
default['cluster']['efs_access_point_ids'] = ''
4041
default['cluster']['fsx_shared_dirs'] = ''
4142
default['cluster']['fsx_fs_ids'] = ''
4243
default['cluster']['fsx_dns_names'] = ''

cookbooks/aws-parallelcluster-environment/recipes/config/efs.rb

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@
1515
id_array = node['cluster']['efs_fs_ids'].split(',')
1616
encryption_array = node['cluster']['efs_encryption_in_transits'].split(',')
1717
iam_array = node['cluster']['efs_iam_authorizations'].split(',')
18+
access_point_id_array = node['cluster']['efs_access_point_ids'].split(',')
1819

1920
# Identify the previously mounted filesystems and remove them from the set of filesystems to mount
2021
shared_dir_array.each_with_index do |dir, index|
@@ -23,6 +24,7 @@
2324
id_array.delete_at(index)
2425
encryption_array.delete_at(index)
2526
iam_array.delete_at(index)
27+
access_point_id_array.delete_at(index)
2628
end
2729

2830
# Mount EFS directories with the efs resource
@@ -31,6 +33,7 @@
3133
efs_fs_id_array id_array
3234
efs_encryption_in_transit_array encryption_array
3335
efs_iam_authorization_array iam_array
36+
efs_access_point_id_array access_point_id_array
3437
action :mount
3538
not_if { shared_dir_array.empty? }
3639
end

cookbooks/aws-parallelcluster-environment/recipes/config/mount_home.rb

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -61,6 +61,7 @@
6161
efs_encryption_in_transit_array [node['cluster']['efs_encryption_in_transits'].split(',')[index]]
6262
efs_iam_authorization_array [node['cluster']['efs_iam_authorizations'].split(',')[index]]
6363
efs_mount_point_array ['/home']
64+
efs_access_point_id [node['cluster']['efs_access_point_ids'].split(',')[index]]
6465
action :mount
6566
end
6667
break
@@ -73,6 +74,7 @@
7374
efs_fs_id_array [node['cluster']['efs_fs_ids'].split(',')[index]]
7475
efs_encryption_in_transit_array [node['cluster']['efs_encryption_in_transits'].split(',')[index]]
7576
efs_iam_authorization_array [node['cluster']['efs_iam_authorizations'].split(',')[index]]
77+
efs_access_point_id [node['cluster']['efs_access_point_ids'].split(',')[index]]
7678
action :mount
7779
end
7880
break

cookbooks/aws-parallelcluster-environment/resources/efs/partial/_mount_umount.rb

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@
1818
property :efs_fs_id_array, Array, required: %i(mount unmount)
1919
property :efs_encryption_in_transit_array, Array, required: false
2020
property :efs_iam_authorization_array, Array, required: false
21+
property :efs_access_point_id_array, Array, required: false
2122
# This is the mount point on the EFS itself, as opposed to the local system directory, defaults to "/"
2223
property :efs_mount_point_array, Array, required: false
2324
property :efs_unmount_forced_array, Array, required: false
@@ -28,19 +29,23 @@
2829
efs_fs_id_array = new_resource.efs_fs_id_array.dup
2930
efs_encryption_in_transit_array = new_resource.efs_encryption_in_transit_array.dup
3031
efs_iam_authorization_array = new_resource.efs_iam_authorization_array.dup
32+
efs_access_point_id_array = new_resource.efs_access_point_id_array.dup
3133
efs_mount_point_array = new_resource.efs_mount_point_array.dup
3234

3335
efs_fs_id_array.each_with_index do |efs_fs_id, index|
3436
efs_shared_dir = efs_shared_dir_array[index]
3537
efs_encryption_in_transit = efs_encryption_in_transit_array[index] unless efs_encryption_in_transit_array.nil?
3638
efs_iam_authorization = efs_iam_authorization_array[index] unless efs_iam_authorization_array.nil?
39+
efs_access_point_id = efs_access_point_id_array[index] unless efs_access_point_id_array.nil?
3740

3841
# Path needs to be fully qualified, for example "shared/temp" becomes "/shared/temp"
3942
efs_shared_dir = "/#{efs_shared_dir}" unless efs_shared_dir.start_with?('/')
4043

4144
# See reference of mount options: https://docs.aws.amazon.com/efs/latest/ug/automount-with-efs-mount-helper.html
4245
mount_options = "_netdev,noresvport"
43-
if efs_encryption_in_transit == "true"
46+
if efs_access_point_id
47+
mount_options = "iam,tls,access_point=#{efs_access_point_id}"
48+
elsif efs_encryption_in_transit == "true"
4449
mount_options += ",tls"
4550
if efs_iam_authorization == "true"
4651
mount_options += ",iam"

cookbooks/aws-parallelcluster-environment/templates/shared_storages/shared_storages_data.erb

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,12 +19,14 @@ raid:
1919
<% efs_shared_dir_array = node['cluster']['efs_shared_dirs'].split(',') -%>
2020
<% efs_encryption_in_transit_array = node['cluster']['efs_encryption_in_transits'].split(',') -%>
2121
<% efs_iam_authorization_array = node['cluster']['efs_iam_authorizations'].split(',') -%>
22+
<% efs_access_point_id_array = node['cluster']['efs_access_point_ids'].split(',') -%>
2223
efs:
2324
<% efs_fs_ids_array.each_with_index do |efs_fs_id, index| -%>
2425
- efs_fs_id: <%= efs_fs_id %>
2526
mount_dir: <%= efs_shared_dir_array[index] %>
2627
efs_encryption_in_transit: <%= efs_encryption_in_transit_array[index] %>
2728
efs_iam_authorization: <%= efs_iam_authorization_array[index] %>
29+
efs_access_point_id: <%= efs_access_point_id_array[index] %>
2830
<% end -%>
2931
<%# FSX %>
3032
<% fsx_fs_id_array = node['cluster']['fsx_fs_ids'].split(',') -%>

0 commit comments

Comments
 (0)