Skip to content

AWS CLI

Perform the following steps to set up AWS CLI:

  • On the Privacera Portal, click Launch Pad from the left menu.
  • In the AWS Services section, click AWS CLI to open the AWS CLI dialog.
  • Under Configure Script in the AWS CLI dialog, click Download Script to save the script to your local machine.
  • Alternatively, you can use wget to pull this script to your execution platform, as shown below. Substitute your installation's Privacera Platform host domain name or IPv4 address for <PRIVACERA_PORTAL_HOST>.
    Bash
    1
    2
    3
    4
    wget http://<PRIVACERA_PORTAL_HOST>:6868/api/cam/download/script -O privacera_aws.sh
    
    # If you are using HTTPS, you may need to use the "--no-check-certificate" option for wget.
    wget --no-check-certificate https://<PRIVACERA_PORTAL_HOST>:6868/api/cam/download/script -O privacera_aws.sh
    
  • Copy the downloaded script to your home directory.
    Bash
    cp privacera_aws.sh ~/
    cd ~/
    
  • Set this file to be executable:
    Bash
    chmod a+x ~/privacera_aws.sh
    

All the commands should be run with a space between the dot (.) and the script name (~/privacera_aws.sh)

  • Under the AWS Cli Generate Token section, generate a platform token.
  • Under Generate the Configuration Token, select Never Expire to generate a token that does not expire. Click Generate.
  • Run the following command:
    Bash
    source privacera_aws.sh --config-token
    
  • Enter Privacera Access Token and Privacera Secret Token displayed on the portal under the Generate Token section.
  • To run AWS CLI command with profile configuration, you need to set up the profile. This can be done by running the following command, replacing <profile-name> with the desired profile name:
    Bash
    . ~/privacesra_aws.sh --profile <profile-name>
    
  • To run any AWS CLI command with endpoint configuration, you need to enable endpoint configuration. This can be done by running the below command
    Bash
    . ~/privacera_aws.sh --enable-endpoint
    
  • Under the Check Status section, run the below command to check all the configuration and dependencies status.
    Bash
    . ~/privacera_aws.sh --status
    
  • Run your aws commands
    Bash
    aws s3 ls s3://
    
  • If you get SSL validation failed error then try below commands
    Bash
    export AWS_CA_BUNDLE=
    aws s3 ls s3://
    
  • On the Privacera Portal, click Launch Pad -> Setup AWS CLI from the left menu.
  • Under Configure Script in AWS CLI, click Download Token to save the token to the .privacera folder in your home directory, (e.g., $HOME/.privacera/privacera_token).
  • Click Download Script to save the script to your home directory, (e.g., $HOME/privacera_aws.sh). Make this file executable by running:
    Bash
    chmod a+x ~/privacera_aws.sh
    
  • To run any AWS CLI command with profile configuration, you need to set up the profile. This can be done by running the following command. Replace with the profile name you want to use for the CLI, such as default.
    Bash
    . ~/privacera_aws.sh --profile <profile-name>
    
  • Under the Check Status section, run the below command to check the status of all configurations and dependencies:
    Bash
    . ~/privacera_aws.sh --status
    
  • To disable Privacera CLI, run the below command:
    Bash
    . ~/privacera_aws.sh --disable
    
  • Once you have configured the AWS CLI, you can run the following command to list S3 buckets:
    Bash
    aws s3 ls s3://
    
  • Once you have configured the AWS CLI, you can run the following command:
    Bash
    aws glue get-catalog-import-status
    

Comments