Coder Social home page Coder Social logo

meshcloud / collie-cli Goto Github PK

View Code? Open in Web Editor NEW
182.0 182.0 11.0 3.57 MB

Build and Deploy modular landing zones with collie on AWS, Azure & GCP

Home Page: https://collie.cloudfoundation.org

License: Apache License 2.0

Shell 1.16% TypeScript 97.59% PowerShell 1.10% Nix 0.14%
aws azure cli cloud cloud-native gcp terraform terragrunt

collie-cli's People

Contributors

dmurtic avatar dritz01234 avatar eraldo6 avatar felixzieger avatar florianow avatar gregorzavodnik avatar henryde avatar ishabakeh avatar j0g3sc avatar jelledb avatar johannesrudolph avatar malhussan avatar nroi avatar pascr avatar tfelix avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar

collie-cli's Issues

Ability to select AWS CLI profile

Some users might have multiple profiles for the AWS CLI, and we currently always use the default (because we do not specify an explicit profile). This might be problematic when a user has the management account configured as an additional profile.

Azure collection crashes when refresh token has expired

(Was found by @mweber-mc)

ERROR Could not parse JSON for command 'az tag list --subscription 8f25c6cb-7398-4054-8f25-3f950f7b0234'
ERROR Could not parse JSON as an error with code 1 was given. The following stderr is given: ERROR: AADSTS700082: The refresh token has expired due to inactivity. The token was issued on 2021-07-21T09:03:57.2770411Z and was inactive for 12:00:00.
Trace ID: b7d4e636-cd69-4894-a248-f6045adb2301
Correlation ID: 85028f2e-e16c-4818-954d-4d92ec0e374a
Timestamp: 2021-07-22 13:29:52Z
To re-authenticate, please run az login. If the problem persists, please contact your tenant administrator.
ERROR SyntaxError: Unexpected end of JSON input
at JSON.parse ()
at parseJsonStdoutWithLog (file://$deno$/bundle.js:17082:21)
at BasicAzureCliFacade.listTags (file://$deno$/bundle.js:18314:16)
at async AutoInstallAzureCliModuleDecorator.wrapCallWithInstallInterception (file://$deno$/bundle.js:18551:20)
at async AutoInstallAzureCliModuleDecorator.listTags (file://$deno$/bundle.js:18535:16)
at async file://$deno$/bundle.js:18407:20
at async RetryingAzureCliFacadeDecorator.retryable (file://$deno$/bundle.js:18422:20)
at async RetryingAzureCliFacadeDecorator.listTags (file://$deno$/bundle.js:18406:16)
at async file://$deno$/bundle.js:18015:26
at async Promise.all (index 0)

Cost CSV Export shows possible errors or warnings in first rows

When some error occur when doing a csv export of the tenant costs, the CSV headers are not set correctly, because warnings like "no management group selected for azure" or" gcp is not supported" are shown in the first rows and used as headers. Those warnings should be shown as console output instead and shouldn't be part of the CSV export.

image

Writing tags to the cloud

Is your feature request related to a problem? Please describe.
As a platform operator I would like to write tags to the cloud from Collie so I can fix any incompliances, e.g. some tenants are missing a cost center tag.

Reach of the feature request
Platform operators using tags or those that forgot to standardize some tags.

Impact of the feature request
We currently offer the analyze-tags command which is helpful to identify gaps, but if I want to fix the issue, I still have to hop into the actual cloud platforms.

How would a solution look like?

collie tags set-missing --tags cost_center would go into a mode where it ask per tenant that misses that tag:
What should the value be of cost_center? The user can type in the value and Collie will submit the result to the cloud platform.

(optional) Implementation Hints
Any hints that could help implementation?

Make sure to write the result to the cache.
Make sure to rename collie tenant analyze-tags to collie tags analyze-missing.
Try to catch exceptions for incompliant tags ,e.g. GCP has a lot of requirements.

Cost Collection crashes upon detecting a Sponsorship subscription

When running tenant costs ... the command crashes when the program encounters at least one Azure subscription of the type Sponsorship subscription. See the following logs as an example:

DEBUG getCostInformation: {"code":0,"stderr":"Command group 'consumption' is in preview. It may be changed/removed in a future release.\n","stdout":"[]\n"}
DEBUG Fetched 0 cost infos from Azure
DEBUG Quering Azure for tenant Microsoft Azure Sponsorship: {"from":"2021-05-01T00:00:00.000Z","to":"2021-05-31T23:59:59.000Z"}
DEBUG getCostInformation: {"code":1,"stderr":"Command group 'consumption' is in preview. It may be changed/removed in a future release.\n(422) Cost Management supports only Enterprise Agreement, Web direct and Microsoft Customer Agreement offer types. Subscription <sub-id> is not associated with a valid offer type.Cost Management supports only Enterprise Agreement, Web direct and Microsoft Customer Agreement offer types. Subscription <sub-id> is not associated with a valid offer type. (Request ID: 6e7bad96-a511-48fa-86fd-cf4569b26e70)\n","stdout":""}
ERROR SyntaxError: Unexpected end of JSON input
    at JSON.parse (<anonymous>)
    at BasicAzureCliFacade.getCostInformation (file:///Users/---/dev/mc/collie/src/azure/basic-azure-cli-facade.ts:86:17)
    at async AutoInstallAzureCliModuleDecorator.wrapCallWithInstallInterception (file:///Users/---/dev/mc/collie/src/azure/auto-install-azure-cli-module-decorator.ts:56:14)
    at async AutoInstallAzureCliModuleDecorator.getCostInformation (file:///Users/---/dev/mc/collie/src/azure/auto-install-azure-cli-module-decorator.ts:43:12)
    at async RetryingAzureCliFacadeDecorator.getCostInformation (file:///Users/---/dev/mc/collie/src/azure/retrying-azure-cli-facade-decorator.ts:38:14)
    at async AzureMeshAdapter.getTenantCostsForWindow (file:///Users/---/dev/mc/collie/src/azure/azure-mesh-adapter.ts:71:28)
    at async AzureMeshAdapter.listTenantCosts (file:///Users/---/dev/mc/collie/src/azure/azure-mesh-adapter.ts:51:24)
    at async Promise.all (index 0)
    at async MultiMeshAdapter.listTenantCosts (file:///Users/---/dev/mc/collie/src/mesh/multi-mesh-adapter.ts:26:13)
    at async Command.listTenantsCostAction [as fn] (file:///Users/---/dev/mc/collie/src/commands/tenant.command.ts:113:26)
✘-1 ~/dev/mc/collie/src [develop|✚ 4…2] 

While the error is not wrong, the program should continue and print a warning that this subscription could not be processed.

Error detection doesn't show missing rights; says you're not logged in instead

The following happened when trying to collect IAM information across GCP tenants when missing a right for one of the tenants:

ERROR: (gcloud.projects.get-ancestors-iam-policy) User is not permitted to access IAM policy for one or more of the ancestors

Instead, Collie CLI tells me:

INFO You are not logged in into GCP CLI. Please disconnect GCP with "Collie config --disconnect GCP or login into GCP CLI."

This is wrong information and we should check more explicitly if it's really a "not logged in" situation.

Implementation hint:
When receiving result code 1 from gcloud, we have to detect if it's really a "not logged in" error. If not, we should throw something like "An unknown error occurred for tenant XYZ: " + result.stderr so it's clearly visible what went wrong. As a bonus, it would also be great to know for which tenant this issue occurred (GCP does not include this information in the response)

Multi-cloud budget alerts

Every public cloud provider offers the possibility to set alerts that warn you about costs. Sadly a lot of people don't do it and have bad surprises at the end of the month. Also REALLY annoying you have to set alerts for every tenant individually 🤪. How cool would it be for an enterprise architect to set alerts globally or only for sandbox environments? BTW I think this also would be amazing for a single cloud even to set alerts on multiple tenants at once.

Found unknown principalType for GCP: deleted, domain

I ran collie tenant iam on our production GCP org and hit the following issue

22:18 $ ./run.sh tenant iam 
Check file:///Users/jrudolph/dev/mc/collie-cli/src/main.ts
WARNING This CLI does not support AWS Role Assignment analysis at the moment. Please keep an eye out for further development on this.
ERROR Error: Found unknown principalType for GCP: deleted
    at GcpMeshAdapter.toPrincipalType (file:///Users/jrudolph/dev/mc/collie-cli/src/gcp/gcp-mesh-adapter.ts:118:15)
    at GcpMeshAdapter.getRoleAssignmentsForTenant (file:///Users/jrudolph/dev/mc/collie-cli/src/gcp/gcp-mesh-adapter.ts:93:33)

Another error message from the same spot is ERROR Error: Found unknown principalType for GCP: domain.

collie upgrade

Is your feature request related to a problem? Please describe.
Collie ships new updates regularly, this is cool :-) But I have to "work" to get them.

Can you support a collie upgrade command like deno upgrade?

Reach of the feature request
me

Impact of the feature request
Saves me time, I can use more awesome collie stuff

How would a solution look like?
see below

(optional) Implementation Hints
Cliffy seems to have that builtin 😍 https://cliffy.io/command/index.html#%E2%9D%AF-upgrade-command

Improve currency detection and display

There should be a way to detect if the same currency is added up during cost collection. The fetched currency symbol should also be saved in order to display it in the tenant cost overview at the end.
This should be done for Azure and AWS as these are the platforms that currently support cost collection.

Analyze tag values

We are currently capable of analyzing tags on a global level, but it would also be nice to analyze the underlying tag values of one single tag. Take the environment tag for example; I would like to know what values are used and by what percentage. This would allow me to identify inconsistencies and see what % of cloud tenants are using a particular environment. The command could work like

collie analyze-tag-values --tag environment
->

Analyzed 92 tenants
The environment tag has the following values:
-- production (12%)
-- test (20%)
-- development (64%)
-- dev (4%) <-- found inconsistency

Consistently use plural/singular for commands

It's a minor nitpick but I just tried to run collie tenant cost and had to learn that it's collie tenant costs instead.

So we have

  • collie tenant (singular)
  • collie tenant list (singular)
  • collie tenant iam (singular)
  • collie tenant costs (plural)
  • collie tenant analyze-tags (plural)

I don't have a strong preference and am not sure this needs to be harmonized at all, just wanted to point out this happened. Other tools for example do it like this

  # List all pods in ps output format.
  kubectl get pods
  
  # List all pods in ps output format with more information (such as node name).
  kubectl get pods -o wide
  
  # List a single replication controller with specified NAME in ps output format.
  kubectl get replicationcontroller web

collie [command] --help invocations are slow

I've just setup collie cli on a new machine and was surprised by the time it takes to run a simple collie --help or collie tenant --help. I have all three cloud provider CLIs installed on my machine, and running the --help commands is something I do quite often when working with a new tool.

Here's some output from my machine.

time collie --help
...
real	0m3.965s
user	0m2.099s
sys	0m0.629s


time collie tenant --help
...
real	0m2.732s
user	0m1.725s
sys	0m0.440s

While it's running my terminal (macOS standard terminal) shows me that it's running python 3.7, so I think there's some auto-detection of provider CLI going on, even though I have a valid collie config already. Interestingly also collie --version is "slow".

18:30 $ collie config list
┌───────┬──────┬───────┐
│ AWS   │ GCP  │ Azure │
├───────┼──────┼───────┤
│ false │ true │ true  │
└───────┴──────┴───────┘
1 entry. 
✔ ~ 
18:30 $ time collie --version
0.3.0
real	0m2.710s
user	0m1.724s
sys	0m0.429s

Error executing Azure CLI: - Subscription '...' not recognized

I have a subscription with a space in the name ("A B C"). Collie chokes on this

22:20 $ ./run.sh tenant iam 
WARNING This CLI does not support AWS Role Assignment analysis at the moment. Please keep an eye out for further development on this.
ERROR Error: Error executing Azure CLI:  - Subscription 'A' not recognized.d --all --output json
UnrecognizedArgumentError: unrecognized arguments: B C
Try this: 'az role assignment list --role a_role'
Still stuck? Run 'az --help' to view all commands or go to 'https://docs.microsoft.com/en-us/cli/azure/reference-index?view=azure-cli-latest' to learn more

    at BasicAzureCliFacade.checkForErrors (file:///Users/jrudolph/dev/mc/collie-cli/src/azure/basic-azure-cli-facade.ts:196:13)
    at BasicAzureCliFacade.getRoleAssignments (file:///Users/jrudolph/dev/mc/collie-cli/src/azure/basic-azure-cli-facade.ts:177:10)
    at async AutoInstallAzureCliModuleDecorator.wrapCallWithInstallInterception (file:///Users/jrudolph/dev/mc/collie-cli/src/azure/auto-install-azure-cli-module-decorator.ts:75:14)
    at async AutoInstallAzureCliModuleDecorator.getRoleAssignments (file:///Users/jrudolph/dev/mc/collie-cli/src/azure/auto-install-azure-cli-module-decorator.ts:66:12)
    at async file:///Users/jrudolph/dev/mc/collie-cli/src/azure/retrying-azure-cli-facade-decorator.ts:71:14

I suppose this is due to the way the ShellRunner accepts a single string and then does a const commands = commandStr.split(" "); before invoking the Deno.run API and thus building an incorrect argument array

Support `collie tenant iam` for AWS

We currently do not support AWS for retrieving IAM information. This has the following two reasons:

  • It is unclear how exactly you can properly execute commands across multiple AWS Accounts.
  • It is unclear how exactly the role model within AWS should look like and if it integrates well with the shared model that is currently used by Azure & GCP (which is pretty much identical)

Check for tty pipe only upon startup

Currently, we are checking on different levels if the collie command gets piped. @tfelix recommends doing it once on startup to prevent any errors from occurring when the stdout is busy.

@JohannesRudolph suggests: we could build an abstraction over tools like fmt so we have a "ttyAware" fmt module that exposes the same API as fmt but NOPs all formatting calls in case the stdout is not a tty.

Auto-detect root management group in Azure

Right now we have the possibility to set a management group in the config, and by doing so, the cost query will be faster.

It is in fact possible to see management groups & which one is the root management group by using the following commands:

az account management-group list

az account management-group show --name "<id>"

collie tenant list crashes with "Unexecpted end of JSON input"

I logged into az and gcloud and ran collie tenant list --debug.

The result is:

DEBUG listProjects: {"code":0,"stderr":"","stdout":"[\n  {\n    \"createTime\": \"2021-06-23T07:12:19.599Z\",\n    \"labels\": {\n      \"mesh-customer\": \"managed-customer\",\n      \"mesh-project\": \"test-dev\",\n      \"meshstack_cident\": 
...
\"type\": \"organization\"\n    },\n    \"projectId\": \"meshstack-root\",\n    \"projectNumber\": \"864000543001\"\n  }\n]\n"}

ERROR SyntaxError: Unexpected end of JSON input-a93c-c9e95d079a13
    at JSON.parse (<anonymous>)
    at BasicAzureCliFacade.listTags (file://$deno$/bundle.js:17995:21)
    at async AutoInstallAzureCliModuleDecorator.wrapCallWithInstallInterception (file://$deno$/bundle.js:18189:20)
    at async AutoInstallAzureCliModuleDecorator.listTags (file://$deno$/bundle.js:18178:16)
    at async file://$deno$/bundle.js:18049:20
    at async RetryingAzureCliFacadeDecorator.retryable (file://$deno$/bundle.js:18059:20)
    at async RetryingAzureCliFacadeDecorator.listTags (file://$deno$/bundle.js:18048:16)
    at async file://$deno$/bundle.js:17852:26
    at async Promise.all (index 1)
    at async Promise.all (index 0)

Integrate with `EXPORT AWS_PROFILE=...` way of setting profiles

Is your feature request related to a problem? Please describe.
We recently introduced a feature to pick an AWS profile that Collie will use for doing CLI calls. But @SimonTheLeg made a good remark where he explained that some AWS devs will be used to doing so using the EXPORT AWS_PROFILE=... method.

Reach of the feature request
AWS developers using EXPORT AWS_PROFILE for picking profiles

Impact of the feature request
They might be confused about what exact profile is used. Especially if they first run EXPORT AWS_PROFILE and then collie tenant list where Collie might use a different profile.

How would a solution look like?
At best, Collie would have to detect EXPORT AWS_PROFILE, and use that profile instead of the one configured using collie config aws.

Cancelling a collie run with SIGINT (Ctrl + C) leads to error messages

I sometimes find myself aborting a collie command that has a long runtime, e.g. when running collie tenant cost and I noticed I had specified the wrong time window.

Every time I do this and while queries are still running I'm getting "random" error messages instead of a clean exit.

[jrudolph@localhost ~]$ collie tenant list
^CERROR Could not parse JSON: nts --output json
ERROR SyntaxError: Unexpected end of JSON input
    at JSON.parse (<anonymous>)
    at parseJsonWithLog (file://$deno$/bundle.js:17093:21)

In the face of a SIGINT I think a "well-behaved" collie should

  • immediately SIGINT any child-processes that it's running (Deno appears to already do this)
  • swallow error messages that are a result of SIGINT-ing the child processes, esp. failing to parse cloud platform cli output

Support GCP cost collection

GCP cost collection is currently not supported as their CLI does not offer any cost export via gcloud CLI. This issue will be used to track progress on this and/or figure out any other methods of retrieving GCP costs.

Collie crashes when requesting AWS tenants

The following error occurs when running collie tenant list

ERROR Error: 
An error occurred (TooManyRequestsException) when calling the ListTagsForResource operation (reached max retries: 2): AWS Organizations can't complete your request because another request is already in progress. Try again later.

    at AwsCliFacade.checkForErrors (file://$deno$/bundle.js:17686:19)
    at AwsCliFacade.listTags (file://$deno$/bundle.js:17646:14)
    at async file://$deno$/bundle.js:17701:26
    at async Promise.all (index 40)
    at async Promise.all (index 0)
    at async MultiMeshAdapter.getMeshTenants (file://$deno$/bundle.js:17833:17)
    at async CachingMeshAdapterDecorator.getMeshTenants (file://$deno$/bundle.js:18173:29)
    at async Command.listTenantAction [as fn] (file://$deno$/bundle.js:18622:24)
    at async Command.execute (file://$deno$/bundle.js:7117:13)
    at async Command.parse (file://$deno$/bundle.js:7058:24)

We might need to do some chunking of requests to prevent too many requests from firing at once.

Consider limiting azure subscriptions to a single AAD tenant

In #72 I described an interaction I had with collie where I thought it was returning me Azure subscriptions from a "poisoned" cache built from a faulty az login I had running against a wrong AAD tenant.

Since then I've found out that doing an az login --tenant meshcloud.io appears to not (!) filter the subscriptions returned from az account list. This is a problem because it makes collie tenant list behave semantically differently on different cloud platforms.

  • A gcloud projects list will only return projects from the GCP organization I'm currently logged in to
  • An az account list will return info from different AAD tenants

For me this is a problem because it makes collie commands querying azure (e.g. collie tenant iam) really slow because it churns through many AAD tenants, most of them where it does not have enough permission to retrieve useful data.

Sign OS X binaries

As of now, the OS X binaries are not signed. For some users, this results in a warning that the application is insecure and it has to be moved to the bin.

By signing our OS X binaries, this situation will no longer occur and it will increase the security of Collie for OS X users.

policy.policy.bindings is not iterable

Using collie v0.3.0

ERROR TypeError: policy.policy.bindings is not iterableoud-dev_0 --include-inherited --all --output json
    at GcpMeshAdapter.getRoleAssignmentsForTenant (file://$deno$/bundle.js:18139:49)
    at async GcpMeshAdapter.attachTenantRoleAssignments (file://$deno$/bundle.js:18126:37)
    at async Promise.all (index 1)
    at async MultiMeshAdapter.attachTenantRoleAssignments (file://$deno$/bundle.js:18044:9)
    at async CachingMeshAdapterDecorator.attachTenantRoleAssignments (file://$deno$/bundle.js:18586:13)
    at async Command.listIamAction [as fn] (file://$deno$/bundle.js:19197:5)

Also attaching a screenshot as it seems the loader/spinner output displayed while the command is running is only partially overwritten by the error message (see the breakup of red to white text)

image

Multi-cloud user off-boarding

Is your feature request related to a problem? Please describe.
As @tfelix found out, it looks absolutely horrible to offboard users in AWS. We could automate this and also do it simultaneously for the other cloud platforms too.

Reach of the feature request
Platforms operators working with AWS (haven't checked Azure & GCP, but it cannot be easy)

Impact of the feature request
Without a nice automation, you have to write a fairly long script for deleting a user including the user's various properties such as keys, CLI profiles, and more.

How would a solution look like?
collie user offboard [email protected]
Take inspiration from: https://github.com/meshcloud/infrastructure/pull/35
(It's a closed repo from meshcloud)

(optional) Implementation Hints
Have a look at the mentioned PR above.

Deprovision Tenants with Collie

Is your feature request related to a problem? Please describe.
I would love to deprovision tenants using Collie as this is a huge pain in the ass by doing it manually in the UI. In my example, this problem goes for AWS, but it might be just as painful for the other platforms as well.

Reach of the feature request
Platform Operators and Project Owners responsible for deleting accounts

Impact of the feature request
Deleting faster could result in a better user experience and even in potential cost savings by deprovisioning unused resources ASAP.

How would a solution look like?
collie tenant delete <identifier>
Not sure how the identifier part would work exactly though. Especially if you have duplicate identifiers across multiple platforms.

(optional) Implementation Hints
Check if the cloud CLIs allow for deletion. It might be that this is not possible.

Tenant list caching is not transparent causing issues switching e.g. az login --tenant ...

I had the following cli interaction

collie tenant list
... 
# returned me subscriptions from another AAD tenant as I wanted to look at
85 entries. GCP: 47, AWS: 10, Azure: 28

# I figure out my az is logged into the wrong tenant, alright I'll fix this
az login --tenant other.example.com

collie tenant list
...
85 entries. GCP: 47, AWS: 10, Azure: 28
# returns the same list as before, no tenants from other.example.com are returned

Now, I know why collie gives me the cached list but this is not transparent anywhere in the output.
We have a couple of options

  • make the AAD/GCP Org/AWS profile (see #10 ) part of collie config and use it conistently everywhere
  • invalidate the cache when detecting a switch of AAD/GCP Org/AWS profile
  • just make the caching transparent and allow a --refresh option (potentially global?)

I'm kind of leaning towards the 3rd option for it offers the lowest complexity and explicit cache control is always a good idea. So maybe my interaction could look like this instead

collie tenant list
... 
# returned me subscriptions from another AAD tenant as I wanted to look at
85 entries. GCP: 47, AWS: 10, Azure: 28 (78.12s - entries retrieved from cloud)

# I figure out my az is logged into the wrong tenant, alright I'll fix this
az login --tenant other.example.com

collie tenant list
...
85 entries. GCP: 47, AWS: 10, Azure: 28 (0.01s - entries retrieved from cache)

# okay, I need to refresh
collie tenant list --refresh
...
85 entries. GCP: 47, AWS: 10, Azure: 46 (90.12s - entries retrieved from cloud)

Loader/spinner not correctly hidden when rendering an error message

Extracted this part from #67

image

It seems the loader/spinner output displayed while the command is running is only partially overwritten by an error message occurring during the run (see the breakup of red to white text).

I've had a quick look at the code that I though would be responsible for it, but couldn't spot anything "obviously" wrong, i.e. it seems to explicitly handle exceptions from running commands

public async run(commandStr: string): Promise<ShellOutput> {
try {
this.startLoading(commandStr);
return await this.runner.run(commandStr);
} catch (e) {
throw e;
} finally {
this.stopLoading();
}
}

This probably needs a more thorough investigation.

tenant list returning Could not parse JSON

ERROR Could not parse JSON:

SyntaxError: Unexpected end of JSON input
at JSON.parse ()
at parseJsonWithLog (file://$deno$/bundle.js:15910:21)
at BasicAzureCliFacade.listTags (file://$deno$/bundle.js:17175:16)
at async AutoInstallAzureCliModuleDecorator.wrapCallWithInstallInterception (file://$deno$/bundle.js:17420:20)
at async AutoInstallAzureCliModuleDecorator.listTags (file://$deno$/bundle.js:17404:16)
at async file://$deno$/bundle.js:17268:20
at async RetryingAzureCliFacadeDecorator.retryable (file://$deno$/bundle.js:17283:20)
at async RetryingAzureCliFacadeDecorator.listTags (file://$deno$/bundle.js:17267:16)
at async file://$deno$/bundle.js:16868:26
at async Promise.all (index 0)

Running on MacOS and connected to Azure and AWS

Running `collie tenant list` returns error

Hey guys,

I have successfully installed collie, however when I run collie tenant list it returns the following error

❯ collie tenant list
ERROR Could not parse JSON: ounts --output json
ERROR SyntaxError: Unexpected end of JSON input
    at JSON.parse (<anonymous>)
    at parseJsonWithLog (file://$deno$/bundle.js:17093:21)
    at AwsCliFacade.listAccounts (file://$deno$/bundle.js:17675:32)
    at async AwsMeshAdapter.getMeshTenants (file://$deno$/bundle.js:17736:26)
    at async Promise.all (index 0)
    at async MultiMeshAdapter.getMeshTenants (file://$deno$/bundle.js:17931:17)
    at async CachingMeshAdapterDecorator.getMeshTenants (file://$deno$/bundle.js:18292:29)
    at async Command.listTenantAction [as fn] (file://$deno$/bundle.js:18775:24)
    at async Command.execute (file://$deno$/bundle.js:7117:13)
    at async Command.parse (file://$deno$/bundle.js:7058:24)

Running `collie config` returns error

Hey guys i have successfully installed collie

❯ collie
INFO No configuration file found. I will create one for you :)
INFO ... searching for installed cloud CLIs
I see you already have these cloud CLIs installed: AWS, Azure.
Do you want to connect these to Collie? [y,N]:
y
INFO Saved your configuration here: /Users/simonbein/.config/collie-cli/config.json. Have fun using Collie!

However when I run collie config it returns the following

❯ collie config
error: TypeError: Cannot read property 'showHelp' of undefined
    at changeConfig (file://$deno$/bundle.js:17635:17)
    at file://$deno$/bundle.js:17621:9

/Users/simonbein/.config/collie-cli/config.json looks like this

{
  "connected": {
    "AWS": true,
    "GCP": false,
    "Azure": true
  },
  "cache": {
    "evictionDelayHrs": 24
  },
  "azure": {
    "parentManagementGroups": []
  }
}

Add Info on tags for cloud costs to Options section

When analyzing my cloud costs, I would like to know which tags are used in order to map costs to corresponding cost centers etc. It's great that this is possible with Collie, but the functionality is a bit hidden.

My proposal would be to add this info to the Options section of the collie tenant costs command, where it says "Defines the output format." Just add: "Use csv/json/yaml to view tags.

Remove blue color of `INFO` log statements

Is your feature request related to a problem? Please describe.
We should remove the blue color of log statements of level INFO. They look unreadable in a PowerShell console

Reach of the feature request
Windows users making use of PowerShell with the

Impact of the feature request
log.info() statements are not visible.

How would a solution look like?
Either change the color to something less used as a background (purple?) or just remove the color altogether.

(optional) Implementation Hints
denoland/std#1077 -> Changing the color is currently not possible

Unify the tenant command invocation

Is your feature request related to a problem? Please describe.
Currently working with tenant-related data poses some problems, it is split into costs and regular tenant listing, its hard to decide what information to display where. What should be done if more information is added gradually like users? Using different invocation commands is confusing.

Impact of the feature request
Hard to use collie

How would a solution look like?
A better approach would be to have a unified structure where the user can decide by himself what information he wants to display. Something like:

collie tenants list --show platform platformTenantName costs tags

if not given only a default set of information is shown (can be equal to the current collie tenant list)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.