aws

package
v0.0.0-...-df6e0f9 Latest Latest
Warning

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

Go to latest
Published: Oct 14, 2021 License: Apache-2.0 Imports: 27 Imported by: 0

Documentation

Index

Constants

View Source
const PORT = 3310

Variables

This section is empty.

Functions

func AskMFAToken

func AskMFAToken() (string, error)

AskMFAToken gets MFA token from command line interface

func GenerateCreds

func GenerateCreds(assumeRole, name string) *credentials.Credentials

GenerateCreds creates new credentials with MFA

func GetASGClientFn

func GetASGClientFn(sess client.ConfigProvider, region string, creds *credentials.Credentials) *autoscaling.AutoScaling

func GetAwsSession

func GetAwsSession() *session.Session

GetAwsSession creates new session for AWS

func GetAwsSessionWithConfig

func GetAwsSessionWithConfig(region string) (*session.Session, error)

GetAwsSessionWithConfig creates new session for AWS

func GetDBAuthToken

func GetDBAuthToken(target, region, user string, creds *credentials.Credentials) (string, error)

Get DB Auth token

func GetELBClientFn

func GetELBClientFn(sess client.ConfigProvider, region string, creds *credentials.Credentials) *elbv2.ELBV2

func GetEcrClientFn

func GetEcrClientFn(sess client.ConfigProvider, region string, creds *credentials.Credentials) *ecr.ECR

func GetIAMClientFn

func GetIAMClientFn(sess client.ConfigProvider, creds *credentials.Credentials) *iam.IAM

func GetRDSClientFn

func GetRDSClientFn(sess client.ConfigProvider, region string, creds *credentials.Credentials) *rds.RDS

func GetS3ClientFn

func GetS3ClientFn(sess client.ConfigProvider, region string, creds *credentials.Credentials) *s3.S3

func GetSTSClientFn

func GetSTSClientFn(sess client.ConfigProvider, region string, creds *credentials.Credentials) *sts.STS

func GetWafClientFn

func GetWafClientFn(sess client.ConfigProvider, region string, creds *credentials.Credentials) *waf.WAF

func ParseWebACLID

func ParseWebACLID(str string) string

ParseWebACLID parses web ACL ID from option string

func SelectTarget

func SelectTarget(opt []string) (string, error)

SelectTarget select only one target from candidates

Types

type Client

type Client struct {
	RDSClient *rds.RDS
	STSClient *sts.STS
	S3Client  *s3.S3
	WafClient *waf.WAF
	ECRClient *ecr.ECR
	IAMClient *iam.IAM
	ELBClient *elbv2.ELBV2
	ASGClient *autoscaling.AutoScaling
	Region    string
}

func NewClient

func NewClient(sess client.ConfigProvider, region string, creds *credentials.Credentials) Client

func (Client) CheckAccessKeyExpired

func (c Client) CheckAccessKeyExpired(name, accessKeyID string) error

CheckAccessKeyExpired check whether access key is expired or not

func (Client) CheckMFAToken

func (c Client) CheckMFAToken(name string) error

CheckMFAToken checks MFA authentication for specific functions

func (Client) CheckWhoIam

func (c Client) CheckWhoIam(out io.Writer) error

CheckWhoIam calls get-caller-identity and print the result

func (Client) CreateMaintenanceRule

func (c Client) CreateMaintenanceRule(listenerArn *string, message string) error

CreateMaintenanceRule creates maintenance rule

func (Client) CreateNewCredentials

func (c Client) CreateNewCredentials(name string) (*iam.AccessKey, error)

CreateNewCredentials creates new ACCESS_KEY, SECRET_ACCESS_KEY

func (Client) DeleteAccessKey

func (c Client) DeleteAccessKey(accessKey, userName string) error

DeleteAccessKey deletes access key of user

func (Client) DeleteMaintenanceRule

func (c Client) DeleteMaintenanceRule(ruleArn *string) error

DeleteMaintenanceRule deletes maintenance rule

func (Client) DescribeListeners

func (c Client) DescribeListeners(loadbalancerArn string) ([]*elbv2.Listener, error)

func (Client) DescribeRule

func (c Client) DescribeRule(ruleID string) (*waf.Rule, error)

DescribeRule describes web ACL rule

func (Client) DescribeRules

func (c Client) DescribeRules(listenerArn *string) ([]*elbv2.Rule, error)

DescribeRules describes list of rules in listener

func (Client) DescribeWebACL

func (c Client) DescribeWebACL(target string) (*schema.WebACL, error)

DescribeWebACL describes web acl

func (Client) GetAccessKeyList

func (c Client) GetAccessKeyList(name string) ([]*iam.AccessKeyMetadata, error)

GetAccessKeyList lists all access key of user

func (Client) GetAllWebACLs

func (c Client) GetAllWebACLs() ([]*waf.WebACLSummary, error)

GetAllWebACLs retrieves all ACLs in AWS WAF

func (Client) GetAuthorizeToken

func (c Client) GetAuthorizeToken() (*ecr.AuthorizationData, error)

GetAuthorizeToken retrieves authorize token via API

func (Client) GetExactASGNames

func (c Client) GetExactASGNames(asgName string) ([]*string, error)

func (Client) GetIPSet

func (c Client) GetIPSet(dataID string) (*waf.IPSet, error)

GetIPSet retrieves information about IP Set

func (Client) GetLoadtestASGStatus

func (c Client) GetLoadtestASGStatus(asgName *string) (*int64, error)

func (Client) GetLoadtestRDSStatus

func (c Client) GetLoadtestRDSStatus(dbClusterID string) (*string, error)

func (Client) GetSessionToken

func (c Client) GetSessionToken(mfaSerialNumber, mfaToken string) error

getSessionToken retrieves session token with MFA authentication

func (Client) GetWebACLInfo

func (c Client) GetWebACLInfo(target string) (*waf.WebACL, error)

GetWebACLInfo retrieves web acl information

func (Client) HeadS3Bucket

func (c Client) HeadS3Bucket(bucket string) error

HeadS3Bucket checks if s3 bucket exists or not

func (Client) SelectACL

func (c Client) SelectACL() (string, error)

SelectAcl selects target acl name from all acl list

func (Client) StartLoadtestASG

func (c Client) StartLoadtestASG(asgName *string) error

func (Client) StartLoadtestRDS

func (c Client) StartLoadtestRDS(dbClusterID string) (*string, error)

func (Client) StopLoadtestASG

func (c Client) StopLoadtestASG(asgName *string) error

func (Client) StopLoadtestRDS

func (c Client) StopLoadtestRDS(dbClusterID string) (*string, error)

Jump to

Keyboard shortcuts

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