Skip to content

credctl setup aws-profile

Terminal window
credctl setup aws-profile [flags]

credctl setup aws-profile adds a credential_process entry to ~/.aws/config so the AWS CLI and SDKs use credctl to obtain temporary credentials automatically.

The command creates or updates the specified profile with the credential_process directive pointing to the credctl binary, and sets the region from your credctl configuration.

Respects the AWS_CONFIG_FILE environment variable for custom config file locations. Preserves existing profiles and their settings.

Requires AWS to be configured first (credctl setup aws).

FlagTypeDefaultDescription
--profilestringcredctlAWS CLI profile name to create.
--forceboolfalseOverwrite the profile if it already exists.
Terminal window
credctl setup aws-profile
Configured profile 'credctl' in /Users/you/.aws/config
AWS_PROFILE=credctl aws sts get-caller-identity

Use it:

Terminal window
AWS_PROFILE=credctl aws s3 ls
Terminal window
credctl setup aws-profile --profile default
Configured profile 'default' in /Users/you/.aws/config
aws sts get-caller-identity
Terminal window
credctl setup aws-profile --profile myproject
Terminal window
credctl setup aws-profile --profile credctl --force

The command adds a section like this to ~/.aws/config:

[profile credctl]
credential_process = /usr/local/bin/credctl auth
region = us-east-1
CodeMeaning
0Profile configured successfully
1Error (device not initialised, AWS not configured, profile already exists, or other error)