Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Reader ¶
type Reader interface { // GetAccountID returns the current ID for the account used GetAccountID() string // GetRegion returns the currently used region for the Connector GetRegion() string // GetAlarms returns all cloudwatch alarms based on the input given. // Returned values are commented in the interface doc comment block. GetAlarms(ctx context.Context, input *cloudwatch.DescribeAlarmsInput) (*cloudwatch.DescribeAlarmsOutput, error) // GetInstances returns all EC2 instances based on the input given. // Returned values are commented in the interface doc comment block. GetInstances(ctx context.Context, input *ec2.DescribeInstancesInput) (*ec2.DescribeInstancesOutput, error) // GetVpcs returns all EC2 VPCs based on the input given. // Returned values are commented in the interface doc comment block. GetVpcs(ctx context.Context, input *ec2.DescribeVpcsInput) (*ec2.DescribeVpcsOutput, error) // GetVpcPeeringConnections returns all VpcPeeringConnections based on the input given. // Returned values are commented in the interface doc comment block. GetVpcPeeringConnections(ctx context.Context, input *ec2.DescribeVpcPeeringConnectionsInput) (*ec2.DescribeVpcPeeringConnectionsOutput, error) // GetImages returns all EC2 AMI based on the input given. // Returned values are commented in the interface doc comment block. GetImages(ctx context.Context, input *ec2.DescribeImagesInput) (*ec2.DescribeImagesOutput, error) // GetOwnImages returns all EC2 AMI belonging to the Account ID based on the input given. // Returned values are commented in the interface doc comment block. GetOwnImages(ctx context.Context, input *ec2.DescribeImagesInput) (*ec2.DescribeImagesOutput, error) // GetKeyPairs returns all KeyPairs based on the input given. // Returned values are commented in the interface doc comment block. GetKeyPairs(ctx context.Context, input *ec2.DescribeKeyPairsInput) (*ec2.DescribeKeyPairsOutput, error) // GetSecurityGroups returns all EC2 security groups based on the input given. // Returned values are commented in the interface doc comment block. GetSecurityGroups(ctx context.Context, input *ec2.DescribeSecurityGroupsInput) (*ec2.DescribeSecurityGroupsOutput, error) // GetSubnets returns all EC2 subnets based on the input given. // Returned values are commented in the interface doc comment block. GetSubnets(ctx context.Context, input *ec2.DescribeSubnetsInput) (*ec2.DescribeSubnetsOutput, error) // GetVolumes returns all EC2 volumes based on the input given. // Returned values are commented in the interface doc comment block. GetVolumes(ctx context.Context, input *ec2.DescribeVolumesInput) (*ec2.DescribeVolumesOutput, error) // GetSnapshots returns all snapshots based on the input given. // Returned values are commented in the interface doc comment block. GetSnapshots(ctx context.Context, input *ec2.DescribeSnapshotsInput) (*ec2.DescribeSnapshotsOutput, error) // GetOwnSnapshots returns all snapshots belonging to the Account ID based on the input given. // Returned values are commented in the interface doc comment block. GetOwnSnapshots(ctx context.Context, input *ec2.DescribeSnapshotsInput) (*ec2.DescribeSnapshotsOutput, error) // GetLaunchTemplates returns all LaunchTemplate belonging to the Account ID based on the input given. // Returned values are commented in the interface doc comment block. GetLaunchTemplates(ctx context.Context, input *ec2.DescribeLaunchTemplatesInput) (*ec2.DescribeLaunchTemplatesOutput, error) // GetAutoScalingGroups returns all AutoScalingGroup belonging to the Account ID based on the input given. // Returned values are commented in the interface doc comment block. GetAutoScalingGroups(ctx context.Context, input *autoscaling.DescribeAutoScalingGroupsInput) (*autoscaling.DescribeAutoScalingGroupsOutput, error) // GetLaunchConfigurations returns all LaunchConfiguration belonging to the Account ID based on the input given. // Returned values are commented in the interface doc comment block. GetLaunchConfigurations(ctx context.Context, input *autoscaling.DescribeLaunchConfigurationsInput) (*autoscaling.DescribeLaunchConfigurationsOutput, error) // GetAutoScalingPolicies returns all AutoScalingPolicies belonging to the Account ID based on the input given. // Returned values are commented in the interface doc comment block. GetAutoScalingPolicies(ctx context.Context, input *autoscaling.DescribePoliciesInput) (*autoscaling.DescribePoliciesOutput, error) // GetElastiCacheClusters returns all Elasticache clusters based on the input given. // Returned values are commented in the interface doc comment block. GetElastiCacheClusters(ctx context.Context, input *elasticache.DescribeCacheClustersInput) (*elasticache.DescribeCacheClustersOutput, error) // GetElastiCacheTags returns a list of tags of Elasticache resources based on its ARN. // Returned values are commented in the interface doc comment block. GetElastiCacheTags(ctx context.Context, input *elasticache.ListTagsForResourceInput) (*elasticache.TagListMessage, error) // GetLoadBalancers returns a list of ELB (v1) based on the input from the different regions. // Returned values are commented in the interface doc comment block. GetLoadBalancers(ctx context.Context, input *elb.DescribeLoadBalancersInput) (*elb.DescribeLoadBalancersOutput, error) // GetLoadBalancersTags returns a list of Tags based on the input from the different regions. // Returned values are commented in the interface doc comment block. GetLoadBalancersTags(ctx context.Context, input *elb.DescribeTagsInput) (*elb.DescribeTagsOutput, error) // GetLoadBalancersV2 returns a list of ELB (v2) - also known as ALB - based on the input from the different regions. // Returned values are commented in the interface doc comment block. GetLoadBalancersV2(ctx context.Context, input *elbv2.DescribeLoadBalancersInput) (*elbv2.DescribeLoadBalancersOutput, error) // GetLoadBalancersV2Tags returns a list of Tags based on the input from the different regions. // Returned values are commented in the interface doc comment block. GetLoadBalancersV2Tags(ctx context.Context, input *elbv2.DescribeTagsInput) (*elbv2.DescribeTagsOutput, error) // GetLoadBalancersV2Listeners returns a list of Listeners based on the input from the different regions. // Returned values are commented in the interface doc comment block. GetLoadBalancersV2Listeners(ctx context.Context, input *elbv2.DescribeListenersInput) (*elbv2.DescribeListenersOutput, error) // GetLoadBalancersV2TargetGroups returns a list of TargetGroups based on the input from the different regions. // Returned values are commented in the interface doc comment block. GetLoadBalancersV2TargetGroups(ctx context.Context, input *elbv2.DescribeTargetGroupsInput) (*elbv2.DescribeTargetGroupsOutput, error) // GetListenerCertificates returns a list of ListenerCertificates based on the input from the different regions. // Returned values are commented in the interface doc comment block. GetListenerCertificates(ctx context.Context, input *elbv2.DescribeListenerCertificatesInput) (*elbv2.DescribeListenerCertificatesOutput, error) // GetLoadBalancersV2Rules returns a list of Rules based on the input from the different regions. // Returned values are commented in the interface doc comment block. GetLoadBalancersV2Rules(ctx context.Context, input *elbv2.DescribeRulesInput) (*elbv2.DescribeRulesOutput, error) // GetDBInstances returns all DB instances based on the input given. // Returned values are commented in the interface doc comment block. GetDBInstances(ctx context.Context, input *rds.DescribeDBInstancesInput) (*rds.DescribeDBInstancesOutput, error) // GetDBInstancesTags returns a list of tags from an ARN, extra filters for tags can also be provided. // Returned values are commented in the interface doc comment block. GetDBInstancesTags(ctx context.Context, input *rds.ListTagsForResourceInput) (*rds.ListTagsForResourceOutput, error) // GetDBParameterGroups returns all DB parameterGroups based on the input given. // Returned values are commented in the interface doc comment block. GetDBParameterGroups(ctx context.Context, input *rds.DescribeDBParameterGroupsInput) (*rds.DescribeDBParameterGroupsOutput, error) // GetDBSubnetGroups returns all DB DBSubnetGroups based on the input given. // Returned values are commented in the interface doc comment block. GetDBSubnetGroups(ctx context.Context, input *rds.DescribeDBSubnetGroupsInput) (*rds.DescribeDBSubnetGroupsOutput, error) // ListBuckets returns all S3 buckets based on the input given and specifically // filtering by Location as ListBuckets does not do it by itself // Returned values are commented in the interface doc comment block. ListBuckets(ctx context.Context, input *s3.ListBucketsInput) (*s3.ListBucketsOutput, error) // GetBucketTags returns tags associated with S3 buckets based on the input given. // Returned values are commented in the interface doc comment block. GetBucketTags(ctx context.Context, input *s3.GetBucketTaggingInput) (*s3.GetBucketTaggingOutput, error) // ListObjects returns a list of all S3 objects in a bucket based on the input given. // Returned values are commented in the interface doc comment block. ListObjects(ctx context.Context, input *s3.ListObjectsInput) (*s3.ListObjectsOutput, error) // GetObjectsTags returns tags associated with S3 objects based on the input given. // Returned values are commented in the interface doc comment block. GetObjectsTags(ctx context.Context, input *s3.GetObjectTaggingInput) (*s3.GetObjectTaggingOutput, error) // GetRecordedResourceCounts returns counts of the AWS resources which have // been recorded by AWS Config. // See https://docs.aws.amazon.com/config/latest/APIReference/API_GetDiscoveredResourceCounts.html // for more information about what to enable in your AWS account, the list of // supported resources, etc. GetRecordedResourceCounts(ctx context.Context, input *configservice.GetDiscoveredResourceCountsInput) (*configservice.GetDiscoveredResourceCountsOutput, error) // GetCloudFrontDistributions returns all the CloudFront Distributions on the given input // Returned values are commented in the interface doc comment block. GetCloudFrontDistributions(ctx context.Context, input *cloudfront.ListDistributionsInput) (*cloudfront.ListDistributionsOutput, error) // GetCloudFrontPublicKeys returns all the CloudFront Public Keys on the given input // Returned values are commented in the interface doc comment block. GetCloudFrontPublicKeys(ctx context.Context, input *cloudfront.ListPublicKeysInput) (*cloudfront.ListPublicKeysOutput, error) // GetCloudFrontOriginAccessIdentities returns all the CloudFront Origin Access Identities on the given input // Returned values are commented in the interface doc comment block. GetCloudFrontOriginAccessIdentities(ctx context.Context, input *cloudfront.ListCloudFrontOriginAccessIdentitiesInput) (*cloudfront.ListCloudFrontOriginAccessIdentitiesOutput, error) // GetAccessKeys returns all the IAM AccessKeys on the given input // Returned values are commented in the interface doc comment block. GetAccessKeys(ctx context.Context, input *iam.ListAccessKeysInput) (*iam.ListAccessKeysOutput, error) // GetAccountAliases returns all the IAM AccountAliases on the given input // Returned values are commented in the interface doc comment block. GetAccountAliases(ctx context.Context, input *iam.ListAccountAliasesInput) (*iam.ListAccountAliasesOutput, error) // GetAccountPasswordPolicy returns the IAM AccountPasswordPolicy on the given input // Returned values are commented in the interface doc comment block. GetAccountPasswordPolicy(ctx context.Context, input *iam.GetAccountPasswordPolicyInput) (*iam.GetAccountPasswordPolicyOutput, error) // GetGroups returns the IAM Groups on the given input // Returned values are commented in the interface doc comment block. GetGroups(ctx context.Context, input *iam.ListGroupsInput) (*iam.ListGroupsOutput, error) // GetGroupPolicies returns the IAM GroupPolicies on the given input // Returned values are commented in the interface doc comment block. GetGroupPolicies(ctx context.Context, input *iam.ListGroupPoliciesInput) (*iam.ListGroupPoliciesOutput, error) // GetAttachedGroupPolicies returns the IAM AttachedGroupPolicies on the given input // Returned values are commented in the interface doc comment block. GetAttachedGroupPolicies(ctx context.Context, input *iam.ListAttachedGroupPoliciesInput) (*iam.ListAttachedGroupPoliciesOutput, error) // GetIstanceProfiles returns the IAM InstanceProfiles on the given input // Returned values are commented in the interface doc comment block. GetInstanceProfiles(ctx context.Context, input *iam.ListInstanceProfilesInput) (*iam.ListInstanceProfilesOutput, error) // GetOpenIDConnectProviders returns the IAM OpenIDConnectProviders on the given input // Returned values are commented in the interface doc comment block. GetOpenIDConnectProviders(ctx context.Context, input *iam.ListOpenIDConnectProvidersInput) (*iam.ListOpenIDConnectProvidersOutput, error) // GetPolicies returns the IAM Policies on the given input // Returned values are commented in the interface doc comment block. GetPolicies(ctx context.Context, input *iam.ListPoliciesInput) (*iam.ListPoliciesOutput, error) // GetRoles returns the IAM Roles on the given input // Returned values are commented in the interface doc comment block. GetRoles(ctx context.Context, input *iam.ListRolesInput) (*iam.ListRolesOutput, error) // GetRolePolicies returns the IAM RolePolicies on the given input // Returned values are commented in the interface doc comment block. GetRolePolicies(ctx context.Context, input *iam.ListRolePoliciesInput) (*iam.ListRolePoliciesOutput, error) // GetAttachedRolePolicies returns the IAM AttachedRolePolicies on the given input // Returned values are commented in the interface doc comment block. GetAttachedRolePolicies(ctx context.Context, input *iam.ListAttachedRolePoliciesInput) (*iam.ListAttachedRolePoliciesOutput, error) // GetSAMLProviders returns the IAM SAMLProviders on the given input // Returned values are commented in the interface doc comment block. GetSAMLProviders(ctx context.Context, input *iam.ListSAMLProvidersInput) (*iam.ListSAMLProvidersOutput, error) // GetServerCertificates returns the IAM ServerCertificates on the given input // Returned values are commented in the interface doc comment block. GetServerCertificates(ctx context.Context, input *iam.ListServerCertificatesInput) (*iam.ListServerCertificatesOutput, error) // GetUsers returns the IAM Users on the given input // Returned values are commented in the interface doc comment block. GetUsers(ctx context.Context, input *iam.ListUsersInput) (*iam.ListUsersOutput, error) // GetUserPolicies returns the IAM UserPolicies on the given input // Returned values are commented in the interface doc comment block. GetUserPolicies(ctx context.Context, input *iam.ListUserPoliciesInput) (*iam.ListUserPoliciesOutput, error) // GetAttachedUserPolicies returns the IAM AttachedUserPolicies on the given input // Returned values are commented in the interface doc comment block. GetAttachedUserPolicies(ctx context.Context, input *iam.ListAttachedUserPoliciesInput) (*iam.ListAttachedUserPoliciesOutput, error) // GetSSHPublicKeys returns the IAM SSHPublicKeys on the given input // Returned values are commented in the interface doc comment block. GetSSHPublicKeys(ctx context.Context, input *iam.ListSSHPublicKeysInput) (*iam.ListSSHPublicKeysOutput, error) // GetActiveReceiptRuleSet returns the SES ActiveReceiptRuleSet on the given input // Returned values are commented in the interface doc comment block. GetActiveReceiptRuleSet(ctx context.Context, input *ses.DescribeActiveReceiptRuleSetInput) (*ses.DescribeActiveReceiptRuleSetOutput, error) // GetIdentities returns the SES Identities on the given input // Returned values are commented in the interface doc comment block. GetIdentities(ctx context.Context, input *ses.ListIdentitiesInput) (*ses.ListIdentitiesOutput, error) // GetReceiptFilters returns the SES ReceiptFilters on the given input // Returned values are commented in the interface doc comment block. GetReceiptFilters(ctx context.Context, input *ses.ListReceiptFiltersInput) (*ses.ListReceiptFiltersOutput, error) // GetConfigurationSets returns the SES ConfigurationSets on the given input // Returned values are commented in the interface doc comment block. GetConfigurationSets(ctx context.Context, input *ses.ListConfigurationSetsInput) (*ses.ListConfigurationSetsOutput, error) // GetIdentityNotificationAttributes returns the SES IdentityNotificationAttributes on the given input // Returned values are commented in the interface doc comment block. GetIdentityNotificationAttributes(ctx context.Context, input *ses.GetIdentityNotificationAttributesInput) (*ses.GetIdentityNotificationAttributesOutput, error) // GetTemplates returns the SES Templates on the given input // Returned values are commented in the interface doc comment block. GetTemplates(ctx context.Context, input *ses.ListTemplatesInput) (*ses.ListTemplatesOutput, error) // GetReusableDelegationSets returns the Route53 ReusableDelegationSets on the given input // Returned values are commented in the interface doc comment block. GetReusableDelegationSets(ctx context.Context, input *route53.ListReusableDelegationSetsInput) (*route53.ListReusableDelegationSetsOutput, error) // GetHealthChecks returns the Route53 HealthChecks on the given input // Returned values are commented in the interface doc comment block. GetHealthChecks(ctx context.Context, input *route53.ListHealthChecksInput) (*route53.ListHealthChecksOutput, error) // GetQueryLoggingConfigs returns the Route53 QueryLoggingConfigs on the given input // Returned values are commented in the interface doc comment block. GetQueryLoggingConfigs(ctx context.Context, input *route53.ListQueryLoggingConfigsInput) (*route53.ListQueryLoggingConfigsOutput, error) // GetResourceRecordSets returns the Route53 ResourceRecordSets on the given input // Returned values are commented in the interface doc comment block. GetResourceRecordSets(ctx context.Context, input *route53.ListResourceRecordSetsInput) (*route53.ListResourceRecordSetsOutput, error) // GetHostedZones returns the Route53 HostedZones on the given input // Returned values are commented in the interface doc comment block. GetHostedZones(ctx context.Context, input *route53.ListHostedZonesInput) (*route53.ListHostedZonesOutput, error) // GetVPCAssociationAuthorizations returns the Route53 VPCAssociationAuthorizations on the given input // Returned values are commented in the interface doc comment block. GetVPCAssociationAuthorizations(ctx context.Context, input *route53.ListVPCAssociationAuthorizationsInput) (*route53.ListVPCAssociationAuthorizationsOutput, error) // GetResolverEndpoints returns the Route53Resolver ResolverEndpoints on the given input // Returned values are commented in the interface doc comment block. GetResolverEndpoints(ctx context.Context, input *route53resolver.ListResolverEndpointsInput) (*route53resolver.ListResolverEndpointsOutput, error) // GetResolverRules returns the Route53Resolver ResolverRules on the given input // Returned values are commented in the interface doc comment block. GetResolverRules(ctx context.Context, input *route53resolver.ListResolverRulesInput) (*route53resolver.ListResolverRulesOutput, error) // GetResolverRuleAssociations returns the Route53Resolver ResolverRuleAssociations on the given input // Returned values are commented in the interface doc comment block. GetResolverRuleAssociations(ctx context.Context, input *route53resolver.ListResolverRuleAssociationsInput) (*route53resolver.ListResolverRuleAssociationsOutput, error) }
Reader is the interface defining all methods that need to be implemented
The next behavior commented in the below paragraph, applies to every method which clearly match what's explained, for the sake of not repeating the same, over and over. The most of the methods defined by this interface, return their results in a map. Those maps, have as keys, the AWS region which have been requested and the values are the items returned by AWS for such region. Because the methods may make calls to different regions, in case that there is an error on a region, the returned map won't have any entry for such region and such errors will be reported by the returned error, nonetheless the items, got from the successful requests to other regions, will be returned, with the meaning that the methods will return partial results, in case of errors. For avoiding by the callers the problem of if the returned map may be nil, the function will always return a map instance, which will be of length 0 in case that there is not any successful request.
func New ¶
func New(ctx context.Context, accessKey string, secretKey string, region string, config *aws.Config) (Reader, error)
New returns an object which also contains the accountID and the region to use.
The accountID is helpful to return only the AMI or snapshots that belong to the account.
While the region has to be a valid AWS region ¶
An error is returned if any of the needed AWS request for creating the reader returns an AWS error, in such case it will have any of the common error codes (see below) or EmptyStaticCreds code or a go standard error in case that no regions are matched with the ones available, at the time, in AWS. See: