# How to automate export using cli ( bash shell)?

**URL:** <https://community.amazonquick.com/t/how-to-automate-export-using-cli-bash-shell/28301>\
**Category:** Q&A\
**Tags:** admin, qls-cli-automate, export, quick-sight\
**Created:** [April 5, 2024, 9:42pm UTC](https://community.amazonquick.com/t/how-to-automate-export-using-cli-bash-shell/28301 "2024-04-05T21:42:23Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![larry](https://avatars.discourse-cdn.com/v4/letter/l/47e85d/32.png) [@larry](https://community.amazonquick.com/u/larry)\
**Post date:** [April 5, 2024, 9:42pm UTC](https://community.amazonquick.com/t/how-to-automate-export-using-cli-bash-shell/28301/1 "2024-04-05T21:42:23Z")

</div>

I am trying automate the export job. But cannot think of a way of automating the list items. I can store all the ARNs in a bash array Is it possible to pass all the arn’s using a file ? It will help in automating ?

Really appreciate if anyone can share if they have already done this.  
Thanks !!

aws quicksight start-asset-bundle-export-job  
–aws-account-id AWSACCOUNTID   
–asset-bundle-export-job-id JOBID   
–resource-arns '_[“arn:aws:quicksight:REGION:AWSACCOUNTID:dashboard/RESOURCEID”,“arn:aws:quicksight:REGION:AWSACCOUNTID:analysis/RESOURCEID”]’_   
–cloud-formation-override-property-configuration ‘{“Dashboards”: [{“Arn”: “arn:aws:quicksight:REGION:AWSACCOUNTID:dashboard/RESOURCEID”,“Properties”: [“Name”]}]}’   
–include-all-dependencies   
–export-format CLOUDFORMATION\_JSON  
–\*

---

<div class="post-metadata">

**Author:** ![awsvig](https://d2orw1595917va.cloudfront.net/user_avatar/community.amazonquick.com/awsvig/32/32522_2.png) [@awsvig](https://community.amazonquick.com/u/awsvig)\
**Post date:** [April 7, 2024, 11:35am UTC](https://community.amazonquick.com/t/how-to-automate-export-using-cli-bash-shell/28301/2 "2024-04-07T11:35:30Z")

</div>

Hi @larry  
Yes, it is possible to pass a file containing the ARN list to the StartAssetBundleExportJob API instead of hardcoding the ARNs. Here is an example of how you can do this:

1. Create a text file called arns.txt with each ARN on a separate line, e.g.:  
arn:aws:quicksight:us-east-1:123456789012:dashboard/d-01234567890  
arn:aws:quicksight:us-east-1:123456789012:analysis/a-01234567890

2. Read the file into a bash array:  
readarray -t arns \< arns.txt

3. Pass the array to the API call using --resource-arns “$arns”:  
aws quicksight start-asset-bundle-export-job --aws-account-id 123456789012 --asset-bundle-export-job-id myexportjob --resource-arns “$arns” --export-format CLOUDFORMATION\_JSON  
This allows you to manage the ARNs in a separate file instead of hardcoding them. Hope this helps!

---

<div class="post-metadata">

**Author:** ![zhaopan](https://avatars.discourse-cdn.com/v4/letter/z/ebca7d/32.png) [@zhaopan](https://community.amazonquick.com/u/zhaopan)\
**Post date:** [April 11, 2024, 2:54pm UTC](https://community.amazonquick.com/t/how-to-automate-export-using-cli-bash-shell/28301/3 "2024-04-11T14:54:15Z")

</div>

Quick Sight offers list APIs to fetch the ARNs by type.

- [ListAnalyses](https://docs.aws.amazon.com/quicksight/latest/APIReference/API_ListAnalyses.html)
- [ListDashboards](https://docs.aws.amazon.com/quicksight/latest/APIReference/API_ListDashboards.html)
- [ListDataSets](https://docs.aws.amazon.com/quicksight/latest/APIReference/API_ListDataSets.html)
- [ListDataSources](https://docs.aws.amazon.com/quicksight/latest/APIReference/API_ListDataSources.html)
- [ListThemes](https://docs.aws.amazon.com/quicksight/latest/APIReference/API_ListThemes.html)
- [ListVPCConnections](https://docs.aws.amazon.com/quicksight/latest/APIReference/API_ListVPCConnections.html)

You can parse the JSON output with a CLI tool like [jq](https://jqlang.github.io/jq/).

---

<div class="post-metadata">

**Author:** ![larry](https://avatars.discourse-cdn.com/v4/letter/l/47e85d/32.png) [@larry](https://community.amazonquick.com/u/larry)\
**Post date:** [July 9, 2024, 9:14pm UTC](https://community.amazonquick.com/t/how-to-automate-export-using-cli-bash-shell/28301/4 "2024-07-09T21:14:16Z")

</div>

@awsvig Have you tried the solution provided by you ? It is not working, can you please try in your environment. Here is what I have done-

1. aws quicksight list-folder-members --aws-account-id $account\_id --folder-id $folder\_id |jq -r ‘.FolderMemberList.MemberArn’ \> arns.txt
2. readarray -t arns \<arns.txt
3. aws quicksight start-asset-bundle-export-job --aws-account-id $account\_id --asset-bundle-export-job-id XXXXXXXXXXXXXXXX   
–include-all-dependencies   
–export-format QUICKSIGHT\_JSON   
–resource-arns “$arns”

Thank you !
