tests

package
v1.0.7 Latest Latest
Warning

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

Go to latest
Published: Mar 21, 2024 License: Apache-2.0 Imports: 21 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetNewestPolicyVersion

func GetNewestPolicyVersion(t *testing.T, svc *iam.IAM, policyArn string, verboseOutput bool) string

GetNewestPolicyVersion gets the newest policy version

func ValidateAccountAlias

func ValidateAccountAlias(t *testing.T, svc *iam.IAM, accountProfile string, verboseOutput bool)

ValidateAccountAlias gets the account alias and verifies it is what you set it to be

func ValidateAccountPasswordPolicy

func ValidateAccountPasswordPolicy(t *testing.T, svc *iam.IAM, verboseOutput bool)

ValidateAccountPasswordPolicy gets the account password policy and validates it

func ValidateBucketACL

func ValidateBucketACL(t *testing.T, svc *s3.S3, bucketName string, verboseOutput bool)

ValidateBucketACL get bucket acl

func ValidateBucketEncryption

func ValidateBucketEncryption(t *testing.T, svc *s3.S3, bucketName string, encryptionType string, verboseOutput bool)

ValidateBucketEncryption get bucket encryption

func ValidateBucketLifecycleConfiguration

func ValidateBucketLifecycleConfiguration(t *testing.T, svc *s3.S3, bucketName string, ruleID string, expiration int64, status string, verboseOutput bool)

ValidateBucketLifecycleConfiguration get bucket LifecycleConfiguration

func ValidateBucketLocation

func ValidateBucketLocation(t *testing.T, svc *s3.S3, bucketName string, region string, verboseOutput bool)

ValidateBucketLocation get bucket location

func ValidateBucketPolicy

func ValidateBucketPolicy(t *testing.T, svc *s3.S3, bucketName string, policyJSON string, verboseOutput bool)

ValidateBucketPolicy get bucket policy

func ValidateBucketReplication

func ValidateBucketReplication(t *testing.T, svc *s3.S3, bucketName string, roleArn string, acl string, status string, destinationBucket string, storageClass string, idDestination string, destinationAccountID string, verboseOutput bool)

ValidateBucketReplication get bucket Replication

func ValidateBucketTagging

func ValidateBucketTagging(t *testing.T, svc *s3.S3, bucketName string, tagValues []string, verboseOutput bool)

ValidateBucketTagging get bucket Tagging

func ValidateBucketVersioning

func ValidateBucketVersioning(t *testing.T, svc *s3.S3, bucketName string, status string, verboseOutput bool)

ValidateBucketVersioning get bucket Versioning

func ValidateCloudWatchEventRule

func ValidateCloudWatchEventRule(t *testing.T, svc *cloudwatchevents.CloudWatchEvents, ruleName string, ruleArn string, ruleEventPatternJSON string, ruleState string, verboseOutput bool)

ValidateCloudWatchEventRule gets the event rule and validates its details

func ValidateCloudWatchEventRuleTarget

func ValidateCloudWatchEventRuleTarget(t *testing.T, svc *cloudwatchevents.CloudWatchEvents, ruleName string, roleArn string, eventBusArn string, verboseOutput bool)

ValidateCloudWatchEventRuleTarget get the event rule target and validates its details

func ValidateCloudWatchLogGroupName

func ValidateCloudWatchLogGroupName(t *testing.T, svc *cloudwatchlogs.CloudWatchLogs, groupName string, verboseOutput bool)

ValidateCloudWatchLogGroupName validate a Cloud Watch Log Group by name

func ValidateCloudWatchLogGroupsByPrefix

func ValidateCloudWatchLogGroupsByPrefix(t *testing.T, svc *cloudwatchlogs.CloudWatchLogs, groupPrefix string, expectedGroupNameList []string, verboseOutput bool)

ValidateCloudWatchLogGroupsByPrefix validate a list of Cloud Watch Log Groups by summarized prefix

func ValidateCreateAccountSCP

func ValidateCreateAccountSCP(t *testing.T, svc *organizations.Organizations, policyName string, policyID string, verboseOutput bool)

ValidateCreateAccountSCP validate create account scp module

func ValidateDatabaseExists

func ValidateDatabaseExists(t *testing.T, svc *athena.Athena, databaseName string, catalogName string, verboseOutput bool)

func ValidateFlowLog

func ValidateFlowLog(t *testing.T, svc *ec2.EC2, vpcID string, deliverLogsPermissionArn string, deliverLogsStatus string, flowLogStatus string, logDestination string, logDestinationType string, logFormat string, trafficType string, verboseOutput bool)

ValidateFlowLog gets FlowLog and validates its info

func ValidateGlueConnectionExists

func ValidateGlueConnectionExists(t *testing.T, svc *glue.Glue, connectionName string, hidePassword bool, verboseOutput bool)

func ValidateGlueCrawlerExists

func ValidateGlueCrawlerExists(t *testing.T, svc *glue.Glue, crawlerName string, schedule string, testSchedule bool, verboseOutput bool)

func ValidateGlueJobExists

func ValidateGlueJobExists(t *testing.T, svc *glue.Glue, jobName string, verboseOutput bool)

func ValidateGlueJobTriggerExists

func ValidateGlueJobTriggerExists(t *testing.T, svc *glue.Glue, triggerName string, verboseOutput bool)

func ValidateGroup

func ValidateGroup(t *testing.T, svc *iam.IAM, groupName string, groupArn string, verboseOutput bool)

ValidateGroup gets Group by name and validates its arn

func ValidateGroupIsAttachedToASpecificUser

func ValidateGroupIsAttachedToASpecificUser(t *testing.T, svc *iam.IAM, groupName string, groupArn string, userName string, userArn string, verboseOutput bool)

ValidateGroupIsAttachedToASpecificUser get the group and the user attached

func ValidateInstanceProfileDetails

func ValidateInstanceProfileDetails(t *testing.T, svc *iam.IAM, instanceProfileName string, instanceProfileArn string, roleName string, roleArn string, verboseOutput bool)

ValidateInstanceProfileDetails get the role by name and validates the details on it

func ValidateInternetGateway

func ValidateInternetGateway(t *testing.T, svc *ec2.EC2, state string, ownerID string, tagValues []string, verboseOutput bool)

ValidateInternetGateway gets InternetGateway and validates its info

func ValidateKmsGrant

func ValidateKmsGrant(t *testing.T, svc *kms.KMS, kmsKeyID string, terraformGrantID string, grantName string, granteePrincipal string, issuingAccount string, keyIDArn string, operations []string, verboseOutput bool)

ValidateKmsGrant get the KMS key rotation status

func ValidateKmsKey

func ValidateKmsKey(t *testing.T, svc *kms.KMS, keyAlias string, accountID string, verboseOutput bool)

ValidateKmsKey get the KMS key

func ValidateKmsKeyPolicy

func ValidateKmsKeyPolicy(t *testing.T, svc *kms.KMS, keyArn string, verboseOutput bool)

ValidateKmsKeyPolicy get the KMS key policy

func ValidateKmsKeyRotationStatus

func ValidateKmsKeyRotationStatus(t *testing.T, svc *kms.KMS, keyArn string, keyRotationStatus bool, verboseOutput bool)

ValidateKmsKeyRotationStatus get the KMS key rotation status

func ValidateKmsKeyTags

func ValidateKmsKeyTags(t *testing.T, svc *kms.KMS, keyArn string, tags []string, verboseOutput bool)

ValidateKmsKeyTags gets tags and validates them

func ValidateLambdaFunctionConfiguration added in v1.0.6

func ValidateLambdaFunctionConfiguration(t *testing.T, svc *lambda.Lambda, functionName string, architecture string, handlerName string, layerNames []string, memorySize int64, packageType string, role string, runtime string, state string, timeout int64, vpcID string, subnets []string, securityGroups []string, verboseOutput bool)

func ValidateLambdaFunctionExists

func ValidateLambdaFunctionExists(t *testing.T, svc *lambda.Lambda, functionName string, layerName string, testLayer bool, verboseOutput bool)

func ValidateLicenseManagerGrant added in v1.0.4

func ValidateLicenseManagerGrant(t *testing.T, svc *licensemanager.LicenseManager, grantName string, grantArn string, licenseArn string, grantStatus string, verboseOutput bool)

func ValidateNatGateway

func ValidateNatGateway(t *testing.T, svc *ec2.EC2, state string, tagValues []string, verboseOutput bool)

ValidateNatGateway gets NatGateway and validates its info

func ValidateNetworkACLs

func ValidateNetworkACLs(t *testing.T, svc *ec2.EC2, naclName string, naclRules int, verboseOutput bool)

ValidateNetworkACLs gets NetworkAcl and validates its info

func ValidateNumberOfAttachedRolePolicies

func ValidateNumberOfAttachedRolePolicies(t *testing.T, svc *iam.IAM, roleName string, roleArn string, numberOfPolicies int, verboseOutput bool)

ValidateNumberOfAttachedRolePolicies get the role by name and validates that the correct number of policies are attached to the role

func ValidatePolicy

func ValidatePolicy(t *testing.T, svc *iam.IAM, policyArn string, policyName string, verboseOutput bool)

ValidatePolicy gets Polcy by arn and validates its data

func ValidatePolicyDetails

func ValidatePolicyDetails(t *testing.T, svc *iam.IAM, policyArn string, policyJSON string, verboseOutput bool)

ValidatePolicyDetails gets the polcy by arn and validates that the JSON permissions are correct

func ValidatePolicyIsAttachedToARole

func ValidatePolicyIsAttachedToARole(t *testing.T, svc *iam.IAM, policyArn string, verboseOutput bool)

ValidatePolicyIsAttachedToARole get polcy by arn and validates that at least one role is attached

func ValidatePolicyIsAttachedToASpecificGroup

func ValidatePolicyIsAttachedToASpecificGroup(t *testing.T, svc *iam.IAM, policyArn string, groupName string, verboseOutput bool)

ValidatePolicyIsAttachedToASpecificGroup gets policy and checks it is attached to a specific group

func ValidatePolicyIsAttachedToASpecificRole

func ValidatePolicyIsAttachedToASpecificRole(t *testing.T, svc *iam.IAM, policyArn string, roleName string, verboseOutput bool)

ValidatePolicyIsAttachedToASpecificRole get polcy by arn and validates that the specified role is attached

func ValidatePublicAccessBlock

func ValidatePublicAccessBlock(t *testing.T, svc *s3.S3, bucketName string, blockPublicAcls bool, blockPublicPolicy bool, ignorePublicAcls bool, restrictPublicBuckets bool, verboseOutput bool)

ValidatePublicAccessBlock get bucket PublicAccessBlock

func ValidateResourceAssociatedToWAFV2WebACL

func ValidateResourceAssociatedToWAFV2WebACL(t *testing.T, svc *wafv2.WAFV2, resourceARN string, webACLARN string, verboseOutput bool)

ValidateResourceAssociatedToWAFV2WebACL validate a REGIONAL qualified resource ARN is associated to a WAFv2 Web ACL

func ValidateRoleArn

func ValidateRoleArn(t *testing.T, svc *iam.IAM, roleName string, roleArn string, verboseOutput bool)

ValidateRoleArn Validate the ARN of an IAM role by querying the Role Name

func ValidateRoleDetails

func ValidateRoleDetails(t *testing.T, svc *iam.IAM, roleName string, roleArn string, trustRelationshipJSON string, tags []string, verboseOutput bool)

ValidateRoleDetails get the role by name and validates the details on it

func ValidateRoleHasManagedPolicyAttached

func ValidateRoleHasManagedPolicyAttached(t *testing.T, svc *iam.IAM, policyArn string, roleName string, verboseOutput bool)

ValidateRoleHasManagedPolicyAttached get role by name and validates that the specified role has managed policy attached

func ValidateRoleInlinePolicy

func ValidateRoleInlinePolicy(t *testing.T, svc *iam.IAM, roleName string, policyName string, policyJSON string, verboseOutput bool)

ValidateRoleInlinePolicy get the role by name and validates the inline policy on it

func ValidateRolePermissionsBoundary

func ValidateRolePermissionsBoundary(t *testing.T, svc *iam.IAM, roleName string, permissionsBoundaryArn string, verboseOutput bool)

func ValidateRoute53HostedZone added in v1.0.3

func ValidateRoute53HostedZone(t *testing.T, svc *route53.Route53, hostedZoneID string, hostedZoneName string, privateZone bool, verboseOutput bool)

ValidateRoute53HostedZone Validate the Hosted Zone was created

func ValidateRoute53ResolverRuleAssociation

func ValidateRoute53ResolverRuleAssociation(t *testing.T, svc *route53resolver.Route53Resolver, vpcID string, ruleAssociationID string, verboseOutput bool)

ValidateRoute53ResolverRuleAssociation Validate a rule association exists

func ValidateRouteTables

func ValidateRouteTables(t *testing.T, svc *ec2.EC2, vpcID string, ownerID string, tagValues []string, verboseOutput bool)

ValidateRouteTables gets Route Tables and validates its info

func ValidateSAMLProvider

func ValidateSAMLProvider(t *testing.T, svc *iam.IAM, providerArn string, verboseOutput bool)

ValidateSAMLProvider get the saml provider

func ValidateSecurityGroup

func ValidateSecurityGroup(t *testing.T, svc *ec2.EC2, vpcID string, groupName string, numIngressRules int, numEgressRules int, verboseOutput bool)

ValidateSecurityGroup gets security group by name and vpcID and validates its info

func ValidateSingleVPC

func ValidateSingleVPC(t *testing.T, svc *ec2.EC2, vpcID string, isDefault bool, cidrBlockState string, instanceTenancy string, ownerID string, state string, tagValues []string, verboseOutput bool)

ValidateSingleVPC gets vpc and validates its info

func ValidateSubnet

func ValidateSubnet(t *testing.T, svc *ec2.EC2, state string, ownerID string, tagValues []string, verboseOutput bool)

ValidateSubnet gets Subnet and validates its info

func ValidateTableOrViewExists

func ValidateTableOrViewExists(t *testing.T, svc *athena.Athena, databaseName string, catalogName string, tableName string, verboseOutput bool)

func ValidateTgwConsumer

func ValidateTgwConsumer(t *testing.T, svc *ec2.EC2, verboseOutput bool, tgwAttachmentID string, vpcID string)

ValidateTgwConsumer helper function to validate transit gateway vpc associations

func ValidateTransitGatewayAttachments

func ValidateTransitGatewayAttachments(t *testing.T, svc *ec2.EC2, verboseOutput bool)

ValidateTransitGatewayAttachments gets NetworkAcl and validates its info

func ValidateTransitGateways

func ValidateTransitGateways(t *testing.T, svc *ec2.EC2, verboseOutput bool)

ValidateTransitGateways gets NetworkAcl and validates its info

func ValidateUserDetails

func ValidateUserDetails(t *testing.T, svc *iam.IAM, userName string, userArn string, verboseOutput bool)

ValidateUserDetails get user details

func ValidateUserDetailsWTags

func ValidateUserDetailsWTags(t *testing.T, svc *iam.IAM, userName string, userArn string, tags []string, verboseOutput bool)

ValidateUserDetailsWTags get user details

func ValidateVPC

func ValidateVPC(t *testing.T, svc *ec2.EC2, isDefault bool, cidrBlockState string, instanceTenancy string, ownerID string, state string, tagValues []string, verboseOutput bool)

ValidateVPC gets vpc and validates its info

func ValidateVpc

func ValidateVpc(t *testing.T, svc *ec2.EC2, vpc Vpc, verboseOutput bool)

ValidateVpc validate a VPC via attributes passed in using the Vpc struct

func ValidateVpcEndpoints

func ValidateVpcEndpoints(t *testing.T, svc *ec2.EC2, serviceName string, vpcID string, ownerID string, state string, privateDNSEnabled bool, securityGroups []string, vpcEndpointType string, verboseOutput bool)

ValidateVpcEndpoints gets NetworkAcl and validates its info

func ValidateWAFV2WebACL

func ValidateWAFV2WebACL(t *testing.T, svc *wafv2.WAFV2, webACLID string, webACLName string, webACLScope string, webACLARN string, verboseOutput bool)

ValidateWAFV2WebACL validate base parameters of a WAFv2 Web ACL

func ValidateWAFV2WebACLRulesByName

func ValidateWAFV2WebACLRulesByName(t *testing.T, svc *wafv2.WAFV2, webACLID string, webACLName string, webACLScope string, expectedRuleNameList []string, verboseOutput bool)

ValidateWAFV2WebACLRulesByName validate the expected names of rules are associated to a WAFv2 Web ACL

Types

type Vpc

type Vpc struct {
	VpcID   string
	VpcCidr string
}

Vpc struct containing elements returned from a VPC module. This provides a convenient way of consolidating our VPC attributes when calling helper functions

Jump to

Keyboard shortcuts

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