terratest: github.com/gruntwork-io/terratest/modules/aws Index | Files

package aws

import "github.com/gruntwork-io/terratest/modules/aws"

Package aws allows to interact with resources on Amazon Web Services.

Index

Package Files

account.go acm.go ami.go asg.go auth.go aws.go cloudwatch.go dynamodb.go ebs.go ec2-files.go ec2-syslog.go ec2.go ecs.go errors.go iam.go keypair.go kms.go lambda.go rds.go region.go s3.go sns.go sqs.go ssm.go vpc.go

Constants

const (
    CanonicalAccountId = "099720109477"
    CentOsAccountId    = "679593333241"
    AmazonAccountId    = "amazon"
)

These are commonly used AMI account IDs.

const (
    AuthAssumeRoleEnvVar = "TERRATEST_IAM_ROLE" // OS environment variable name through which Assume Role ARN may be passed for authentication
)

func AddTagsToResource Uses

func AddTagsToResource(t testing.TestingT, region string, resource string, tags map[string]string)

AddTagsToResource adds the tags to the given taggable AWS resource such as EC2, AMI or VPC.

func AddTagsToResourceE Uses

func AddTagsToResourceE(t testing.TestingT, region string, resource string, tags map[string]string) error

AddTagsToResourceE adds the tags to the given taggable AWS resource such as EC2, AMI or VPC.

func AssertS3BucketExists Uses

func AssertS3BucketExists(t testing.TestingT, region string, name string)

AssertS3BucketExists checks if the given S3 bucket exists in the given region and fail the test if it does not.

func AssertS3BucketExistsE Uses

func AssertS3BucketExistsE(t testing.TestingT, region string, name string) error

AssertS3BucketExistsE checks if the given S3 bucket exists in the given region and return an error if it does not.

func AssertS3BucketPolicyExists Uses

func AssertS3BucketPolicyExists(t testing.TestingT, region string, bucketName string)

AssertS3BucketPolicyExists checks if the given S3 bucket has a resource policy attached and returns an error if it does not

func AssertS3BucketPolicyExistsE Uses

func AssertS3BucketPolicyExistsE(t testing.TestingT, region string, bucketName string) error

AssertS3BucketPolicyExistsE checks if the given S3 bucket has a resource policy attached and returns an error if it does not

func AssertS3BucketVersioningExists Uses

func AssertS3BucketVersioningExists(t testing.TestingT, region string, bucketName string)

AssertS3BucketVersioningExists checks if the given S3 bucket has a versioning configuration enabled and returns an error if it does not.

func AssertS3BucketVersioningExistsE Uses

func AssertS3BucketVersioningExistsE(t testing.TestingT, region string, bucketName string) error

AssertS3BucketVersioningExistsE checks if the given S3 bucket has a versioning configuration enabled and returns an error if it does not.

func AssumeRole Uses

func AssumeRole(sess *session.Session, roleARN string) *session.Session

AssumeRole mutates the provided session by obtaining new credentials by assuming the role provided in roleARN.

func CreateAwsCredentials Uses

func CreateAwsCredentials(accessKeyID string, secretAccessKey string) *credentials.Credentials

CreateAwsCredentials creates an AWS Credentials configuration with specific AWS credentials.

func CreateAwsCredentialsWithSessionToken Uses

func CreateAwsCredentialsWithSessionToken(accessKeyID, secretAccessKey, sessionToken string) *credentials.Credentials

CreateAwsCredentialsWithSessionToken creates an AWS Credentials configuration with temporary AWS credentials by including a session token (used for authenticating with MFA).

func CreateAwsSessionFromRole Uses

func CreateAwsSessionFromRole(region string, roleARN string) (*session.Session, error)

CreateAwsSessionFromRole returns a new AWS session after assuming the role whose ARN is provided in roleARN.

func CreateAwsSessionWithCreds Uses

func CreateAwsSessionWithCreds(region string, accessKeyID string, secretAccessKey string) (*session.Session, error)

CreateAwsSessionWithCreds creates a new AWS session using explicit credentials. This is useful if you want to create an IAM User dynamically and create an AWS session authenticated as the new IAM User.

func CreateAwsSessionWithMfa Uses

func CreateAwsSessionWithMfa(region string, stsClient *sts.STS, mfaDevice *iam.VirtualMFADevice) (*session.Session, error)

CreateAwsSessionWithMfa creates a new AWS session authenticated using an MFA token retrieved using the given STS client and MFA Device.

func CreateEcsCluster Uses

func CreateEcsCluster(t testing.TestingT, region string, name string) *ecs.Cluster

CreateEcsCluster creates ECS cluster in the given region under the given name.

func CreateEcsClusterE Uses

func CreateEcsClusterE(t testing.TestingT, region string, name string) (*ecs.Cluster, error)

CreateEcsClusterE creates ECS cluster in the given region under the given name.

func CreateMfaDevice Uses

func CreateMfaDevice(t testing.TestingT, iamClient *iam.IAM, deviceName string) *iam.VirtualMFADevice

CreateMfaDevice creates an MFA device using the given IAM client.

func CreateMfaDeviceE Uses

func CreateMfaDeviceE(t testing.TestingT, iamClient *iam.IAM, deviceName string) (*iam.VirtualMFADevice, error)

CreateMfaDeviceE creates an MFA device using the given IAM client.

func CreateRandomFifoQueue Uses

func CreateRandomFifoQueue(t testing.TestingT, awsRegion string, prefix string) string

CreateRandomFifoQueue creates a new FIFO SQS queue with a random name that starts with the given prefix and return the queue URL.

func CreateRandomFifoQueueE Uses

func CreateRandomFifoQueueE(t testing.TestingT, awsRegion string, prefix string) (string, error)

CreateRandomFifoQueueE creates a new FIFO SQS queue with a random name that starts with the given prefix and return the queue URL.

func CreateRandomQueue Uses

func CreateRandomQueue(t testing.TestingT, awsRegion string, prefix string) string

CreateRandomQueue creates a new SQS queue with a random name that starts with the given prefix and return the queue URL.

func CreateRandomQueueE Uses

func CreateRandomQueueE(t testing.TestingT, awsRegion string, prefix string) (string, error)

CreateRandomQueueE creates a new SQS queue with a random name that starts with the given prefix and return the queue URL.

func CreateS3Bucket Uses

func CreateS3Bucket(t testing.TestingT, region string, name string)

CreateS3Bucket creates an S3 bucket in the given region with the given name. Note that S3 bucket names must be globally unique.

func CreateS3BucketE Uses

func CreateS3BucketE(t testing.TestingT, region string, name string) error

CreateS3BucketE creates an S3 bucket in the given region with the given name. Note that S3 bucket names must be globally unique.

func CreateSnsTopic Uses

func CreateSnsTopic(t testing.TestingT, region string, snsTopicName string) string

CreateSnsTopic creates an SNS Topic and return the ARN.

func CreateSnsTopicE Uses

func CreateSnsTopicE(t testing.TestingT, region string, snsTopicName string) (string, error)

CreateSnsTopicE creates an SNS Topic and return the ARN.

func DeleteAmi Uses

func DeleteAmi(t testing.TestingT, region string, imageID string)

DeleteAmi deletes the given AMI in the given region.

func DeleteAmiAndAllSnapshots Uses

func DeleteAmiAndAllSnapshots(t testing.TestingT, region string, ami string)

DeleteAmiAndAllSnapshots will delete the given AMI along with all EBS snapshots that backed that AMI

func DeleteAmiAndAllSnapshotsE Uses

func DeleteAmiAndAllSnapshotsE(t testing.TestingT, region string, ami string) error

DeleteAmiAndAllSnapshotsE will delete the given AMI along with all EBS snapshots that backed that AMI

func DeleteAmiE Uses

func DeleteAmiE(t testing.TestingT, region string, imageID string) error

DeleteAmiE deletes the given AMI in the given region.

func DeleteEC2KeyPair Uses

func DeleteEC2KeyPair(t testing.TestingT, keyPair *Ec2Keypair)

DeleteEC2KeyPair deletes an EC2 key pair.

func DeleteEC2KeyPairE Uses

func DeleteEC2KeyPairE(t testing.TestingT, keyPair *Ec2Keypair) error

DeleteEC2KeyPairE deletes an EC2 key pair.

func DeleteEbsSnapshot Uses

func DeleteEbsSnapshot(t testing.TestingT, region string, snapshot string)

DeleteEbsSnapshot deletes the given EBS snapshot

func DeleteEbsSnapshotE Uses

func DeleteEbsSnapshotE(t testing.TestingT, region string, snapshot string) error

DeleteEbsSnapshot deletes the given EBS snapshot

func DeleteEcsCluster Uses

func DeleteEcsCluster(t testing.TestingT, region string, cluster *ecs.Cluster)

func DeleteEcsClusterE Uses

func DeleteEcsClusterE(t testing.TestingT, region string, cluster *ecs.Cluster) error

DeleteEcsClusterE deletes existing ECS cluster in the given region.

func DeleteMessageFromQueue Uses

func DeleteMessageFromQueue(t testing.TestingT, awsRegion string, queueURL string, receipt string)

DeleteMessageFromQueue deletes the message with the given receipt from the SQS queue with the given URL.

func DeleteMessageFromQueueE Uses

func DeleteMessageFromQueueE(t testing.TestingT, awsRegion string, queueURL string, receipt string) error

DeleteMessageFromQueueE deletes the message with the given receipt from the SQS queue with the given URL.

func DeleteQueue Uses

func DeleteQueue(t testing.TestingT, awsRegion string, queueURL string)

DeleteQueue deletes the SQS queue with the given URL.

func DeleteQueueE Uses

func DeleteQueueE(t testing.TestingT, awsRegion string, queueURL string) error

DeleteQueueE deletes the SQS queue with the given URL.

func DeleteS3Bucket Uses

func DeleteS3Bucket(t testing.TestingT, region string, name string)

DeleteS3Bucket destroys the S3 bucket in the given region with the given name.

func DeleteS3BucketE Uses

func DeleteS3BucketE(t testing.TestingT, region string, name string) error

DeleteS3BucketE destroys the S3 bucket in the given region with the given name.

func DeleteSNSTopic Uses

func DeleteSNSTopic(t testing.TestingT, region string, snsTopicArn string)

DeleteSNSTopic deletes an SNS Topic.

func DeleteSNSTopicE Uses

func DeleteSNSTopicE(t testing.TestingT, region string, snsTopicArn string) error

DeleteSNSTopicE deletes an SNS Topic.

func EmptyS3Bucket Uses

func EmptyS3Bucket(t testing.TestingT, region string, name string)

EmptyS3Bucket removes the contents of an S3 bucket in the given region with the given name.

func EmptyS3BucketE Uses

func EmptyS3BucketE(t testing.TestingT, region string, name string) error

EmptyS3BucketE removes the contents of an S3 bucket in the given region with the given name.

func EnableMfaDevice Uses

func EnableMfaDevice(t testing.TestingT, iamClient *iam.IAM, mfaDevice *iam.VirtualMFADevice)

EnableMfaDevice enables a newly created MFA Device by supplying the first two one-time passwords, so that it can be used for future logins by the given IAM User.

func EnableMfaDeviceE Uses

func EnableMfaDeviceE(t testing.TestingT, iamClient *iam.IAM, mfaDevice *iam.VirtualMFADevice) error

EnableMfaDeviceE enables a newly created MFA Device by supplying the first two one-time passwords, so that it can be used for future logins by the given IAM User.

func FetchContentsOfFileFromAsg Uses

func FetchContentsOfFileFromAsg(t testing.TestingT, awsRegion string, sshUserName string, keyPair *Ec2Keypair, asgName string, useSudo bool, filePath string) map[string]string

FetchContentsOfFileFromAsg looks up the EC2 Instances in the given ASG, looks up the public IPs of those EC2 Instances, connects to each Instance via SSH using the given username and Key Pair, fetches the contents of the file at the given path (using sudo if useSudo is true), and returns a map from Instance ID to the contents of that file as a string.

func FetchContentsOfFileFromAsgE Uses

func FetchContentsOfFileFromAsgE(t testing.TestingT, awsRegion string, sshUserName string, keyPair *Ec2Keypair, asgName string, useSudo bool, filePath string) (map[string]string, error)

FetchContentsOfFileFromAsgE looks up the EC2 Instances in the given ASG, looks up the public IPs of those EC2 Instances, connects to each Instance via SSH using the given username and Key Pair, fetches the contents of the file at the given path (using sudo if useSudo is true), and returns a map from Instance ID to the contents of that file as a string.

func FetchContentsOfFileFromInstance Uses

func FetchContentsOfFileFromInstance(t testing.TestingT, awsRegion string, sshUserName string, keyPair *Ec2Keypair, instanceID string, useSudo bool, filePath string) string

FetchContentsOfFileFromInstance looks up the public IP address of the EC2 Instance with the given ID, connects to the Instance via SSH using the given username and Key Pair, fetches the contents of the file at the given path (using sudo if useSudo is true), and returns the contents of that file as a string.

func FetchContentsOfFileFromInstanceE Uses

func FetchContentsOfFileFromInstanceE(t testing.TestingT, awsRegion string, sshUserName string, keyPair *Ec2Keypair, instanceID string, useSudo bool, filePath string) (string, error)

FetchContentsOfFileFromInstanceE looks up the public IP address of the EC2 Instance with the given ID, connects to the Instance via SSH using the given username and Key Pair, fetches the contents of the file at the given path (using sudo if useSudo is true), and returns the contents of that file as a string.

func FetchContentsOfFilesFromAsg Uses

func FetchContentsOfFilesFromAsg(t testing.TestingT, awsRegion string, sshUserName string, keyPair *Ec2Keypair, asgName string, useSudo bool, filePaths ...string) map[string]map[string]string

FetchContentsOfFilesFromAsg looks up the EC2 Instances in the given ASG, looks up the public IPs of those EC2 Instances, connects to each Instance via SSH using the given username and Key Pair, fetches the contents of the files at the given paths (using sudo if useSudo is true), and returns a map from Instance ID to a map of file path to the contents of that file as a string.

func FetchContentsOfFilesFromAsgE Uses

func FetchContentsOfFilesFromAsgE(t testing.TestingT, awsRegion string, sshUserName string, keyPair *Ec2Keypair, asgName string, useSudo bool, filePaths ...string) (map[string]map[string]string, error)

FetchContentsOfFilesFromAsgE looks up the EC2 Instances in the given ASG, looks up the public IPs of those EC2 Instances, connects to each Instance via SSH using the given username and Key Pair, fetches the contents of the files at the given paths (using sudo if useSudo is true), and returns a map from Instance ID to a map of file path to the contents of that file as a string.

func FetchContentsOfFilesFromInstance Uses

func FetchContentsOfFilesFromInstance(t testing.TestingT, awsRegion string, sshUserName string, keyPair *Ec2Keypair, instanceID string, useSudo bool, filePaths ...string) map[string]string

FetchContentsOfFilesFromInstance looks up the public IP address of the EC2 Instance with the given ID, connects to the Instance via SSH using the given username and Key Pair, fetches the contents of the files at the given paths (using sudo if useSudo is true), and returns a map from file path to the contents of that file as a string.

func FetchContentsOfFilesFromInstanceE Uses

func FetchContentsOfFilesFromInstanceE(t testing.TestingT, awsRegion string, sshUserName string, keyPair *Ec2Keypair, instanceID string, useSudo bool, filePaths ...string) (map[string]string, error)

FetchContentsOfFilesFromInstanceE looks up the public IP address of the EC2 Instance with the given ID, connects to the Instance via SSH using the given username and Key Pair, fetches the contents of the files at the given paths (using sudo if useSudo is true), and returns a map from file path to the contents of that file as a string.

func FetchFilesFromAsgs Uses

func FetchFilesFromAsgs(t testing.TestingT, awsRegion string, spec RemoteFileSpecification)

FetchFilesFromAsgs looks up the EC2 Instances in all the ASGs given in the RemoteFileSpecification, looks up the public IPs of those EC2 Instances, connects to each Instance via SSH using the given username and Key Pair, downloads the files matching filenameFilters at the given remoteDirectory (using sudo if useSudo is true), and stores the files locally at localDirectory/<publicip>/<remoteFolderName>

func FetchFilesFromAsgsE Uses

func FetchFilesFromAsgsE(t testing.TestingT, awsRegion string, spec RemoteFileSpecification) error

FetchFilesFromAsgsE looks up the EC2 Instances in all the ASGs given in the RemoteFileSpecification, looks up the public IPs of those EC2 Instances, connects to each Instance via SSH using the given username and Key Pair, downloads the files matching filenameFilters at the given remoteDirectory (using sudo if useSudo is true), and stores the files locally at localDirectory/<publicip>/<remoteFolderName>

func FetchFilesFromInstance Uses

func FetchFilesFromInstance(t testing.TestingT, awsRegion string, sshUserName string, keyPair *Ec2Keypair, instanceID string, useSudo bool, remoteDirectory string, localDirectory string, filenameFilters []string)

FetchFilesFromInstance looks up the EC2 Instances in the given ASG, looks up the public IPs of those EC2 Instances, connects to each Instance via SSH using the given username and Key Pair, downloads the files matching filenameFilters at the given remoteDirectory (using sudo if useSudo is true), and stores the files locally at localDirectory/<publicip>/<remoteFolderName>

func FetchFilesFromInstanceE Uses

func FetchFilesFromInstanceE(t testing.TestingT, awsRegion string, sshUserName string, keyPair *Ec2Keypair, instanceID string, useSudo bool, remoteDirectory string, localDirectory string, filenameFilters []string) error

FetchFilesFromInstanceE looks up the EC2 Instances in the given ASG, looks up the public IPs of those EC2 Instances, connects to each Instance via SSH using the given username and Key Pair, downloads the files matching filenameFilters at the given remoteDirectory (using sudo if useSudo is true), and stores the files locally at localDirectory/<publicip>/<remoteFolderName>

func FindS3BucketWithTag Uses

func FindS3BucketWithTag(t testing.TestingT, awsRegion string, key string, value string) string

FindS3BucketWithTag finds the name of the S3 bucket in the given region with the given tag key=value.

func FindS3BucketWithTagE Uses

func FindS3BucketWithTagE(t testing.TestingT, awsRegion string, key string, value string) (string, error)

FindS3BucketWithTagE finds the name of the S3 bucket in the given region with the given tag key=value.

func FindVpcName Uses

func FindVpcName(vpc *ec2.Vpc) string

FindVpcName extracts the VPC name from its tags (if any). Fall back to "Default" if it's the default VPC or empty string otherwise.

func GetAccountId Uses

func GetAccountId(t testing.TestingT) string

GetAccountId gets the Account ID for the currently logged in IAM User.

func GetAccountIdE Uses

func GetAccountIdE(t testing.TestingT) (string, error)

GetAccountIdE gets the Account ID for the currently logged in IAM User.

func GetAccountsWithLaunchPermissionsForAmi Uses

func GetAccountsWithLaunchPermissionsForAmi(t testing.TestingT, awsRegion string, amiID string) []string

GetAccountsWithLaunchPermissionsForAmi returns list of accounts that the AMI is shared with

func GetAccountsWithLaunchPermissionsForAmiE Uses

func GetAccountsWithLaunchPermissionsForAmiE(t testing.TestingT, awsRegion string, amiID string) ([]string, error)

GetAccountsWithLaunchPermissionsForAmiE returns list of accounts that the AMI is shared with

func GetAcmCertificateArn Uses

func GetAcmCertificateArn(t testing.TestingT, awsRegion string, certDomainName string) string

GetAcmCertificateArn gets the ACM certificate for the given domain name in the given region.

func GetAcmCertificateArnE Uses

func GetAcmCertificateArnE(t testing.TestingT, awsRegion string, certDomainName string) (string, error)

GetAcmCertificateArnE gets the ACM certificate for the given domain name in the given region.

func GetAddressOfRdsInstance Uses

func GetAddressOfRdsInstance(t testing.TestingT, dbInstanceID string, awsRegion string) string

GetAddressOfRdsInstance gets the address of the given RDS Instance in the given region.

func GetAddressOfRdsInstanceE Uses

func GetAddressOfRdsInstanceE(t testing.TestingT, dbInstanceID string, awsRegion string) (string, error)

GetAddressOfRdsInstanceE gets the address of the given RDS Instance in the given region.

func GetAllAwsRegions Uses

func GetAllAwsRegions(t testing.TestingT) []string

GetAllAwsRegions gets the list of AWS regions available in this account.

func GetAllAwsRegionsE Uses

func GetAllAwsRegionsE(t testing.TestingT) ([]string, error)

GetAllAwsRegionsE gets the list of AWS regions available in this account.

func GetAllParametersOfRdsInstance Uses

func GetAllParametersOfRdsInstance(t testing.TestingT, dbInstanceID string, awsRegion string) []*rds.Parameter

GetAllParametersOfRdsInstance gets all the parameters defined in the parameter group for the RDS instance in the given region.

func GetAllParametersOfRdsInstanceE Uses

func GetAllParametersOfRdsInstanceE(t testing.TestingT, dbInstanceID string, awsRegion string) ([]*rds.Parameter, error)

GetAllParametersOfRdsInstanceE gets all the parameters defined in the parameter group for the RDS instance in the given region.

func GetAmazonLinuxAmi Uses

func GetAmazonLinuxAmi(t testing.TestingT, region string) string

GetAmazonLinuxAmi returns an Amazon Linux AMI HVM, SSD Volume Type public AMI for the given region.

func GetAmazonLinuxAmiE Uses

func GetAmazonLinuxAmiE(t testing.TestingT, region string) (string, error)

GetAmazonLinuxAmiE returns an Amazon Linux AMI HVM, SSD Volume Type public AMI for the given region.

func GetAmiPubliclyAccessible Uses

func GetAmiPubliclyAccessible(t testing.TestingT, awsRegion string, amiID string) bool

GetAmiPubliclyAccessible returns whether the AMI is publicly accessible or not

func GetAmiPubliclyAccessibleE Uses

func GetAmiPubliclyAccessibleE(t testing.TestingT, awsRegion string, amiID string) (bool, error)

GetAmiPubliclyAccessibleE returns whether the AMI is publicly accessible or not

func GetAvailabilityZones Uses

func GetAvailabilityZones(t testing.TestingT, region string) []string

GetAvailabilityZones gets the Availability Zones for a given AWS region. Note that for certain regions (e.g. us-east-1), different AWS accounts have access to different availability zones.

func GetAvailabilityZonesE Uses

func GetAvailabilityZonesE(t testing.TestingT, region string) ([]string, error)

GetAvailabilityZonesE gets the Availability Zones for a given AWS region. Note that for certain regions (e.g. us-east-1), different AWS accounts have access to different availability zones.

func GetCentos7Ami Uses

func GetCentos7Ami(t testing.TestingT, region string) string

GetCentos7Ami returns a CentOS 7 public AMI from the given region. WARNING: you may have to accept the terms & conditions of this AMI in AWS MarketPlace for your AWS Account before you can successfully launch the AMI.

func GetCentos7AmiE Uses

func GetCentos7AmiE(t testing.TestingT, region string) (string, error)

GetCentos7AmiE returns a CentOS 7 public AMI from the given region. WARNING: you may have to accept the terms & conditions of this AMI in AWS MarketPlace for your AWS Account before you can successfully launch the AMI.

func GetCloudWatchLogEntries Uses

func GetCloudWatchLogEntries(t testing.TestingT, awsRegion string, logStreamName string, logGroupName string) []string

GetCloudWatchLogEntries returns the CloudWatch log messages in the given region for the given log stream and log group.

func GetCloudWatchLogEntriesE Uses

func GetCloudWatchLogEntriesE(t testing.TestingT, awsRegion string, logStreamName string, logGroupName string) ([]string, error)

GetCloudWatchLogEntriesE returns the CloudWatch log messages in the given region for the given log stream and log group.

func GetCmkArn Uses

func GetCmkArn(t testing.TestingT, region string, cmkID string) string

GetCmkArn gets the ARN of a KMS Customer Master Key (CMK) in the given region with the given ID. The ID can be an alias, such as "alias/my-cmk".

func GetCmkArnE Uses

func GetCmkArnE(t testing.TestingT, region string, cmkID string) (string, error)

GetCmkArnE gets the ARN of a KMS Customer Master Key (CMK) in the given region with the given ID. The ID can be an alias, such as "alias/my-cmk".

func GetDefaultEcsCluster Uses

func GetDefaultEcsCluster(t testing.TestingT, region string) *ecs.Cluster

GetDefaultEcsCluster fetches information about default ECS cluster.

func GetDefaultEcsClusterE Uses

func GetDefaultEcsClusterE(t testing.TestingT, region string) (*ecs.Cluster, error)

GetDefaultEcsClusterE fetches information about default ECS cluster.

func GetDynamoDBTable Uses

func GetDynamoDBTable(t testing.TestingT, region string, tableName string) *dynamodb.TableDescription

GetDynamoDBTable fetches information about the specified dynamoDB table. This will fail the test if there are any errors.

func GetDynamoDBTableE Uses

func GetDynamoDBTableE(t testing.TestingT, region string, tableName string) (*dynamodb.TableDescription, error)

GetDynamoDBTableE fetches information about the specified dynamoDB table.

func GetDynamoDBTableTimeToLive Uses

func GetDynamoDBTableTimeToLive(t testing.TestingT, region string, tableName string) *dynamodb.TimeToLiveDescription

GetDynamoDBTableTimeToLive fetches information about the TTL configuration of a specified dynamoDB table. This will fail the test if there are any errors.

func GetDynamoDBTableTimeToLiveE Uses

func GetDynamoDBTableTimeToLiveE(t testing.TestingT, region string, tableName string) (*dynamodb.TimeToLiveDescription, error)

GetDynamoDBTableTimeToLiveE fetches information about the TTL configuration of a specified dynamoDB table.

func GetDynamoDbTableTags Uses

func GetDynamoDbTableTags(t testing.TestingT, region string, tableName string) []*dynamodb.Tag

GetDynamoDbTableTags fetches resource tags of a specified dynamoDB table. This will fail the test if there are any errors

func GetDynamoDbTableTagsE Uses

func GetDynamoDbTableTagsE(t testing.TestingT, region string, tableName string) ([]*dynamodb.Tag, error)

GetDynamoDbTableTagsE fetches resource tags of a specified dynamoDB table.

func GetEbsSnapshotsForAmi Uses

func GetEbsSnapshotsForAmi(t testing.TestingT, region string, ami string) []string

GetEbsSnapshotsForAmi retrieves the EBS snapshots which back the given AMI

func GetEbsSnapshotsForAmiE Uses

func GetEbsSnapshotsForAmiE(t testing.TestingT, region string, ami string) ([]string, error)

GetEbsSnapshotsForAmi retrieves the EBS snapshots which back the given AMI

func GetEc2InstanceIdsByFilters Uses

func GetEc2InstanceIdsByFilters(t testing.TestingT, region string, ec2Filters map[string][]string) []string

GetEc2InstanceIdsByFilters returns all the IDs of EC2 instances in the given region which match to EC2 filter list as per https://docs.aws.amazon.com/sdk-for-go/api/service/ec2/#DescribeInstancesInput.

func GetEc2InstanceIdsByFiltersE Uses

func GetEc2InstanceIdsByFiltersE(t testing.TestingT, region string, ec2Filters map[string][]string) ([]string, error)

GetEc2InstanceIdsByFilters returns all the IDs of EC2 instances in the given region which match to EC2 filter list as per https://docs.aws.amazon.com/sdk-for-go/api/service/ec2/#DescribeInstancesInput.

func GetEc2InstanceIdsByTag Uses

func GetEc2InstanceIdsByTag(t testing.TestingT, region string, tagName string, tagValue string) []string

GetEc2InstanceIdsByTag returns all the IDs of EC2 instances in the given region with the given tag.

func GetEc2InstanceIdsByTagE Uses

func GetEc2InstanceIdsByTagE(t testing.TestingT, region string, tagName string, tagValue string) ([]string, error)

GetEc2InstanceIdsByTagE returns all the IDs of EC2 instances in the given region with the given tag.

func GetEcsCluster Uses

func GetEcsCluster(t testing.TestingT, region string, name string) *ecs.Cluster

GetEcsCluster fetches information about specified ECS cluster.

func GetEcsClusterE Uses

func GetEcsClusterE(t testing.TestingT, region string, name string) (*ecs.Cluster, error)

GetEcsClusterE fetches information about specified ECS cluster.

func GetEcsOptimizedAmazonLinuxAmi Uses

func GetEcsOptimizedAmazonLinuxAmi(t testing.TestingT, region string) string

GetEcsOptimizedAmazonLinuxAmi returns an Amazon ECS-Optimized Amazon Linux AMI for the given region. This AMI is useful for running an ECS cluster.

func GetEcsOptimizedAmazonLinuxAmiE Uses

func GetEcsOptimizedAmazonLinuxAmiE(t testing.TestingT, region string) (string, error)

GetEcsOptimizedAmazonLinuxAmiE returns an Amazon ECS-Optimized Amazon Linux AMI for the given region. This AMI is useful for running an ECS cluster.

func GetEcsService Uses

func GetEcsService(t testing.TestingT, region string, clusterName string, serviceName string) *ecs.Service

GetEcsService fetches information about specified ECS service.

func GetEcsServiceE Uses

func GetEcsServiceE(t testing.TestingT, region string, clusterName string, serviceName string) (*ecs.Service, error)

GetEcsServiceE fetches information about specified ECS service.

func GetEcsTaskDefinition Uses

func GetEcsTaskDefinition(t testing.TestingT, region string, taskDefinition string) *ecs.TaskDefinition

GetEcsTaskDefinition fetches information about specified ECS task definition.

func GetEcsTaskDefinitionE Uses

func GetEcsTaskDefinitionE(t testing.TestingT, region string, taskDefinition string) (*ecs.TaskDefinition, error)

GetEcsTaskDefinitionE fetches information about specified ECS task definition.

func GetFirstTwoOctets Uses

func GetFirstTwoOctets(cidrBlock string) string

GetFirstTwoOctets gets the first two octets from a CIDR block.

func GetIamCurrentUserArn Uses

func GetIamCurrentUserArn(t testing.TestingT) string

GetIamCurrentUserArn gets the ARN for the current IAM user.

func GetIamCurrentUserArnE Uses

func GetIamCurrentUserArnE(t testing.TestingT) (string, error)

GetIamCurrentUserArnE gets the ARN for the current IAM user.

func GetIamCurrentUserName Uses

func GetIamCurrentUserName(t testing.TestingT) string

GetIamCurrentUserName gets the username for the current IAM user.

func GetIamCurrentUserNameE Uses

func GetIamCurrentUserNameE(t testing.TestingT) (string, error)

GetIamCurrentUserNameE gets the username for the current IAM user.

func GetInstanceIdsForAsg Uses

func GetInstanceIdsForAsg(t testing.TestingT, asgName string, awsRegion string) []string

GetInstanceIdsForAsg gets the IDs of EC2 Instances in the given ASG.

func GetInstanceIdsForAsgE Uses

func GetInstanceIdsForAsgE(t testing.TestingT, asgName string, awsRegion string) ([]string, error)

GetInstanceIdsForAsgE gets the IDs of EC2 Instances in the given ASG.

func GetLaunchPermissionsForAmiE Uses

func GetLaunchPermissionsForAmiE(t testing.TestingT, awsRegion string, amiID string) ([]*ec2.LaunchPermission, error)

GetLaunchPermissionsForAmiE returns launchPermissions as configured in AWS

func GetMostRecentAmiId Uses

func GetMostRecentAmiId(t testing.TestingT, region string, ownerId string, filters map[string][]string) string

GetMostRecentAmiId gets the ID of the most recent AMI in the given region that has the given owner and matches the given filters. Each filter should correspond to the name and values of a filter supported by DescribeImagesInput: https://docs.aws.amazon.com/sdk-for-go/api/service/ec2/#DescribeImagesInput

func GetMostRecentAmiIdE Uses

func GetMostRecentAmiIdE(t testing.TestingT, region string, ownerId string, filters map[string][]string) (string, error)

GetMostRecentAmiIdE gets the ID of the most recent AMI in the given region that has the given owner and matches the given filters. Each filter should correspond to the name and values of a filter supported by DescribeImagesInput: https://docs.aws.amazon.com/sdk-for-go/api/service/ec2/#DescribeImagesInput

func GetOptionGroupNameOfRdsInstance Uses

func GetOptionGroupNameOfRdsInstance(t testing.TestingT, dbInstanceID string, awsRegion string) string

GetOptionGroupNameOfRdsInstance gets the name of the option group associated with the RDS instance

func GetOptionGroupNameOfRdsInstanceE Uses

func GetOptionGroupNameOfRdsInstanceE(t testing.TestingT, dbInstanceID string, awsRegion string) (string, error)

GetOptionGroupNameOfRdsInstanceE gets the name of the option group associated with the RDS instance

func GetOptionSettingForOfRdsInstance Uses

func GetOptionSettingForOfRdsInstance(t testing.TestingT, optionName string, optionSettingName string, dbInstanceID, awsRegion string) string

GetOptionSettingForOfRdsInstance gets the value of the option name in the option group specified for the RDS instance in the given region.

func GetOptionSettingForOfRdsInstanceE Uses

func GetOptionSettingForOfRdsInstanceE(t testing.TestingT, optionName string, optionSettingName string, dbInstanceID, awsRegion string) (string, error)

GetOptionSettingForOfRdsInstanceE gets the value of the option name in the option group specified for the RDS instance in the given region.

func GetOptionsOfOptionGroup Uses

func GetOptionsOfOptionGroup(t testing.TestingT, optionGroupName string, awsRegion string) []*rds.Option

GetOptionsOfOptionGroup gets the options of the option group specified

func GetOptionsOfOptionGroupE Uses

func GetOptionsOfOptionGroupE(t testing.TestingT, optionGroupName string, awsRegion string) ([]*rds.Option, error)

GetOptionsOfOptionGroupE gets the options of the option group specified

func GetParameter Uses

func GetParameter(t testing.TestingT, awsRegion string, keyName string) string

GetParameter retrieves the latest version of SSM Parameter at keyName with decryption.

func GetParameterE Uses

func GetParameterE(t testing.TestingT, awsRegion string, keyName string) (string, error)

GetParameterE retrieves the latest version of SSM Parameter at keyName with decryption.

func GetParameterValueForParameterOfRdsInstance Uses

func GetParameterValueForParameterOfRdsInstance(t testing.TestingT, parameterName string, dbInstanceID string, awsRegion string) string

GetParameterValueForParameterOfRdsInstance gets the value of the parameter name specified for the RDS instance in the given region.

func GetParameterValueForParameterOfRdsInstanceE Uses

func GetParameterValueForParameterOfRdsInstanceE(t testing.TestingT, parameterName string, dbInstanceID string, awsRegion string) (string, error)

GetParameterValueForParameterOfRdsInstanceE gets the value of the parameter name specified for the RDS instance in the given region.

func GetPortOfRdsInstance Uses

func GetPortOfRdsInstance(t testing.TestingT, dbInstanceID string, awsRegion string) int64

GetPortOfRdsInstance gets the address of the given RDS Instance in the given region.

func GetPortOfRdsInstanceE Uses

func GetPortOfRdsInstanceE(t testing.TestingT, dbInstanceID string, awsRegion string) (int64, error)

GetPortOfRdsInstanceE gets the address of the given RDS Instance in the given region.

func GetPrivateHostnameOfEc2Instance Uses

func GetPrivateHostnameOfEc2Instance(t testing.TestingT, instanceID string, awsRegion string) string

GetPrivateHostnameOfEc2Instance gets the private IP address of the given EC2 Instance in the given region.

func GetPrivateHostnameOfEc2InstanceE Uses

func GetPrivateHostnameOfEc2InstanceE(t testing.TestingT, instanceID string, awsRegion string) (string, error)

GetPrivateHostnameOfEc2InstanceE gets the private IP address of the given EC2 Instance in the given region.

func GetPrivateHostnamesOfEc2Instances Uses

func GetPrivateHostnamesOfEc2Instances(t testing.TestingT, instanceIDs []string, awsRegion string) map[string]string

GetPrivateHostnamesOfEc2Instances gets the private IP address of the given EC2 Instance in the given region. Returns a map of instance ID to IP address.

func GetPrivateHostnamesOfEc2InstancesE Uses

func GetPrivateHostnamesOfEc2InstancesE(t testing.TestingT, instanceIDs []string, awsRegion string) (map[string]string, error)

GetPrivateHostnamesOfEc2InstancesE gets the private IP address of the given EC2 Instance in the given region. Returns a map of instance ID to IP address.

func GetPrivateIpOfEc2Instance Uses

func GetPrivateIpOfEc2Instance(t testing.TestingT, instanceID string, awsRegion string) string

GetPrivateIpOfEc2Instance gets the private IP address of the given EC2 Instance in the given region.

func GetPrivateIpOfEc2InstanceE Uses

func GetPrivateIpOfEc2InstanceE(t testing.TestingT, instanceID string, awsRegion string) (string, error)

GetPrivateIpOfEc2InstanceE gets the private IP address of the given EC2 Instance in the given region.

func GetPrivateIpsOfEc2Instances Uses

func GetPrivateIpsOfEc2Instances(t testing.TestingT, instanceIDs []string, awsRegion string) map[string]string

GetPrivateIpsOfEc2Instances gets the private IP address of the given EC2 Instance in the given region. Returns a map of instance ID to IP address.

func GetPrivateIpsOfEc2InstancesE Uses

func GetPrivateIpsOfEc2InstancesE(t testing.TestingT, instanceIDs []string, awsRegion string) (map[string]string, error)

GetPrivateIpsOfEc2InstancesE gets the private IP address of the given EC2 Instance in the given region. Returns a map of instance ID to IP address.

func GetPublicIpOfEc2Instance Uses

func GetPublicIpOfEc2Instance(t testing.TestingT, instanceID string, awsRegion string) string

GetPublicIpOfEc2Instance gets the public IP address of the given EC2 Instance in the given region.

func GetPublicIpOfEc2InstanceE Uses

func GetPublicIpOfEc2InstanceE(t testing.TestingT, instanceID string, awsRegion string) (string, error)

GetPublicIpOfEc2InstanceE gets the public IP address of the given EC2 Instance in the given region.

func GetPublicIpsOfEc2Instances Uses

func GetPublicIpsOfEc2Instances(t testing.TestingT, instanceIDs []string, awsRegion string) map[string]string

GetPublicIpsOfEc2Instances gets the public IP address of the given EC2 Instance in the given region. Returns a map of instance ID to IP address.

func GetPublicIpsOfEc2InstancesE Uses

func GetPublicIpsOfEc2InstancesE(t testing.TestingT, instanceIDs []string, awsRegion string) (map[string]string, error)

GetPublicIpsOfEc2InstancesE gets the public IP address of the given EC2 Instance in the given region. Returns a map of instance ID to IP address.

func GetRandomPrivateCidrBlock Uses

func GetRandomPrivateCidrBlock(routingPrefix int) string

GetRandomPrivateCidrBlock gets a random CIDR block from the range of acceptable private IP addresses per RFC 1918 (https://tools.ietf.org/html/rfc1918#section-3) The routingPrefix refers to the "/28" in 1.2.3.4/28. Note that, as written, this function will return a subset of all valid ranges. Since we will probably use this function mostly for generating random CIDR ranges for VPCs and Subnets, having comprehensive set coverage is not essential.

func GetRandomRegion Uses

func GetRandomRegion(t testing.TestingT, approvedRegions []string, forbiddenRegions []string) string

GetRandomRegion gets a randomly chosen AWS region. If approvedRegions is not empty, this will be a region from the approvedRegions list; otherwise, this method will fetch the latest list of regions from the AWS APIs and pick one of those. If forbiddenRegions is not empty, this method will make sure the returned region is not in the forbiddenRegions list.

func GetRandomRegionE Uses

func GetRandomRegionE(t testing.TestingT, approvedRegions []string, forbiddenRegions []string) (string, error)

GetRandomRegionE gets a randomly chosen AWS region. If approvedRegions is not empty, this will be a region from the approvedRegions list; otherwise, this method will fetch the latest list of regions from the AWS APIs and pick one of those. If forbiddenRegions is not empty, this method will make sure the returned region is not in the forbiddenRegions list.

func GetRandomStableRegion Uses

func GetRandomStableRegion(t testing.TestingT, approvedRegions []string, forbiddenRegions []string) string

GetRandomStableRegion gets a randomly chosen AWS region that is considered stable. Like GetRandomRegion, you can further restrict the stable region list using approvedRegions and forbiddenRegions. We consider stable regions to be those that have been around for at least 1 year. Note that regions in the approvedRegions list that are not considered stable are ignored.

func GetRdsInstanceDetailsE Uses

func GetRdsInstanceDetailsE(t testing.TestingT, dbInstanceID string, awsRegion string) (*rds.DBInstance, error)

GetRdsInstanceDetailsE gets the details of a single DB instance whose identifier is passed.

func GetS3BucketPolicy Uses

func GetS3BucketPolicy(t testing.TestingT, awsRegion string, bucket string) string

GetS3BucketPolicy fetches the given bucket's resource policy and returns it as a string

func GetS3BucketPolicyE Uses

func GetS3BucketPolicyE(t testing.TestingT, awsRegion string, bucket string) (string, error)

GetS3BucketPolicyE fetches the given bucket's resource policy and returns it as a string

func GetS3BucketVersioning Uses

func GetS3BucketVersioning(t testing.TestingT, awsRegion string, bucket string) string

GetS3BucketVersioning fetches the given bucket's versioning configuration status and returns it as a string

func GetS3BucketVersioningE Uses

func GetS3BucketVersioningE(t testing.TestingT, awsRegion string, bucket string) (string, error)

GetS3BucketVersioningE fetches the given bucket's versioning configuration status and returns it as a string

func GetS3ObjectContents Uses

func GetS3ObjectContents(t testing.TestingT, awsRegion string, bucket string, key string) string

GetS3ObjectContents fetches the contents of the object in the given bucket with the given key and return it as a string.

func GetS3ObjectContentsE Uses

func GetS3ObjectContentsE(t testing.TestingT, awsRegion string, bucket string, key string) (string, error)

GetS3ObjectContentsE fetches the contents of the object in the given bucket with the given key and return it as a string.

func GetSyslogForInstance Uses

func GetSyslogForInstance(t testing.TestingT, instanceID string, awsRegion string) string

(Deprecated) See the FetchContentsOfFileFromInstance method for a more powerful solution.

GetSyslogForInstance gets the syslog for the Instance with the given ID in the given region. This should be available ~1 minute after an Instance boots and is very useful for debugging boot-time issues, such as an error in User Data.

func GetSyslogForInstanceE Uses

func GetSyslogForInstanceE(t testing.TestingT, instanceID string, region string) (string, error)

(Deprecated) See the FetchContentsOfFileFromInstanceE method for a more powerful solution.

GetSyslogForInstanceE gets the syslog for the Instance with the given ID in the given region. This should be available ~1 minute after an Instance boots and is very useful for debugging boot-time issues, such as an error in User Data.

func GetSyslogForInstancesInAsg Uses

func GetSyslogForInstancesInAsg(t testing.TestingT, asgName string, awsRegion string) map[string]string

(Deprecated) See the FetchContentsOfFilesFromAsg method for a more powerful solution.

GetSyslogForInstancesInAsg gets the syslog for each of the Instances in the given ASG in the given region. These logs should be available ~1 minute after the Instance boots and are very useful for debugging boot-time issues, such as an error in User Data. Returns a map of Instance Id -> Syslog for that Instance.

func GetSyslogForInstancesInAsgE Uses

func GetSyslogForInstancesInAsgE(t testing.TestingT, asgName string, awsRegion string) (map[string]string, error)

(Deprecated) See the FetchContentsOfFilesFromAsgE method for a more powerful solution.

GetSyslogForInstancesInAsgE gets the syslog for each of the Instances in the given ASG in the given region. These logs should be available ~1 minute after the Instance boots and are very useful for debugging boot-time issues, such as an error in User Data. Returns a map of Instance Id -> Syslog for that Instance.

func GetTagsForEc2Instance Uses

func GetTagsForEc2Instance(t testing.TestingT, region string, instanceID string) map[string]string

GetTagsForEc2Instance returns all the tags for the given EC2 Instance.

func GetTagsForEc2InstanceE Uses

func GetTagsForEc2InstanceE(t testing.TestingT, region string, instanceID string) (map[string]string, error)

GetTagsForEc2InstanceE returns all the tags for the given EC2 Instance.

func GetTimeBasedOneTimePassword Uses

func GetTimeBasedOneTimePassword(mfaDevice *iam.VirtualMFADevice) (string, error)

GetTimeBasedOneTimePassword gets a One-Time Password from the given mfaDevice. Per the RFC 6238 standard, this value will be different every 30 seconds.

func GetUbuntu1404Ami Uses

func GetUbuntu1404Ami(t testing.TestingT, region string) string

GetUbuntu1404Ami gets the ID of the most recent Ubuntu 14.04 HVM x86_64 EBS GP2 AMI in the given region.

func GetUbuntu1404AmiE Uses

func GetUbuntu1404AmiE(t testing.TestingT, region string) (string, error)

GetUbuntu1404AmiE gets the ID of the most recent Ubuntu 14.04 HVM x86_64 EBS GP2 AMI in the given region.

func GetUbuntu1604Ami Uses

func GetUbuntu1604Ami(t testing.TestingT, region string) string

GetUbuntu1604Ami gets the ID of the most recent Ubuntu 16.04 HVM x86_64 EBS GP2 AMI in the given region.

func GetUbuntu1604AmiE Uses

func GetUbuntu1604AmiE(t testing.TestingT, region string) (string, error)

GetUbuntu1604AmiE gets the ID of the most recent Ubuntu 16.04 HVM x86_64 EBS GP2 AMI in the given region.

func GetWhetherSchemaExistsInRdsMySqlInstance Uses

func GetWhetherSchemaExistsInRdsMySqlInstance(t testing.TestingT, dbUrl string, dbPort int64, dbUsername string, dbPassword string, expectedSchemaName string) bool

GetWhetherSchemaExistsInRdsMySqlInstance checks whether the specified schema/table name exists in the RDS instance

func GetWhetherSchemaExistsInRdsMySqlInstanceE Uses

func GetWhetherSchemaExistsInRdsMySqlInstanceE(t testing.TestingT, dbUrl string, dbPort int64, dbUsername string, dbPassword string, expectedSchemaName string) (bool, error)

GetWhetherSchemaExistsInRdsMySqlInstanceE checks whether the specified schema/table name exists in the RDS instance

func InvokeFunction Uses

func InvokeFunction(t testing.TestingT, region, functionName string, payload interface{}) []byte

InvokeFunction invokes a lambda function.

func InvokeFunctionE Uses

func InvokeFunctionE(t testing.TestingT, region, functionName string, payload interface{}) ([]byte, error)

InvokeFunctionE invokes a lambda function.

func IsPublicSubnet Uses

func IsPublicSubnet(t testing.TestingT, subnetId string, region string) bool

IsPublicSubnet returns True if the subnet identified by the given id in the provided region is public.

func IsPublicSubnetE Uses

func IsPublicSubnetE(t testing.TestingT, subnetId string, region string) (bool, error)

IsPublicSubnetE returns True if the subnet identified by the given id in the provided region is public.

func NewAcmClient Uses

func NewAcmClient(t testing.TestingT, region string) *acm.ACM

NewAcmClient create a new ACM client.

func NewAcmClientE Uses

func NewAcmClientE(t testing.TestingT, awsRegion string) (*acm.ACM, error)

NewAcmClientE creates a new ACM client.

func NewAsgClient Uses

func NewAsgClient(t testing.TestingT, region string) *autoscaling.AutoScaling

NewAsgClient creates an Auto Scaling Group client.

func NewAsgClientE Uses

func NewAsgClientE(t testing.TestingT, region string) (*autoscaling.AutoScaling, error)

NewAsgClientE creates an Auto Scaling Group client.

func NewAuthenticatedSession Uses

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

NewAuthenticatedSession creates an AWS session following to standard AWS authentication workflow. If AuthAssumeIamRoleEnvVar environment variable is set, assumes IAM role specified in it.

func NewAuthenticatedSessionFromDefaultCredentials Uses

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

NewAuthenticatedSessionFromDefaultCredentials gets an AWS Session, checking that the user has credentials properly configured in their environment.

func NewAuthenticatedSessionFromRole Uses

func NewAuthenticatedSessionFromRole(region string, roleARN string) (*session.Session, error)

NewAuthenticatedSessionFromRole returns a new AWS Session after assuming the role whose ARN is provided in roleARN. If the credentials are not properly configured in the underlying environment, an error is returned.

func NewCloudWatchLogsClient Uses

func NewCloudWatchLogsClient(t testing.TestingT, region string) *cloudwatchlogs.CloudWatchLogs

NewCloudWatchLogsClient creates a new CloudWatch Logs client.

func NewCloudWatchLogsClientE Uses

func NewCloudWatchLogsClientE(t testing.TestingT, region string) (*cloudwatchlogs.CloudWatchLogs, error)

NewCloudWatchLogsClientE creates a new CloudWatch Logs client.

func NewDynamoDBClient Uses

func NewDynamoDBClient(t testing.TestingT, region string) *dynamodb.DynamoDB

NewDynamoDBClient creates a DynamoDB client.

func NewDynamoDBClientE Uses

func NewDynamoDBClientE(t testing.TestingT, region string) (*dynamodb.DynamoDB, error)

NewDynamoDBClientE creates a DynamoDB client.

func NewEc2Client Uses

func NewEc2Client(t testing.TestingT, region string) *ec2.EC2

NewEc2Client creates an EC2 client.

func NewEc2ClientE Uses

func NewEc2ClientE(t testing.TestingT, region string) (*ec2.EC2, error)

NewEc2ClientE creates an EC2 client.

func NewEcsClient Uses

func NewEcsClient(t testing.TestingT, region string) *ecs.ECS

NewEcsClient creates en ECS client.

func NewEcsClientE Uses

func NewEcsClientE(t testing.TestingT, region string) (*ecs.ECS, error)

NewEcsClientE creates an ECS client.

func NewIamClient Uses

func NewIamClient(t testing.TestingT, region string) *iam.IAM

NewIamClient creates a new IAM client.

func NewIamClientE Uses

func NewIamClientE(t testing.TestingT, region string) (*iam.IAM, error)

NewIamClientE creates a new IAM client.

func NewKmsClient Uses

func NewKmsClient(t testing.TestingT, region string) *kms.KMS

NewKmsClient creates a KMS client.

func NewKmsClientE Uses

func NewKmsClientE(t testing.TestingT, region string) (*kms.KMS, error)

NewKmsClientE creates a KMS client.

func NewLambdaClient Uses

func NewLambdaClient(t testing.TestingT, region string) *lambda.Lambda

NewLambdaClient creates a new Lambda client.

func NewLambdaClientE Uses

func NewLambdaClientE(t testing.TestingT, region string) (*lambda.Lambda, error)

NewLambdaClientE creates a new Lambda client.

func NewRdsClient Uses

func NewRdsClient(t testing.TestingT, region string) *rds.RDS

NewRdsClient creates an RDS client.

func NewRdsClientE Uses

func NewRdsClientE(t testing.TestingT, region string) (*rds.RDS, error)

NewRdsClientE creates an RDS client.

func NewS3Client Uses

func NewS3Client(t testing.TestingT, region string) *s3.S3

NewS3Client creates an S3 client.

func NewS3ClientE Uses

func NewS3ClientE(t testing.TestingT, region string) (*s3.S3, error)

NewS3ClientE creates an S3 client.

func NewS3Uploader Uses

func NewS3Uploader(t testing.TestingT, region string) *s3manager.Uploader

NewS3Uploader creates an S3 Uploader.

func NewS3UploaderE Uses

func NewS3UploaderE(t testing.TestingT, region string) (*s3manager.Uploader, error)

NewS3UploaderE creates an S3 Uploader.

func NewSnsClient Uses

func NewSnsClient(t testing.TestingT, region string) *sns.SNS

NewSnsClient creates a new SNS client.

func NewSnsClientE Uses

func NewSnsClientE(t testing.TestingT, region string) (*sns.SNS, error)

NewSnsClientE creates a new SNS client.

func NewSqsClient Uses

func NewSqsClient(t testing.TestingT, region string) *sqs.SQS

NewSqsClient creates a new SQS client.

func NewSqsClientE Uses

func NewSqsClientE(t testing.TestingT, region string) (*sqs.SQS, error)

NewSqsClientE creates a new SQS client.

func NewSsmClient Uses

func NewSsmClient(t testing.TestingT, region string) *ssm.SSM

NewSsmClient creates a SSM client.

func NewSsmClientE Uses

func NewSsmClientE(t testing.TestingT, region string) (*ssm.SSM, error)

NewSsmClientE creates an SSM client.

func NewStsClientE Uses

func NewStsClientE(t testing.TestingT, region string) (*sts.STS, error)

NewStsClientE creates a new STS client.

func PutParameter Uses

func PutParameter(t testing.TestingT, awsRegion string, keyName string, keyDescription string, keyValue string) int64

PutParameter creates new version of SSM Parameter at keyName with keyValue as SecureString.

func PutParameterE Uses

func PutParameterE(t testing.TestingT, awsRegion string, keyName string, keyDescription string, keyValue string) (int64, error)

PutParameterE creates new version of SSM Parameter at keyName with keyValue as SecureString.

func PutS3BucketPolicy Uses

func PutS3BucketPolicy(t testing.TestingT, region string, bucketName string, policyJSONString string)

PutS3BucketPolicy applies an IAM resource policy to a given S3 bucket to create it's bucket policy

func PutS3BucketPolicyE Uses

func PutS3BucketPolicyE(t testing.TestingT, region string, bucketName string, policyJSONString string) error

PutS3BucketPolicyE applies an IAM resource policy to a given S3 bucket to create it's bucket policy

func PutS3BucketVersioning Uses

func PutS3BucketVersioning(t testing.TestingT, region string, bucketName string)

PutS3BucketVersioning creates an S3 bucket versioning configuration in the given region against the given bucket name, WITHOUT requiring MFA to remove versioning.

func PutS3BucketVersioningE Uses

func PutS3BucketVersioningE(t testing.TestingT, region string, bucketName string) error

PutS3BucketVersioningE creates an S3 bucket versioning configuration in the given region against the given bucket name, WITHOUT requiring MFA to remove versioning.

func ReadPasswordPolicyMinPasswordLength Uses

func ReadPasswordPolicyMinPasswordLength(iamClient *iam.IAM) (int, error)

ReadPasswordPolicyMinPasswordLength returns the minimal password length.

func SendMessageFifoToQueue Uses

func SendMessageFifoToQueue(t testing.TestingT, awsRegion string, queueURL string, message string, messageGroupID string)

SendMessageToFifoQueue sends the given message to the FIFO SQS queue with the given URL.

func SendMessageToFifoQueueE Uses

func SendMessageToFifoQueueE(t testing.TestingT, awsRegion string, queueURL string, message string, messageGroupID string) error

SendMessageToFifoQueueE sends the given message to the FIFO SQS queue with the given URL.

func SendMessageToQueue Uses

func SendMessageToQueue(t testing.TestingT, awsRegion string, queueURL string, message string)

SendMessageToQueue sends the given message to the SQS queue with the given URL.

func SendMessageToQueueE Uses

func SendMessageToQueueE(t testing.TestingT, awsRegion string, queueURL string, message string) error

SendMessageToQueueE sends the given message to the SQS queue with the given URL.

func TerminateInstance Uses

func TerminateInstance(t testing.TestingT, region string, instanceID string)

TerminateInstance terminates the EC2 instance with the given ID in the given region.

func TerminateInstanceE Uses

func TerminateInstanceE(t testing.TestingT, region string, instanceID string) error

TerminateInstanceE terminates the EC2 instance with the given ID in the given region.

func WaitForCapacity Uses

func WaitForCapacity(
    t testing.TestingT,
    asgName string,
    region string,
    maxRetries int,
    sleepBetweenRetries time.Duration,
)

WaitForCapacity waits for the currently set desired capacity to be reached on the ASG

func WaitForCapacityE Uses

func WaitForCapacityE(
    t testing.TestingT,
    asgName string,
    region string,
    maxRetries int,
    sleepBetweenRetries time.Duration,
) error

WaitForCapacityE waits for the currently set desired capacity to be reached on the ASG

type AsgCapacityInfo Uses

type AsgCapacityInfo struct {
    MinCapacity     int64
    MaxCapacity     int64
    CurrentCapacity int64
    DesiredCapacity int64
}

func GetCapacityInfoForAsg Uses

func GetCapacityInfoForAsg(t testing.TestingT, asgName string, awsRegion string) AsgCapacityInfo

GetCapacityInfoForAsg returns the capacity info for the queried asg as a struct, AsgCapacityInfo.

func GetCapacityInfoForAsgE Uses

func GetCapacityInfoForAsgE(t testing.TestingT, asgName string, awsRegion string) (AsgCapacityInfo, error)

GetCapacityInfoForAsgE returns the capacity info for the queried asg as a struct, AsgCapacityInfo.

type AsgCapacityNotMetError Uses

type AsgCapacityNotMetError struct {
    // contains filtered or unexported fields
}

AsgCapacityNotMetError is returned when the ASG capacity is not yet at the desired capacity.

func NewAsgCapacityNotMetError Uses

func NewAsgCapacityNotMetError(asgName string, desiredCapacity int64, currentCapacity int64) AsgCapacityNotMetError

func (AsgCapacityNotMetError) Error Uses

func (err AsgCapacityNotMetError) Error() string

type BucketVersioningNotEnabledError Uses

type BucketVersioningNotEnabledError struct {
    // contains filtered or unexported fields
}

BucketVersioningNotEnabledError is returned when an S3 bucket that should have versioning does not have it applied

func NewBucketVersioningNotEnabledError Uses

func NewBucketVersioningNotEnabledError(s3BucketName string, awsRegion string, versioningStatus string) BucketVersioningNotEnabledError

func (BucketVersioningNotEnabledError) Error Uses

func (err BucketVersioningNotEnabledError) Error() string

type CredentialsError Uses

type CredentialsError struct {
    UnderlyingErr error
}

CredentialsError is an error that occurs because AWS credentials can't be found.

func (CredentialsError) Error Uses

func (err CredentialsError) Error() string

type Ec2Keypair Uses

type Ec2Keypair struct {
    *ssh.KeyPair
    Name   string // The name assigned in AWS to the EC2 Key Pair
    Region string // The AWS region where the EC2 Key Pair lives
}

Ec2Keypair is an EC2 key pair.

func CreateAndImportEC2KeyPair Uses

func CreateAndImportEC2KeyPair(t testing.TestingT, region string, name string) *Ec2Keypair

CreateAndImportEC2KeyPair generates a public/private KeyPair and import it into EC2 in the given region under the given name.

func CreateAndImportEC2KeyPairE Uses

func CreateAndImportEC2KeyPairE(t testing.TestingT, region string, name string) (*Ec2Keypair, error)

CreateAndImportEC2KeyPairE generates a public/private KeyPair and import it into EC2 in the given region under the given name.

func ImportEC2KeyPair Uses

func ImportEC2KeyPair(t testing.TestingT, region string, name string, keyPair *ssh.KeyPair) *Ec2Keypair

ImportEC2KeyPair creates a Key Pair in EC2 by importing an existing public key.

func ImportEC2KeyPairE Uses

func ImportEC2KeyPairE(t testing.TestingT, region string, name string, keyPair *ssh.KeyPair) (*Ec2Keypair, error)

ImportEC2KeyPairE creates a Key Pair in EC2 by importing an existing public key.

type FunctionError Uses

type FunctionError struct {
    Message    string
    StatusCode int64
    Payload    []byte
}

func (*FunctionError) Error Uses

func (err *FunctionError) Error() string

type HostnameForEc2InstanceNotFound Uses

type HostnameForEc2InstanceNotFound struct {
    InstanceId string
    AwsRegion  string
    Type       string
}

HostnameForEc2InstanceNotFound is an error that occurs when the IP for an EC2 instance is not found.

func (HostnameForEc2InstanceNotFound) Error Uses

func (err HostnameForEc2InstanceNotFound) Error() string

type IpForEc2InstanceNotFound Uses

type IpForEc2InstanceNotFound struct {
    InstanceId string
    AwsRegion  string
    Type       string
}

IpForEc2InstanceNotFound is an error that occurs when the IP for an EC2 instance is not found.

func (IpForEc2InstanceNotFound) Error Uses

func (err IpForEc2InstanceNotFound) Error() string

type NoBucketPolicyError Uses

type NoBucketPolicyError struct {
    // contains filtered or unexported fields
}

NoBucketPolicyError is returned when an S3 bucket that should have a policy applied does not

func NewNoBucketPolicyError Uses

func NewNoBucketPolicyError(s3BucketName string, awsRegion string, bucketPolicy string) NoBucketPolicyError

func (NoBucketPolicyError) Error Uses

func (err NoBucketPolicyError) Error() string

type NoImagesFound Uses

type NoImagesFound struct {
    Region  string
    OwnerId string
    Filters map[string][]string
}

NoImagesFound is an error that occurs if no images were found.

func (NoImagesFound) Error Uses

func (err NoImagesFound) Error() string

type NotFoundError Uses

type NotFoundError struct {
    // contains filtered or unexported fields
}

NotFoundError is returned when an expected object is not found

func NewNotFoundError Uses

func NewNotFoundError(objectType string, objectID string, region string) NotFoundError

func (NotFoundError) Error Uses

func (err NotFoundError) Error() string

type OptionGroupOptionSettingForDbInstanceNotFound Uses

type OptionGroupOptionSettingForDbInstanceNotFound struct {
    OptionName        string
    OptionSettingName string
    DbInstanceID      string
    AwsRegion         string
}

OptionGroupOptionSettingForDbInstanceNotFound is an error that occurs when the option setting specified is not found in the option group of the DB instance

func (OptionGroupOptionSettingForDbInstanceNotFound) Error Uses

func (err OptionGroupOptionSettingForDbInstanceNotFound) Error() string

type ParameterForDbInstanceNotFound Uses

type ParameterForDbInstanceNotFound struct {
    ParameterName string
    DbInstanceID  string
    AwsRegion     string
}

ParameterForDbInstanceNotFound is an error that occurs when the parameter group specified is not found for the DB instance

func (ParameterForDbInstanceNotFound) Error Uses

func (err ParameterForDbInstanceNotFound) Error() string

type QueueMessageResponse Uses

type QueueMessageResponse struct {
    ReceiptHandle string
    MessageBody   string
    Error         error
}

QueueMessageResponse contains a queue message.

func WaitForQueueMessage Uses

func WaitForQueueMessage(t testing.TestingT, awsRegion string, queueURL string, timeout int) QueueMessageResponse

WaitForQueueMessage waits to receive a message from on the queueURL. Since the API only allows us to wait a max 20 seconds for a new message to arrive, we must loop TIMEOUT/20 number of times to be able to wait for a total of TIMEOUT seconds

type ReceiveMessageTimeout Uses

type ReceiveMessageTimeout struct {
    QueueUrl   string
    TimeoutSec int
}

ReceiveMessageTimeout is an error that occurs if receiving a message times out.

func (ReceiveMessageTimeout) Error Uses

func (err ReceiveMessageTimeout) Error() string

type RemoteFileSpecification Uses

type RemoteFileSpecification struct {
    AsgNames               []string            //ASGs where our instances will be
    RemotePathToFileFilter map[string][]string //A map of the files to fetch, where the keys are directories on the remote host and the values are filters for what files to fetch from the directory. The filters support bash-style wildcards.
    UseSudo                bool
    SshUser                string
    KeyPair                *Ec2Keypair
    LocalDestinationDir    string //base path where to store downloaded artifacts locally. The final path of each resource will include the ip of the host and the name of the immediate parent folder.
}

RemoteFileSpecification describes which files you want to copy from your instances

type Subnet Uses

type Subnet struct {
    Id               string // The ID of the Subnet
    AvailabilityZone string // The Availability Zone the subnet is in
}

Subnet is a subnet in an availability zone.

func GetSubnetsForVpc Uses

func GetSubnetsForVpc(t testing.TestingT, vpcID string, region string) []Subnet

GetSubnetsForVpc gets the subnets in the specified VPC.

func GetSubnetsForVpcE Uses

func GetSubnetsForVpcE(t testing.TestingT, vpcID string, region string) ([]Subnet, error)

GetSubnetsForVpcE gets the subnets in the specified VPC.

type Vpc Uses

type Vpc struct {
    Id      string   // The ID of the VPC
    Name    string   // The name of the VPC
    Subnets []Subnet // A list of subnets in the VPC
}

Vpc is an Amazon Virtual Private Cloud.

func GetDefaultVpc Uses

func GetDefaultVpc(t testing.TestingT, region string) *Vpc

GetDefaultVpc fetches information about the default VPC in the given region.

func GetDefaultVpcE Uses

func GetDefaultVpcE(t testing.TestingT, region string) (*Vpc, error)

GetDefaultVpcE fetches information about the default VPC in the given region.

func GetVpcById Uses

func GetVpcById(t testing.TestingT, vpcId string, region string) *Vpc

GetVpcById fetches information about a VPC with given Id in the given region.

func GetVpcByIdE Uses

func GetVpcByIdE(t testing.TestingT, vpcId string, region string) (*Vpc, error)

GetVpcByIdE fetches information about a VPC with given Id in the given region.

func GetVpcsE Uses

func GetVpcsE(t testing.TestingT, filters []*ec2.Filter, region string) ([]*Vpc, error)

GetVpcsE fetches informations about VPCs from given regions limited by filters

Package aws imports 44 packages (graph) and is imported by 4 packages. Updated 2020-04-07. Refresh now. Tools for package owners.