awsx-cloudelements

command module
v1.1.7 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Sep 14, 2023 License: Apache-2.0 Imports: 1 Imported by: 0

README

awsx-cloudelements

This is a plugin subcommand for awsx cli ( https://github.com/Appkube-awsx/awsx#awsx ) cli.

For details about awsx commands and how its used in Appkube platform , please refer to the diagram below:

alt text

How to write plugin subcommand

Please refer to the instaruction - https://github.com/Appkube-awsx/awsx#how-to-write-a-plugin-subcommand

It has detailed instruction on how to write a subcommand plugin , build / test / debug / publish and integrate into the main commmand.

How to build / Test

        - With Vault URL    
        go run .\main.go --zone=us-east-1 --vaultUrl=http://<server-address>:<port>/v1/kv-v1 --accountId=SYNECTIKS/HR/AWS/1111111111 --vaultToken=xxxxxxxxxx
        or
        go run .\main.go getElementDetails --zone=us-east-1 --vaultUrl=http://<server-address>:<port>/v1/kv-v1 --accountId=SYNECTIKS/HR/AWS/111111111 --vaultToken=xxxxxxxxxx
        
        - With Access/Secret key
        go run .\main.go --zone=us-east-1 --accessKey=######### --secretKey=######### --externalId=######### --crossAccountRoleArn=#########
        or
        go run .\main.go  getElementDetails --zone=us-east-1 --accessKey=######### --secretKey=######### --externalId=######### --crossAccountRoleArn=#########

        Another way of testing is by running go install command
        go install
        - go install command creates an exe with the name of the module (e.g. awsx-cloudelements) and save it in the GOPATH
        - Now we can execute this command on command prompt as below
        - With Vault URL    
        awsx-cloudelements --zone=us-east-1 --vaultUrl=http://<server-address>:<port>/v1/kv-v1 --accountId=SYNECTIKS/HR/AWS/111111111 --vaultToken=xxxxxxxxxx
        - With Access/Secret key
        awsx-cloudelements --zone=us-east-1 --accessKey=######### --secretKey=######### --externalId=######### --crossAccountRoleArn=#########

what it does

This subcommand implement the following functionalities

  • getElementDetails - It will get the resource count summary for a given AWS account id

command input

  • valutURL = URL location of vault - that stores credentials to call API
  • acountId = The AWS account id.
  • zone = AWS region
  • vaultToken = Vault token to access vault

command output

{ ResourceCounts: [ { Count: 124, ResourceType: "AWS::S3::Bucket" }, { Count: 121, ResourceType: "AWS::Lambda::Function" }, { Count: 72, ResourceType: "AWS::CloudFormation::Stack" }, { Count: 50, ResourceType: "AWS::CloudWatch::Alarm" } ], TotalDiscoveredResources: 367 }

How to run

From main awsx command , it is called as follows:

  • awsx getElementDetails --zone=us-east-1 --vaultUrl=http://:/v1/kv-v1 --accountId=SYNECTIKS/HR/AWS/1111111111 --vaultToken=xxxxxxxxxx

    OR

  • awsx getElementDetails --zone=us-east-1 --accessKey=######### --secretKey=######### --externalId=######### --crossAccountRoleArn=#########

If you build it locally , you can simply run it as standalone command as

  • awsx-cloudelements --zone=us-east-1 --vaultUrl=http://:/v1/kv-v1 --accountId=SYNECTIKS/HR/AWS/1111111111 --vaultToken=xxxxxxxxxx

    OR

  • awsx-cloudelements --zone=us-east-1 --accessKey=######### --secretKey=######### --externalId=######### --crossAccountRoleArn=#########

Documentation

Overview

Copyright © 2023 Manoj Sharma [email protected]

Directories

Path Synopsis

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL