Skip to content

Commit

Permalink
Debug EFS list
Browse files Browse the repository at this point in the history
  • Loading branch information
hardillb committed Jun 28, 2024
1 parent 08be07f commit c5ec55c
Showing 1 changed file with 9 additions and 4 deletions.
13 changes: 9 additions & 4 deletions lib/aws-efs.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,22 +10,25 @@ async function lookupStorageClass (tag) {

const fsCommand = new DescribeFileSystemsCommand()
const fsList = await client.send(fsCommand)
console.log(fsList)
console.log(JSON.stringify(fsList, null, 2))

const fileSystems = []

for (let i = 0; i< fsList.FileSystems.length; i++) {
for (let i = 0; i<fsList.FileSystems.length; i++) {
let found = false
let storageClass = ''
fsList.FileSystems[i].Tags.forEach(tag => {
// fsList.FileSystems[i].Tags.forEach(tag => {
for (let j = 0; j<fsList.FileSystems[i].Tags.length; j++) {
const tag = fsList.FileSystems[i].Tags[j]
if (tag.Key === tag) {
found = true
}
if (tag.Key === 'storage-class-name') {
storageClass = tag.Value
}
})
}
if (found) {
console.log(storageClass)
const apParams = {
FileSystemId: fsList.FileSystems[i].FileSystemId
}
Expand All @@ -37,6 +40,8 @@ async function lookupStorageClass (tag) {
apCount: apList.AccessPoints.length,
storageClass
})
} else {
console.log(`${fsList.FileSystems[i]} efs not tagged`)
}

}
Expand Down

0 comments on commit c5ec55c

Please sign in to comment.