Documentation ¶
Index ¶
- Constants
- Variables
- func AcmClient() *acm.ACM
- func AcmClientExplicit(accessKeyID, accessKeySecret, region string) *acm.ACM
- func AcmListCertificates(ctx context.Context) ([]*acm.CertificateSummary, error)
- func Api(ctx context.Context, name string) (*apigatewayv2.Api, error)
- func ApiClient() *apigatewayv2.ApiGatewayV2
- func ApiClientExplicit(accessKeyID, accessKeySecret, region string) *apigatewayv2.ApiGatewayV2
- func ApiList(ctx context.Context) ([]*apigatewayv2.Api, error)
- func ApiListDomains(ctx context.Context) ([]*apigatewayv2.DomainName, error)
- func ApiUrl(ctx context.Context, name string) (string, error)
- func ApiUrlDomain(ctx context.Context, name string) (string, error)
- func ApiWebsocketClose(ctx context.Context, domain, connectionID string) error
- func ApiWebsocketSend(ctx context.Context, domain, connectionID string, data []byte) error
- func ArnToInfraName(arn string) string
- func Assert(cond bool, format string, a ...interface{})
- func Atoi(a string) int
- func Chunk(xs []string, chunkSize int) [][]string
- func CloudwatchClient() *cloudwatch.CloudWatch
- func CloudwatchClientExplicit(accessKeyID, accessKeySecret, region string) *cloudwatch.CloudWatch
- func CloudwatchGetMetricData(ctx context.Context, period int, stat string, fromTime, toTime *time.Time, ...) ([]*cloudwatch.MetricDataResult, error)
- func CloudwatchListMetrics(ctx context.Context, namespace, metric *string) ([]*cloudwatch.Metric, error)
- func CodeCommitClient() *codecommit.CodeCommit
- func CodeCommitClientExplicit(accessKeyID, accessKeySecret, region string) *codecommit.CodeCommit
- func CodeCommitListRepos(ctx context.Context) ([]*codecommit.RepositoryNameIdPair, error)
- func Contains(parts []string, part string) bool
- func CostExplorerClient() *costexplorer.CostExplorer
- func CostExplorerClientExplicit(accessKeyID, accessKeySecret, region string) *costexplorer.CostExplorer
- func DropLinesWithAny(s string, tokens ...string) string
- func DynamoDBArn(ctx context.Context, tableName string) (string, error)
- func DynamoDBClient() *dynamodb.DynamoDB
- func DynamoDBClientExplicit(accessKeyID, accessKeySecret, region string) *dynamodb.DynamoDB
- func DynamoDBDeleteTable(ctx context.Context, tableName string, preview bool) error
- func DynamoDBEnsure(ctx context.Context, input *dynamodb.CreateTableInput, preview bool) error
- func DynamoDBEnsureInput(name string, keys []string, attrs []string) (*dynamodb.CreateTableInput, error)
- func DynamoDBListTables(ctx context.Context) ([]string, error)
- func DynamoDBListTags(ctx context.Context, tableName string) ([]*dynamodb.Tag, error)
- func DynamoDBStreamArn(ctx context.Context, tableName string) (string, error)
- func DynamoDBStreamArnToTableName(arn string) string
- func DynamoDBWaitForReady(ctx context.Context, tableName string) error
- func EC2AmiBase(ctx context.Context, name, arch string) (amiID string, sshUser string, err error)
- func EC2AmiUser(ctx context.Context, amiID string) (string, error)
- func EC2Client() *ec2.EC2
- func EC2ClientExplicit(accessKeyID, accessKeySecret, region string) *ec2.EC2
- func EC2DescribeInstances(ctx context.Context, instanceIDs []string) ([]*ec2.Instance, error)
- func EC2DescribeSpotFleet(ctx context.Context, spotFleetRequestId *string) (*ec2.SpotFleetRequestConfig, error)
- func EC2DescribeSpotFleetActiveInstances(ctx context.Context, spotFleetRequestId *string) ([]*ec2.ActiveInstance, error)
- func EC2EnsureSg(ctx context.Context, input *EC2EnsureSgInput) error
- func EC2FinalizeSpotFleet(ctx context.Context, spotFleetRequestId *string) error
- func EC2GetTag(tags []*ec2.Tag, key string, defaultValue string) string
- func EC2GoSsh(ctx context.Context, input *EC2GoSshInput) ([]*ec2GoSshResult, error)
- func EC2Kind(instance *ec2.Instance) string
- func EC2ListInstances(ctx context.Context, selectors []string, state string) ([]*ec2.Instance, error)
- func EC2ListSgs(ctx context.Context) ([]*ec2.SecurityGroup, error)
- func EC2Name(tags []*ec2.Tag) string
- func EC2NameColored(instance *ec2.Instance) string
- func EC2NewAmi(ctx context.Context, input *EC2NewAmiInput) (string, error)
- func EC2NewInstances(ctx context.Context, config *EC2Config) ([]*ec2.Instance, error)
- func EC2RequestSpotFleet(ctx context.Context, spotStrategy string, config *EC2Config) ([]*ec2.Instance, error)
- func EC2Rsync(ctx context.Context, input *EC2RsyncInput) ([]*ec2SshResult, error)
- func EC2Scp(ctx context.Context, input *EC2ScpInput) ([]*ec2SshResult, error)
- func EC2SecurityGroups(sgs []*ec2.GroupIdentifier) string
- func EC2SgID(ctx context.Context, vpcName, sgName string) (string, error)
- func EC2Ssh(ctx context.Context, input *EC2SshInput) ([]*ec2SshResult, error)
- func EC2SshLogin(instance *ec2.Instance, user string) error
- func EC2Tags(tags []*ec2.Tag) string
- func EC2TagsAll(tags []*ec2.Tag) string
- func EC2TeardownSpotFleet(ctx context.Context, spotFleetRequestId *string) error
- func EC2WaitGoSsh(ctx context.Context, input *EC2WaitGoSshInput) ([]string, error)
- func EC2WaitSpotFleet(ctx context.Context, spotFleetRequestId *string, num int) error
- func EC2WaitSsh(ctx context.Context, input *EC2WaitSshInput) ([]string, error)
- func EC2WaitState(ctx context.Context, instanceIDs []string, state string) error
- func EC2ZonesWithInstance(ctx context.Context, instanceType string) (zones []string, err error)
- func ECSClient() *ecs.ECS
- func ECSClientExplicit(accessKeyID, accessKeySecret, region string) *ecs.ECS
- func EcrClient() *ecr.ECR
- func EcrClientExplicit(accessKeyID, accessKeySecret, region string) *ecr.ECR
- func EcrDescribeRepos(ctx context.Context) ([]*ecr.Repository, error)
- func EcrEnsure(ctx context.Context, name string, preview bool) error
- func EcrUrl(ctx context.Context) (string, error)
- func EventsClient() *cloudwatchevents.CloudWatchEvents
- func EventsClientExplicit(accessKeyID, accessKeySecret, region string) *cloudwatchevents.CloudWatchEvents
- func EventsListRuleTargets(ctx context.Context, ruleName string) ([]*cloudwatchevents.Target, error)
- func EventsListRules(ctx context.Context) ([]*cloudwatchevents.Rule, error)
- func Exists(path string) bool
- func FromUnixMilli(msec int64) time.Time
- func IamClient() *iam.IAM
- func IamClientExplicit(accessKeyID, accessKeySecret, region string) *iam.IAM
- func IamDeleteInstanceProfile(ctx context.Context, name string, preview bool) error
- func IamDeleteRole(ctx context.Context, name string, preview bool) error
- func IamDeleteRoleAllows(ctx context.Context, name string, preview bool) error
- func IamDeleteRolePolicies(ctx context.Context, name string, preview bool) error
- func IamDeleteUser(ctx context.Context, name string, preview bool) error
- func IamEnsureEC2SpotRoles(ctx context.Context) error
- func IamEnsureInstanceProfile(ctx context.Context, name string, policies, allows []string, preview bool) error
- func IamEnsureRole(ctx context.Context, roleName, principalName string, preview bool) error
- func IamEnsureRoleAllows(ctx context.Context, roleName string, allows []string, preview bool) error
- func IamEnsureRolePolicies(ctx context.Context, roleName string, policyNames []string, preview bool) error
- func IamEnsureUserAllows(ctx context.Context, username string, allows []string, preview bool) error
- func IamEnsureUserApi(ctx context.Context, username string, preview bool) (*iam.AccessKey, error)
- func IamEnsureUserLogin(ctx context.Context, username, password string, preview bool) error
- func IamEnsureUserPolicies(ctx context.Context, username string, policyNames []string, preview bool) error
- func IamGetSSHPublicKey(ctx context.Context, keyID string) (*iam.SSHPublicKey, error)
- func IamInstanceProfileArn(ctx context.Context, profileName string) (string, error)
- func IamListPolicies(ctx context.Context) ([]*iam.Policy, error)
- func IamListRolePolicies(ctx context.Context, roleName string) ([]*iam.AttachedPolicy, error)
- func IamListSSHPublicKeys(ctx context.Context) ([]*iam.SSHPublicKeyMetadata, error)
- func IamListUserPolicies(ctx context.Context, username string) ([]*iam.Policy, error)
- func IamPolicyArn(ctx context.Context, policyName string) (string, error)
- func IamResetUserLoginTempPassword(ctx context.Context, username, password string) error
- func IamRoleArn(ctx context.Context, principalName, roleName string) (string, error)
- func InfraEnsureDynamoDB(ctx context.Context, dbs []string, preview bool) error
- func InfraEnsureS3(ctx context.Context, buckets []string, preview bool) error
- func InfraEnsureSqs(ctx context.Context, queues []string, preview bool) error
- func InfraListApi(ctx context.Context, triggersChan chan<- InfraLambdaTrigger) (map[string]InfraApi, error)
- func InfraListCloudwatch(ctx context.Context, triggersChan chan<- InfraLambdaTrigger) (map[string]string, error)
- func InfraListDynamoDB(ctx context.Context) (map[string]InfraDynamoDB, error)
- func InfraListEC2(ctx context.Context) (map[string]InfraEC2, error)
- func InfraListLambda(ctx context.Context, triggersChan <-chan InfraLambdaTrigger, filter string) (map[string]InfraLambda, error)
- func InfraListS3(ctx context.Context, triggersChan chan<- InfraLambdaTrigger) (map[string]InfraS3, error)
- func InfraListSQS(ctx context.Context) (map[string]InfraSQS, error)
- func InfraListVpc(ctx context.Context) (map[string]InfraVpc, error)
- func IsDigit(s string) bool
- func Json(i interface{}) string
- func LambdaApiUri(ctx context.Context, lambdaName string) (string, error)
- func LambdaApiUriToLambdaName(apiUri string) string
- func LambdaArn(ctx context.Context, name string) (string, error)
- func LambdaArnToLambdaName(arn string) string
- func LambdaClient() *lambda.Lambda
- func LambdaClientExplicit(accessKeyID, accessKeySecret, region string) *lambda.Lambda
- func LambdaDeleteFunction(ctx context.Context, name string, preview bool) error
- func LambdaEnsure(ctx context.Context, pth string, quick, preview bool) error
- func LambdaEnsureTriggerApi(ctx context.Context, name string, meta *LambdaMetadata, preview bool) ([]string, error)
- func LambdaEnsureTriggerCloudwatch(ctx context.Context, name, arnLambda string, meta *LambdaMetadata, ...) ([]string, error)
- func LambdaEnsureTriggerDynamoDB(ctx context.Context, name, arnLambda string, meta *LambdaMetadata, ...) error
- func LambdaEnsureTriggerEcr(ctx context.Context, name, arnLambda string, meta *LambdaMetadata, ...) ([]string, error)
- func LambdaEnsureTriggerS3(ctx context.Context, name, arnLambda string, meta *LambdaMetadata, ...) ([]string, error)
- func LambdaEnsureTriggerSQS(ctx context.Context, name, arnLambda string, meta *LambdaMetadata, ...) error
- func LambdaIncludeInZip(pth string, includes []string, preview bool) error
- func LambdaListFunctions(ctx context.Context) ([]*lambda.FunctionConfiguration, error)
- func LambdaName(pth string) (string, error)
- func LambdaSetConcurrency(ctx context.Context, name string, concurrency int, preview bool) error
- func LambdaUpdateFunctionZip(ctx context.Context, name, pth string, preview bool) error
- func LambdaZipBytes(path string) ([]byte, error)
- func LambdaZipFile(path string) (string, error)
- func Last(parts []string) string
- func LogsClient() *cloudwatchlogs.CloudWatchLogs
- func LogsClientExplicit(accessKeyID, accessKeySecret, region string) *cloudwatchlogs.CloudWatchLogs
- func LogsDeleteGroup(ctx context.Context, name string, preview bool) error
- func LogsEnsureGroup(ctx context.Context, name string, ttlDays int, preview bool) error
- func LogsListLogGroups(ctx context.Context) ([]*cloudwatchlogs.LogGroup, error)
- func LogsMostRecentStreams(ctx context.Context, name string) ([]*cloudwatchlogs.LogStream, error)
- func LogsStreams(ctx context.Context, name string) ([]*cloudwatchlogs.LogStream, error)
- func LogsTail(ctx context.Context, name string, minAge time.Time, ...) error
- func Max(i, j int) int
- func NowUnixMilli() int64
- func OrganizationsClient() *organizations.Organizations
- func OrganizationsClientExplicit(accessKeyID, accessKeySecret, region string) *organizations.Organizations
- func OrganizationsEnsure(ctx context.Context, name, email string, preview bool) (string, error)
- func Panic1(err error)
- func Panic2(x interface{}, e error) interface{}
- func Pformat(i interface{}) string
- func PformatAlways(i interface{}) string
- func PreviewString(preview bool) string
- func PromptProceed(prompt string) error
- func Region() string
- func Retry(ctx context.Context, fn func() error) error
- func RetryAttempts(ctx context.Context, attempts int, fn func() error) error
- func Route53Client() *route53.Route53
- func Route53ClientExplicit(accessKeyID, accessKeySecret, region string) *route53.Route53
- func Route53DeleteRecord(ctx context.Context, input *route53EnsureRecordInput, preview bool) error
- func Route53DeleteZone(ctx context.Context, name string, preview bool) error
- func Route53EnsureRecord(ctx context.Context, input *route53EnsureRecordInput, preview bool) error
- func Route53EnsureRecordInput(zoneName, recordName string, attrs []string) (*route53EnsureRecordInput, error)
- func Route53EnsureZone(ctx context.Context, name string, preview bool) error
- func Route53ListRecords(ctx context.Context, zoneId string) ([]*route53.ResourceRecordSet, error)
- func Route53ListZones(ctx context.Context) ([]*route53.HostedZone, error)
- func Route53ZoneID(ctx context.Context, name string) (string, error)
- func S3BucketRegion(bucket string) (string, error)
- func S3Client() *s3.S3
- func S3ClientBucketRegion(bucket string) (*s3.S3, error)
- func S3ClientBucketRegionMust(bucket string) *s3.S3
- func S3ClientExplicit(accessKeyID, accessKeySecret, region string) *s3.S3
- func S3ClientRegion(region string) (*s3.S3, error)
- func S3ClientRegionMust(region string) *s3.S3
- func S3DeleteBucket(ctx context.Context, bucket string, preview bool) error
- func S3Ensure(ctx context.Context, input *s3EnsureInput, preview bool) error
- func S3EnsureInput(name string, attrs []string) (*s3EnsureInput, error)
- func S3PresignGet(bucket, key, byterange string, expire time.Duration) string
- func S3PresignPut(bucket, key string, expire time.Duration) string
- func SNSArn(ctx context.Context, name string) (string, error)
- func SNSClient() *sns.SNS
- func SNSClientExplicit(accessKeyID, accessKeySecret, region string) *sns.SNS
- func SNSEnsure(ctx context.Context, name string, preview bool) error
- func SNSListSubscriptions(ctx context.Context, topicArn string) ([]*sns.Subscription, error)
- func SQSArn(ctx context.Context, name string) (string, error)
- func SQSArnToName(arn string) string
- func SQSClient() *sqs.SQS
- func SQSClientExplicit(accessKeyID, accessKeySecret, region string) *sqs.SQS
- func SQSDeleteQueue(ctx context.Context, name string, preview bool) error
- func SQSEnsure(ctx context.Context, input *sqsEnsureInput, preview bool) error
- func SQSEnsureInput(name string, attrs []string) (*sqsEnsureInput, error)
- func SQSListQueueUrls(ctx context.Context) ([]string, error)
- func SQSListQueues(ctx context.Context) ([]string, error)
- func SQSQueueUrl(ctx context.Context, queueName string) (string, error)
- func SQSUrlToName(url string) string
- func STSClient() *sts.STS
- func STSClientExplicit(accessKeyID, accessKeySecret, region string) *sts.STS
- func Session() *session.Session
- func SessionExplicit(accessKeyID, accessKeySecret, region string) *session.Session
- func SessionRegion(region string) (*session.Session, error)
- func SignalHandler(cancel func())
- func SplitOnce(s string, sep string) (head, tail string, err error)
- func SplitTwice(s string, sep string) (head, mid, tail string, err error)
- func SshKeygenEd25519() (string, string, error)
- func SshKeygenRsa() (string, string, error)
- func StringOr(s *string, d string) string
- func StringSlice(xs []*string) []string
- func StsAccount(ctx context.Context) (string, error)
- func StsArn(ctx context.Context) (string, error)
- func StsUser(ctx context.Context) (string, error)
- func ToUnixMilli(t time.Time) int64
- func VpcEnsure(ctx context.Context, name string, xx int) (string, error)
- func VpcID(ctx context.Context, name string) (string, error)
- func VpcList(ctx context.Context) ([]*ec2.Vpc, error)
- func VpcRm(ctx context.Context, name string) error
- func VpcSubnets(ctx context.Context, vpcID string) ([]*ec2.Subnet, error)
- func Zones(ctx context.Context) ([]*ec2.AvailabilityZone, error)
- type ArgsStruct
- type EC2Config
- type EC2EnsureSgInput
- type EC2GoSshInput
- type EC2NewAmiInput
- type EC2RsyncInput
- type EC2ScpInput
- type EC2SgRule
- type EC2SshInput
- type EC2Tag
- type EC2WaitGoSshInput
- type EC2WaitSshInput
- type IamAllow
- type IamInstanceProfile
- type IamPolicy
- type IamPolicyDocument
- type IamPolicyDocumentCondition
- type IamRole
- type IamStatementEntry
- type IamStatementEntryCondition
- type IamUser
- type Infra
- type InfraApi
- type InfraDynamoDB
- type InfraEC2
- type InfraLambda
- type InfraLambdaTrigger
- type InfraS3
- type InfraSQS
- type InfraVpc
- type Kind
- type LambdaCreateZipFn
- type LambdaMetadata
- type LambdaUpdateZipFn
- type LoggerStruct
- type S3BucketDescription
- type SQSNumMessageOutput
Constants ¶
View Source
const ( EC2ArchAmd64 = "x86_64" EC2ArchArm64 = "arm64" EC2AmiLambda = "lambda" EC2AmiAmzn = "amzn" EC2AmiArch = "arch" EC2AmiAlpine = "alpine" EC2AmiUbuntuFocal = "focal" EC2AmiUbuntuBionic = "bionic" EC2AmiUbuntuXenial = "xenial" EC2AmiUbuntuTrusty = "trusty" )
View Source
const (
ErrPrefixDidntFindExactlyOne = "didn't find exactly one"
)
View Source
const (
LambdaWebsocketSuffix = "-websocket"
)
Variables ¶
View Source
var ( Red = color(31) Green = color(32) Yellow = color(33) Blue = color(34) Magenta = color(35) Cyan = color(36) White = color(37) )
View Source
var Args = make(map[string]ArgsStruct)
View Source
var Commands = make(map[string]func())
View Source
var Logger = &LoggerStruct{ Print: func(args ...interface{}) { fmt.Fprint(os.Stderr, args...) }, Flush: func() {}, disabled: strings.ToLower(os.Getenv("LOGGING") + " ")[:1] == "n", }
View Source
var PrettyStyle = &pretty.Style{ Key: [2]string{"\033[31m", "\033[0m"}, String: [2]string{"\033[32m", "\033[0m"}, Number: [2]string{"\033[33m", "\033[0m"}, True: [2]string{"\033[34m", "\033[0m"}, False: [2]string{"\033[35m", "\033[0m"}, Null: [2]string{"\033[36m", "\033[0m"}, Escape: [2]string{"\033[37m", "\033[0m"}, Append: func(dst []byte, c byte) []byte { hexp := func(p byte) byte { switch { case p < 10: return p + '0' default: return (p - 10) + 'a' } } if c < ' ' && (c != '\r' && c != '\n' && c != '\t' && c != '\v') { dst = append(dst, "\\u00"...) dst = append(dst, hexp((c>>4)&0xF)) return append(dst, hexp((c)&0xF)) } return append(dst, c) }, }
Functions ¶
func AcmClientExplicit ¶
func AcmListCertificates ¶
func AcmListCertificates(ctx context.Context) ([]*acm.CertificateSummary, error)
func ApiClient ¶
func ApiClient() *apigatewayv2.ApiGatewayV2
func ApiClientExplicit ¶
func ApiClientExplicit(accessKeyID, accessKeySecret, region string) *apigatewayv2.ApiGatewayV2
func ApiListDomains ¶
func ApiListDomains(ctx context.Context) ([]*apigatewayv2.DomainName, error)
func ApiWebsocketClose ¶
func ApiWebsocketSend ¶
func ArnToInfraName ¶
func CloudwatchClient ¶
func CloudwatchClient() *cloudwatch.CloudWatch
func CloudwatchClientExplicit ¶
func CloudwatchClientExplicit(accessKeyID, accessKeySecret, region string) *cloudwatch.CloudWatch
func CloudwatchGetMetricData ¶
func CloudwatchListMetrics ¶
func CodeCommitClient ¶
func CodeCommitClient() *codecommit.CodeCommit
func CodeCommitClientExplicit ¶
func CodeCommitClientExplicit(accessKeyID, accessKeySecret, region string) *codecommit.CodeCommit
func CodeCommitListRepos ¶
func CodeCommitListRepos(ctx context.Context) ([]*codecommit.RepositoryNameIdPair, error)
func CostExplorerClient ¶
func CostExplorerClient() *costexplorer.CostExplorer
func CostExplorerClientExplicit ¶
func CostExplorerClientExplicit(accessKeyID, accessKeySecret, region string) *costexplorer.CostExplorer
func DropLinesWithAny ¶
func DynamoDBClient ¶
func DynamoDBClientExplicit ¶
func DynamoDBDeleteTable ¶
func DynamoDBEnsure ¶
func DynamoDBEnsureInput ¶
func DynamoDBListTags ¶
func DynamoDBStreamArn ¶
func EC2AmiBase ¶
func EC2ClientExplicit ¶
func EC2DescribeInstances ¶
func EC2DescribeSpotFleet ¶
func EC2EnsureSg ¶
func EC2EnsureSg(ctx context.Context, input *EC2EnsureSgInput) error
func EC2FinalizeSpotFleet ¶
func EC2ListInstances ¶
func EC2ListSgs ¶
func EC2ListSgs(ctx context.Context) ([]*ec2.SecurityGroup, error)
func EC2NameColored ¶
func EC2NewInstances ¶
func EC2RequestSpotFleet ¶
func EC2SecurityGroups ¶
func EC2SecurityGroups(sgs []*ec2.GroupIdentifier) string
func EC2TagsAll ¶
func EC2TeardownSpotFleet ¶
func EC2WaitGoSsh ¶
func EC2WaitGoSsh(ctx context.Context, input *EC2WaitGoSshInput) ([]string, error)
func EC2WaitSpotFleet ¶
func EC2WaitSsh ¶
func EC2WaitSsh(ctx context.Context, input *EC2WaitSshInput) ([]string, error)
func EC2WaitState ¶
func EC2ZonesWithInstance ¶
func ECSClientExplicit ¶
func EcrClientExplicit ¶
func EcrDescribeRepos ¶
func EcrDescribeRepos(ctx context.Context) ([]*ecr.Repository, error)
func EventsClient ¶
func EventsClient() *cloudwatchevents.CloudWatchEvents
func EventsClientExplicit ¶
func EventsClientExplicit(accessKeyID, accessKeySecret, region string) *cloudwatchevents.CloudWatchEvents
func EventsListRuleTargets ¶
func EventsListRules ¶
func EventsListRules(ctx context.Context) ([]*cloudwatchevents.Rule, error)
func FromUnixMilli ¶
func IamClientExplicit ¶
func IamDeleteRoleAllows ¶
func IamDeleteRolePolicies ¶
func IamEnsureEC2SpotRoles ¶
func IamEnsureRole ¶
func IamEnsureRoleAllows ¶
func IamEnsureRolePolicies ¶
func IamEnsureUserAllows ¶
func IamEnsureUserApi ¶
func IamEnsureUserLogin ¶
func IamEnsureUserPolicies ¶
func IamGetSSHPublicKey ¶
func IamInstanceProfileArn ¶
func IamListRolePolicies ¶
func IamListSSHPublicKeys ¶
func IamListSSHPublicKeys(ctx context.Context) ([]*iam.SSHPublicKeyMetadata, error)
func IamListUserPolicies ¶
func IamRoleArn ¶
func InfraEnsureDynamoDB ¶
func InfraListApi ¶
func InfraListCloudwatch ¶
func InfraListDynamoDB ¶
func InfraListDynamoDB(ctx context.Context) (map[string]InfraDynamoDB, error)
func InfraListLambda ¶
func InfraListLambda(ctx context.Context, triggersChan <-chan InfraLambdaTrigger, filter string) (map[string]InfraLambda, error)
func InfraListS3 ¶
func LambdaArnToLambdaName ¶
func LambdaClient ¶
func LambdaClientExplicit ¶
func LambdaDeleteFunction ¶
func LambdaEnsureTriggerApi ¶
func LambdaEnsureTriggerEcr ¶
func LambdaEnsureTriggerS3 ¶
func LambdaEnsureTriggerSQS ¶
func LambdaIncludeInZip ¶
func LambdaListFunctions ¶
func LambdaListFunctions(ctx context.Context) ([]*lambda.FunctionConfiguration, error)
func LambdaName ¶
func LambdaSetConcurrency ¶
func LambdaUpdateFunctionZip ¶
func LambdaZipBytes ¶
func LambdaZipFile ¶
func LogsClient ¶
func LogsClient() *cloudwatchlogs.CloudWatchLogs
func LogsClientExplicit ¶
func LogsClientExplicit(accessKeyID, accessKeySecret, region string) *cloudwatchlogs.CloudWatchLogs
func LogsEnsureGroup ¶
func LogsListLogGroups ¶
func LogsListLogGroups(ctx context.Context) ([]*cloudwatchlogs.LogGroup, error)
func LogsMostRecentStreams ¶
func LogsStreams ¶
func NowUnixMilli ¶
func NowUnixMilli() int64
func OrganizationsClient ¶
func OrganizationsClient() *organizations.Organizations
func OrganizationsClientExplicit ¶
func OrganizationsClientExplicit(accessKeyID, accessKeySecret, region string) *organizations.Organizations
func OrganizationsEnsure ¶
func PformatAlways ¶
func PformatAlways(i interface{}) string
func PreviewString ¶
func PromptProceed ¶
func RetryAttempts ¶
6 attempts = 5 seconds total delay 7 attempts = 10 seconds total delay 8 attempts = 20 seconds total delay 9 attempts = 40 seconds total delay 10 attempts = 80 seconds total delay 11 attempts = 160 seconds total delay 12 attempts = 320 seconds total delay
func Route53Client ¶
func Route53ClientExplicit ¶
func Route53DeleteRecord ¶
func Route53DeleteZone ¶
func Route53EnsureRecord ¶
func Route53EnsureZone ¶
func Route53ListRecords ¶
func Route53ListZones ¶
func Route53ListZones(ctx context.Context) ([]*route53.HostedZone, error)
func S3BucketRegion ¶
func S3ClientExplicit ¶
func S3ClientRegionMust ¶
func S3EnsureInput ¶
func SNSClientExplicit ¶
func SNSListSubscriptions ¶
func SQSArnToName ¶
func SQSClientExplicit ¶
func SQSEnsureInput ¶
func SQSUrlToName ¶
func STSClientExplicit ¶
func SessionExplicit ¶
func SignalHandler ¶
func SignalHandler(cancel func())
func SshKeygenEd25519 ¶
func SshKeygenRsa ¶
func StringSlice ¶
func ToUnixMilli ¶
Types ¶
type ArgsStruct ¶
type ArgsStruct interface {
Description() string
}
type EC2EnsureSgInput ¶
type EC2GoSshInput ¶
type EC2NewAmiInput ¶
type EC2RsyncInput ¶
type EC2ScpInput ¶
type EC2SgRule ¶
type EC2SgRule struct { Proto string `json:"proto"` Port int `json:"port"` Source string `json:"source"` }
func EC2SgRules ¶
func EC2SgRules(p *ec2.IpPermission) ([]EC2SgRule, error)
type EC2SshInput ¶
type EC2WaitGoSshInput ¶
type EC2WaitSshInput ¶
type IamInstanceProfile ¶
type IamInstanceProfile struct { Arn *string `json:",omitempty"` CreateDate *time.Time `json:",omitempty"` InstanceProfileId *string `json:",omitempty"` InstanceProfileName *string `json:",omitempty"` Path *string `json:",omitempty"` Roles []*IamRole `json:",omitempty"` Tags []*iam.Tag `json:",omitempty"` }
func IamListInstanceProfiles ¶
func IamListInstanceProfiles(ctx context.Context, pathPrefix *string) ([]*IamInstanceProfile, error)
func (*IamInstanceProfile) FromProfile ¶
func (p *IamInstanceProfile) FromProfile(ctx context.Context, profile *iam.InstanceProfile) error
type IamPolicy ¶
type IamPolicy struct { Arn *string `json:",omitempty"` AttachmentCount *int64 `json:",omitempty"` CreateDate *time.Time `json:",omitempty"` DefaultVersionId *string `json:",omitempty"` Description *string `json:",omitempty"` IsAttachable *bool `json:",omitempty"` Path *string `json:",omitempty"` PermissionsBoundaryUsageCount *int64 `json:",omitempty"` PolicyId *string `json:",omitempty"` PolicyName *string `json:",omitempty"` Tags []*iam.Tag `json:",omitempty"` UpdateDate *time.Time `json:",omitempty"` PolicyDocument *IamPolicyDocument `json:",omitempty"` }
type IamPolicyDocument ¶
type IamPolicyDocument struct { Version string `json:",omitempty"` Id string `json:",omitempty"` Statement []IamStatementEntry `json:",omitempty"` }
type IamPolicyDocumentCondition ¶
type IamPolicyDocumentCondition struct { Version string Id string Statement []IamStatementEntryCondition }
type IamRole ¶
type IamRole struct { Arn *string `json:",omitempty"` AssumeRolePolicyDocument *IamPolicyDocument `json:",omitempty"` CreateDate *time.Time `json:",omitempty"` Description *string `json:",omitempty"` MaxSessionDuration *int64 `json:",omitempty"` Path *string `json:",omitempty"` PermissionsBoundary *iam.AttachedPermissionsBoundary `json:",omitempty"` RoleId *string `json:",omitempty"` RoleLastUsed *iam.RoleLastUsed `json:",omitempty"` RoleName *string `json:",omitempty"` Tags []*iam.Tag `json:",omitempty"` Allows []string `json:",omitempty"` Policies []string `json:",omitempty"` // contains filtered or unexported fields }
type IamStatementEntry ¶
type IamUser ¶
type IamUser struct { Arn *string `json:",omitempty"` CreateDate *time.Time `json:",omitempty"` PasswordLastUsed *time.Time `json:",omitempty"` Path *string `json:",omitempty"` PermissionsBoundary *iam.AttachedPermissionsBoundary `json:",omitempty"` Tags []*iam.Tag `json:",omitempty"` UserId *string `json:",omitempty"` UserName *string `json:",omitempty"` Allows []string `json:",omitempty"` Policies []string `json:",omitempty"` }
type Infra ¶
type Infra struct { Account string `json:"account"` Region string `json:"region"` Api map[string]InfraApi `json:"api,omitempty"` DynamoDB map[string]InfraDynamoDB `json:"dynamodb,omitempty"` Vpc map[string]InfraVpc `json:"vpc,omitempty"` EC2 map[string]InfraEC2 `json:"ec2,omitempty"` Lambda map[string]InfraLambda `json:"lambda,omitempty"` SQS map[string]InfraSQS `json:"sqs,omitempty"` S3 map[string]InfraS3 `json:"s3,omitempty"` }
type InfraDynamoDB ¶
type InfraLambda ¶
type InfraLambdaTrigger ¶
type Kind ¶
type Kind string
const ( KindTags Kind = "tags" KindDnsName Kind = "dns-name" KindVpcId Kind = "vpc-id" KindSubnetID Kind = "subnet-id" KindSecurityGroupID Kind = "instance.group-id" KindPrivateDnsName Kind = "private-dns-name" KindIPAddress Kind = "ip-address" KindPrivateIPAddress Kind = "private-ip-address" KindInstanceID Kind = "instance-id" )
type LambdaCreateZipFn ¶
type LambdaMetadata ¶
type LambdaMetadata struct { S3 []string `json:"s3,omitempty"` DynamoDB []string `json:"dynamodb,omitempty"` Sqs []string `json:"sqs,omitempty"` Policy []string `json:"policy,omitempty"` Allow []string `json:"allow,omitempty"` Include []string `json:"include,omitempty"` Trigger []string `json:"trigger,omitempty"` Require []string `json:"require,omitempty"` Attr []string `json:"attr,omitempty"` Env []string `json:"env,omitempty"` }
func LambdaGetMetadata ¶
func LambdaGetMetadata(lines []string) (*LambdaMetadata, error)
func LambdaParseFile ¶
func LambdaParseFile(path string) (*LambdaMetadata, error)
type LambdaUpdateZipFn ¶
type LoggerStruct ¶
type LoggerStruct struct { Print func(args ...interface{}) Flush func() // contains filtered or unexported fields }
func (*LoggerStruct) Fatal ¶
func (l *LoggerStruct) Fatal(v ...interface{})
func (*LoggerStruct) Fatalf ¶
func (l *LoggerStruct) Fatalf(format string, v ...interface{})
func (*LoggerStruct) Printf ¶
func (l *LoggerStruct) Printf(format string, v ...interface{})
func (*LoggerStruct) Println ¶
func (l *LoggerStruct) Println(v ...interface{})
type S3BucketDescription ¶
type S3BucketDescription struct { Metrics *s3.MetricsConfiguration Versioning bool Acl *s3.GetBucketAclOutput Cors []*s3.CORSRule Encryption *s3.ServerSideEncryptionConfiguration Lifecycle []*s3.LifecycleRule Region string Logging *s3.LoggingEnabled Notifications *s3.NotificationConfiguration Policy *IamPolicyDocument Replication *s3.ReplicationConfiguration }
func S3GetBucketDescription ¶
func S3GetBucketDescription(ctx context.Context, bucket string) (*S3BucketDescription, error)
type SQSNumMessageOutput ¶
func SQSNumMessages ¶
func SQSNumMessages(ctx context.Context, queueUrl string) (*SQSNumMessageOutput, error)
Click to show internal directories.
Click to hide internal directories.