Commit 2bf6354
committed
[BACKPORT 2024.1][PLAT-14805]Support adding EAR configs
Summary:
Command format: `./yba ear <provider-type (aws/azure/gcp/hcv)> create -n <name> [flags]`
AWS:
```
./yba ear aws create
Create an AWS encryption at rest configuration in YugabyteDB Anywhere
Usage:
yba ear aws create [flags]
Aliases:
create, add
Flags:
--access-key-id string AWS Access Key ID. Required for non IAM role based configurations. Can also be set using environment variable AWS_ACCESS_KEY_ID.
--secret-access-key string AWS Secret Access Key. Required for non IAM role based configurations. Can also be set using environment variable AWS_SECRET_ACCESS_KEY.
--region string AWS region where the customer master key is located. Can also be set using environment variable AWS_REGION
--use-iam-instance-profile [Optional] Use IAM Role from the YugabyteDB Anywhere Host. EAR creation will fail on insufficient permissions on the host. (default false)
--cmk-id string [Optional] Customer Master Key ID. If an identifier is not entered, a CMK ID will be auto-generated.
--endpoint string [Optional] AWS KMS Endpoint.
--cmk-policy-file-path string [Optional] AWS KMS Customer Master Key Policy file path. Custom policy file is not needed when Customer Master Key ID is specified. Allowed file type is json.
-h, --help help for create
Global Flags:
-a, --apiToken string YugabyteDB Anywhere api token.
--config string Config file, defaults to $HOME/.yba-cli.yaml
--debug Use debug mode, same as --logLevel debug.
--disable-color Disable colors in output. (default false)
-H, --host string YugabyteDB Anywhere Host (default "http://localhost:9000")
-l, --logLevel string Select the desired log level format. Allowed values: debug, info, warn, error, fatal. (default "info")
-n, --name string [Optional] The name of the configuration for the action. Required for create, delete, describe, update.
-o, --output string Select the desired output format. Allowed values: table, json, pretty. (default "table")
--timeout duration Wait command timeout, example: 5m, 1h. (default 168h0m0s)
--wait Wait until the task is completed, otherwise it will exit immediately. (default true)
```
Azure:
```
Create an Azure encryption at rest configuration in YugabyteDB Anywhere
Usage:
yba ear azure create [flags]
Aliases:
create, add
Flags:
--client-id string Azure Client ID. Can also be set using environment variable AZURE_CLIENT_ID.
--tenant-id string Azure Tenant ID. Can also be set using environment variable AZURE_TENANT_ID.
--client-secret string Azure Secret Access Key. Required for Non Managed Identity based configurations. Can also be set using environment variable AZURE_CLIENT_SECRET.
--use-managed-identity [Optional] Use Azure Managed Identity from the YugabyteDB Anywhere Host. EAR creation will fail on insufficient permissions on the host. (default false)
--vault-url string [Required] Azure Vault URL.
--key-name string [Required] Azure Key Name.If master key with same name already exists then it will be used, else a new one will be created automatically.
--key-algorithm string [Optional] Azure Key Algorithm. Allowed values (case sensitive): RSA (default "RSA")
--key-size int [Optional] Azure Key Size. Allowed values per algorithm: RSA(Default:2048, 3072, 4096)
-h, --help help for create
Global Flags:
-a, --apiToken string YugabyteDB Anywhere api token.
--config string Config file, defaults to $HOME/.yba-cli.yaml
--debug Use debug mode, same as --logLevel debug.
--disable-color Disable colors in output. (default false)
-H, --host string YugabyteDB Anywhere Host (default "http://localhost:9000")
-l, --logLevel string Select the desired log level format. Allowed values: debug, info, warn, error, fatal. (default "info")
-n, --name string [Optional] The name of the configuration for the action. Required for create, delete, describe, update.
-o, --output string Select the desired output format. Allowed values: table, json, pretty. (default "table")
--timeout duration Wait command timeout, example: 5m, 1h. (default 168h0m0s)
--wait Wait until the task is completed, otherwise it will exit immediately. (default true)
```
GCP:
```
./yba ear gcp create
Create a GCP encryption at rest configuration in YugabyteDB Anywhere
Usage:
yba ear gcp create [flags]
Aliases:
create, add
Flags:
--credentials-file-path string GCP Credentials File Path. Can also be set using environment variable GOOGLE_APPLICATION_CREDENTIALS.
--location string [Optional] The geographical region where the Cloud KMS resource is stored and accessed. (default "global")
--key-ring-name string [Required] Name of the key ring. If key ring with same name already exists then it will be used, else a new one will be created automatically.
--crypto-key-name string [Required] Name of the cryptographic key that will be used for encrypting and decrypting universe key. If crypto key with same name already exists then it will be used, else a new one will be created automatically.
--protection-level string [Optional] The protection level to use for this key. Allowed values (case sensitive): SOFTWARE and HSM. (default "HSM")
--endpoint string [Optional] GCP KMS Endpoint.
-h, --help help for create
Global Flags:
-a, --apiToken string YugabyteDB Anywhere api token.
--config string Config file, defaults to $HOME/.yba-cli.yaml
--debug Use debug mode, same as --logLevel debug.
--disable-color Disable colors in output. (default false)
-H, --host string YugabyteDB Anywhere Host (default "http://localhost:9000")
-l, --logLevel string Select the desired log level format. Allowed values: debug, info, warn, error, fatal. (default "info")
-n, --name string [Optional] The name of the configuration for the action. Required for create, delete, describe, update.
-o, --output string Select the desired output format. Allowed values: table, json, pretty. (default "table")
--timeout duration Wait command timeout, example: 5m, 1h. (default 168h0m0s)
--wait Wait until the task is completed, otherwise it will exit immediately. (default true)
```
HCV:
```
Create a Hashicorp Vault encryption at rest configuration in YugabyteDB Anywhere
Usage:
yba ear hashicorp create [flags]
Aliases:
create, add
Flags:
--vault-address string Hashicorp Vault address. Can also be set using environment variable VAULT_ADDR
--role-id string [Optional] Hashicorp Vault AppRole ID.
--secret-id string [Optional] Hashicorp Vault AppRole Secret ID.
--auth-namespace string [Optional] Hashicorp Vault AppRole Auth Namespace.
--token string [Optional] Hashicorp Vault Token. Required if AppRole credentials are not provided. Can also be set using environment variable VAULT_TOKEN
--secret-engine string [Optional] Hashicorp Vault Secret Engine. Allowed values: transit. (default "transit")
--key-name string [Optional] Hashicorp Vault key name. If key with same name already exists then it will be used, else a new one will be created automatically. (default "key_yugabyte")
--mount-path string [Optional] Hashicorp Vault mount path. (default "transit/")
-h, --help help for create
Global Flags:
-a, --apiToken string YugabyteDB Anywhere api token.
--config string Config file, defaults to $HOME/.yba-cli.yaml
--debug Use debug mode, same as --logLevel debug.
--disable-color Disable colors in output. (default false)
-H, --host string YugabyteDB Anywhere Host (default "http://localhost:9000")
-l, --logLevel string Select the desired log level format. Allowed values: debug, info, warn, error, fatal. (default "info")
-n, --name string [Optional] The name of the configuration for the action. Required for create, delete, describe, update.
-o, --output string Select the desired output format. Allowed values: table, json, pretty. (default "table")
--timeout duration Wait command timeout, example: 5m, 1h. (default 168h0m0s)
--wait Wait until the task is completed, otherwise it will exit immediately. (default true)
```
Original commit: 38d8ae8 / D37728
Test Plan:
`./yba ear hashicorp add -n dkumar-cli --token <token> --vault-address <>`
`./yba ear hcv create -n dkumar-cli-approle --role-id <> --secret-id <> --vault-address <>`
`./yba ear aws add -n dkumar-aws-cli --access-key-id <> --secret-access-key <> --cmk-id <>`
`./yba ear aws add -n dkumar-aws-cli --access-key-id <>--secret-access-key <> --cmk-policy-file-path policy.json `
` ./yba ear gcp add -n dkumar-cli-gcp --credentials-file-path gce.json --key-ring-name <> --crypto-key-name <>`
`./yba ear azu create -n dkumar-cli-az --vault-url <> --key-name <>--client-id <> --tenant-id <> --client-secret <>`
Reviewers: sneelakantan, skurapati
Reviewed By: skurapati
Subscribers: yugaware
Differential Revision: https://phorge.dev.yugabyte.com/D377691 parent 9f8c943 commit 2bf6354
File tree
29 files changed
+1285
-70
lines changed- managed/yba-cli
- cmd
- ear
- aws
- azu
- earutil
- gcp
- hashicorp
- eit/eitutil
- util
- docs
- internal
- client
- formatter
- aws
- ear
- gcp
- hashicorp
29 files changed
+1285
-70
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
48 | 48 | | |
49 | 49 | | |
50 | 50 | | |
51 | | - | |
52 | | - | |
| 51 | + | |
| 52 | + | |
53 | 53 | | |
54 | 54 | | |
55 | 55 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
25 | 25 | | |
26 | 26 | | |
27 | 27 | | |
28 | | - | |
| 28 | + | |
29 | 29 | | |
30 | 30 | | |
31 | 31 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
| 63 | + | |
| 64 | + | |
| 65 | + | |
| 66 | + | |
| 67 | + | |
| 68 | + | |
| 69 | + | |
| 70 | + | |
| 71 | + | |
| 72 | + | |
| 73 | + | |
| 74 | + | |
| 75 | + | |
| 76 | + | |
| 77 | + | |
| 78 | + | |
| 79 | + | |
| 80 | + | |
| 81 | + | |
| 82 | + | |
| 83 | + | |
| 84 | + | |
| 85 | + | |
| 86 | + | |
| 87 | + | |
| 88 | + | |
| 89 | + | |
| 90 | + | |
| 91 | + | |
| 92 | + | |
| 93 | + | |
| 94 | + | |
| 95 | + | |
| 96 | + | |
| 97 | + | |
| 98 | + | |
| 99 | + | |
| 100 | + | |
| 101 | + | |
| 102 | + | |
| 103 | + | |
| 104 | + | |
| 105 | + | |
| 106 | + | |
| 107 | + | |
| 108 | + | |
| 109 | + | |
| 110 | + | |
| 111 | + | |
| 112 | + | |
| 113 | + | |
| 114 | + | |
| 115 | + | |
| 116 | + | |
| 117 | + | |
| 118 | + | |
| 119 | + | |
| 120 | + | |
| 121 | + | |
| 122 | + | |
| 123 | + | |
| 124 | + | |
| 125 | + | |
| 126 | + | |
| 127 | + | |
| 128 | + | |
| 129 | + | |
| 130 | + | |
| 131 | + | |
| 132 | + | |
| 133 | + | |
| 134 | + | |
| 135 | + | |
| 136 | + | |
| 137 | + | |
| 138 | + | |
| 139 | + | |
| 140 | + | |
| 141 | + | |
| 142 | + | |
| 143 | + | |
| 144 | + | |
| 145 | + | |
| 146 | + | |
| 147 | + | |
| 148 | + | |
| 149 | + | |
| 150 | + | |
| 151 | + | |
| 152 | + | |
| 153 | + | |
| 154 | + | |
| 155 | + | |
| 156 | + | |
| 157 | + | |
| 158 | + | |
| 159 | + | |
| 160 | + | |
| 161 | + | |
| 162 | + | |
| 163 | + | |
| 164 | + | |
| 165 | + | |
| 166 | + | |
| 167 | + | |
| 168 | + | |
| 169 | + | |
| 170 | + | |
| 171 | + | |
| 172 | + | |
| 173 | + | |
| 174 | + | |
| 175 | + | |
| 176 | + | |
| 177 | + | |
| 178 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
26 | 26 | | |
27 | 27 | | |
28 | 28 | | |
29 | | - | |
| 29 | + | |
30 | 30 | | |
31 | 31 | | |
32 | 32 | | |
| |||
0 commit comments