Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Prepend OKTA_AWSCLI_ on ENV VARs #98

Merged
merged 1 commit into from
Apr 28, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions .env.example
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
OKTA_ORG_DOMAIN=
OKTA_OIDC_CLIENT_ID=
OKTA_AWS_ACCOUNT_FEDERATION_APP_ID=
AWS_IAM_IDP=
AWS_IAM_ROLE=
OKTA_AWSCLI_IAM_IDP=
OKTA_AWSCLI_IAM_ROLE=
22 changes: 11 additions & 11 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -189,17 +189,17 @@ Also see the CLI's online help `$ okta-aws-cli --help`
| Okta Org Domain (**required**) | `OKTA_ORG_DOMAIN` | `--org-domain [value]` | Full domain hostname of the Okta org e.g. `test.okta.com` |
| OIDC Client ID (**required**) | `OKTA_OIDC_CLIENT_ID` | `--oidc-client-id [value]` | See [Allowed Web SSO Client](#allowed-web-sso-client) |
| Okta AWS Account Federation integration app ID (optional) | `OKTA_AWS_ACCOUNT_FEDERATION_APP_ID` | `--aws-acct-fed-app-id [value]` | See [AWS Account Federation integration app](#aws-account-federation-integration-app). This value is only required if the OIDC app doesn't have the `okta.apps.read` grant for whatever reason |
| Preselect the AWS IAM Identity Provider ARN (optional) | `AWS_IAM_IDP` | `--aws-iam-idp [value]` | Preselects the IdP list to this preferred IAM Identity Provider. If there are other IdPs available they will not be listed. |
| Preselects the AWS IAM Role ARN to assume (optional) | `AWS_IAM_ROLE` | `--aws-iam-role [value]` | Preselects the role list to this preferred IAM role for the given IAM Identity Provider. If there are other Roles available they will not be listed. |
| AWS Session Duration (optional) | `AWS_SESSION_DURATION` | `--session-duration [value]` | The lifetime, in seconds, of the AWS credentials. Must be between 60 and 43200. |
| Output format (optional) | `FORMAT` | `--format [value]` | Default is `env-var`. Options: `env-var` for output to environment variables, `aws-credentials` for output to AWS credentials file |
| Profile (optional) | `PROFILE` | `--profile [value]` | Default is `default` |
| Display QR Code (optional) | `QR_CODE=true` | `--qr-code` | `true` if flag is present |
| Automatically open the activation URL with the system web browser (optional) | `OPEN_BROWSER=true` | `--open-browser` | `true` if flag is present |
| Alternate AWS credentials file path (optional) | `AWS_CREDENTIALS` | `--aws-credentials` | Path to alternative credentials file other than AWS CLI default |
| (Over)write the given profile to the AWS credentials file (optional). WARNING: When enabled, overwriting can inadvertently remove dangling comments and extraneous formatting from the creds file. | `WRITE_AWS_CREDENTIALS=true` | `--write-aws-credentials` | `true` if flag is present |
| Emit deprecated AWS variable `aws_security_token` with duplicated value from `aws_session_token` | `LEGACY_AWS_VARIABLES=true` | `--legacy-aws-variables` | `true` if flag is present |
| Verbosely print all API calls/responses to the screen | `DEBUG_API_CALLS=true` | `--debug-api-calls` | `true` if flag is present |
| Preselect the AWS IAM Identity Provider ARN (optional) | `OKTA_AWSCLI_IAM_IDP` | `--aws-iam-idp [value]` | Preselects the IdP list to this preferred IAM Identity Provider. If there are other IdPs available they will not be listed. |
| Preselects the AWS IAM Role ARN to assume (optional) | `OKTA_AWSCLI_IAM_ROLE` | `--aws-iam-role [value]` | Preselects the role list to this preferred IAM role for the given IAM Identity Provider. If there are other Roles available they will not be listed. |
| AWS Session Duration (optional) | `OKTA_AWSCLI_SESSION_DURATION` | `--session-duration [value]` | The lifetime, in seconds, of the AWS credentials. Must be between 60 and 43200. |
| Output format (optional) | `OKTA_AWSCLI_FORMAT` | `--format [value]` | Default is `env-var`. Options: `env-var` for output to environment variables, `aws-credentials` for output to AWS credentials file |
| Profile (optional) | `OKTA_AWSCLI_PROFILE` | `--profile [value]` | Default is `default` |
| Display QR Code (optional) | `OKTA_AWSCLI_QR_CODE=true` | `--qr-code` | `true` if flag is present |
| Automatically open the activation URL with the system web browser (optional) | `OKTA_AWSCLI_OPEN_BROWSER=true` | `--open-browser` | `true` if flag is present |
| Alternate AWS credentials file path (optional) | `OKTA_AWSCLI_AWS_CREDENTIALS` | `--aws-credentials` | Path to alternative credentials file other than AWS CLI default |
| (Over)write the given profile to the AWS credentials file (optional). WARNING: When enabled, overwriting can inadvertently remove dangling comments and extraneous formatting from the creds file. | `OKTA_AWSCLI_WRITE_AWS_CREDENTIALS=true` | `--write-aws-credentials` | `true` if flag is present |
| Emit deprecated AWS variable `aws_security_token` with duplicated value from `aws_session_token` | `OKTA_AWSCLI_LEGACY_AWS_VARIABLES=true` | `--legacy-aws-variables` | `true` if flag is present |
| Verbosely print all API calls/responses to the screen | `OKTA_AWSCLI_DEBUG_API_CALLS=true` | `--debug-api-calls` | `true` if flag is present |
| HTTP/HTTPS Proxy support | `HTTP_PROXY` or `HTTPS_PROXY` | n/a | HTTP/HTTPS URL of proxy service (based on golang [net/http/httpproxy](https://pkg.go.dev/golang.org/x/net/http/httpproxy) package) |

NOTE: If
Expand Down
22 changes: 11 additions & 11 deletions internal/config/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -69,33 +69,33 @@ const (
LegacyAWSVariablesFlag = "legacy-aws-variables"

// AWSCredentialsEnvVar env var const
AWSCredentialsEnvVar = "AWS_CREDENTIALS"
AWSCredentialsEnvVar = "OKTA_AWSCLI_AWS_CREDENTIALS"
// AWSIAMIdPEnvVar env var const
AWSIAMIdPEnvVar = "AWS_IAM_IDP"
AWSIAMIdPEnvVar = "OKTA_AWSCLI_IAM_IDP"
// AWSIAMRoleEnvVar env var const
AWSIAMRoleEnvVar = "AWS_IAM_ROLE"
AWSIAMRoleEnvVar = "OKTA_AWSCLI_IAM_ROLE"
// AWSSessionDurationEnvVar env var const
AWSSessionDurationEnvVar = "AWS_SESSION_DURATION"
AWSSessionDurationEnvVar = "OKTA_AWSCLI_SESSION_DURATION"
// FormatEnvVar env var const
FormatEnvVar = "FORMAT"
FormatEnvVar = "OKTA_AWSCLI_FORMAT"
// OktaOIDCClientIDEnvVar env var const
OktaOIDCClientIDEnvVar = "OKTA_OIDC_CLIENT_ID"
// OktaOrgDomainEnvVar env var const
OktaOrgDomainEnvVar = "OKTA_ORG_DOMAIN"
// OktaAWSAccountFederationAppIDEnvVar env var const
OktaAWSAccountFederationAppIDEnvVar = "OKTA_AWS_ACCOUNT_FEDERATION_APP_ID"
// OpenBrowserEnvVar env var const
OpenBrowserEnvVar = "OPEN_BROWSER"
OpenBrowserEnvVar = "OKTA_AWSCLI_OPEN_BROWSER"
// ProfileEnvVar env var const
ProfileEnvVar = "PROFILE"
ProfileEnvVar = "OKTA_AWSCLI_PROFILE"
// QRCodeEnvVar env var const
QRCodeEnvVar = "QR_CODE"
QRCodeEnvVar = "OKTA_AWSCLI_QR_CODE"
// WriteAWSCredentialsEnvVar env var const
WriteAWSCredentialsEnvVar = "WRITE_AWS_CREDENTIALS"
WriteAWSCredentialsEnvVar = "OKTA_AWSCLI_WRITE_AWS_CREDENTIALS"
// DebugAPICallsEnvVar env var const
DebugAPICallsEnvVar = "DEBUG_API_CALLS"
DebugAPICallsEnvVar = "OKTA_AWSCLI_DEBUG_API_CALLS"
// LegacyAWSVariablesEnvVar env var const
LegacyAWSVariablesEnvVar = "LEGACY_AWS_VARIABLES"
LegacyAWSVariablesEnvVar = "OKTA_AWSCLI_LEGACY_AWS_VARIABLES"

// CannotBeBlankErrMsg error message const
CannotBeBlankErrMsg = "cannot be blank"
Expand Down