Currently trying to aoutomate some stuf and writing simple shell script (bash) to create EFS. This is what I have:
keyarn=$( aws kms create-key --profile "${awsprofile}" \
--region "${awsregion})" \
--output 'text' --query 'KeyMetadata.Arn' )
fsid=$( aws efs create-file-system \
--creation-token "$(uuid)" \
--performance-mode 'generalPurpose' \
--encrypted --kms-key-id "${keyarn}" \
--profile "${awsprofile}" \
--region "${awsregion}" \
--query 'FileSystemId' \
--output 'text' )
sleep 80s
aws efs describe-file-systems \
--file-system-id "${fsid}" \
--profile "${awsprofile}" \
--region "${awsregion}" \
--output 'text' \
--query "FileSystems | [0].FileSystemArn"
The final command output's nothing, meaning FileSystemArn is either empty or not present. So I removed query and indeed FileSystemArn is not being returned.
{
"FileSystems": [
{
"OwnerId": "<snipped>",
"CreationToken": "842d5976-8016-11eb-890f-43bd98cd016a",
"FileSystemId": "fs-396efdcf",
"CreationTime": "2021-03-08T10:59:37-03:00",
"LifeCycleState": "available",
"NumberOfMountTargets": 0,
"SizeInBytes": {
"Value": 6144,
"Timestamp": "2021-03-08T11:57:49-03:00",
"ValueInIA": 0,
"ValueInStandard": 6144
},
"PerformanceMode": "generalPurpose",
"Encrypted": true,
"KmsKeyId": "<snipped>",
"ThroughputMode": "bursting",
"Tags": []
}
]
}
Any suggestions as to why this is happening?