Skip to content

Instantly share code, notes, and snippets.

View sathish1223's full-sized avatar

sathish sathish1223

  • india
View GitHub Profile
// GetServiceFromArn removes the arn:aws: component string of
// the name and returns the first keyword that appears, svc
func ServiceNameFromARN(arn *string) *string {
shortArn := strings.Replace(*arn, "arn:aws:", "", -1)
sliced := strings.Split(shortArn, ":")
return &sliced[0]
}
// Short ARN removes the unnecessary info from the ARN we already
// know at this point like region, account id and the service name.
@sathish1223
sathish1223 / caws.go
Created March 7, 2022 08:39 — forked from joaoferrao/caws.go
AWS Resource Crawler
package main
import (
"fmt"
"github.com/aws/aws-sdk-go/aws"
"github.com/aws/aws-sdk-go/aws/session"
"github.com/aws/aws-sdk-go/service/resourcegroupstaggingapi"
"github.com/olekukonko/tablewriter"
"os"
"strings"