Documentation
¶
Index ¶
- Constants
- Variables
- func AccountMultiplex(table string) func(meta schema.ClientMeta) []schema.ClientMeta
- func AwsMockTestHelper(t *testing.T, parentTable *schema.Table, ...)
- func Configure(ctx context.Context, logger zerolog.Logger, s spec.Spec) (schema.ClientMeta, error)
- func ConfigureAwsSDK(ctx context.Context, logger zerolog.Logger, awsPluginSpec *spec.Spec, ...) (aws.Config, error)
- func CreateReplaceTransformer(replace map[string]string) func(field reflect.StructField) (string, error)
- func CreateTrimPrefixTransformer(prefixes ...string) func(field reflect.StructField) (string, error)
- func DefaultAccountIDColumn(pk bool) schema.Column
- func DefaultRegionColumn(pk bool) schema.Column
- func IgnoreAccessDeniedServiceDisabled(err error) bool
- func IgnoreCommonErrors(err error) bool
- func IgnoreNotAvailableRegion(err error) bool
- func IgnoreWithInvalidAction(err error) bool
- func IsAWSError(err error, code ...string) bool
- func IsInvalidParameterValueError(err error) bool
- func LanguageCodeColumn(pk bool) schema.Column
- func RegionsPartition(region string) (string, bool)
- func RequestAccountIDColumn(pk bool) schema.Column
- func RequestRegionColumn(pk bool) schema.Column
- func ResolveARN(service AWSService, ...) schema.ColumnResolver
- func ResolveARNGlobal(service AWSService, ...) schema.ColumnResolver
- func ResolveARNWithAccount(service AWSService, ...) schema.ColumnResolver
- func ResolveAWSAccount(_ context.Context, meta schema.ClientMeta, r *schema.Resource, c schema.Column) error
- func ResolveAWSNamespace(_ context.Context, meta schema.ClientMeta, r *schema.Resource, c schema.Column) error
- func ResolveAWSPartition(_ context.Context, meta schema.ClientMeta, r *schema.Resource, c schema.Column) error
- func ResolveAWSRegion(_ context.Context, meta schema.ClientMeta, r *schema.Resource, c schema.Column) error
- func ResolveLanguageCode(_ context.Context, meta schema.ClientMeta, r *schema.Resource, c schema.Column) error
- func ResolveObjectHash(_ context.Context, _ schema.ClientMeta, r *schema.Resource, c schema.Column) error
- func ResolveTagPath(fieldPath string) ...
- func ResolveTags(ctx context.Context, meta schema.ClientMeta, r *schema.Resource, ...) error
- func ResolveWAFScope(_ context.Context, meta schema.ClientMeta, r *schema.Resource, c schema.Column) error
- func ServiceAccountRegionMultiplexer(table, service string) func(meta schema.ClientMeta) []schema.ClientMeta
- func ServiceAccountRegionNamespaceMultiplexer(table, service string) func(meta schema.ClientMeta) []schema.ClientMeta
- func ServiceAccountRegionScopeMultiplexer(table, service string) func(meta schema.ClientMeta) []schema.ClientMeta
- func ServiceAccountRegionsLanguageCodeMultiplex(table, service string, codes []string) func(meta schema.ClientMeta) []schema.ClientMeta
- func Sleep(ctx context.Context, dur time.Duration) error
- func TagsIntoMap(tagSlice any, dst map[string]string)
- func TagsResolverTransformer(field reflect.StructField, path string) schema.ColumnResolver
- func TagsToMap(tagSlice any) map[string]string
- func TimestampResolverTransformer(field reflect.StructField, path string) schema.ColumnResolver
- func TimestampTypeTransformer(field reflect.StructField) (arrow.DataType, error)
- type AWSService
- type AWSServiceName
- type AssumeRoleAPIClient
- type AwsLogger
- type AwsPartition
- type AwsService
- type Client
- func (c *Client) Duplicate() *Client
- func (c *Client) ID() string
- func (c *Client) IsNotFoundError(err error) bool
- func (c *Client) Logger() *zerolog.Logger
- func (c *Client) Services(service_names ...AWSServiceName) *Services
- func (c *Client) SetStateClient(client state.Client)
- func (c *Client) StateClient() state.Client
- type DetailResolverFunc
- type ListResolverFunc
- type NoRateLimiter
- type Services
- type ServicesManager
- type ServicesPartitionAccountMap
- type SupportedServiceRegionsData
- type TestOptions
Constants ¶
const (
PartitionServiceRegionFile = "data/partition_service_region.json"
)
Variables ¶
var AllAWSServiceNames = [...]string{}/* 120 elements not displayed */
var AllNamespaces = []string{
"comprehend", "rds", "sagemaker", "appstream", "elasticmapreduce", "dynamodb", "lambda", "ecs", "cassandra", "ec2", "neptune", "kafka", "custom-resource", "elasticache",
}
var ErrPaidAPIsNotEnabled = errors.New("not fetching resource because `use_paid_apis` is set to false")
Functions ¶
func AccountMultiplex ¶
func AccountMultiplex(table string) func(meta schema.ClientMeta) []schema.ClientMeta
func AwsMockTestHelper ¶
func AwsMockTestHelper(t *testing.T, parentTable *schema.Table, builder func(*testing.T, *gomock.Controller) Services, testOpts TestOptions)
func Configure ¶
Configure is the entrypoint into configuring the AWS plugin. It is called by the plugin initialization in resources/plugin/aws.go
func ConfigureAwsSDK ¶
func CreateTrimPrefixTransformer ¶
func CreateTrimPrefixTransformer(prefixes ...string) func(field reflect.StructField) (string, error)
func DefaultAccountIDColumn ¶
func DefaultRegionColumn ¶
func IgnoreCommonErrors ¶
func IgnoreWithInvalidAction ¶
func IsAWSError ¶
func LanguageCodeColumn ¶
func RegionsPartition ¶
func RequestAccountIDColumn ¶
func RequestRegionColumn ¶
func ResolveARN ¶
func ResolveARN(service AWSService, resourceID func(resource *schema.Resource) ([]string, error)) schema.ColumnResolver
ResolveARN returns a column resolver that will set a field value to a proper ARN based on provided AWS service and resource id value returned by resourceID function. Region and account id are set to the values of the client.
func ResolveARNGlobal ¶
func ResolveARNGlobal(service AWSService, resourceID func(resource *schema.Resource) ([]string, error)) schema.ColumnResolver
ResolveARNGlobal returns a column resolver that will set a field value to a proper ARN based on provided AWS service and resource id value returned by resourceID function. Region and account id are left empty.
func ResolveARNWithAccount ¶
func ResolveARNWithAccount(service AWSService, resourceID func(resource *schema.Resource) ([]string, error)) schema.ColumnResolver
ResolveARNWithAccount returns a column resolver that will set a field value to a proper ARN based on provided AWS service and resource id value returned by resourceID function. Region is left empty and account id is set to the value of the client.
func ResolveAWSAccount ¶
func ResolveAWSNamespace ¶
func ResolveAWSPartition ¶
func ResolveAWSRegion ¶
func ResolveLanguageCode ¶
func ResolveObjectHash ¶
func ResolveTagPath ¶
func ResolveTags ¶
func ResolveWAFScope ¶
func ServiceAccountRegionMultiplexer ¶
func ServiceAccountRegionMultiplexer(table, service string) func(meta schema.ClientMeta) []schema.ClientMeta
func ServiceAccountRegionNamespaceMultiplexer ¶
func ServiceAccountRegionNamespaceMultiplexer(table, service string) func(meta schema.ClientMeta) []schema.ClientMeta
func ServiceAccountRegionScopeMultiplexer ¶
func ServiceAccountRegionScopeMultiplexer(table, service string) func(meta schema.ClientMeta) []schema.ClientMeta
func ServiceAccountRegionsLanguageCodeMultiplex ¶
func ServiceAccountRegionsLanguageCodeMultiplex(table, service string, codes []string) func(meta schema.ClientMeta) []schema.ClientMeta
func TagsIntoMap ¶
TagsIntoMap expects []T (usually "[]Tag") where T has "Key" and "Value" fields (of type string or *string) and writes them into the given map
func TagsResolverTransformer ¶
func TagsResolverTransformer(field reflect.StructField, path string) schema.ColumnResolver
TagsResolverTransformer adds possibility to override the column resolver for "Tags" field
func TagsToMap ¶
TagsToMap expects []T (usually "[]Tag") where T has "Key" and "Value" fields (of type string or *string) and returns a map
func TimestampResolverTransformer ¶
func TimestampResolverTransformer(field reflect.StructField, path string) schema.ColumnResolver
func TimestampTypeTransformer ¶
func TimestampTypeTransformer(field reflect.StructField) (arrow.DataType, error)
Types ¶
type AWSService ¶
type AWSService string
const ( ApigatewayService AWSService = "apigateway" AppconfigService AWSService = "appconfig" AthenaService AWSService = "athena" CloudformationService AWSService = "cloudformation" CloudfrontService AWSService = "cloudfront" CognitoIdentityService AWSService = "cognito-identity" DirectConnectService AWSService = "directconnect" DynamoDBService AWSService = "dynamodb" EC2Service AWSService = "ec2" EFSService AWSService = "elasticfilesystem" ElasticLoadBalancingService AWSService = "elasticloadbalancing" GlueService AWSService = "glue" GuardDutyService AWSService = "guardduty" IamService AWSService = "iam" IdentitystoreService AWSService = "identitystore" RedshiftService AWSService = "redshift" Route53Service AWSService = "route53" S3Service AWSService = "s3" SESService AWSService = "ses" WAFRegional AWSService = "waf-regional" WorkspacesService AWSService = "workspaces" XRayService AWSService = "xray" RDSService AWSService = "rds" )
type AWSServiceName ¶
type AWSServiceName int
const ( AWSServiceAccessanalyzer AWSServiceName = iota AWSServiceAccount AWSServiceAcm AWSServiceAcmpca AWSServiceAmp AWSServiceAmplify AWSServiceApigateway AWSServiceApigatewayv2 AWSServiceAppconfig AWSServiceAppflow AWSServiceApplicationautoscaling AWSServiceAppmesh AWSServiceApprunner AWSServiceAppstream AWSServiceAppsync AWSServiceAthena AWSServiceAuditmanager AWSServiceAutoscaling AWSServiceAutoscalingplans AWSServiceBackup AWSServiceBatch AWSServiceCloudformation AWSServiceCloudfront AWSServiceCloudhsmv2 AWSServiceCloudtrail AWSServiceCloudwatch AWSServiceCloudwatchlogs AWSServiceCodeartifact AWSServiceCodebuild AWSServiceCodecommit AWSServiceCodepipeline AWSServiceCognitoidentity AWSServiceCognitoidentityprovider AWSServiceComputeoptimizer AWSServiceConfigservice AWSServiceCostexplorer AWSServiceDatabasemigrationservice AWSServiceDax AWSServiceDetective AWSServiceDirectconnect AWSServiceDocdb AWSServiceDynamodb AWSServiceDynamodbstreams AWSServiceEc2 AWSServiceEcr AWSServiceEcrpublic AWSServiceEcs AWSServiceEfs AWSServiceEks AWSServiceElasticache AWSServiceElasticbeanstalk AWSServiceElasticloadbalancing AWSServiceElasticloadbalancingv2 AWSServiceElasticsearchservice AWSServiceElastictranscoder AWSServiceEmr AWSServiceEventbridge AWSServiceFirehose AWSServiceFrauddetector AWSServiceFsx AWSServiceGlacier AWSServiceGlue AWSServiceGuardduty AWSServiceIam AWSServiceIdentitystore AWSServiceInspector AWSServiceInspector2 AWSServiceIot AWSServiceKafka AWSServiceKinesis AWSServiceKms AWSServiceLambda AWSServiceLightsail AWSServiceMq AWSServiceMwaa AWSServiceNeptune AWSServiceNetworkfirewall AWSServiceNetworkmanager AWSServiceOrganizations AWSServiceQldb AWSServiceQuicksight AWSServiceRam AWSServiceRds AWSServiceRedshift AWSServiceResiliencehub AWSServiceResourcegroups AWSServiceRoute53 AWSServiceRoute53domains AWSServiceRoute53recoverycontrolconfig AWSServiceRoute53recoveryreadiness AWSServiceRoute53resolver AWSServiceS3 AWSServiceS3control AWSServiceSagemaker AWSServiceSavingsplans AWSServiceScheduler AWSServiceSecretsmanager AWSServiceSecurityhub AWSServiceServicecatalog AWSServiceServicecatalogappregistry AWSServiceServicediscovery AWSServiceServicequotas AWSServiceSes AWSServiceSesv2 AWSServiceSfn AWSServiceShield AWSServiceSigner AWSServiceSns AWSServiceSqs AWSServiceSsm AWSServiceSsoadmin AWSServiceSupport AWSServiceTimestreamwrite AWSServiceTransfer AWSServiceWaf AWSServiceWafregional AWSServiceWafv2 AWSServiceWellarchitected AWSServiceWorkspaces AWSServiceXray )
func (AWSServiceName) String ¶
func (s AWSServiceName) String() string
type AssumeRoleAPIClient ¶
type AssumeRoleAPIClient interface {
AssumeRole(ctx context.Context, params *sts.AssumeRoleInput, optFns ...func(*sts.Options)) (*sts.AssumeRoleOutput, error)
}
type AwsPartition ¶
type AwsPartition struct { Id string `json:"partition"` Name string `json:"partitionName"` Services map[string]*AwsService `json:"services"` }
type AwsService ¶
type Client ¶
type Client struct { // Those are already normalized values after configure and this is why we don't want to hold // config directly. ServicesManager *ServicesManager // this is set by table clientList AccountID string Region string AutoscalingNamespace string WAFScope wafv2types.Scope Partition string LanguageCode string Spec *spec.Spec // contains filtered or unexported fields }
func AwsCreateMockClient ¶
func AwsCreateMockClient(t *testing.T, ctrl *gomock.Controller, builder func(*testing.T, *gomock.Controller) Services, testOpts TestOptions) Client
func (*Client) IsNotFoundError ¶
IsNotFoundError checks if api error should be ignored
func (*Client) Services ¶
func (c *Client) Services(service_names ...AWSServiceName) *Services
func (*Client) SetStateClient ¶
SetStateClient will set state.Client value (or state.NopClient if the param is nil) to the current Client state backend.
func (*Client) StateClient ¶
type DetailResolverFunc ¶
type DetailResolverFunc func(ctx context.Context, meta schema.ClientMeta, resultsChan chan<- any, errorChan chan<- error, summary any)
DetailResolveFunc is responsible for grabbing any and all metadata for a resource. All errors should be sent to the error channel.
type ListResolverFunc ¶
type ListResolverFunc func(ctx context.Context, meta schema.ClientMeta, detailChan chan<- any) error
ListResolver is responsible for iterating through entire list of resources that should be grabbed (if API is paginated). It should send list of items via the `resultsChan` so that the DetailResolver can grab the details of each item. All errors should be sent to the error channel.
type NoRateLimiter ¶
type NoRateLimiter struct { }
func (*NoRateLimiter) AddTokens ¶
func (*NoRateLimiter) AddTokens(uint) error
type Services ¶
type Services struct { AWSConfig aws.Config Regions []string Accessanalyzer services.AccessanalyzerClient Account services.AccountClient Acm services.AcmClient Acmpca services.AcmpcaClient Amp services.AmpClient Amplify services.AmplifyClient Apigateway services.ApigatewayClient Apigatewayv2 services.Apigatewayv2Client Appconfig services.AppconfigClient Appflow services.AppflowClient Applicationautoscaling services.ApplicationautoscalingClient Appmesh services.AppmeshClient Apprunner services.ApprunnerClient Appstream services.AppstreamClient Appsync services.AppsyncClient Athena services.AthenaClient Auditmanager services.AuditmanagerClient Autoscaling services.AutoscalingClient Autoscalingplans services.AutoscalingplansClient Backup services.BackupClient Batch services.BatchClient Cloudformation services.CloudformationClient Cloudfront services.CloudfrontClient Cloudhsmv2 services.Cloudhsmv2Client Cloudtrail services.CloudtrailClient Cloudwatch services.CloudwatchClient Cloudwatchlogs services.CloudwatchlogsClient Codeartifact services.CodeartifactClient Codebuild services.CodebuildClient Codecommit services.CodecommitClient Codepipeline services.CodepipelineClient Cognitoidentity services.CognitoidentityClient Cognitoidentityprovider services.CognitoidentityproviderClient Computeoptimizer services.ComputeoptimizerClient Configservice services.ConfigserviceClient Costexplorer services.CostexplorerClient Databasemigrationservice services.DatabasemigrationserviceClient Dax services.DaxClient Detective services.DetectiveClient Directconnect services.DirectconnectClient Docdb services.DocdbClient Dynamodb services.DynamodbClient Dynamodbstreams services.DynamodbstreamsClient Ec2 services.Ec2Client Ecr services.EcrClient Ecrpublic services.EcrpublicClient Ecs services.EcsClient Efs services.EfsClient Eks services.EksClient Elasticache services.ElasticacheClient Elasticbeanstalk services.ElasticbeanstalkClient Elasticloadbalancing services.ElasticloadbalancingClient Elasticloadbalancingv2 services.Elasticloadbalancingv2Client Elasticsearchservice services.ElasticsearchserviceClient Elastictranscoder services.ElastictranscoderClient Emr services.EmrClient Eventbridge services.EventbridgeClient Firehose services.FirehoseClient Frauddetector services.FrauddetectorClient Fsx services.FsxClient Glacier services.GlacierClient Glue services.GlueClient Guardduty services.GuarddutyClient Iam services.IamClient Identitystore services.IdentitystoreClient Inspector services.InspectorClient Inspector2 services.Inspector2Client Iot services.IotClient Kafka services.KafkaClient Kinesis services.KinesisClient Kms services.KmsClient Lambda services.LambdaClient Lightsail services.LightsailClient Mq services.MqClient Mwaa services.MwaaClient Neptune services.NeptuneClient Networkfirewall services.NetworkfirewallClient Networkmanager services.NetworkmanagerClient Organizations services.OrganizationsClient Qldb services.QldbClient Quicksight services.QuicksightClient Ram services.RamClient Rds services.RdsClient Redshift services.RedshiftClient Resourcegroups services.ResourcegroupsClient Resiliencehub services.ResiliencehubClient Route53 services.Route53Client Route53domains services.Route53domainsClient Route53recoverycontrolconfig services.Route53recoverycontrolconfigClient Route53recoveryreadiness services.Route53recoveryreadinessClient Route53resolver services.Route53resolverClient S3 services.S3Client S3control services.S3controlClient Sagemaker services.SagemakerClient Savingsplans services.SavingsplansClient Scheduler services.SchedulerClient Secretsmanager services.SecretsmanagerClient Securityhub services.SecurityhubClient Servicecatalog services.ServicecatalogClient Servicecatalogappregistry services.ServicecatalogappregistryClient Servicediscovery services.ServicediscoveryClient Servicequotas services.ServicequotasClient Ses services.SesClient Sesv2 services.Sesv2Client Sfn services.SfnClient Shield services.ShieldClient Signer services.SignerClient Sns services.SnsClient Sqs services.SqsClient Ssm services.SsmClient Ssoadmin services.SsoadminClient Support services.SupportClient Timestreamwrite services.TimestreamwriteClient Transfer services.TransferClient Waf services.WafClient Wafregional services.WafregionalClient Wafv2 services.Wafv2Client Wellarchitected services.WellarchitectedClient Workspaces services.WorkspacesClient Xray services.XrayClient }
func (*Services) GetService ¶
func (s *Services) GetService(service AWSServiceName) any
func (*Services) InitService ¶
func (s *Services) InitService(service AWSServiceName)
type ServicesManager ¶
type ServicesManager struct {
// contains filtered or unexported fields
}
ServicesManager will hold the entire map of (account X region) services
func (*ServicesManager) InitServices ¶
func (s *ServicesManager) InitServices(details svcsDetail)
func (*ServicesManager) InitServicesForPartitionAccount ¶
func (s *ServicesManager) InitServicesForPartitionAccount(partition, accountId string, svcs Services)
func (*ServicesManager) ServicesByPartitionAccount ¶
func (s *ServicesManager) ServicesByPartitionAccount(partition, accountId string) *Services
type SupportedServiceRegionsData ¶
type SupportedServiceRegionsData struct { Partitions map[string]AwsPartition `json:"partitions"` // contains filtered or unexported fields }
func ReadSupportedServiceRegions ¶
func ReadSupportedServiceRegions() *SupportedServiceRegionsData
type TestOptions ¶
Source Files
¶
Directories
¶
Path | Synopsis |
---|---|
When executed, this file modifies the mocks in the client/mocks directory and adds assertions to all of them to check that the Region parameter is being set in all calls to the AWS SDK.
|
When executed, this file modifies the mocks in the client/mocks directory and adds assertions to all of them to check that the Region parameter is being set in all calls to the AWS SDK. |
Package mocks is a generated GoMock package.
|
Package mocks is a generated GoMock package. |
Code generated by codegen; DO NOT EDIT.
|
Code generated by codegen; DO NOT EDIT. |