This repository has been archived by the owner on Aug 16, 2022. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 40
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Upgrade sdk v0.2.0 protocol v2 (#66)
* Upgrade sdk v0.2.0 protocol v2
- Loading branch information
Showing
44 changed files
with
788 additions
and
553 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,86 +1,33 @@ | ||
package client | ||
|
||
// Provider Configuration | ||
type Account struct { | ||
ID string | ||
RoleARN string `yaml:"role_arn"` | ||
ID string `hcl:"label,optional"` | ||
RoleARN string `hcl:"role_arn,optional"` | ||
} | ||
|
||
type Config struct { | ||
Regions []string `yaml:"regions"` | ||
Accounts []Account `yaml:"accounts"` | ||
AWSDebug bool `yaml:"aws_debug"` | ||
LogLevel *string `yaml:"log_level"` | ||
MaxRetries int `yaml:"max_retries" default:"5"` | ||
MaxBackoff int `yaml:"max_backoff" default:"30"` | ||
Resources []Resource | ||
Regions []string `hcl:"regions,optional"` | ||
Accounts []Account `hcl:"accounts,block"` | ||
AWSDebug bool `hcl:"aws_debug,optional"` | ||
MaxRetries int `hcl:"max_retries,optional" default:"5"` | ||
MaxBackoff int `hcl:"max_backoff,optional" default:"30"` | ||
} | ||
|
||
type Resource struct { | ||
Name string | ||
Other map[string]interface{} `yaml:",inline"` | ||
func (c Config) Example() string { | ||
return `configuration { | ||
// Optional. if you want to assume role to multiple account and fetch data from them | ||
//accounts "<YOUR ID>"{ | ||
// Optional. Role ARN we want to assume when accessing this account | ||
// role_arn = <YOUR_ROLE_ARN> | ||
// } | ||
// Optional. by default assumes all regions | ||
// regions = ["us-east-1", "us-west-2"] | ||
// Optional. Enable AWS SDK debug logging. | ||
aws_debug = false | ||
// The maximum number of times that a request will be retried for failures. Defaults to 5 retry attempts. | ||
// max_retries = 5 | ||
// The maximum back off delay between attempts. The backoff delays exponentially with a jitter based on the number of attempts. Defaults to 60 seconds. | ||
// max_backoff = 30 | ||
} | ||
` | ||
} | ||
|
||
const DefaultConfigYaml = ` | ||
- name: aws | ||
# accounts: # Optional. if you want to assume role to multiple account and fetch data from them | ||
# - role_arn: <CHANGE_THIS> | ||
# regions: # Optional. if commented out assumes all regions | ||
# - us-east-1 | ||
# - us-west-2 | ||
# aws_debug: false # Optional. if commented out will enable AWS SDK debug logging. | ||
# max_retries: 5 # Optional. The maximum number of times that a request will be retried for failures. Defaults to 5 retry attempts. | ||
# max_backoff: 30 # Optional. The maximum back off delay between attempts. The backoff delays exponentially with a jitter based on the number of attempts. Defaults to 60 seconds. | ||
resources: # You can comment resources your are not interested in for faster fetching. | ||
- name: autoscaling.launch_configurations | ||
- name: cloudfront.cache_policies | ||
- name: cloudfront.distributions | ||
- name: cloudtrail.trails | ||
- name: cloudwatch.alarms | ||
- name: cloudwatchlogs.filters | ||
- name: directconnect.gateways | ||
- name: directconnect.virtual_gateways | ||
- name: directconnect.virtual_interfaces | ||
- name: ec2.customer_gateways | ||
- name: ec2.ebs_volumes | ||
- name: ec2.flow_logs | ||
- name: ec2.images | ||
- name: ec2.instances | ||
- name: ec2.internet_gateways | ||
- name: ec2.nat_gateways | ||
- name: ec2.network_acls | ||
- name: ec2.route_tables | ||
- name: ec2.security_groups | ||
- name: ec2.subnets | ||
- name: ec2.transit_gateways | ||
- name: ec2.vpc_peering_connections | ||
- name: ec2.vpcs | ||
- name: ec2.vpc_endpoints | ||
- name: ecs.clusters | ||
- name: ecr.repositories | ||
- name: efs.filesystems | ||
- name: eks.clusters | ||
- name: elasticbeanstalk.environments | ||
- name: elbv2.load_balancers | ||
- name: elbv2.target_groups | ||
- name: emr.clusters | ||
- name: fsx.backups | ||
- name: iam.groups | ||
- name: iam.password_policies | ||
- name: iam.policies | ||
- name: iam.roles | ||
- name: iam.users | ||
- name: iam.virtual_mfa_devices | ||
- name: iam.openid_connect_identity_providers | ||
- name: iam.saml_identity_providers | ||
- name: kms.keys | ||
- name: organizations.accounts | ||
- name: rds.certificates | ||
- name: rds.clusters | ||
- name: rds.db_subnet_groups | ||
- name: rds.instances | ||
- name: redshift.clusters | ||
- name: redshift.subnet_groups | ||
- name: s3.buckets | ||
- name: sns.subscriptions | ||
- name: sns.topics` |
Oops, something went wrong.