awstest

package
v1.16.0 Latest Latest
Warning

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

Go to latest
Published: Mar 10, 2021 License: AGPL-3.0 Imports: 54 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ExampleCertificateArn = aws.String("arn:aws:acm:us-west-2:123456789012:certificate/asdfasdf-1234-1234-1234-1")

	ExampleListCertificatesOutput = &acm.ListCertificatesOutput{
		CertificateSummaryList: []*acm.CertificateSummary{
			{
				DomainName:     aws.String("runpanther.xyz"),
				CertificateArn: ExampleCertificateArn,
			},
		},
	}

	ExampleListCertificatesOutputContinue = &acm.ListCertificatesOutput{
		CertificateSummaryList: []*acm.CertificateSummary{
			{
				DomainName:     aws.String("runpanther.123"),
				CertificateArn: ExampleCertificateArn,
			},
			{
				DomainName:     aws.String("runpanther.abc"),
				CertificateArn: ExampleCertificateArn,
			},
		},
		NextToken: aws.String("1"),
	}

	ExampleDescribeCertificateOutput = &acm.DescribeCertificateOutput{
		Certificate: &acm.CertificateDetail{
			CertificateArn:     ExampleCertificateArn,
			CreatedAt:          &ExampleTime,
			DomainName:         aws.String("runpanther.xyz"),
			Serial:             aws.String("b7:5b:09:63:dd:47:9c:46"),
			NotBefore:          &ExampleTime,
			NotAfter:           &ExampleTime,
			KeyAlgorithm:       aws.String("RSA-2048"),
			SignatureAlgorithm: aws.String("SHA256WITHRSA"),
			Type:               aws.String("AMAZON_CREATED"),
		},
	}

	ExampleListTagsForCertificate = &acm.ListTagsForCertificateOutput{
		Tags: []*acm.Tag{
			{
				Key:   aws.String("Key1"),
				Value: aws.String("Value1"),
			},
		},
	}

	MockAcmForSetup = &MockAcm{}
)

Example ACM API return values

View Source
var (
	ExampleDescribeScalableTargetsOutput = &applicationautoscaling.DescribeScalableTargetsOutput{
		ScalableTargets: []*applicationautoscaling.ScalableTarget{
			{
				ServiceNamespace:  aws.String("dynamodb"),
				ResourceId:        aws.String("table/example-table"),
				ScalableDimension: aws.String("dynamodb:table:ReadCapacityUnits"),
				MinCapacity:       aws.Int64(5),
				MaxCapacity:       aws.Int64(4000),
				RoleARN:           aws.String("arn:aws:iam::123456789012:role/aws-service-role/dynamodb.application-autoscaling.amazonaws.com/AutoScalingRole"),
				CreationTime:      &ExampleTime,
			},
			{
				ServiceNamespace:  aws.String("dynamodb"),
				ResourceId:        aws.String("table/example-table"),
				ScalableDimension: aws.String("dynamodb:table:WriteCapacityUnits"),
				MinCapacity:       aws.Int64(5),
				MaxCapacity:       aws.Int64(40000),
				RoleARN:           aws.String("arn:aws:iam::123456789012:role/aws-service-role/dynamodb.application-autoscaling.amazonaws.com/AutoScalingRole"),
				CreationTime:      &ExampleTime,
			},
		},
	}

	MockApplicationAutoScalingForSetup = &MockApplicationAutoScaling{}
)

Example ApplicationAutoScaling return values

View Source
var (
	StackDriftDetectionInProgress = false

	ExampleDescribeStacks = &cloudformation.DescribeStacksOutput{
		Stacks: []*cloudformation.Stack{
			{
				StackId:     aws.String("arn:aws:cloudformation:us-west-2:111111111111:stack/iam-roles/67fc9960-556b-11e9-a978-067794494828"),
				StackName:   aws.String("iam-roles"),
				Description: aws.String("Nick's IAM Admin role"),
				Parameters: []*cloudformation.Parameter{
					{
						ParameterKey:   aws.String("MaxSessionDurationSec"),
						ParameterValue: aws.String("28800"),
					},
					{
						ParameterKey:   aws.String("Prefix"),
						ParameterValue: aws.String("DevNick"),
					},
				},
				CreationTime:    &ExampleTime,
				LastUpdatedTime: &ExampleTime,
				RollbackConfiguration: &cloudformation.RollbackConfiguration{
					RollbackTriggers: []*cloudformation.RollbackTrigger{},
				},
				StackStatus:      aws.String("UPDATE_COMPLETE"),
				DisableRollback:  aws.Bool(false),
				NotificationARNs: []*string{},
				Capabilities: []*string{
					aws.String("CAPABILITY_NAMED_IAM"),
				},
				Tags: []*cloudformation.Tag{},
				DriftInformation: &cloudformation.StackDriftInformation{
					StackDriftStatus:   aws.String("DRIFTED"),
					LastCheckTimestamp: &ExampleTime,
				},
			},
		},
	}
	ExampleDescribeStacksContinue = &cloudformation.DescribeStacksOutput{
		Stacks: []*cloudformation.Stack{
			ExampleDescribeStacks.Stacks[0],
			ExampleDescribeStacks.Stacks[0],
		},
		NextToken: aws.String("1"),
	}

	ExampleDescribeStackResourceDrifts = &cloudformation.DescribeStackResourceDriftsOutput{
		StackResourceDrifts: []*cloudformation.StackResourceDrift{
			{
				StackId:            aws.String("arn:aws:cloudformation:us-west-2:111111111111:stack/iam-roles/67fc9960-556b-11e9-a978-067794494828"),
				LogicalResourceId:  aws.String("Administrators"),
				PhysicalResourceId: aws.String("PantherDevNickAdministrator"),
				ResourceType:       aws.String("AWS::IAM::Role"),
				ExpectedProperties: aws.String("{\"AssumeRolePolicyDocument\":{\"Statement\":[{\"Action\":\"sts:AssumeRole\",\"Condition\":{\"Bool\":{\"aws:MultiFactorAuthPresent\":true,\"aws:SecureTransport\":true},\"NumericLessThan\":{\"aws:MultiFactorAuthAge\":28800}},\"Effect\":\"Allow\",\"Principal\":{\"AWS\":111111111111}}],\"Version\":\"2012-10-17\"},\"ManagedPolicyArns\":[\"arn:aws:iam::aws:policy/AdministratorAccess\"],\"MaxSessionDuration\":28800,\"RoleName\":\"PantherDevNickAdministrator\"}"),
				ActualProperties:   aws.String("{\"AssumeRolePolicyDocument\":{\"Statement\":[{\"Action\":\"sts:AssumeRole\",\"Condition\":{\"Bool\":{\"aws:MultiFactorAuthPresent\":true,\"aws:SecureTransport\":true},\"NumericLessThan\":{\"aws:MultiFactorAuthAge\":28800}},\"Effect\":\"Allow\",\"Principal\":{\"AWS\":\"arn:aws:iam::111111111111:root\"}}],\"Version\":\"2012-10-17\"},\"ManagedPolicyArns\":[\"arn:aws:iam::aws:policy/AdministratorAccess\"],\"MaxSessionDuration\":28800,\"RoleName\":\"PantherDevNickAdministrator\"}"),
				PropertyDifferences: []*cloudformation.PropertyDifference{
					{
						PropertyPath:   aws.String("/AssumeRolePolicyDocument/Statement/0/Principal/AWS"),
						ExpectedValue:  aws.String("111111111111"),
						ActualValue:    aws.String("arn:aws:iam::111111111111:root"),
						DifferenceType: aws.String("NOT_EQUAL"),
					},
				},
				StackResourceDriftStatus: aws.String("MODIFIED"),
				Timestamp:                &ExampleTime,
			},
		},
	}

	ExampleDetectStackDrift = &cloudformation.DetectStackDriftOutput{
		StackDriftDetectionId: aws.String("5115ff60-b863-11e9-bf7f-0657eb5c1e84"),
	}

	ExampleDescribeStackDriftDetectionStatus = &cloudformation.DescribeStackDriftDetectionStatusOutput{
		StackId:                   aws.String("arn:aws:cloudformation:us-west-2:111111111111:stack/iam-roles/67fc9960-556b-11e9-a978-067794494828"),
		StackDriftDetectionId:     aws.String("5115ff60-b863-11e9-bf7f-0657eb5c1e84"),
		StackDriftStatus:          aws.String("DRIFTED"),
		DetectionStatus:           aws.String("DETECTION_COMPLETE"),
		DriftedStackResourceCount: aws.Int64(1),
		Timestamp:                 &ExampleTime,
	}

	ExampleDescribeStackDriftDetectionStatusInProgress = &cloudformation.DescribeStackDriftDetectionStatusOutput{
		StackId:                   aws.String("arn:aws:cloudformation:us-west-2:111111111111:stack/iam-roles/67fc9960-556b-11e9-a978-067794494828"),
		StackDriftDetectionId:     aws.String("5115ff60-b863-11e9-bf7f-0657eb5c1e84"),
		StackDriftStatus:          aws.String("DRIFTED"),
		DetectionStatus:           aws.String("DETECTION_IN_PROGESS"),
		DriftedStackResourceCount: aws.Int64(1),
		Timestamp:                 &ExampleTime,
	}

	MockCloudFormationForSetup = &MockCloudFormation{}
)

Example CloudFormation API return values

View Source
var (
	ExampleTrail = &cloudtrail.Trail{
		CloudWatchLogsLogGroupArn:  aws.String("arn:aws:logs:us-west-2:123456789012:log-group:Trail:*"),
		CloudWatchLogsRoleArn:      aws.String("arn:aws:iam::123456789012:role/Trail"),
		HasCustomEventSelectors:    aws.Bool(true),
		HomeRegion:                 aws.String("us-west-2"),
		IncludeGlobalServiceEvents: aws.Bool(true),
		IsMultiRegionTrail:         aws.Bool(true),
		IsOrganizationTrail:        aws.Bool(true),
		KmsKeyId:                   aws.String("arn:aws:kms:us-west-2:123456789012:key/2222dddd-ffff-4444-8888-999911113"),
		LogFileValidationEnabled:   aws.Bool(true),
		Name:                       aws.String("Trail"),
		S3BucketName:               aws.String("unit-test-cloudtrail-bucket"),
		TrailARN:                   aws.String("arn:aws:cloudtrail:us-west-2:123456789012:trail/Trail"),
	}

	ExampleTrailStatus = &cloudtrail.GetTrailStatusOutput{
		IsLogging: aws.Bool(true),
	}

	ExampleTrailEventSelectors = []*cloudtrail.EventSelector{{
		IncludeManagementEvents: aws.Bool(true),
		ReadWriteType:           aws.String("All"),
		DataResources: []*cloudtrail.DataResource{{
			Type: aws.String("AWS::S3::Object"),
		}},
	}}

	ExampleListTagsCloudTrail = &cloudtrail.ListTagsOutput{
		ResourceTagList: []*cloudtrail.ResourceTag{
			{
				TagsList: []*cloudtrail.Tag{
					{
						Key:   aws.String("Key1Name"),
						Value: aws.String("Value1Name"),
					},
					{
						Key:   aws.String("Key2Name"),
						Value: aws.String("Value2Name"),
					},
				},
				ResourceId: ExampleTrail.TrailARN,
			},
		},
	}

	ExampleDescribeTrails = &cloudtrail.DescribeTrailsOutput{
		TrailList: []*cloudtrail.Trail{ExampleTrail},
	}

	ExampleGetEventSelectors = &cloudtrail.GetEventSelectorsOutput{
		EventSelectors: ExampleTrailEventSelectors,
		TrailARN:       ExampleTrail.TrailARN,
	}

	// MockCloudTrailForSetup is the object returned by the SetupMockCloudTrail function.
	MockCloudTrailForSetup = &MockCloudTrail{}
)
View Source
var (
	ExampleDescribeLogGroups = &cloudwatchlogs.DescribeLogGroupsOutput{
		LogGroups: []*cloudwatchlogs.LogGroup{
			{
				LogGroupName:      aws.String("LogGroup-1"),
				CreationTime:      aws.Int64(1234567890123),
				RetentionInDays:   aws.Int64(30),
				MetricFilterCount: aws.Int64(0),
				Arn:               aws.String("arn:aws:logs:us-west-2:123456789012:log-group:LogGroup-1:*"),
				StoredBytes:       aws.Int64(10000000),
			},
			{
				LogGroupName:      aws.String("LogGroup-2"),
				CreationTime:      aws.Int64(1234567890123),
				MetricFilterCount: aws.Int64(0),
				Arn:               aws.String("arn:aws:logs:us-west-2:1234456789012:log-group:LogGroup-2:*"),
				StoredBytes:       aws.Int64(0),
			},
		},
	}

	ExampleDescribeLogGroupsContinue = &cloudwatchlogs.DescribeLogGroupsOutput{
		LogGroups: ExampleDescribeLogGroups.LogGroups,
		NextToken: aws.String("1"),
	}

	ExampleListTagsLogGroup = &cloudwatchlogs.ListTagsLogGroupOutput{
		Tags: map[string]*string{
			"Key1Name": aws.String("Value1"),
		},
	}

	MockCloudWatchLogsForSetup = &MockCloudWatchLogs{}
)

Example ACM API return values

View Source
var (
	ExampleDescribeConfigurationRecorders = &configservice.DescribeConfigurationRecordersOutput{
		ConfigurationRecorders: []*configservice.ConfigurationRecorder{
			{
				Name: aws.String("default"),
				RecordingGroup: &configservice.RecordingGroup{
					AllSupported:               aws.Bool(true),
					IncludeGlobalResourceTypes: aws.Bool(true),
				},
				RoleARN: aws.String("arn:aws:iam::111111111111:role/aws-service-role/config.amazonaws.com/AWSServiceRoleForConfig"),
			},
		},
	}

	ExampleDescribeConfigurationRecorderStatus = &configservice.DescribeConfigurationRecorderStatusOutput{
		ConfigurationRecordersStatus: []*configservice.ConfigurationRecorderStatus{
			{
				LastStartTime:        &ExampleTime,
				LastStatus:           aws.String("SUCCESS"),
				LastStatusChangeTime: &ExampleTime,
				LastStopTime:         &ExampleTime,
				Name:                 aws.String("default"),
				Recording:            aws.Bool(true),
			},
		},
	}

	ExampleConfigName = aws.String("IAmTheConfig")

	MockConfigServiceForSetup = &MockConfigService{}
)
View Source
var (
	ExampleTableName = aws.String("example-table")

	ExampleDescribeTableOutput = &dynamodb.DescribeTableOutput{
		Table: &dynamodb.TableDescription{
			AttributeDefinitions: []*dynamodb.AttributeDefinition{
				{
					AttributeName: aws.String("attr_1"),
					AttributeType: aws.String("S"),
				},
			},
			TableName: ExampleTableName,
			KeySchema: []*dynamodb.KeySchemaElement{
				{
					AttributeName: aws.String("primary_key"),
					KeyType:       aws.String("HASH"),
				},
			},
			TableStatus:      aws.String("ACTIVE"),
			CreationDateTime: &ExampleTime,
			ProvisionedThroughput: &dynamodb.ProvisionedThroughputDescription{
				NumberOfDecreasesToday: aws.Int64(0),
				ReadCapacityUnits:      aws.Int64(5),
				WriteCapacityUnits:     aws.Int64(5),
			},
			TableSizeBytes: aws.Int64(1000),
			ItemCount:      aws.Int64(10),
			TableArn:       aws.String("arn:aws:dynamodb:us-west-2:123456789012:table/example-table"),
			TableId:        aws.String("1234abcd-12ab-aabb-123456abcde"),
			BillingModeSummary: &dynamodb.BillingModeSummary{
				BillingMode:                       aws.String("PROVISIONED"),
				LastUpdateToPayPerRequestDateTime: &ExampleTime,
			},
			GlobalSecondaryIndexes: []*dynamodb.GlobalSecondaryIndexDescription{
				{
					IndexName: aws.String("index-1"),
					KeySchema: []*dynamodb.KeySchemaElement{
						{
							AttributeName: aws.String("attr-1"),
							KeyType:       aws.String("HASH"),
						},
					},
					Projection: &dynamodb.Projection{
						ProjectionType: aws.String("ALL"),
					},
					IndexStatus: aws.String("ACTIVE"),
					ProvisionedThroughput: &dynamodb.ProvisionedThroughputDescription{
						LastDecreaseDateTime:   &ExampleTime,
						LastIncreaseDateTime:   &ExampleTime,
						NumberOfDecreasesToday: aws.Int64(0),
						ReadCapacityUnits:      aws.Int64(5),
						WriteCapacityUnits:     aws.Int64(5),
					},
					IndexSizeBytes: aws.Int64(500),
					ItemCount:      aws.Int64(5),
					IndexArn:       aws.String("arn:aws:dynamodb:us-west-2:123456789012:table/example-table/index/index-1"),
				},
			},
		},
	}

	ExampleListTablesOutput = &dynamodb.ListTablesOutput{
		TableNames: []*string{
			ExampleTableName,
		},
	}

	ExampleListTablesOutputContinue = &dynamodb.ListTablesOutput{
		TableNames: []*string{
			ExampleTableName,
			ExampleTableName,
		},
		LastEvaluatedTableName: ExampleTableName,
	}

	ExampleListTagsOfResource = &dynamodb.ListTagsOfResourceOutput{
		Tags: []*dynamodb.Tag{
			{
				Key:   aws.String("KeyName1"),
				Value: aws.String("Value1"),
			},
		},
	}

	ExampleDescribeTimeToLive = &dynamodb.DescribeTimeToLiveOutput{
		TimeToLiveDescription: &dynamodb.TimeToLiveDescription{
			TimeToLiveStatus: aws.String("ENABLED"),
			AttributeName:    aws.String("expireTime"),
		},
	}

	MockDynamoDBForSetup = &MockDynamoDB{}
)

Example DynamoDB return values

View Source
var (
	ExampleInstanceId = aws.String("instance-aabbcc123")
	ExampleVpcId      = aws.String("vpc-aabbccddee123")
	ExampleVolumeId   = aws.String("vol-aaabbbccc123123")
	ExampleSnapshotId = aws.String("snapshot-aaabbbccc123123")

	ExampleInstance = &ec2.Instance{
		AmiLaunchIndex: aws.Int64(0),
		ImageId:        aws.String("ami-111222333444555666"),
		InstanceId:     ExampleInstanceId,
		InstanceType:   aws.String("t2.micro"),
		KeyName:        aws.String("ec2-instance-key-pair"),
		LaunchTime:     &ExampleTime,
		Monitoring: &ec2.Monitoring{
			State: aws.String("disabled"),
		},
		Placement: &ec2.Placement{
			AvailabilityZone: aws.String("us-west-2b"),
			GroupName:        aws.String(""),
			Tenancy:          aws.String("default"),
		},
		PrivateDnsName:   aws.String("ip-172-0-0-0.us-west-2.compute.internal"),
		PrivateIpAddress: aws.String("172.0.0.0"),
		ProductCodes:     []*ec2.ProductCode{},
		PublicDnsName:    aws.String("ec2-54-0-0-0.us-west-2.compute.amazonaws.com"),
		PublicIpAddress:  aws.String("54.0.0.0"),
		State: &ec2.InstanceState{
			Code: aws.Int64(16),
			Name: aws.String("running"),
		},
		StateTransitionReason: aws.String(""),
		SubnetId:              aws.String("subnet-123123"),
		VpcId:                 ExampleVpcId,
		Architecture:          aws.String("x86_64"),
		BlockDeviceMappings: []*ec2.InstanceBlockDeviceMapping{
			{
				DeviceName: aws.String("/dev/sda1"),
				Ebs: &ec2.EbsInstanceBlockDevice{
					AttachTime:          &ExampleTime,
					DeleteOnTermination: aws.Bool(true),
					Status:              aws.String("attached"),
					VolumeId:            ExampleVolumeId,
				},
			},
		},
		ClientToken:  aws.String(""),
		EbsOptimized: aws.Bool(false),
		EnaSupport:   aws.Bool(true),
		Hypervisor:   aws.String("xen"),
		NetworkInterfaces: []*ec2.InstanceNetworkInterface{
			{
				Association: &ec2.InstanceNetworkInterfaceAssociation{
					IpOwnerId:     aws.String("123456789012"),
					PublicDnsName: aws.String("ec2-54-0-0-0.us-west-2.compute.amazonaws.com"),
					PublicIp:      aws.String("54.0.0.0"),
				},
				Attachment: &ec2.InstanceNetworkInterfaceAttachment{
					AttachTime:          &ExampleTime,
					AttachmentId:        aws.String("eni-attach-112233445566"),
					DeleteOnTermination: aws.Bool(true),
					DeviceIndex:         aws.Int64(0),
					Status:              aws.String("attached"),
				},
				Description: aws.String(""),
				Groups: []*ec2.GroupIdentifier{
					{
						GroupName: aws.String("launch-wizard-1"),
						GroupId:   aws.String("sg-0123abcde1234"),
					},
				},
				Ipv6Addresses:      []*ec2.InstanceIpv6Address{},
				MacAddress:         aws.String("DE:AD:BE:EF:00:00"),
				NetworkInterfaceId: aws.String("eni-000111222333"),
				OwnerId:            aws.String("123456789012"),
				PrivateDnsName:     aws.String("ip-172-0-0-0.us-west-2.compute.internal"),
				PrivateIpAddress:   aws.String("172.0.0.0"),
				PrivateIpAddresses: []*ec2.InstancePrivateIpAddress{
					{
						Association: &ec2.InstanceNetworkInterfaceAssociation{
							IpOwnerId:     aws.String("123456789012"),
							PublicDnsName: aws.String("ec2-54-0-0-0.us-west-2.compute.amazonaws.com"),
							PublicIp:      aws.String("54.0.0.0"),
						},
						Primary:          aws.Bool(true),
						PrivateDnsName:   aws.String("ip-172-0-0-0.us-west-2.compute.internal"),
						PrivateIpAddress: aws.String("172.0.0.0"),
					},
				},
				SourceDestCheck: aws.Bool(true),
				Status:          aws.String("in-use"),
				SubnetId:        aws.String("subnet-basdf123"),
				VpcId:           ExampleVpcId,
			},
		},
		RootDeviceName: aws.String("/dev/sda1"),
		RootDeviceType: aws.String("ebs"),
		SecurityGroups: []*ec2.GroupIdentifier{
			{
				GroupName: aws.String("launch-wizard-1"),
				GroupId:   aws.String("sg-0001122334455"),
			},
		},
		SourceDestCheck:    aws.Bool(true),
		VirtualizationType: aws.String("hvm"),
		CpuOptions: &ec2.CpuOptions{
			CoreCount:      aws.Int64(1),
			ThreadsPerCore: aws.Int64(1),
		},
		CapacityReservationSpecification: &ec2.CapacityReservationSpecificationResponse{
			CapacityReservationPreference: aws.String("open"),
		},
		HibernationOptions: &ec2.HibernationOptions{
			Configured: aws.Bool(false),
		},
	}

	ExampleDescribeInstancesOutput = &ec2.DescribeInstancesOutput{
		Reservations: []*ec2.Reservation{
			{
				Instances: []*ec2.Instance{
					ExampleInstance,
				},
			},
		},
	}

	ExampleDescribeInstancesOutputContinue = &ec2.DescribeInstancesOutput{
		Reservations: []*ec2.Reservation{
			{
				Instances: []*ec2.Instance{
					ExampleInstance,
					ExampleInstance,
				},
			},
		},
		NextToken: aws.String("1"),
	}

	ExampleDescribeVolumesOutput = &ec2.DescribeVolumesOutput{
		Volumes: []*ec2.Volume{
			{
				Attachments: []*ec2.VolumeAttachment{
					{
						AttachTime:          &ExampleTime,
						Device:              aws.String("/dev/sda1"),
						InstanceId:          ExampleInstanceId,
						State:               aws.String("attached"),
						VolumeId:            ExampleVolumeId,
						DeleteOnTermination: aws.Bool(true),
					},
				},
				AvailabilityZone: aws.String("us-west-2b"),
				CreateTime:       &ExampleTime,
				Encrypted:        aws.Bool(false),
				Size:             aws.Int64(10),
				SnapshotId:       aws.String("snap-abcdefg012345"),
				State:            aws.String("in-use"),
				VolumeId:         ExampleVolumeId,
				Iops:             aws.Int64(100),
				VolumeType:       aws.String("gp2"),
			},
		},
	}
	ExampleDescribeVolumesOutputContinue = &ec2.DescribeVolumesOutput{
		Volumes: []*ec2.Volume{
			ExampleDescribeVolumesOutput.Volumes[0],
			ExampleDescribeVolumesOutput.Volumes[0],
		},
		NextToken: aws.String("1"),
	}

	ExampleDescribeImagesOutput = &ec2.DescribeImagesOutput{
		Images: []*ec2.Image{
			{
				Architecture:        aws.String("x86_64"),
				CreationDate:        aws.String("2011-11-04T12:34:17.000Z"),
				ImageId:             aws.String("ari-abc234"),
				ImageLocation:       aws.String("ubuntu-us-west-2/kernels/ubuntu.xml"),
				ImageType:           aws.String("ramdisk"),
				Public:              aws.Bool(true),
				OwnerId:             aws.String("123456789012"),
				State:               aws.String("available"),
				BlockDeviceMappings: []*ec2.BlockDeviceMapping{},
				Hypervisor:          aws.String("xen"),
				Name:                aws.String("ubuntu/image"),
				RootDeviceType:      aws.String("instance-store"),
				VirtualizationType:  aws.String("paravirtual"),
			},
			{
				Architecture:        aws.String("i386"),
				CreationDate:        aws.String("2011-11-04T12:36:14.000Z"),
				ImageId:             aws.String("ari-xyz789"),
				ImageLocation:       aws.String("ubuntu-us-west-2/kernels/ubuntu-2.xml"),
				ImageType:           aws.String("ramdisk"),
				Public:              aws.Bool(true),
				OwnerId:             aws.String("123456789013"),
				State:               aws.String("available"),
				BlockDeviceMappings: []*ec2.BlockDeviceMapping{},
				Hypervisor:          aws.String("xen"),
				Name:                aws.String("ubuntu/kernels/ubuntu/other-image"),
				RootDeviceType:      aws.String("instance-store"),
				VirtualizationType:  aws.String("paravirtual"),
			},
			{
				Architecture:        aws.String("i386"),
				CreationDate:        aws.String("2011-11-04T12:36:14.000Z"),
				ImageId:             aws.String("ami-111222333444555666"),
				ImageLocation:       aws.String("ubuntu-us-west-2/kernels/ubuntu-2.xml"),
				ImageType:           aws.String("ramdisk"),
				Public:              aws.Bool(true),
				OwnerId:             aws.String("123456789013"),
				State:               aws.String("available"),
				BlockDeviceMappings: []*ec2.BlockDeviceMapping{},
				Hypervisor:          aws.String("xen"),
				Name:                aws.String("ubuntu/kernels/ubuntu/other-image"),
				RootDeviceType:      aws.String("instance-store"),
				VirtualizationType:  aws.String("paravirtual"),
			},
		},
	}

	ExampleAmi = &ec2.Image{
		Architecture:        aws.String("x86_64"),
		CreationDate:        aws.String("2011-11-04T12:34:17.000Z"),
		ImageId:             aws.String("ari-abc234"),
		ImageLocation:       aws.String("ubuntu-us-west-2/kernels/ubuntu.xml"),
		ImageType:           aws.String("ramdisk"),
		Public:              aws.Bool(true),
		OwnerId:             aws.String("123456789012"),
		State:               aws.String("available"),
		BlockDeviceMappings: []*ec2.BlockDeviceMapping{},
		Hypervisor:          aws.String("xen"),
		Name:                aws.String("ubuntu/image"),
		RootDeviceType:      aws.String("instance-store"),
		VirtualizationType:  aws.String("paravirtual"),
	}

	ExampleVpc = &ec2.Vpc{
		CidrBlock:     aws.String("172.31.0.0/16"),
		DhcpOptionsId: aws.String("dopt-63f9231b"),
		CidrBlockAssociationSet: []*ec2.VpcCidrBlockAssociation{
			{
				AssociationId: aws.String("vpc-cidr-assoc-dfb6ceb5"),
				CidrBlock:     aws.String("172.31.0.0/16"),
				CidrBlockState: &ec2.VpcCidrBlockState{
					State: aws.String("associated"),
				},
			},
		},
		State:           aws.String("available"),
		InstanceTenancy: aws.String("default"),
		IsDefault:       aws.Bool(true),
		OwnerId:         aws.String("123456789012"),
		VpcId:           aws.String("vpc-6aa60b12"),
	}

	ExampleDescribeVpcsOutput = &ec2.DescribeVpcsOutput{
		Vpcs: []*ec2.Vpc{
			ExampleVpc,
		},
	}

	ExampleDescribeVpcsOutputContinue = &ec2.DescribeVpcsOutput{
		Vpcs: []*ec2.Vpc{
			ExampleVpc,
			ExampleVpc,
		},
		NextToken: aws.String("1"),
	}

	ExampleDescribeSecurityGroupsOutput = &ec2.DescribeSecurityGroupsOutput{
		SecurityGroups: []*ec2.SecurityGroup{
			{
				Description: aws.String("default VPC security group"),
				GroupId:     aws.String("sg-111222333"),
				GroupName:   aws.String("default"),
				IpPermissions: []*ec2.IpPermission{
					{
						IpProtocol: aws.String("-1"),
					},
				},
				IpPermissionsEgress: []*ec2.IpPermission{},
				OwnerId:             aws.String("123456789012"),
				VpcId:               aws.String("vpc-6aa60b12"),
			},
		},
	}
	ExampleDescribeSecurityGroupsOutputContinue = &ec2.DescribeSecurityGroupsOutput{
		SecurityGroups: []*ec2.SecurityGroup{
			ExampleDescribeSecurityGroupsOutput.SecurityGroups[0],
			ExampleDescribeSecurityGroupsOutput.SecurityGroups[0],
		},
		NextToken: aws.String("1"),
	}

	ExampleDescribeNetworkAclsOutput = &ec2.DescribeNetworkAclsOutput{
		NetworkAcls: []*ec2.NetworkAcl{
			{
				Associations: []*ec2.NetworkAclAssociation{
					{
						NetworkAclAssociationId: aws.String("aclassoc-111222333"),
						NetworkAclId:            aws.String("acl-111222333"),
						SubnetId:                aws.String("subnet-111222333"),
					},
				},
				Entries: []*ec2.NetworkAclEntry{
					{
						CidrBlock:  aws.String("0.0.0.0/0"),
						Egress:     aws.Bool(true),
						Protocol:   aws.String("-1"),
						RuleAction: aws.String("allow"),
						RuleNumber: aws.Int64(100),
					},
				},
				IsDefault:    aws.Bool(true),
				NetworkAclId: aws.String("acl-111222333"),
				OwnerId:      aws.String("123456789012"),
				VpcId:        aws.String("vpc-6aa60b12"),
			},
		},
	}

	ExampleDescribeNetworkAclsOutputContinue = &ec2.DescribeNetworkAclsOutput{
		NetworkAcls: []*ec2.NetworkAcl{
			ExampleDescribeNetworkAclsOutput.NetworkAcls[0],
			ExampleDescribeNetworkAclsOutput.NetworkAcls[0],
		},
		NextToken: aws.String("1"),
	}

	ExampleDescribeFlowLogsOutput = &ec2.DescribeFlowLogsOutput{
		FlowLogs: []*ec2.FlowLog{
			{
				CreationTime:             &ExampleTime,
				DeliverLogsPermissionArn: aws.String("arn:aws:iam::123456789012:role/PantherDevNickAdministrator"),
				DeliverLogsStatus:        aws.String("SUCCESS"),
				FlowLogStatus:            aws.String("ACTIVE"),
				LogDestination:           aws.String("arn:aws:logs:us-west-2:123456789012:log-group:vpc-flow-test"),
				LogDestinationType:       aws.String("cloud-watch-logs"),
				LogGroupName:             aws.String("vpc-flow-test"),
				ResourceId:               aws.String("vpc-6aa60b12"),
				TrafficType:              aws.String("REJECT"),
			},
		},
	}

	ExampleDescribeRouteTablesOutput = &ec2.DescribeRouteTablesOutput{
		RouteTables: []*ec2.RouteTable{
			{
				OwnerId:      aws.String("123456789012"),
				RouteTableId: aws.String("rtb-8b28a7f0"),
				Associations: []*ec2.RouteTableAssociation{
					{
						Main:                    aws.Bool(true),
						RouteTableAssociationId: aws.String("rtbassoc-8184e8fc"),
						RouteTableId:            aws.String("rtb-8b28a7f0"),
					},
				},
				Routes: []*ec2.Route{
					{
						DestinationCidrBlock: aws.String("172.31.0.0/16"),
						GatewayId:            aws.String("local"),
						Origin:               aws.String("CreateRouteTable"),
						State:                aws.String("active"),
					},
					{
						DestinationCidrBlock: aws.String("0.0.0.0/0"),
						GatewayId:            aws.String("igw-a4b1a6c2"),
						Origin:               aws.String("CreateRoute"),
						State:                aws.String("active"),
					},
				},
				VpcId: aws.String("vpc-6aa60b12"),
			},
		},
	}

	ExampleDescribeStaleSecurityGroups = &ec2.DescribeStaleSecurityGroupsOutput{
		StaleSecurityGroupSet: []*ec2.StaleSecurityGroup{
			{
				Description: aws.String("example security group"),
				GroupId:     aws.String("sg-111222333"),
				GroupName:   aws.String("default"),
				StaleIpPermissionsEgress: []*ec2.StaleIpPermission{
					{
						FromPort:   aws.Int64(5555),
						IpProtocol: aws.String("tcp"),
						ToPort:     aws.Int64(5555),
						UserIdGroupPairs: []*ec2.UserIdGroupPair{
							{
								GroupId:                aws.String("sg-444555666"),
								GroupName:              aws.String("default"),
								PeeringStatus:          aws.String("deleted"),
								UserId:                 aws.String("123456789012"),
								VpcId:                  aws.String("vpc-112233445566"),
								VpcPeeringConnectionId: aws.String("pcx-112233445566"),
							},
						},
					},
				},
				VpcId: aws.String("vpc-111222333444"),
			},
		},
	}

	ExampleDescribeRegionsOutput = &ec2.DescribeRegionsOutput{
		Regions: []*ec2.Region{
			{
				Endpoint:   aws.String("ec2.ap-southeast-2.amazonaws.com"),
				RegionName: aws.String("ap-southeast-2"),
			},
			{
				Endpoint:   aws.String("ec2.eu-central-1.amazonaws.com"),
				RegionName: aws.String("eu-central-1"),
			},
			{
				Endpoint:   aws.String("ec2.us-west-2.amazonaws.com"),
				RegionName: aws.String("us-west-2"),
			},
		},
	}

	ExampleDescribeSnapshots = &ec2.DescribeSnapshotsOutput{
		Snapshots: []*ec2.Snapshot{
			{
				Description: aws.String("Copied for destinationAmi..."),
				Encrypted:   aws.Bool(false),
				OwnerId:     ExampleAccountId,
				Progress:    aws.String("100%"),
				SnapshotId:  ExampleSnapshotId,
				StartTime:   &ExampleTime,
				State:       aws.String("completed"),
				VolumeId:    ExampleVolumeId,
				VolumeSize:  aws.Int64(16),
			},
		},
	}

	ExampleDescribeSnapshotAttribute = &ec2.DescribeSnapshotAttributeOutput{
		SnapshotId: ExampleSnapshotId,
		CreateVolumePermissions: []*ec2.CreateVolumePermission{
			{
				Group:  aws.String("GroupName"),
				UserId: aws.String("user-123"),
			},
		},
		ProductCodes: []*ec2.ProductCode{
			{
				ProductCodeId:   aws.String("id-123"),
				ProductCodeType: aws.String("PremiumSubscription"),
			},
		},
	}

	MockEC2ForSetup = &MockEC2{}
)
View Source
var (
	ExampleEcsClusterArn          = aws.String("arn:aws:ecs:us-west-2:123456789012:cluster/example-cluster")
	ExampleEcsClusterMultiSvcArn  = aws.String("arn:aws:ecs:us-west-2:123456789012:cluster/example-cluster-multi-service")
	ExampleEcsClusterMultiTaskArn = aws.String("arn:aws:ecs:us-west-2:123456789012:cluster/example-cluster-multi-task")
	ExampleTaskArn                = aws.String("arn:aws:ecs:us-west-2:123456789012:task/1111-2222")
	ExampleServiceArn             = aws.String("arn:aws:ecs:us-west-2:123456789012:service/example-service")

	ExampleEcsListClusters = &ecs.ListClustersOutput{
		ClusterArns: []*string{
			ExampleEcsClusterArn,
		},
	}

	ExampleEcsListClustersContinue = &ecs.ListClustersOutput{
		ClusterArns: []*string{
			ExampleEcsClusterArn,
			ExampleEcsClusterArn,
		},
		NextToken: aws.String("1"),
	}

	ExampleEcsListTasks = &ecs.ListTasksOutput{
		TaskArns: []*string{
			ExampleTaskArn,
		},
	}

	ExampleEcsListTasksMultiTasks = &ecs.ListTasksOutput{
		TaskArns: []*string{},
	}

	ExampleEcsListServices = &ecs.ListServicesOutput{
		ServiceArns: []*string{
			ExampleServiceArn,
		},
	}

	ExampleEcsListServicesMultiSvc = &ecs.ListServicesOutput{
		ServiceArns: []*string{},
	}

	ExampleEcsDescribeClustersOutput = &ecs.DescribeClustersOutput{
		Clusters: []*ecs.Cluster{
			{
				ClusterArn:                        ExampleEcsClusterArn,
				ClusterName:                       aws.String("example-cluster"),
				Status:                            aws.String("ACTIVE"),
				RegisteredContainerInstancesCount: aws.Int64(0),
				RunningTasksCount:                 aws.Int64(1),
				PendingTasksCount:                 aws.Int64(0),
				ActiveServicesCount:               aws.Int64(1),
				Statistics:                        []*ecs.KeyValuePair{},
				Tags: []*ecs.Tag{
					{
						Key:   aws.String("Key1"),
						Value: aws.String("Value1"),
					},
				},
				Settings: []*ecs.ClusterSetting{
					{
						Name:  aws.String("containerInsights"),
						Value: aws.String("disabled"),
					},
				},
				CapacityProviders:               []*string{},
				DefaultCapacityProviderStrategy: []*ecs.CapacityProviderStrategyItem{},
			},
		},
	}

	ExampleEcsDescribeTasksOutput = &ecs.DescribeTasksOutput{
		Failures: nil,
		Tasks: []*ecs.Task{
			{
				Attachments: []*ecs.Attachment{
					{
						Id:     aws.String("1111-222"),
						Type:   aws.String("ElasticNetworkInterface"),
						Status: aws.String("ATTACHED"),
						Details: []*ecs.KeyValuePair{
							{
								Name:  aws.String("subnetId"),
								Value: aws.String("subnet-111"),
							},
						},
					},
				},
				AvailabilityZone: aws.String("us-west-2b"),
				ClusterArn:       aws.String("arn:aws:ecs:us-west-2:123456789012:cluster/example-cluster"),
				Connectivity:     aws.String("CONNECTED"),
				Containers: []*ecs.Container{
					{
						ContainerArn: aws.String("arn:aws:ecs:us-west-2:123456789012:container/1111"),
						TaskArn:      aws.String("arn:aws:ecs:us-west-2:123456789012:task/2222"),
						Name:         aws.String("example"),
					},
				},
				Cpu:             aws.String("512"),
				DesiredStatus:   aws.String("RUNNING"),
				Group:           aws.String("service:example"),
				PlatformVersion: aws.String("1.3.0"),
				StartedBy:       aws.String("ecs-svc/1111"),
				Tags:            []*ecs.Tag{},
				Version:         aws.Int64(3),
			},
		},
	}

	ExampleEcsDescribeServicesOutput = &ecs.DescribeServicesOutput{
		Services: []*ecs.Service{
			{
				ServiceArn:  aws.String("arn:aws:ecs:us-west-2:123456789012:service/example"),
				ServiceName: aws.String("example"),
				ClusterArn:  aws.String("arn:aws:ecs:us-west-2:123456789012:cluster/example-cluster"),
				LoadBalancers: []*ecs.LoadBalancer{
					{
						TargetGroupArn: aws.String("arn:aws:elasticloadbalancing:us-west-2:123456789012:targetgroup/example/1111"),
						ContainerName:  aws.String("example"),
						ContainerPort:  aws.Int64(80),
					},
				},
				RunningCount: aws.Int64(1),
				PendingCount: aws.Int64(0),
				DeploymentConfiguration: &ecs.DeploymentConfiguration{
					MaximumPercent:        aws.Int64(200),
					MinimumHealthyPercent: aws.Int64(50),
				},
				RoleArn: aws.String("arn:aws:iam::123456789012:role/aws-service-role/ecs.amazonaws.com/AWSServiceRoleForECS"),
				Events: []*ecs.ServiceEvent{
					{
						Id:        aws.String("2222"),
						CreatedAt: aws.Time(time.Unix(1581379785, 0)),
						Message:   aws.String("(service example) has reached a steady state."),
					},
					{
						Id:        aws.String("1111"),
						CreatedAt: aws.Time(time.Unix(1581379764, 0)),
						Message:   aws.String("(service example) has stopped 1 running tasks: (task 1111)."),
					},
				},
				CreatedAt: aws.Time(time.Unix(1579896067, 0)),
			},
		},
	}

	MockEcsForSetup = &MockEcs{}
)

Example ECS API return values

View Source
var (
	ExampleEksClusterName      = aws.String("example-cluster")
	ExampleEksClusterNameMulti = aws.String("example-cluster-multi-profile")
	ExampleEksClusterArn       = aws.String("arn:aws:eks:us-west-2:123456789012:cluster/example-cluster")
	ExampleFargateProfileName  = aws.String("example-fargate-profile")
	ExampleNodegroupName       = aws.String("example-nodegroup-name")
	ExampleNodegroupArn        = aws.String("arn:aws:eks:us-west-2:123456789012:service/example-service")
	ExampleTags                = map[string]*string{*aws.String("test-tag-key"): aws.String("test-tag-value")}
	ExampleLabels              = map[string]*string{*aws.String("test-label-key"): aws.String("test-label-value")}
	ExampleCreatedAt           = aws.Time(time.Unix(1579896067, 0))

	ExampleEksListClusters = &eks.ListClustersOutput{
		Clusters: []*string{
			ExampleEksClusterName,
		},
	}

	ExampleEksListClustersContinue = &eks.ListClustersOutput{
		Clusters: []*string{
			ExampleEksClusterName,
			ExampleEksClusterName,
		},
		NextToken: aws.String("1"),
	}

	ExampleEncryptionProvider = []*eks.Provider{{KeyArn: aws.String("example-encryption-key-provider-arn")}}
	ExampleEncryptionConfig   = []*eks.EncryptionConfig{
		{
			Provider:  ExampleEncryptionProvider[0],
			Resources: []*string{aws.String("example-resource")},
		},
	}

	ExampleLogSetup = []*eks.LogSetup{{
		Enabled: aws.Bool(true),
		Types:   []*string{aws.String("example-type")},
	}}

	ExampleEksNodegroup = [1]*eks.Nodegroup{
		{
			AmiType:     aws.String("example-ami-type"),
			ClusterName: aws.String("example-cluster"),
			CreatedAt:   ExampleCreatedAt,
			DiskSize:    aws.Int64(128),
			Health: &eks.NodegroupHealth{
				Issues: []*eks.Issue{
					{
						Code:        aws.String("AccessDenied"),
						Message:     aws.String("Example Issue Message"),
						ResourceIds: []*string{ExampleEksClusterName},
					},
				},
			},
			InstanceTypes: []*string{aws.String("T2.micro")},
			Labels:        ExampleLabels,
			LaunchTemplate: &eks.LaunchTemplateSpecification{
				Id:      nil,
				Name:    aws.String("example-launch-template-id"),
				Version: aws.String("v1.0"),
			},
			ModifiedAt:     ExampleCreatedAt,
			NodeRole:       aws.String("example-node-role"),
			NodegroupArn:   ExampleNodegroupArn,
			NodegroupName:  ExampleNodegroupName,
			ReleaseVersion: aws.String("v1.0"),
			Status:         aws.String("ACTIVE"),
			Subnets:        []*string{aws.String("a"), aws.String("b")},
			Tags:           ExampleTags,
			Version:        aws.String("v1.0"),
		},
	}

	ExampleEksFargateProfile = [1]*eks.FargateProfile{
		{
			ClusterName: aws.String("example-cluster"),
			CreatedAt:   ExampleCreatedAt,
			FargateProfileArn: aws.String("arn:aws:eks:us-west-2:012345678910:fargateprofile/fargate/" +
				"default-with-infrastructure-label/06b7453e-ef9a-82fc-f0c3-736633e31d41"),
			FargateProfileName:  aws.String("example-fargate-profile-name"),
			PodExecutionRoleArn: aws.String("arn:aws:iam::012345678910:role/AmazonEKSPodExecutionRole"),
			Selectors:           []*eks.FargateProfileSelector{},
			Status:              aws.String("ACTIVE"),
			Subnets:             []*string{aws.String("a"), aws.String("b")},
			Tags:                ExampleTags,
		},
	}

	ExampleListFargateProfile = &eks.ListFargateProfilesOutput{
		FargateProfileNames: []*string{
			ExampleFargateProfileName,
		},
	}

	ExampleListFargateProfilesMulti = &eks.ListFargateProfilesOutput{
		FargateProfileNames: []*string{
			ExampleFargateProfileName,
			ExampleFargateProfileName,
		},
	}

	ExampleListNodegroups = &eks.ListNodegroupsOutput{
		Nodegroups: []*string{
			ExampleNodegroupName,
			ExampleNodegroupName,
		},
	}

	ExampleEksDescribeClusterOutput = &eks.DescribeClusterOutput{
		Cluster: &eks.Cluster{
			Arn:                  ExampleEksClusterArn,
			CertificateAuthority: &eks.Certificate{Data: aws.String("example-certificate-data")},
			ClientRequestToken:   aws.String("example-client-request-token"),
			CreatedAt:            ExampleCreatedAt,
			EncryptionConfig:     ExampleEncryptionConfig,
			Endpoint:             aws.String("example-endpoint"),
			Identity:             &eks.Identity{Oidc: &eks.OIDC{Issuer: aws.String("example-oidc-issuer")}},
			Logging:              &eks.Logging{ClusterLogging: ExampleLogSetup},
			Name:                 ExampleEksClusterName,
			PlatformVersion:      aws.String("example-cluster-platform-version"),
			ResourcesVpcConfig: &eks.VpcConfigResponse{
				ClusterSecurityGroupId: aws.String("example-cluster-security-group-id"),
				EndpointPrivateAccess:  aws.Bool(true),
				EndpointPublicAccess:   aws.Bool(true),
				PublicAccessCidrs:      []*string{aws.String("10.0.0.0/24")},
				SecurityGroupIds:       []*string{aws.String("sg-0123456789")},
				SubnetIds:              []*string{aws.String("subnet-0123456789")},
				VpcId:                  aws.String("vpc-0123456789"),
			},
			RoleArn: aws.String("arn:aws:iam::012345678910:role/EksServiceRole"),
			Status:  aws.String("CREATING"),
			Tags:    ExampleTags,
			Version: aws.String("v1.0.0"),
		},
	}

	ExampleEksDescribeNodegroupOutput      = &eks.DescribeNodegroupOutput{Nodegroup: ExampleEksNodegroup[0]}
	ExampleEksDescribeFargateProfileOutput = &eks.DescribeFargateProfileOutput{FargateProfile: ExampleEksFargateProfile[0]}

	MockEksForSetup = &MockEks{}
)

Example Eks API return values

View Source
var (
	ExampleDescribeLoadBalancersOutput = &elbv2.DescribeLoadBalancersOutput{
		LoadBalancers: []*elbv2.LoadBalancer{
			{
				LoadBalancerArn:       aws.String("arn:aws:elasticloadbalancing:us-west-2:111111111111:loadbalancer/app/panther-test/aaaaaaaaaaaaa"),
				DNSName:               aws.String("internal-panther-test-123456789.us-west-2.elb.amazonaws.com"),
				CanonicalHostedZoneId: aws.String("AAAAA123"),
				CreatedTime:           &ExampleTime,
				LoadBalancerName:      aws.String("panther-test"),
				Scheme:                aws.String("internal"),
				VpcId:                 aws.String("vpc-aaaa66666"),
				State: &elbv2.LoadBalancerState{
					Code: aws.String("active"),
				},
				Type: aws.String("application"),
				AvailabilityZones: []*elbv2.AvailabilityZone{
					{
						ZoneName: aws.String("us-west-2c"),
						SubnetId: aws.String("subnet-1234eee"),
					},
					{
						ZoneName: aws.String("us-west-2d"),
						SubnetId: aws.String("subnet-1234fff"),
					},
				},
				SecurityGroups: []*string{
					aws.String("sg-1234asdf"),
				},
				IpAddressType: aws.String("ipv4"),
			},
		},
	}
	ExampleDescribeNetworkLoadBalancersOutput = &elbv2.DescribeLoadBalancersOutput{
		LoadBalancers: []*elbv2.LoadBalancer{
			{
				LoadBalancerArn:       aws.String("arn:aws:elasticloadbalancing:us-west-2:222222222222:loadbalancer/app/panther-test/bbbbbbbbbbbb"),
				DNSName:               aws.String("internal-panther-test-987654321.us-west-2.elb.amazonaws.com"),
				CanonicalHostedZoneId: aws.String("BBBB123"),
				CreatedTime:           &ExampleTime,
				LoadBalancerName:      aws.String("panther-test"),
				Scheme:                aws.String("internal"),
				VpcId:                 aws.String("vpc-bbbb66666"),
				State: &elbv2.LoadBalancerState{
					Code: aws.String("active"),
				},
				Type: aws.String("network"),
				AvailabilityZones: []*elbv2.AvailabilityZone{
					{
						ZoneName: aws.String("us-west-2c"),
						SubnetId: aws.String("subnet-1234eee"),
					},
					{
						ZoneName: aws.String("us-west-2d"),
						SubnetId: aws.String("subnet-1234fff"),
					},
				},
				SecurityGroups: []*string{
					aws.String("sg-1234asdf"),
				},
				IpAddressType: aws.String("ipv4"),
			},
		},
	}
	ExampleDescribeLoadBalancersOutputContinue = &elbv2.DescribeLoadBalancersOutput{
		LoadBalancers: []*elbv2.LoadBalancer{
			ExampleDescribeLoadBalancersOutput.LoadBalancers[0],
			ExampleDescribeLoadBalancersOutput.LoadBalancers[0],
		},
		NextMarker: aws.String("1"),
	}

	ExampleDescribeTags = &elbv2.DescribeTagsOutput{
		TagDescriptions: []*elbv2.TagDescription{
			{
				ResourceArn: ExampleDescribeLoadBalancersOutput.LoadBalancers[0].LoadBalancerArn,
				Tags: []*elbv2.Tag{
					{
						Key:   aws.String("KeyName1"),
						Value: aws.String("Value1"),
					},
				},
			},
		},
	}

	ExampleDescribeSSLPolicies = &elbv2.DescribeSSLPoliciesOutput{
		SslPolicies: []*elbv2.SslPolicy{
			{
				SslProtocols: []*string{
					aws.String("TLSv1"),
				},
				Ciphers: []*elbv2.Cipher{
					{
						Name:     aws.String("ECDHE"),
						Priority: aws.Int64(1),
					},
				},
				Name: aws.String("ELBSecurityPolicy1"),
			},
		},
	}

	ExampleDescribeListeners = &elbv2.DescribeListenersOutput{
		Listeners: []*elbv2.Listener{
			{
				ListenerArn:     aws.String("arn:aws:elasticloadbalancing:us-west-2:123456789012:listener/app/load-balancer-listener/123/abc"),
				LoadBalancerArn: aws.String("arn:aws:elasticloadbalancing:us-west-2:123456789012:loadbalancer/app/load-balancer/123"),
				Port:            aws.Int64(443),
				Protocol:        aws.String("HTTPS"),
				Certificates: []*elbv2.Certificate{
					{
						CertificateArn: aws.String("arn:aws:acm:us-west-2:123456789012:certificate/abc123"),
					},
				},
				SslPolicy: aws.String("ELBSecurityPolicy1"),
				DefaultActions: []*elbv2.Action{
					{
						Type:           aws.String("forward"),
						TargetGroupArn: aws.String("arn:aws:elasticloadbalancing:us-west-2:123456789012:targetgroup/routing-group/123abc"),
					},
				},
			},
		},
	}

	MockElbv2ForSetup = &MockElbv2{}
)

Example ELBV2 API return values

View Source
var (
	ExampleDetectorID = aws.String("12a12345b12345c12ab12a1a1ab1a1ab1")

	ExampleListDetectorsOutput = &guardduty.ListDetectorsOutput{
		DetectorIds: []*string{
			ExampleDetectorID,
		},
	}

	ExampleGetMasterAccountOutput = &guardduty.GetMasterAccountOutput{
		Master: &guardduty.Master{
			AccountId:          aws.String("99a12345b12345c12ab12a1a1ab1a1ab1"),
			InvitationId:       aws.String("11111111111111"),
			InvitedAt:          aws.String("2019"),
			RelationshipStatus: aws.String("active"),
		},
	}

	ExampleGetDetector = &guardduty.GetDetectorOutput{
		CreatedAt:                  aws.String("2019-01-01T00:00:00.000Z"),
		FindingPublishingFrequency: aws.String("SIX_HOURS"),
		ServiceRole:                aws.String("arn:aws:iam::123456789012:role/aws-service-role/guardduty.amazonaws.com/AWSServiceRoleForAmazonGuardDuty"),
		Status:                     aws.String("ENABLED"),
		UpdatedAt:                  aws.String("2019-01-01T00:00:00.000Z"),
		Tags: map[string]*string{
			"KeyName1": aws.String("Value1"),
		},
	}

	MockGuardDutyForSetup = &MockGuardDuty{}
)

Example GuardDuty API return values

View Source
var (
	ExamplePasswordPolicy = &iam.PasswordPolicy{
		AllowUsersToChangePassword: aws.Bool(true),
		ExpirePasswords:            aws.Bool(true),
		HardExpiry:                 aws.Bool(false),
		MaxPasswordAge:             aws.Int64(80),
		MinimumPasswordLength:      aws.Int64(12),
		PasswordReusePrevention:    aws.Int64(10),
		RequireLowercaseCharacters: aws.Bool(true),
		RequireNumbers:             aws.Bool(true),
		RequireSymbols:             aws.Bool(true),
		RequireUppercaseCharacters: aws.Bool(true),
	}

	ExamplePasswordPolicyOutput = &iam.GetAccountPasswordPolicyOutput{
		PasswordPolicy: ExamplePasswordPolicy,
	}

	ExampleCredentialReport = &iam.GetCredentialReportOutput{
		Content:       []byte("user,arn,user_creation_time,password_enabled,password_last_used,password_last_changed,password_next_rotation,mfa_active,access_key_1_active,access_key_1_last_rotated,access_key_1_last_used_date,access_key_1_last_used_region,access_key_1_last_used_service,access_key_2_active,access_key_2_last_rotated,access_key_2_last_used_date,access_key_2_last_used_region,access_key_2_last_used_service,cert_1_active,cert_1_last_rotated,cert_2_active,cert_2_last_rotated\nFranklin,arn:aws:iam::123456789012:user/Franklin,2019-04-01T23:51:37+00:00,not_supported,2019-04-02T17:16:30+00:00,not_supported,not_supported,false,false,N/A,N/A,N/A,N/A,false,N/A,N/A,N/A,N/A,false,N/A,false,N/A\n<root_account>,arn:aws:iam::123456789012:root,2019-04-02T17:16:30+00:00,not_supported,2019-04-02T17:16:30+00:00,not_supported,not_supported,false,false,N/A,N/A,N/A,N/A,false,N/A,N/A,N/A,N/A,false,N/A,false,N/A\nunit_test_user,arn:aws:iam::123456789012:user/unit_test_user,2018-12-18T23:44:51+00:00,TRUE,2019-05-30T15:40:58+00:00,2019-04-03T15:16:13+00:00,2019-07-02T15:16:13+00:00,TRUE,TRUE,2019-05-29T23:36:39+00:00,2019-05-30T20:14:00+00:00,us-east-1,sts,FALSE,2019-04-02T20:45:11+00:00,2019-05-29T20:33:00+00:00,us-east-1,sts,FALSE,N/A,FALSE,N/A"),
		GeneratedTime: &ExampleTime,
		ReportFormat:  aws.String("text/csv"),
	}

	ExampleExtractedCredentialReport = map[string]*awsmodels.IAMCredentialReport{
		"<root_account>": {
			UserName:                  aws.String("<root_account>"),
			ARN:                       aws.String("arn:aws:iam::123456789012:root"),
			UserCreationTime:          aws.Time(utils.ParseTimeRFC3339("2019-04-02T17:16:30+00:00")),
			PasswordEnabled:           aws.Bool(false),
			PasswordLastUsed:          aws.Time(utils.ParseTimeRFC3339("2019-04-02T17:16:30+00:00")),
			PasswordLastChanged:       aws.Time(time.Time{}),
			PasswordNextRotation:      aws.Time(time.Time{}),
			MfaActive:                 aws.Bool(false),
			AccessKey1Active:          aws.Bool(false),
			AccessKey1LastRotated:     aws.Time(time.Time{}),
			AccessKey1LastUsedDate:    aws.Time(time.Time{}),
			AccessKey1LastUsedRegion:  aws.String("N/A"),
			AccessKey1LastUsedService: aws.String("N/A"),
			AccessKey2Active:          aws.Bool(false),
			AccessKey2LastRotated:     aws.Time(time.Time{}),
			AccessKey2LastUsedDate:    aws.Time(time.Time{}),
			AccessKey2LastUsedRegion:  aws.String("N/A"),
			AccessKey2LastUsedService: aws.String("N/A"),
			Cert1Active:               aws.Bool(false),
			Cert1LastRotated:          aws.Time(time.Time{}),
			Cert2Active:               aws.Bool(false),
			Cert2LastRotated:          aws.Time(time.Time{}),
		},
		"Franklin": {
			UserName:                  aws.String("Franklin"),
			ARN:                       aws.String("arn:aws:iam::123456789012:user/Franklin"),
			UserCreationTime:          aws.Time(utils.ParseTimeRFC3339("2019-04-01T23:51:37+00:00")),
			PasswordEnabled:           aws.Bool(false),
			PasswordLastUsed:          aws.Time(utils.ParseTimeRFC3339("2019-04-02T17:16:30+00:00")),
			PasswordLastChanged:       aws.Time(time.Time{}),
			PasswordNextRotation:      aws.Time(time.Time{}),
			MfaActive:                 aws.Bool(false),
			AccessKey1Active:          aws.Bool(false),
			AccessKey1LastRotated:     aws.Time(time.Time{}),
			AccessKey1LastUsedDate:    aws.Time(time.Time{}),
			AccessKey1LastUsedRegion:  aws.String("N/A"),
			AccessKey1LastUsedService: aws.String("N/A"),
			AccessKey2Active:          aws.Bool(false),
			AccessKey2LastRotated:     aws.Time(time.Time{}),
			AccessKey2LastUsedDate:    aws.Time(time.Time{}),
			AccessKey2LastUsedRegion:  aws.String("N/A"),
			AccessKey2LastUsedService: aws.String("N/A"),
			Cert1Active:               aws.Bool(false),
			Cert1LastRotated:          aws.Time(time.Time{}),
			Cert2Active:               aws.Bool(false),
			Cert2LastRotated:          aws.Time(time.Time{}),
		},
		"unit_test_user": {
			UserName:                  aws.String("unit_test_user"),
			ARN:                       aws.String("arn:aws:iam::123456789012:user/unit_test_user"),
			UserCreationTime:          aws.Time(utils.ParseTimeRFC3339("2018-12-18T23:44:51+00:00")),
			PasswordEnabled:           aws.Bool(true),
			PasswordLastUsed:          aws.Time(utils.ParseTimeRFC3339("2019-05-30T15:40:58+00:00")),
			PasswordLastChanged:       aws.Time(utils.ParseTimeRFC3339("2019-04-03T15:16:13+00:00")),
			PasswordNextRotation:      aws.Time(utils.ParseTimeRFC3339("2019-07-02T15:16:13+00:00")),
			MfaActive:                 aws.Bool(true),
			AccessKey1Active:          aws.Bool(true),
			AccessKey1LastRotated:     aws.Time(utils.ParseTimeRFC3339("2019-05-29T23:36:39+00:00")),
			AccessKey1LastUsedDate:    aws.Time(utils.ParseTimeRFC3339("2019-05-30T20:14:00+00:00")),
			AccessKey1LastUsedRegion:  aws.String("us-east-1"),
			AccessKey1LastUsedService: aws.String("sts"),
			AccessKey2Active:          aws.Bool(false),
			AccessKey2LastRotated:     aws.Time(utils.ParseTimeRFC3339("2019-04-02T20:45:11+00:00")),
			AccessKey2LastUsedDate:    aws.Time(utils.ParseTimeRFC3339("2019-05-29T20:33:00+00:00")),
			AccessKey2LastUsedRegion:  aws.String("us-east-1"),
			AccessKey2LastUsedService: aws.String("sts"),
			Cert1Active:               aws.Bool(false),
			Cert1LastRotated:          aws.Time(time.Time{}),
			Cert2Active:               aws.Bool(false),
			Cert2LastRotated:          aws.Time(time.Time{}),
		},
	}

	ExampleGenerateCredentialReport = &iam.GenerateCredentialReportOutput{
		Description: aws.String("Ok alright"),
		State:       aws.String("COMPLETE"),
	}

	ExampleGenerateCredentialReportProg = &iam.GenerateCredentialReportOutput{
		Description: aws.String("Not ok Not alright"),
		State:       aws.String("INPROGRESS"),
	}

	GenerateCredentialReportInProgress = false

	ExampleListUsers = &iam.ListUsersOutput{
		IsTruncated: aws.Bool(false),
		Users: []*iam.User{
			{
				Arn:        aws.String("arn:aws:iam::123456789012:user/unit_test_user"),
				CreateDate: &ExampleTime,
				Path:       aws.String("/service_accounts/"),
				UserId:     aws.String("AAAAAAAQQQQQO2HVVVVVV"),
				UserName:   aws.String("unit_test_user"),
			},
			{
				Arn:        aws.String("arn:aws:iam::123456789012:user/Franklin"),
				CreateDate: &ExampleTime,
				Path:       aws.String("/"),
				UserId:     aws.String("AIDA4PIQ2YYOO2HYP2JNV"),
				UserName:   aws.String("Franklin"),
			},
		},
	}

	ExampleListUsersContinue = &iam.ListUsersOutput{
		Users:  ExampleListUsers.Users,
		Marker: aws.String("1"),
	}

	ExampleGetUsers = map[string]*iam.GetUserOutput{
		*ExampleListUsers.Users[0].UserName: {User: ExampleListUsers.Users[0]},
		*ExampleListUsers.Users[1].UserName: {User: ExampleListUsers.Users[1]},
	}

	ExampleListGroupsForUserOutput = &iam.ListGroupsForUserOutput{
		Groups: []*iam.Group{
			ExampleGroup,
		},
	}

	ExampleGetUserPolicy = &iam.GetUserPolicyOutput{
		UserName:       aws.String("Franklin"),
		PolicyName:     aws.String("KinesisWriteOnly"),
		PolicyDocument: aws.String("JSON POLICY DOCUMENT"),
	}

	ExampleListVirtualMFADevices = &iam.ListVirtualMFADevicesOutput{
		IsTruncated: aws.Bool(false),
		VirtualMFADevices: []*iam.VirtualMFADevice{
			{
				SerialNumber: aws.String("arn:aws:iam::123456789012:mfa/root-account-mfa-device"),
				EnableDate:   &ExampleTime,
				User: &iam.User{
					Arn:        aws.String("arn:aws:iam::123456789012:root"),
					CreateDate: &ExampleTime,
					Path:       aws.String("/"),
					UserId:     aws.String("123456789012"),
					UserName:   aws.String(""),
				},
			},
			{
				SerialNumber: aws.String("arn:aws:iam::123456789012:mfa/unit_test_user"),
				EnableDate:   &ExampleTime,
				User: &iam.User{
					Arn:        aws.String("arn:aws:iam::123456789012:user/unit_test_user"),
					CreateDate: &ExampleTime,
					Path:       aws.String("/service_accounts/"),
					UserId:     aws.String("AAAAAAAQQQQQO2HVVVVVV"),
					UserName:   aws.String("service_accounts"),
				},
			},
		},
	}

	ExampleListUserPolicies = &iam.ListUserPoliciesOutput{
		PolicyNames: []*string{
			aws.String("KinesisWriteOnly"),
			aws.String("SQSCreateQueue"),
		},
	}

	ExampleListAttachedUserPolicies = &iam.ListAttachedUserPoliciesOutput{
		AttachedPolicies: []*iam.AttachedPolicy{
			{
				PolicyName: aws.String("ForceMFA"),
			},
			{
				PolicyName: aws.String("IAMAdministrator"),
			},
		},
	}

	ExampleGroup = &iam.Group{
		CreateDate: &ExampleTime,
		GroupId:    aws.String("1234"),
		GroupName:  aws.String("example-group"),
		Path:       aws.String("/"),
		Arn:        aws.String("arn:aws:iam::123456789012:group/example-group"),
	}

	ExampleListGroupsOutput = &iam.ListGroupsOutput{
		Groups: []*iam.Group{
			ExampleGroup,
		},
	}

	ExampleListGroupsOutputContinue = &iam.ListGroupsOutput{
		Groups: []*iam.Group{
			ExampleGroup,
			ExampleGroup,
		},
		Marker: aws.String("1"),
	}

	ExampleGetGroupOutput = &iam.GetGroupOutput{
		Group: ExampleGroup,
		Users: []*iam.User{
			{
				UserName: aws.String("Bob"),
				UserId:   aws.String("111222333444"),
			},
		},
	}

	ExampleListGroupPolicies = &iam.ListGroupPoliciesOutput{
		PolicyNames: []*string{
			aws.String("GroupPolicy1"),
			aws.String("GroupPolicy2"),
		},
	}

	ExampleGetGroupPolicy = &iam.GetGroupPolicyOutput{
		GroupName:      aws.String("TestGroup"),
		PolicyName:     aws.String("TestPolicyName"),
		PolicyDocument: aws.String("JSON POLICY DOCUMENT"),
	}

	ExampleListAttachedGroupPolicies = &iam.ListAttachedGroupPoliciesOutput{
		AttachedPolicies: []*iam.AttachedPolicy{
			{
				PolicyName: aws.String("AttachedGroupPolicy1"),
				PolicyArn:  aws.String("arn:aws:iam::123456789012:group/example-group/policy"),
			},
		},
	}

	ExampleListPolicies = &iam.ListPoliciesOutput{
		Policies: []*iam.Policy{
			{
				Arn:                           aws.String("arn:aws:iam::aws:policy/aws-service-role/AWSSupportServiceRolePolicy"),
				AttachmentCount:               aws.Int64(1),
				CreateDate:                    &ExampleTime,
				DefaultVersionId:              aws.String("v4"),
				IsAttachable:                  aws.Bool(false),
				Path:                          aws.String("/aws-service-role/"),
				PermissionsBoundaryUsageCount: aws.Int64(0),
				PolicyId:                      aws.String("ANPAJ7W6266ELXF5MISDS"),
				PolicyName:                    aws.String("AWSSupportServiceRolePolicy"),
				UpdateDate:                    &ExampleTime,
			},
		},
	}
	ExampleListPoliciesContinue = &iam.ListPoliciesOutput{
		Policies: []*iam.Policy{
			ExampleListPolicies.Policies[0],
			ExampleListPolicies.Policies[0],
		},
		Marker: aws.String("1"),
	}

	ExamplePolicyDocumentEncoded = aws.String(url.QueryEscape(
		`{”PolicyVersion”: {”Document”: {”Version”: ”2012-10-17”,”Statement”: [{”Action"": [”appstream:Get*”,”appstream:List*”,“appstream:Describe*”],“Effect”: ”Allow”,”Resource”: ”*”}]},”VersionId”: ”v2”,”IsDefaultVersion”: true,“CreateDate”: ”2016-12-07T21:00:06Z”}}`))
	ExamplePolicyDocumentDecoded = aws.String(
		`{”PolicyVersion”: {”Document”: {”Version”: ”2012-10-17”,”Statement”: [{”Action"": [”appstream:Get*”,”appstream:List*”,“appstream:Describe*”],“Effect”: ”Allow”,”Resource”: ”*”}]},”VersionId”: ”v2”,”IsDefaultVersion”: true,“CreateDate”: ”2016-12-07T21:00:06Z”}}`)

	ExamplePolicyVersionOutput = &iam.GetPolicyVersionOutput{
		PolicyVersion: &iam.PolicyVersion{
			Document:         ExamplePolicyDocumentEncoded,
			IsDefaultVersion: aws.Bool(true),
			VersionId:        aws.String("v2"),
		},
	}

	ExampleListEntitiesForPolicy = &iam.ListEntitiesForPolicyOutput{
		PolicyRoles: []*iam.PolicyRole{
			{
				RoleId:   aws.String("AROA4PIQ2YYOH6ORE5WWX"),
				RoleName: aws.String("AWSServiceRoleForSupport"),
			},
		},
		PolicyGroups: []*iam.PolicyGroup{},
		PolicyUsers:  []*iam.PolicyUser{},
	}

	ExampleRoleID  = aws.String("AAABBB123456BBBAAA")
	ExampleIAMRole = &iam.Role{
		Path:       aws.String("/"),
		RoleName:   aws.String("test-role"),
		RoleId:     ExampleRoleID,
		Arn:        aws.String("arn:aws:iam::123456789012:role/test-role"),
		CreateDate: &ExampleTime,
		AssumeRolePolicyDocument: aws.String("" +
			"Version: \"2012-10-17, " +
			"Statement: [" +
			"{" +
			"\"Effect\": \"Allow\"," +
			"\"Principal\": {" +
			"\"AWS\": [\"arn:aws:iam::123456789012:user/Franklin\"," +
			"]" +
			"}," +
			"\"Action\": \"sts:AssumeRole\"" +
			"}" +
			"]",
		),
		Description:        aws.String("This is a test role."),
		MaxSessionDuration: aws.Int64(3600),
	}

	ExampleListRolesOutput = &iam.ListRolesOutput{
		Roles: []*iam.Role{
			ExampleIAMRole,
		},
	}

	ExampleListRolesOutputContinue = &iam.ListRolesOutput{
		Roles: []*iam.Role{
			ExampleIAMRole,
			ExampleIAMRole,
		},
		Marker: aws.String("1"),
	}

	ExampleGetRoles = map[string]*iam.GetRoleOutput{
		*ExampleListRolesOutput.Roles[0].RoleName: {Role: ExampleListRolesOutput.Roles[0]},
	}

	ExampleListRolePoliciesOutput = &iam.ListRolePoliciesOutput{
		PolicyNames: []*string{
			aws.String("KinesisWriteOnly"),
			aws.String("SQSCreateQueue"),
		},
	}

	ExampleListAttachedRolePoliciesOutput = &iam.ListAttachedRolePoliciesOutput{
		AttachedPolicies: []*iam.AttachedPolicy{
			{
				PolicyArn:  aws.String("arn:aws:iam::aws:policy/AdministratorAccess"),
				PolicyName: aws.String("AdministratorAccess"),
			},
		},
	}

	ExampleGetRolePolicy = &iam.GetRolePolicyOutput{
		RoleName:       aws.String("ExampleRole"),
		PolicyName:     aws.String("PolicyName"),
		PolicyDocument: aws.String("JSON POLICY DOCUMENT"),
	}

	MockIAMForSetup = &MockIAM{}
)
View Source
var (
	ExampleKeyId = aws.String("188c57ed-b28a-4c0e-9821-f4940d15cb0a")

	ExampleListKeysOutput = &kms.ListKeysOutput{
		Keys: []*kms.KeyListEntry{
			{
				KeyArn: aws.String("arn:aws:kms:us-west-2:111111111111:key/188c57ed-b28a-4c0e-9821-f4940d15cb0a"),
				KeyId:  aws.String("188c57ed-b28a-4c0e-9821-f4940d15cb0a"),
			},
			{
				KeyArn: aws.String("arn:aws:kms:us-west-2:111111111111:key/d15a1e37-3ef7-4882-9be5-ef3a024114db"),
				KeyId:  aws.String("d15a1e37-3ef7-4882-9be5-ef3a024114db"),
			},
		},
	}

	ExampleListKeysOutputContinue = &kms.ListKeysOutput{
		Keys: []*kms.KeyListEntry{
			{
				KeyArn: aws.String("arn:aws:kms:us-west-2:111111111111:key/188c57ed-b28a-4c0e-9821-f4940d15cb0a"),
				KeyId:  aws.String("188c57ed-b28a-4c0e-9821-f4940d15cb0a"),
			},
			{
				KeyArn: aws.String("arn:aws:kms:us-west-2:111111111111:key/d15a1e37-3ef7-4882-9be5-ef3a024114db"),
				KeyId:  aws.String("d15a1e37-3ef7-4882-9be5-ef3a024114db"),
			},
		},
		NextMarker: aws.String("1"),
	}

	ExampleGetKeyRotationStatusOutput = &kms.GetKeyRotationStatusOutput{
		KeyRotationEnabled: aws.Bool(true),
	}

	ExampleDescribeKeyOutput = &kms.DescribeKeyOutput{
		KeyMetadata: &kms.KeyMetadata{
			AWSAccountId: aws.String("111111111111"),
			Arn:          aws.String("arn:aws:kms:us-west-2:111111111111:key/188c57ed-b28a-4c0e-9821-f4940d15cb0a"),
			CreationDate: &ExampleTime,
			Description:  aws.String("Encryption key for panther-snapshot-queue data"),
			Enabled:      aws.Bool(true),
			KeyId:        aws.String("188c57ed-b28a-4c0e-9821-f4940d15cb0a"),
			KeyManager:   aws.String("CUSTOMER"),
			KeyState:     aws.String("Enabled"),
			KeyUsage:     aws.String("ENCRYPT_DECRYPT"),
			Origin:       aws.String("AWS_KMS"),
		},
	}

	ExampleDescribeKeyOutputAWSManaged = &kms.DescribeKeyOutput{
		KeyMetadata: &kms.KeyMetadata{
			AWSAccountId: aws.String("123456789012"),
			Arn:          aws.String("arn:aws:kms:us-west-2:111111111111:key/188c57ed-b28a-4c0e-9821-f4940d15cb0a"),
			CreationDate: &ExampleTime,
			Description:  aws.String("Default master key"),
			Enabled:      aws.Bool(true),
			KeyId:        aws.String("188c57ed-b28a-4c0e-9821-f4940d15cb0a"),
			KeyManager:   aws.String("AWS"),
			KeyState:     aws.String("Enabled"),
			KeyUsage:     aws.String("ENCRYPT_DECRYPT"),
			Origin:       aws.String("AWS_KMS"),
		},
	}

	ExampleGetKeyPolicyOutput = &kms.GetKeyPolicyOutput{
		Policy: aws.String("{\n  \"Version\" : \"2012-10-17\",\n  \"Id\" : \"auto-awslambda\",\n  \"Statement\" : [ {\n    \"Sid\" : \"Allow access through AWS Lambda for all principals in the account that are authorized to use AWS Lambda\",\n    \"Effect\" : \"Allow\",\n    \"Principal\" : {\n      \"AWS\" : \"*\"\n    },\n    \"Action\" : [ \"kms:Encrypt\", \"kms:Decrypt\", \"kms:ReEncrypt*\", \"kms:GenerateDataKey*\", \"kms:CreateGrant\", \"kms:DescribeKey\" ],\n    \"Resource\" : \"*\",\n    \"Condition\" : {\n      \"StringEquals\" : {\n        \"kms:CallerAccount\" : \"111111111111\",\n        \"kms:ViaService\" : \"lambda.us-west-2.amazonaws.com\"\n      }\n    }\n  }, {\n    \"Sid\" : \"Allow direct access to key metadata to the account\",\n    \"Effect\" : \"Allow\",\n    \"Principal\" : {\n      \"AWS\" : \"arn:aws:iam::111111111111:root\"\n    },\n    \"Action\" : \"kms:Describe*\",\n    \"Resource\" : \"*\"\n  } ]\n}"),
	}

	ExampleListResourceTags = &kms.ListResourceTagsOutput{
		Tags: []*kms.Tag{
			{
				TagKey:   aws.String("Key1"),
				TagValue: aws.String("Value1"),
			},
		},
	}

	MockKmsForSetup = &MockKms{}
)

Example KMS API return values

View Source
var (
	ExampleFunctionName = aws.String("example-function-name")

	ExampleFunctionConfiguration = &lambda.FunctionConfiguration{
		FunctionName: aws.String("ExampleFunction"),
		FunctionArn:  aws.String("arn:aws:lambda:us-west-2:123456789012:function:ExampleFunction"),
		Runtime:      aws.String("python3.7"),
		Role:         aws.String("arn:aws:iam::123456789012:role/service-role/ExampleFunction-role-abcdefg"),
		Handler:      aws.String("lambda_function.lambda_handler"),
		CodeSize:     aws.Int64(500),
		Description:  aws.String("This is an example Lambda function"),
		Timeout:      aws.Int64(3),
		MemorySize:   aws.Int64(128),
		LastModified: aws.String("2019-01-01T00:00:00.000+0000"),
		CodeSha256:   aws.String("abcdefghjikl/asdfasdfasdf="),
		Version:      aws.String("$LATEST"),
		TracingConfig: &lambda.TracingConfigResponse{
			Mode: aws.String("PassThrough"),
		},
		RevisionId: aws.String("abcdefg-1234-1234-abcde-1234567890"),
	}

	ExampleListFunctions = &lambda.ListFunctionsOutput{
		Functions: []*lambda.FunctionConfiguration{
			ExampleFunctionConfiguration,
		},
	}

	ExampleListFunctionsContinue = &lambda.ListFunctionsOutput{
		Functions: []*lambda.FunctionConfiguration{
			ExampleFunctionConfiguration,
			ExampleFunctionConfiguration,
		},
		NextMarker: aws.String("1"),
	}

	ExampleListTagsLambda = &lambda.ListTagsOutput{
		Tags: map[string]*string{
			"Application":                   aws.String("Panther"),
			"aws:cloudformation:logical-id": aws.String("LambdaFunction"),
			"aws:cloudformation:stack-id":   aws.String("arn:aws:cloudformation:us-west-2:123456789012:stack/example-function/1234abcdef"),
			"lambda:createdBy":              aws.String("SAM"),
		},
	}

	ExampleGetPolicy = &lambda.GetPolicyOutput{
		Policy:     aws.String("{\"Policy\": \"{\"Version\":\"2012-10-17\",\"Id\":\"default\",\"Statement\":[{\"Sid\":\"sns\",\"Effect\":\"Allow\",\"Principal\":{\"Service\":\"sns.amazonaws.com\"},\"Action\":\"lambda:InvokeFunction\",\"Resource\":\"arn:aws:lambda:us-west-2:123456789012:function:ExampleFunction\"}]}"),
		RevisionId: aws.String("abcdefg-1234567890-abcdefg"),
	}

	MockLambdaForSetup = &MockLambda{}
)

Example Lambda API return values

View Source
var (
	ExampleRDSInstanceName = aws.String("example-instance")

	ExampleRDSSnapshotID = aws.String("example-snapshot-id")

	ExampleDescribeDBSnapshotsAttributesOutput = &rds.DescribeDBSnapshotAttributesOutput{
		DBSnapshotAttributesResult: &rds.DBSnapshotAttributesResult{
			DBSnapshotIdentifier: aws.String("test-snapshot-1"),
			DBSnapshotAttributes: []*rds.DBSnapshotAttribute{
				{
					AttributeName: aws.String("restore"),
				},
			},
		},
	}

	ExampleDescribeDBInstancesOutput = &rds.DescribeDBInstancesOutput{
		DBInstances: []*rds.DBInstance{
			{
				DBInstanceIdentifier: ExampleRDSInstanceName,
				DBInstanceClass:      aws.String("db.t2.micro"),
				Engine:               aws.String("mysql"),
				DBInstanceStatus:     aws.String("available"),
				MasterUsername:       aws.String("superuser"),
				DBName:               aws.String("db_1"),
				Endpoint: &rds.Endpoint{
					Address:      aws.String("example-instance.1111.us-west-2.rds.amazonaws.com"),
					Port:         aws.Int64(3306),
					HostedZoneId: aws.String("ABCDE1234"),
				},
				AllocatedStorage:      aws.Int64(20),
				InstanceCreateTime:    &ExampleTime,
				PreferredBackupWindow: aws.String("07:31-08:01"),
				BackupRetentionPeriod: aws.Int64(7),
				VpcSecurityGroups: []*rds.VpcSecurityGroupMembership{
					{
						VpcSecurityGroupId: aws.String("sg-123456789"),
						Status:             aws.String("active"),
					},
				},
				DBParameterGroups: []*rds.DBParameterGroupStatus{
					{
						DBParameterGroupName: aws.String("default.mysql5.7"),
						ParameterApplyStatus: aws.String("in-sync"),
					},
				},
				AvailabilityZone: aws.String("us-west-2a"),
				DBSubnetGroup: &rds.DBSubnetGroup{
					DBSubnetGroupName:        aws.String("default"),
					DBSubnetGroupDescription: aws.String("default"),
					VpcId:                    aws.String("vpc-asdfasdf"),
					SubnetGroupStatus:        aws.String("Complete"),
					Subnets: []*rds.Subnet{
						{
							SubnetIdentifier: aws.String("subnet-asdfasdfasdf"),
							SubnetAvailabilityZone: &rds.AvailabilityZone{
								Name: aws.String("us-west-2d"),
							},
							SubnetStatus: aws.String("Active"),
						},
						{
							SubnetIdentifier: aws.String("subnet-1234567"),
							SubnetAvailabilityZone: &rds.AvailabilityZone{
								Name: aws.String("us-west-2c"),
							},
							SubnetStatus: aws.String("Active"),
						},
						{
							SubnetIdentifier: aws.String("subnet-asdfasdf123"),
							SubnetAvailabilityZone: &rds.AvailabilityZone{
								Name: aws.String("us-west-2a"),
							},
							SubnetStatus: aws.String("Active"),
						},
						{
							SubnetIdentifier: aws.String("subnet-asdfadsf123"),
							SubnetAvailabilityZone: &rds.AvailabilityZone{
								Name: aws.String("us-west-2b"),
							},
							SubnetStatus: aws.String("Active"),
						},
					},
				},
				PreferredMaintenanceWindow: aws.String("thu:12:02-thu:12:32"),
				LatestRestorableTime:       &ExampleTime,
				MultiAZ:                    aws.Bool(false),
				EngineVersion:              aws.String("5.7.22"),
				AutoMinorVersionUpgrade:    aws.Bool(true),
				LicenseModel:               aws.String("general-public-license"),
				OptionGroupMemberships: []*rds.OptionGroupMembership{
					{
						OptionGroupName: aws.String("default:mysql-5-7"),
						Status:          aws.String("in-sync"),
					},
				},
				PubliclyAccessible:               aws.Bool(false),
				StorageType:                      aws.String("gp2"),
				DbInstancePort:                   aws.Int64(0),
				StorageEncrypted:                 aws.Bool(false),
				DbiResourceId:                    aws.String("db-ASDFADLKJ"),
				CACertificateIdentifier:          aws.String("rds-ca-2015"),
				CopyTagsToSnapshot:               aws.Bool(true),
				MonitoringInterval:               aws.Int64(0),
				DBInstanceArn:                    aws.String("arn:aws:rds:us-west-2:123456789012:db:example-instance"),
				IAMDatabaseAuthenticationEnabled: aws.Bool(false),
				PerformanceInsightsEnabled:       aws.Bool(false),
				DeletionProtection:               aws.Bool(true),
			},
		},
	}
	ExampleDescribeDBInstancesOutputContinue = &rds.DescribeDBInstancesOutput{
		DBInstances: []*rds.DBInstance{
			ExampleDescribeDBInstancesOutput.DBInstances[0],
			ExampleDescribeDBInstancesOutput.DBInstances[0],
		},
		Marker: aws.String("1"),
	}

	ExampleDescribeDBSnapshotsOutput = &rds.DescribeDBSnapshotsOutput{
		DBSnapshots: []*rds.DBSnapshot{
			{
				DBSnapshotIdentifier:             aws.String("rds:example-instance-2019-01-01-01-01"),
				DBInstanceIdentifier:             aws.String("example-instance"),
				SnapshotCreateTime:               &ExampleTime,
				Engine:                           aws.String("mysql"),
				AllocatedStorage:                 aws.Int64(20),
				Status:                           aws.String("available"),
				Port:                             aws.Int64(3306),
				AvailabilityZone:                 aws.String("us-west-2a"),
				VpcId:                            aws.String("vpc-asdfasdf"),
				InstanceCreateTime:               &ExampleTime,
				MasterUsername:                   aws.String("superuser"),
				EngineVersion:                    aws.String("5.7.22"),
				LicenseModel:                     aws.String("general-public-license"),
				SnapshotType:                     aws.String("automated"),
				OptionGroupName:                  aws.String("default:mysql-5-7"),
				PercentProgress:                  aws.Int64(100),
				StorageType:                      aws.String("gp2"),
				Encrypted:                        aws.Bool(false),
				DBSnapshotArn:                    aws.String("arn:aws:rds:us-west-2:111111111111:snapshot:rds:example-instance-2019-01-01-01-01"),
				IAMDatabaseAuthenticationEnabled: aws.Bool(false),
				DbiResourceId:                    aws.String("db-asdfasdfasdfasdf"),
			},
		},
	}

	ExampleListTagsForResourceRds = &rds.ListTagsForResourceOutput{
		TagList: []*rds.Tag{
			{
				Key:   aws.String("Key1"),
				Value: aws.String("Value1"),
			},
		},
	}

	MockRdsForSetup = &MockRds{}
)

Example RDS API return values

View Source
var (
	ExampleDescribeClustersOutput = &redshift.DescribeClustersOutput{
		Clusters: []*redshift.Cluster{
			{
				ClusterIdentifier: aws.String("example-cluster"),
				NodeType:          aws.String("dc2.large"),
				ClusterStatus:     aws.String("available"),
				MasterUsername:    aws.String("awsuser"),
				DBName:            aws.String("dev"),
				Endpoint: &redshift.Endpoint{
					Address: aws.String("example-cluster.asdf123.us-west-2.redshift.amazonaws.com"),
					Port:    aws.Int64(5439),
				},
				ClusterCreateTime:                &ExampleTime,
				AutomatedSnapshotRetentionPeriod: aws.Int64(1),
				ManualSnapshotRetentionPeriod:    aws.Int64(-1),
				ClusterParameterGroups: []*redshift.ClusterParameterGroupStatus{
					{
						ParameterGroupName:   aws.String("default.redshift-1.0"),
						ParameterApplyStatus: aws.String("in-sync"),
					},
				},
				ClusterSubnetGroupName:     aws.String("default"),
				VpcId:                      aws.String("vpc-asdfasdf"),
				AvailabilityZone:           aws.String("us-west-2c"),
				PreferredMaintenanceWindow: aws.String("sat:10:30-sat:11:00"),
				ClusterVersion:             aws.String("1.0"),
				AllowVersionUpgrade:        aws.Bool(true),
				NumberOfNodes:              aws.Int64(2),
				PubliclyAccessible:         aws.Bool(true),
				Encrypted:                  aws.Bool(false),
				ClusterPublicKey:           aws.String("ssh-rsa keyhash123 Amazon-Redshift\n"),
				ClusterNodes: []*redshift.ClusterNode{
					{
						NodeRole:         aws.String("LEADER"),
						PrivateIPAddress: aws.String("172.0.0.0"),
						PublicIPAddress:  aws.String("54.0.0.1"),
					},
					{
						NodeRole:         aws.String("COMPUTE-1"),
						PrivateIPAddress: aws.String("172.0.0.1"),
						PublicIPAddress:  aws.String("34.0.0.0"),
					},
				},
				ClusterRevisionNumber:            aws.String("7804"),
				EnhancedVpcRouting:               aws.Bool(false),
				MaintenanceTrackName:             aws.String("current"),
				ElasticResizeNumberOfNodeOptions: aws.String("[4]"),
			},
		},
	}

	ExampleDescribeClustersOutputContinue = &redshift.DescribeClustersOutput{
		Clusters: []*redshift.Cluster{
			ExampleDescribeClustersOutput.Clusters[0],
			ExampleDescribeClustersOutput.Clusters[0],
		},
		Marker: aws.String("1"),
	}

	ExampleLoggingStatus = &redshift.LoggingStatus{
		LoggingEnabled: aws.Bool(false),
	}

	MockRedshiftForSetup = &MockRedshift{}
)

Example RDS API return values

View Source
var (
	ExampleS3Owner = &s3.Owner{
		DisplayName: aws.String("root.user"),
		ID:          aws.String("555555eeeeee41f994e6151b666666f2a69149f2935670e702fa919eaf77777d"),
	}

	ExampleBucketAcl = &s3.GetBucketAclOutput{
		Grants: []*s3.Grant{
			{
				Grantee: &s3.Grantee{
					DisplayName:  aws.String("root.user"),
					EmailAddress: aws.String("root.user@test.io"),
					ID:           aws.String("555555eeeeee41f994e6151b666666f2a69149f2935670e702fa919eaf77777d"),
					Type:         aws.String("CanonicalUser"),
				},
				Permission: aws.String("FULL_CONTROL"),
			},
		},
		Owner: ExampleS3Owner,
	}

	ExampleBucketName = aws.String("random-identifier-us-west-2")

	ExampleBuckets = []*s3.Bucket{
		{
			Name:         aws.String("unit-test-cloudtrail-bucket"),
			CreationDate: &ExampleTime,
		},
	}

	ExampleListBuckets = &s3.ListBucketsOutput{
		Buckets: ExampleBuckets,
		Owner:   ExampleS3Owner,
	}

	ExampleBucketLogging = &s3.GetBucketLoggingOutput{
		LoggingEnabled: &s3.LoggingEnabled{
			TargetBucket: aws.String("random-target-us-west-2"),
			TargetPrefix: aws.String(""),
		},
	}

	ExampleGetBucketEncryptionOutput = &s3.GetBucketEncryptionOutput{
		ServerSideEncryptionConfiguration: &s3.ServerSideEncryptionConfiguration{
			Rules: []*s3.ServerSideEncryptionRule{
				{
					ApplyServerSideEncryptionByDefault: &s3.ServerSideEncryptionByDefault{
						SSEAlgorithm: aws.String("AES256"),
					},
				},
			},
		},
	}

	ExampleGetBucketVersioningOutput = &s3.GetBucketVersioningOutput{
		MFADelete: aws.String("Enabled"),
		Status:    aws.String("Enabled"),
	}

	ExampleGetBucketLocationOutput = &s3.GetBucketLocationOutput{
		LocationConstraint: aws.String("us-west-2"),
	}

	ExampleGetBucketLifecycleConfigurationOutput = &s3.GetBucketLifecycleConfigurationOutput{
		Rules: []*s3.LifecycleRule{
			{
				AbortIncompleteMultipartUpload: &s3.AbortIncompleteMultipartUpload{
					DaysAfterInitiation: aws.Int64(7),
				},
				Expiration: &s3.LifecycleExpiration{
					Days: aws.Int64(180),
				},
				Filter: &s3.LifecycleRuleFilter{
					Prefix: aws.String(""),
				},
				ID:     aws.String("Polling-Testing-Rule"),
				Status: aws.String("Enabled"),
			},
		},
	}

	ExampleBucketPolicy = &s3.GetBucketPolicyOutput{
		Policy: aws.String("{\"Version\":\"2012-10-17\",\"Statement\":[{\"Sid\":\"AWSCloudTrailAclCheck\",\"Effect\":\"Allow\",\"Principal\":{\"Service\":\"cloudtrail.amazonaws.com\"},\"Action\":\"s3:GetBucketAcl\",\"Resource\":\"arn:aws:s3:::cloudtrail-bucket-name\"},{\"Sid\":\"AWSCloudTrailWrite\",\"Effect\":\"Allow\",\"Principal\":{\"Service\":\"cloudtrail.amazonaws.com\"},\"Action\":\"s3:PutObject\",\"Resource\":[\"arn:aws:s3:::cloudtrail-bucket-name/AWSLogs/123456789012/*\"],\"Condition\":{\"StringEquals\":{\"s3:x-amz-acl\":\"bucket-owner-full-control\"}}}]}"),
	}

	ExampleBucketPublicAccessBlockConfig = &s3.GetPublicAccessBlockOutput{
		PublicAccessBlockConfiguration: &s3.PublicAccessBlockConfiguration{
			BlockPublicAcls:       aws.Bool(true),
			BlockPublicPolicy:     aws.Bool(true),
			IgnorePublicAcls:      aws.Bool(true),
			RestrictPublicBuckets: aws.Bool(true),
		},
	}

	ExampleGetBucketTagging = &s3.GetBucketTaggingOutput{
		TagSet: []*s3.Tag{
			{
				Key:   aws.String("Key1"),
				Value: aws.String("Value1"),
			},
		},
	}

	ExampleGetObjectLockConfiguration = &s3.GetObjectLockConfigurationOutput{
		ObjectLockConfiguration: &s3.ObjectLockConfiguration{
			ObjectLockEnabled: aws.String("Enabled"),
		},
	}

	MockS3ForSetup = &MockS3{}
)
View Source
var (
	ExampleTime, _             = time.Parse(time.RFC3339, "2019-04-02T17:16:30+00:00")
	ExampleIntegrationID       = aws.String("8e39aa9d-9823-4872-a1bd-40fd8795634b")
	ExampleAuthSource          = "arn:aws:iam::123456789012:role/PantherAuditRole"
	ExampleAuthSourceParsedARN = ParseExampleAuthSourceARN(ExampleAuthSource)
	ExampleAccountId           = aws.String("123456789012")
	ExampleRegion              = aws.String("us-west-2")
)

Example output from the AWS API

View Source
var (
	PaginateListWebAcls = false

	ExampleListWebAclsOutput = &waf.ListWebACLsOutput{
		WebACLs: []*waf.WebACLSummary{
			{
				Name:     aws.String("example-web-acl-1"),
				WebACLId: aws.String("asdfasdf-f123-e123-g123-1234asdf1234"),
			},
			{
				Name:     aws.String("example-web-acl-2"),
				WebACLId: aws.String("asdfasdf-x123-y123-z123-1234asdf1234"),
			},
		},
		NextMarker: aws.String("asdfasdf-x123-y123-z123-1234asdf1234"),
	}

	ExampleGetWebAclOutput = &waf.GetWebACLOutput{
		WebACL: &waf.WebACL{
			WebACLId:   aws.String("asdfasdf-f123-e123-g123-1234asdf1234"),
			Name:       aws.String("example-web-acl-1"),
			MetricName: aws.String("examplewebacl1"),
			DefaultAction: &waf.WafAction{
				Type: aws.String("ALLOW"),
			},
			WebACLArn: aws.String("arn:aws:waf-regional:us-west-2:123456789012:webacl/asdfasdf-f123-e123-g123-1234asdf1234"),
			Rules: []*waf.ActivatedRule{
				{
					Priority: aws.Int64(1),
					RuleId:   aws.String("112233"),
					Action: &waf.WafAction{
						Type: aws.String("COUNT"),
					},
					Type: aws.String("REGULAR"),
				},
			},
		},
	}

	ExampleGetRule = &waf.GetRuleOutput{
		Rule: &waf.Rule{
			RuleId:     aws.String("112233"),
			Name:       aws.String("test-rule"),
			MetricName: aws.String("testrule"),
			Predicates: []*waf.Predicate{
				{
					Negated: aws.Bool(false),
					Type:    aws.String("XssMatch"),
					DataId:  aws.String("123abc-123def"),
				},
			},
		},
	}

	ExampleListTagsForResourceWaf = &waf.ListTagsForResourceOutput{
		TagInfoForResource: &waf.TagInfoForResource{
			TagList: []*waf.Tag{
				{
					Key:   aws.String("Key1"),
					Value: aws.String("Value1"),
				},
			},
		},
	}

	MockWafForSetup = &MockWaf{}
)

Example WAF regional API return values

View Source
var (
	ExampleWebAclID = aws.String("asdfasdf-f123-e123-g123-1234asdf1234")

	ExampleGetWebAclForResourceOutput = &wafregional.GetWebACLForResourceOutput{
		WebACLSummary: &waf.WebACLSummary{
			Name:     aws.String("example-web-acl-1"),
			WebACLId: ExampleWebAclID,
		},
	}

	MockWafRegionalForSetup = &MockWafRegional{}
)

Example WAF regional API return values

View Source
var MockSTSClient = &MockSTS{}

MockSTSClient is the client attached to the assume role provider. This can be overridden to return errors, etc.

View Source
var (
	MockSTSForSetup = &MockSTS{}
)

Functions

func AssumeRoleMock

AssumeRoleMock generates a set of fake credentials for testing.

func ParseExampleAuthSourceARN

func ParseExampleAuthSourceARN(arnToParse string) arn.ARN

ParseExampleAuthSourceARN returns a parsed Auth Source ARN

func STSAssumeRoleProviderMock

func STSAssumeRoleProviderMock() func(p *stscreds.AssumeRoleProvider)

STSAssumeRoleProviderMock is used to override the assumeRoleProviderFunc in testing.

func SetupMockAcm

func SetupMockAcm(_ *session.Session, _ *aws.Config) interface{}

SetupMockAcm is used to override the ACM Client initializer

func SetupMockApplicationAutoScaling

func SetupMockApplicationAutoScaling(sess *session.Session, cfg *aws.Config) interface{}

SetupMockApplicationAutoScaling is used to override the Application Auto Scaling Client initializer

func SetupMockCloudFormation

func SetupMockCloudFormation(_ *session.Session, _ *aws.Config) interface{}

SetupMockCloudFormation is used to override the CloudFormation Client initializer

func SetupMockCloudTrail

func SetupMockCloudTrail(_ *session.Session, _ *aws.Config) interface{}

SetupMockCloudTrail is used to override the CloudTrail client initializer.

func SetupMockCloudWatchLogs

func SetupMockCloudWatchLogs(_ *session.Session, _ *aws.Config) interface{}

SetupMockCloudWatchLogs is used to override the CloudWatchLogs Client initializer

func SetupMockConfigService

func SetupMockConfigService(_ *session.Session, _ *aws.Config) interface{}

SetupMockConfigService is used to override the ConfigService client initializer

func SetupMockDynamoDB

func SetupMockDynamoDB(_ *session.Session, _ *aws.Config) interface{}

SetupMockDynamoDB is used to override the DynamoDB Client initializer

func SetupMockEC2

func SetupMockEC2(_ *session.Session, _ *aws.Config) interface{}

SetupMockEC2 is used to override the EC2 Client initializer

func SetupMockEcs added in v0.3.0

func SetupMockEcs(_ *session.Session, _ *aws.Config) interface{}

SetupMockEcs is used to override the ECS Client initializer

func SetupMockEks added in v1.11.0

func SetupMockEks(_ *session.Session, _ *aws.Config) interface{}

SetupMockEks is used to override the Eks Client initializer

func SetupMockElbv2

func SetupMockElbv2(_ *session.Session, _ *aws.Config) interface{}

SetupMockElbv2 is used to override the Elbv2 Client initializer

func SetupMockGuardDuty

func SetupMockGuardDuty(_ *session.Session, _ *aws.Config) interface{}

SetupMockGuardDuty is used to override the GuardDuty Client initializer

func SetupMockIAM

func SetupMockIAM(_ *session.Session, _ *aws.Config) interface{}

SetupMockIAM is used to override the IAM Client initializer.

func SetupMockKms

func SetupMockKms(_ *session.Session, _ *aws.Config) interface{}

SetupMockKms is used to override the KMS Client initializer

func SetupMockLambda

func SetupMockLambda(_ *session.Session, _ *aws.Config) interface{}

SetupMockLambda is used to override the Lambda Client initializer

func SetupMockRds

func SetupMockRds(_ *session.Session, _ *aws.Config) interface{}

SetupMockRds is used to override the RDS Client initializer

func SetupMockRedshift

func SetupMockRedshift(_ *session.Session, _ *aws.Config) interface{}

SetupMockRedshift is used to override the Redshift Client initializer

func SetupMockS3

func SetupMockS3(_ *session.Session, _ *aws.Config) interface{}

SetupMockS3 is used to override the S3 Client initializer.

func SetupMockSTSClient

func SetupMockSTSClient(sess *session.Session, cfg *aws.Config) stsiface.STSAPI

func SetupMockWaf

func SetupMockWaf(_ *session.Session, _ *aws.Config) interface{}

SetupMockWaf is used to override the WAF Client initializer

func SetupMockWafRegional

func SetupMockWafRegional(_ *session.Session, _ *aws.Config) interface{}

SetupMockWafRegional is used to override the WAF Regional Client initializer

Types

type MockAcm

type MockAcm struct {
	acmiface.ACMAPI
	mock.Mock
}

MockAcm is a mock ACM client

func BuildMockAcmSvc

func BuildMockAcmSvc(funcs []string) (mockSvc *MockAcm)

BuildMockAcmSvc builds and returns a MockAcm struct

Additionally, the appropriate calls to On and Return are made based on the strings passed in

func BuildMockAcmSvcAll

func BuildMockAcmSvcAll() (mockSvc *MockAcm)

BuildAcmServiceSvcAll builds and returns a MockAcm struct

Additionally, the appropriate calls to On and Return are made for all possible function calls

func BuildMockAcmSvcAllError

func BuildMockAcmSvcAllError() (mockSvc *MockAcm)

BuildMockAcmSvcAllError builds and returns a MockAcm struct with errors set

Additionally, the appropriate calls to On and Return are made for all possible function calls

func BuildMockAcmSvcError

func BuildMockAcmSvcError(funcs []string) (mockSvc *MockAcm)

BuildMockAcmSvcError builds and returns a MockAcm struct with errors set

Additionally, the appropriate calls to On and Return are made based on the strings passed in

func (*MockAcm) DescribeCertificate

func (m *MockAcm) DescribeCertificate(in *acm.DescribeCertificateInput) (*acm.DescribeCertificateOutput, error)

func (*MockAcm) ListCertificatesPages

func (m *MockAcm) ListCertificatesPages(
	in *acm.ListCertificatesInput,
	paginationFunction func(*acm.ListCertificatesOutput, bool) bool,
) error

func (*MockAcm) ListTagsForCertificate

func (m *MockAcm) ListTagsForCertificate(in *acm.ListTagsForCertificateInput) (*acm.ListTagsForCertificateOutput, error)

type MockApplicationAutoScaling

type MockApplicationAutoScaling struct {
	applicationautoscalingiface.ApplicationAutoScalingAPI
	mock.Mock
}

MockApplicationAutoScaling is a mock Application Auto Scaling client

func BuildMockApplicationAutoScalingSvc

func BuildMockApplicationAutoScalingSvc(funcs []string) (mockSvc *MockApplicationAutoScaling)

BuildMockApplicationAutoScalingSvc builds and returns a MockApplicationAutoScaling struct

Additionally, the appropriate calls to On and Return are made based on the strings passed in

func BuildMockApplicationAutoScalingSvcAll

func BuildMockApplicationAutoScalingSvcAll() (mockSvc *MockApplicationAutoScaling)

BuildApplicationAutoScalingServiceSvcAll builds and returns a MockApplicationAutoScaling struct

Additionally, the appropriate calls to On and Return are made for all possible function calls

func BuildMockApplicationAutoScalingSvcAllError

func BuildMockApplicationAutoScalingSvcAllError() (mockSvc *MockApplicationAutoScaling)

BuildMockApplicationAutoScalingSvcAllError builds and returns a MockApplicationAutoScaling struct with errors set

Additionally, the appropriate calls to On and Return are made for all possible function calls

func BuildMockApplicationAutoScalingSvcError

func BuildMockApplicationAutoScalingSvcError(funcs []string) (mockSvc *MockApplicationAutoScaling)

BuildMockApplicationAutoScalingSvcError builds and returns a MockApplicationAutoScaling struct with errors set

Additionally, the appropriate calls to On and Return are made based on the strings passed in

func (*MockApplicationAutoScaling) DescribeScalableTargetsPages

type MockCloudFormation

type MockCloudFormation struct {
	cloudformationiface.CloudFormationAPI
	mock.Mock
}

MockCloudFormation is a mock CloudFormation client

func BuildMockCloudFormationSvc

func BuildMockCloudFormationSvc(funcs []string) (mockSvc *MockCloudFormation)

BuildMockCloudFormationSvc builds and returns a MockCloudFormation struct

Additionally, the appropriate calls to On and Return are made based on the strings passed in

func BuildMockCloudFormationSvcAll

func BuildMockCloudFormationSvcAll() (mockSvc *MockCloudFormation)

BuildCloudFormationServiceSvcAll builds and returns a MockCloudFormation struct

Additionally, the appropriate calls to On and Return are made for all possible function calls

func BuildMockCloudFormationSvcAllError

func BuildMockCloudFormationSvcAllError() (mockSvc *MockCloudFormation)

BuildMockCloudFormationSvcAllError builds and returns a MockCloudFormation struct with errors set

Additionally, the appropriate calls to On and Return are made for all possible function calls

func BuildMockCloudFormationSvcError

func BuildMockCloudFormationSvcError(funcs []string) (mockSvc *MockCloudFormation)

BuildMockCloudFormationSvcError builds and returns a MockCloudFormation struct with errors set

Additionally, the appropriate calls to On and Return are made based on the strings passed in

func (*MockCloudFormation) DescribeStackResourceDriftsPages

func (m *MockCloudFormation) DescribeStackResourceDriftsPages(
	in *cloudformation.DescribeStackResourceDriftsInput,
	paginationFunction func(*cloudformation.DescribeStackResourceDriftsOutput, bool) bool,
) error

func (*MockCloudFormation) DescribeStacksPages

func (m *MockCloudFormation) DescribeStacksPages(
	in *cloudformation.DescribeStacksInput,
	paginationFunction func(*cloudformation.DescribeStacksOutput, bool) bool,
) error

type MockCloudTrail

type MockCloudTrail struct {
	cloudtrailiface.CloudTrailAPI
	mock.Mock
}

MockCloudTrail is a mock CloudTrail client.

func BuildMockCloudTrailSvc

func BuildMockCloudTrailSvc(funcs []string) (mockSvc *MockCloudTrail)

BuildMockCloudTrailSvc builds and returns a MockCloudTrail struct

Additionally, the appropriate calls to On and Return are made based on the strings passed in

func BuildMockCloudTrailSvcAll

func BuildMockCloudTrailSvcAll() (mockSvc *MockCloudTrail)

BuildCloudTrailServiceSvcAll builds and returns a MockCloudTrail struct

Additionally, the appropriate calls to On and Return are made for all possible function calls

func BuildMockCloudTrailSvcAllError

func BuildMockCloudTrailSvcAllError() (mockSvc *MockCloudTrail)

BuildMockCloudTrailSvcAllError builds and returns a MockCloudTrail struct with errors set

Additionally, the appropriate calls to On and Return are made for all possible function calls

func BuildMockCloudTrailSvcError

func BuildMockCloudTrailSvcError(funcs []string) (mockSvc *MockCloudTrail)

BuildMockCloudTrailSvcError builds and returns a MockCloudTrail struct with errors set

Additionally, the appropriate calls to On and Return are made based on the strings passed in

func (*MockCloudTrail) DescribeTrails

DescribeTrails is a mock function to return fake CloudTrail data.

func (*MockCloudTrail) GetEventSelectors

GetEventSelectors is a mock function to return fake CloudTrail Event Selector data.

func (*MockCloudTrail) GetTrailStatus

GetTrailStatus is a mock function to return fake CloudTrail Status data.

func (*MockCloudTrail) ListTags

type MockCloudWatchLogs

type MockCloudWatchLogs struct {
	cloudwatchlogsiface.CloudWatchLogsAPI
	mock.Mock
}

MockCloudWatchLogs is a mock CloudWatchLogs client

func BuildMockCloudWatchLogsSvc

func BuildMockCloudWatchLogsSvc(funcs []string) (mockSvc *MockCloudWatchLogs)

BuildMockCloudWatchLogsSvc builds and returns a MockCloudWatchLogs struct

Additionally, the appropriate calls to On and Return are made based on the strings passed in

func BuildMockCloudWatchLogsSvcAll

func BuildMockCloudWatchLogsSvcAll() (mockSvc *MockCloudWatchLogs)

BuildCloudWatchLogsServiceSvcAll builds and returns a MockCloudWatchLogs struct

Additionally, the appropriate calls to On and Return are made for all possible function calls

func BuildMockCloudWatchLogsSvcAllError

func BuildMockCloudWatchLogsSvcAllError() (mockSvc *MockCloudWatchLogs)

BuildMockCloudWatchLogsSvcAllError builds and returns a MockCloudWatchLogs struct with errors set

Additionally, the appropriate calls to On and Return are made for all possible function calls

func BuildMockCloudWatchLogsSvcError

func BuildMockCloudWatchLogsSvcError(funcs []string) (mockSvc *MockCloudWatchLogs)

BuildMockCloudWatchLogsSvcError builds and returns a MockCloudWatchLogs struct with errors set

Additionally, the appropriate calls to On and Return are made based on the strings passed in

func (*MockCloudWatchLogs) DescribeLogGroupsPages

func (m *MockCloudWatchLogs) DescribeLogGroupsPages(
	in *cloudwatchlogs.DescribeLogGroupsInput,
	paginationFunction func(*cloudwatchlogs.DescribeLogGroupsOutput, bool) bool,
) error

func (*MockCloudWatchLogs) ListTagsLogGroup

type MockConfigService

type MockConfigService struct {
	configserviceiface.ConfigServiceAPI
	mock.Mock
}

func BuildMockConfigServiceSvc

func BuildMockConfigServiceSvc(funcs []string) (mockSvc *MockConfigService)

BuildMockConfigServiceSvc builds and returns a MockConfigService struct

Additionally, the appropriate calls to On and Return are made based on the strings passed in

func BuildMockConfigServiceSvcAll

func BuildMockConfigServiceSvcAll() (mockSvc *MockConfigService)

BuildMockConfigServiceSvcAll builds and returns a MockConfigService struct

Additionally, the appropriate calls to On and Return are made for all possible function calls

func BuildMockConfigServiceSvcAllError

func BuildMockConfigServiceSvcAllError() (mockSvc *MockConfigService)

BuildMockConfigServiceSvcAllError builds and returns a MockConfigService struct with errors set

Additionally, the appropriate calls to On and Return are made for all possible function calls

func BuildMockConfigServiceSvcError

func BuildMockConfigServiceSvcError(funcs []string) (mockSvc *MockConfigService)

BuildMockConfigServiceSvcError builds and returns a MockConfigService struct with errors set

Additionally, the appropriate calls to On and Return are made based on the strings passed in

type MockDynamoDB

type MockDynamoDB struct {
	dynamodbiface.DynamoDBAPI
	mock.Mock
}

MockDynamoDB is a mock Dynamo DB client

func BuildMockDynamoDBSvc

func BuildMockDynamoDBSvc(funcs []string) (mockSvc *MockDynamoDB)

BuildMockDynamoDBSvc builds and returns a MockDynamoDB struct

Additionally, the appropriate calls to On and Return are made based on the strings passed in

func BuildMockDynamoDBSvcAll

func BuildMockDynamoDBSvcAll() (mockSvc *MockDynamoDB)

BuildDynamoDBServiceSvcAll builds and returns a MockDynamoDB struct

Additionally, the appropriate calls to On and Return are made for all possible function calls

func BuildMockDynamoDBSvcAllError

func BuildMockDynamoDBSvcAllError() (mockSvc *MockDynamoDB)

BuildMockDynamoDBSvcAllError builds and returns a MockDynamoDB struct with errors set

Additionally, the appropriate calls to On and Return are made for all possible function calls

func BuildMockDynamoDBSvcError

func BuildMockDynamoDBSvcError(funcs []string) (mockSvc *MockDynamoDB)

BuildMockDynamoDBSvcError builds and returns a MockDynamoDB struct with errors set

Additionally, the appropriate calls to On and Return are made based on the strings passed in

func (*MockDynamoDB) DescribeTable

func (*MockDynamoDB) DescribeTimeToLive

func (*MockDynamoDB) ListTablesPages

func (m *MockDynamoDB) ListTablesPages(
	in *dynamodb.ListTablesInput,
	paginationFunction func(*dynamodb.ListTablesOutput, bool) bool,
) error

func (*MockDynamoDB) ListTagsOfResource

type MockEC2

type MockEC2 struct {
	ec2iface.EC2API
	mock.Mock
}

MockEC2 is a mock EC2 client

func BuildMockEC2Svc

func BuildMockEC2Svc(funcs []string) (mockSvc *MockEC2)

BuildMockEC2Svc builds and returns a MockEC2 struct

Additionally, the appropriate calls to On and Return are made based on the strings passed in

func BuildMockEC2SvcAll

func BuildMockEC2SvcAll() (mockSvc *MockEC2)

BuildEC2ServiceSvcAll builds and returns a MockEC2 struct

Additionally, the appropriate calls to On and Return are made for all possible function calls

func BuildMockEC2SvcAllError

func BuildMockEC2SvcAllError() (mockSvc *MockEC2)

BuildMockEC2SvcAllError builds and returns a MockEC2 struct with errors set

Additionally, the appropriate calls to On and Return are made for all possible function calls

func BuildMockEC2SvcError

func BuildMockEC2SvcError(funcs []string) (mockSvc *MockEC2)

BuildMockEC2SvcError builds and returns a MockEC2 struct with errors set

Additionally, the appropriate calls to On and Return are made based on the strings passed in

func (*MockEC2) DescribeFlowLogsPages

func (m *MockEC2) DescribeFlowLogsPages(
	in *ec2.DescribeFlowLogsInput,
	paginationFunction func(*ec2.DescribeFlowLogsOutput, bool) bool,
) error

func (*MockEC2) DescribeImages

func (m *MockEC2) DescribeImages(in *ec2.DescribeImagesInput) (*ec2.DescribeImagesOutput, error)

func (*MockEC2) DescribeInstancesPages

func (m *MockEC2) DescribeInstancesPages(
	in *ec2.DescribeInstancesInput,
	paginationFunction func(*ec2.DescribeInstancesOutput, bool) bool,
) error

func (*MockEC2) DescribeNetworkAcls

func (m *MockEC2) DescribeNetworkAcls(in *ec2.DescribeNetworkAclsInput) (*ec2.DescribeNetworkAclsOutput, error)

func (*MockEC2) DescribeNetworkAclsPages

func (m *MockEC2) DescribeNetworkAclsPages(
	in *ec2.DescribeNetworkAclsInput,
	paginationFunction func(*ec2.DescribeNetworkAclsOutput, bool) bool,
) error

func (*MockEC2) DescribeRegions

func (m *MockEC2) DescribeRegions(in *ec2.DescribeRegionsInput) (*ec2.DescribeRegionsOutput, error)

func (*MockEC2) DescribeRouteTablesPages

func (m *MockEC2) DescribeRouteTablesPages(
	in *ec2.DescribeRouteTablesInput,
	paginationFunction func(*ec2.DescribeRouteTablesOutput, bool) bool,
) error

func (*MockEC2) DescribeSecurityGroups

func (m *MockEC2) DescribeSecurityGroups(in *ec2.DescribeSecurityGroupsInput) (*ec2.DescribeSecurityGroupsOutput, error)

func (*MockEC2) DescribeSecurityGroupsPages

func (m *MockEC2) DescribeSecurityGroupsPages(
	in *ec2.DescribeSecurityGroupsInput,
	paginationFunction func(*ec2.DescribeSecurityGroupsOutput, bool) bool,
) error

func (*MockEC2) DescribeSnapshotsPages

func (m *MockEC2) DescribeSnapshotsPages(
	in *ec2.DescribeSnapshotsInput,
	paginationFunction func(*ec2.DescribeSnapshotsOutput, bool) bool,
) error

func (*MockEC2) DescribeStaleSecurityGroupsPages

func (m *MockEC2) DescribeStaleSecurityGroupsPages(
	in *ec2.DescribeStaleSecurityGroupsInput,
	paginationFunction func(*ec2.DescribeStaleSecurityGroupsOutput, bool) bool,
) error

func (*MockEC2) DescribeVolumesPages

func (m *MockEC2) DescribeVolumesPages(
	in *ec2.DescribeVolumesInput,
	paginationFunction func(*ec2.DescribeVolumesOutput, bool) bool,
) error

func (*MockEC2) DescribeVpcsPages

func (m *MockEC2) DescribeVpcsPages(
	in *ec2.DescribeVpcsInput,
	paginationFunction func(*ec2.DescribeVpcsOutput, bool) bool,
) error

type MockEcs added in v0.3.0

type MockEcs struct {
	ecsiface.ECSAPI
	mock.Mock
}

MockEcs is a mock ECS client

func BuildMockEcsSvc added in v0.3.0

func BuildMockEcsSvc(funcs []string) (mockSvc *MockEcs)

BuildMockEcsSvc builds and returns a MockEcs struct

Additionally, the appropriate calls to On and Return are made based on the strings passed in

func BuildMockEcsSvcAll added in v0.3.0

func BuildMockEcsSvcAll() (mockSvc *MockEcs)

BuildMockEcsSvcAll builds and returns a MockEcs struct

Additionally, the appropriate calls to On and Return are made for all possible function calls

func BuildMockEcsSvcAllError added in v0.3.0

func BuildMockEcsSvcAllError() (mockSvc *MockEcs)

BuildMockEcsSvcAllError builds and returns a MockEcs struct with errors set

Additionally, the appropriate calls to On and Return are made for all possible function calls

func BuildMockEcsSvcError added in v0.3.0

func BuildMockEcsSvcError(funcs []string) (mockSvc *MockEcs)

BuildMockEcsSvcError builds and returns a MockEcs struct with errors set

Additionally, the appropriate calls to On and Return are made based on the strings passed in

func (*MockEcs) DescribeClusters added in v0.3.0

func (m *MockEcs) DescribeClusters(in *ecs.DescribeClustersInput) (*ecs.DescribeClustersOutput, error)

func (*MockEcs) DescribeServices added in v0.3.0

func (m *MockEcs) DescribeServices(in *ecs.DescribeServicesInput) (*ecs.DescribeServicesOutput, error)

func (*MockEcs) DescribeTasks added in v0.3.0

func (m *MockEcs) DescribeTasks(in *ecs.DescribeTasksInput) (*ecs.DescribeTasksOutput, error)

func (*MockEcs) ListClustersPages added in v0.3.0

func (m *MockEcs) ListClustersPages(
	in *ecs.ListClustersInput,
	paginationFunction func(*ecs.ListClustersOutput, bool) bool,
) error

func (*MockEcs) ListServicesPages added in v0.3.0

func (m *MockEcs) ListServicesPages(
	in *ecs.ListServicesInput,
	paginationFunction func(*ecs.ListServicesOutput, bool) bool,
) error

func (*MockEcs) ListTasksPages added in v0.3.0

func (m *MockEcs) ListTasksPages(
	in *ecs.ListTasksInput,
	paginationFunction func(*ecs.ListTasksOutput, bool) bool,
) error

type MockEks added in v1.11.0

type MockEks struct {
	eksiface.EKSAPI
	mock.Mock
}

MockEks is a mock Eks client

func BuildMockEksSvc added in v1.11.0

func BuildMockEksSvc(funcs []string) (mockSvc *MockEks)

BuildMockEksSvc builds and returns a MockEks struct

Additionally, the appropriate calls to On and Return are made based on the strings passed in

func BuildMockEksSvcAll added in v1.11.0

func BuildMockEksSvcAll() (mockSvc *MockEks)

BuildEksFargateProfilevcAll builds and returns a MockEks struct

Additionally, the appropriate calls to On and Return are made for all possible function calls

func BuildMockEksSvcAllError added in v1.11.0

func BuildMockEksSvcAllError() (mockSvc *MockEks)

BuildMockEksSvcAllError builds and returns a MockEks struct with errors set

Additionally, the appropriate calls to On and Return are made for all possible function calls

func BuildMockEksSvcError added in v1.11.0

func BuildMockEksSvcError(funcs []string) (mockSvc *MockEks)

BuildMockEksSvcError builds and returns a MockEks struct with errors set

Additionally, the appropriate calls to On and Return are made based on the strings passed in

func (*MockEks) DescribeCluster added in v1.11.0

func (m *MockEks) DescribeCluster(in *eks.DescribeClusterInput) (*eks.DescribeClusterOutput, error)

func (*MockEks) DescribeFargateProfile added in v1.11.0

func (m *MockEks) DescribeFargateProfile(in *eks.DescribeFargateProfileInput) (*eks.DescribeFargateProfileOutput, error)

func (*MockEks) DescribeNodegroup added in v1.11.0

func (m *MockEks) DescribeNodegroup(in *eks.DescribeNodegroupInput) (*eks.DescribeNodegroupOutput, error)

func (*MockEks) ListClustersPages added in v1.11.0

func (m *MockEks) ListClustersPages(
	in *eks.ListClustersInput,
	paginationFunction func(*eks.ListClustersOutput, bool) bool,
) error

func (*MockEks) ListFargateProfilesPages added in v1.11.0

func (m *MockEks) ListFargateProfilesPages(
	in *eks.ListFargateProfilesInput,
	paginationFunction func(*eks.ListFargateProfilesOutput, bool) bool,
) error

func (*MockEks) ListNodegroupsPages added in v1.11.0

func (m *MockEks) ListNodegroupsPages(
	in *eks.ListNodegroupsInput,
	paginationFunction func(*eks.ListNodegroupsOutput, bool) bool,
) error

type MockElbv2

type MockElbv2 struct {
	elbv2iface.ELBV2API
	mock.Mock
}

MockElbv2 is a mock Elbv2 client

func BuildMockElbv2Svc

func BuildMockElbv2Svc(funcs []string) (mockSvc *MockElbv2)

BuildMockElbv2Svc builds and returns a MockElbv2 struct

Additionally, the appropriate calls to On and Return are made based on the strings passed in

func BuildMockElbv2SvcAll

func BuildMockElbv2SvcAll() (mockSvc *MockElbv2)

BuildElbv2ServiceSvcAll builds and returns a MockElbv2 struct

Additionally, the appropriate calls to On and Return are made for all possible function calls

func BuildMockElbv2SvcAllError

func BuildMockElbv2SvcAllError() (mockSvc *MockElbv2)

BuildMockElbv2SvcAllError builds and returns a MockElbv2 struct with errors set

Additionally, the appropriate calls to On and Return are made for all possible function calls

func BuildMockElbv2SvcError

func BuildMockElbv2SvcError(funcs []string) (mockSvc *MockElbv2)

BuildMockElbv2SvcError builds and returns a MockElbv2 struct with errors set

Additionally, the appropriate calls to On and Return are made based on the strings passed in

func (*MockElbv2) DescribeListenersPages

func (m *MockElbv2) DescribeListenersPages(
	in *elbv2.DescribeListenersInput,
	paginationFunction func(*elbv2.DescribeListenersOutput, bool) bool,
) error

func (*MockElbv2) DescribeLoadBalancers

func (*MockElbv2) DescribeLoadBalancersPages

func (m *MockElbv2) DescribeLoadBalancersPages(
	in *elbv2.DescribeLoadBalancersInput,
	paginationFunction func(*elbv2.DescribeLoadBalancersOutput, bool) bool,
) error

func (*MockElbv2) DescribeSSLPolicies

func (*MockElbv2) DescribeTags

type MockGuardDuty

type MockGuardDuty struct {
	guarddutyiface.GuardDutyAPI
	mock.Mock
}

MockGuardDuty is a mock GuardDuty client

func BuildMockGuardDutySvc

func BuildMockGuardDutySvc(funcs []string) (mockSvc *MockGuardDuty)

BuildMockGuardDutySvc builds and returns a MockGuardDuty struct

Additionally, the appropriate calls to On and Return are made based on the strings passed in

func BuildMockGuardDutySvcAll

func BuildMockGuardDutySvcAll() (mockSvc *MockGuardDuty)

BuildGuardDutyServiceSvcAll builds and returns a MockGuardDuty struct

Additionally, the appropriate calls to On and Return are made for all possible function calls

func BuildMockGuardDutySvcAllError

func BuildMockGuardDutySvcAllError() (mockSvc *MockGuardDuty)

BuildMockGuardDutySvcAllError builds and returns a MockGuardDuty struct with errors set

Additionally, the appropriate calls to On and Return are made for all possible function calls

func BuildMockGuardDutySvcError

func BuildMockGuardDutySvcError(funcs []string) (mockSvc *MockGuardDuty)

BuildMockGuardDutySvcError builds and returns a MockGuardDuty struct with errors set

Additionally, the appropriate calls to On and Return are made based on the strings passed in

func (*MockGuardDuty) GetDetector

func (*MockGuardDuty) GetMasterAccount

func (*MockGuardDuty) ListDetectors

func (*MockGuardDuty) ListDetectorsPages

func (m *MockGuardDuty) ListDetectorsPages(
	in *guardduty.ListDetectorsInput,
	paginationFunction func(*guardduty.ListDetectorsOutput, bool) bool,
) error

type MockIAM

type MockIAM struct {
	iamiface.IAMAPI
	mock.Mock
}

MockIAM is a mock IAM client.

func BuildMockIAMSvc

func BuildMockIAMSvc(funcs []string) (mockSvc *MockIAM)

BuildMockIAMSvc builds and returns a MockIAM struct

Additionally, the appropriate calls to On and Return are made based on the strings passed in

func BuildMockIAMSvcAll

func BuildMockIAMSvcAll() (mockSvc *MockIAM)

BuildIamServiceSvcAll builds and returns a MockIAM struct

Additionally, the appropriate calls to On and Return are made for all possible function calls

func BuildMockIAMSvcAllError

func BuildMockIAMSvcAllError() (mockSvc *MockIAM)

BuildMockIAMSvcAllError builds and returns a MockIAM struct with errors set

Additionally, the appropriate calls to On and Return are made for all possible function calls

func BuildMockIAMSvcError

func BuildMockIAMSvcError(funcs []string) (mockSvc *MockIAM)

BuildMockIAMSvcError builds and returns a MockIAM struct with errors set

Additionally, the appropriate calls to On and Return are made based on the strings passed in

func (*MockIAM) GenerateCredentialReport

GenerateCredentialReport is a mock function to return fake generate credential report data. If the credential report is 'not ready', it makes it ready for the next return

func (*MockIAM) GetAccountPasswordPolicy

GetAccountPasswordPolicy is a mock function to return fake password policy data.

func (*MockIAM) GetCredentialReport

func (m *MockIAM) GetCredentialReport(in *iam.GetCredentialReportInput) (*iam.GetCredentialReportOutput, error)

GetCredentialReport is a mock function to return fake credential report data.

func (*MockIAM) GetGroup

func (m *MockIAM) GetGroup(in *iam.GetGroupInput) (*iam.GetGroupOutput, error)

GetGroup is a mock function to return a fake IAM group

func (*MockIAM) GetGroupPolicy

func (m *MockIAM) GetGroupPolicy(in *iam.GetGroupPolicyInput) (*iam.GetGroupPolicyOutput, error)

GetGroup is a mock function to return a fake IAM group policy

func (*MockIAM) GetPolicyVersion

func (m *MockIAM) GetPolicyVersion(in *iam.GetPolicyVersionInput) (*iam.GetPolicyVersionOutput, error)

GetPolicyVersion is a mock function to return a fake policy document

func (*MockIAM) GetRole

func (m *MockIAM) GetRole(in *iam.GetRoleInput) (*iam.GetRoleOutput, error)

func (*MockIAM) GetRolePolicy

func (m *MockIAM) GetRolePolicy(in *iam.GetRolePolicyInput) (*iam.GetRolePolicyOutput, error)

func (*MockIAM) GetUser

func (m *MockIAM) GetUser(in *iam.GetUserInput) (*iam.GetUserOutput, error)

For better unit test accuracy, these two cases return different output depending on the input

func (*MockIAM) GetUserPolicy

func (m *MockIAM) GetUserPolicy(in *iam.GetUserPolicyInput) (*iam.GetUserPolicyOutput, error)

func (*MockIAM) ListAttachedGroupPoliciesPages

func (m *MockIAM) ListAttachedGroupPoliciesPages(
	in *iam.ListAttachedGroupPoliciesInput,
	paginationFunction func(*iam.ListAttachedGroupPoliciesOutput, bool) bool,
) error

func (*MockIAM) ListAttachedRolePoliciesPages

func (m *MockIAM) ListAttachedRolePoliciesPages(
	in *iam.ListAttachedRolePoliciesInput,
	paginationFunction func(*iam.ListAttachedRolePoliciesOutput, bool) bool,
) error

func (*MockIAM) ListAttachedUserPolicies

ListAttachedUserPolicies is a mock function to return fake list attached user policies data

func (*MockIAM) ListAttachedUserPoliciesPages

func (m *MockIAM) ListAttachedUserPoliciesPages(
	in *iam.ListAttachedUserPoliciesInput,
	paginationFunction func(*iam.ListAttachedUserPoliciesOutput, bool) bool,
) error

ListAttachedUserPoliciesPages is a mock function to return fake list attached user policies data with paging

func (*MockIAM) ListEntitiesForPolicy

func (m *MockIAM) ListEntitiesForPolicy(in *iam.ListEntitiesForPolicyInput) (*iam.ListEntitiesForPolicyOutput, error)

ListEntitiesForPolicy is a mock function to return fake list entity data

func (*MockIAM) ListEntitiesForPolicyPages

func (m *MockIAM) ListEntitiesForPolicyPages(
	in *iam.ListEntitiesForPolicyInput,
	paginationFunction func(*iam.ListEntitiesForPolicyOutput, bool) bool,
) error

ListEntitiesForPolicyPages is a mock function to return fake list attached policy entites data with paging

func (*MockIAM) ListGroupPoliciesPages

func (m *MockIAM) ListGroupPoliciesPages(
	in *iam.ListGroupPoliciesInput,
	paginationFunction func(*iam.ListGroupPoliciesOutput, bool) bool,
) error

func (*MockIAM) ListGroups

func (m *MockIAM) ListGroups(in *iam.ListGroupsInput) (*iam.ListGroupsOutput, error)

ListGroups is a mock function to return fake groups

func (*MockIAM) ListGroupsForUserPages

func (m *MockIAM) ListGroupsForUserPages(
	in *iam.ListGroupsForUserInput,
	paginationFunction func(*iam.ListGroupsForUserOutput, bool) bool,
) error

func (*MockIAM) ListGroupsPages

func (m *MockIAM) ListGroupsPages(
	in *iam.ListGroupsInput,
	paginationFunction func(*iam.ListGroupsOutput, bool) bool,
) error

func (*MockIAM) ListPolicies

func (m *MockIAM) ListPolicies(in *iam.ListPoliciesInput) (*iam.ListPoliciesOutput, error)

ListPolicies is a mock function to return fake list policy data

func (*MockIAM) ListPoliciesPages

func (m *MockIAM) ListPoliciesPages(
	in *iam.ListPoliciesInput,
	paginationFunction func(*iam.ListPoliciesOutput, bool) bool,
) error

ListPoliciesPages is a mock function to return fake policies with paging

func (*MockIAM) ListRolePoliciesPages

func (m *MockIAM) ListRolePoliciesPages(
	in *iam.ListRolePoliciesInput,
	paginationFunction func(*iam.ListRolePoliciesOutput, bool) bool,
) error

func (*MockIAM) ListRolesPages

func (m *MockIAM) ListRolesPages(
	in *iam.ListRolesInput,
	paginationFunction func(*iam.ListRolesOutput, bool) bool,
) error

func (*MockIAM) ListUserPolicies

func (m *MockIAM) ListUserPolicies(in *iam.ListUserPoliciesInput) (*iam.ListUserPoliciesOutput, error)

ListUserPolicies is a mock function to return fake list user policies data

func (*MockIAM) ListUserPoliciesPages

func (m *MockIAM) ListUserPoliciesPages(
	in *iam.ListUserPoliciesInput,
	paginationFunction func(*iam.ListUserPoliciesOutput, bool) bool,
) error

ListUserPoliciesPages is a mock function to return fake list user policies data with paging

func (*MockIAM) ListUsers

func (m *MockIAM) ListUsers(in *iam.ListUsersInput) (*iam.ListUsersOutput, error)

ListUsers is a mock function to return fake list user data

func (*MockIAM) ListUsersPages

func (m *MockIAM) ListUsersPages(
	in *iam.ListUsersInput,
	paginationFunction func(*iam.ListUsersOutput, bool) bool,
) error

ListUsersPages is a mock function to return fake list user data with paging.

func (*MockIAM) ListVirtualMFADevices

func (m *MockIAM) ListVirtualMFADevices(in *iam.ListVirtualMFADevicesInput) (*iam.ListVirtualMFADevicesOutput, error)

ListVirtualMFADevices is a mock function to return a fake list of virtual MFA Devices

func (*MockIAM) ListVirtualMFADevicesPages

func (m *MockIAM) ListVirtualMFADevicesPages(
	in *iam.ListVirtualMFADevicesInput,
	paginationFunction func(*iam.ListVirtualMFADevicesOutput, bool) bool,
) error

ListVirtualMFADevicesPages is a mock function to return a fake list of virtual MFA Devices with paging.

type MockKms

type MockKms struct {
	kmsiface.KMSAPI
	mock.Mock
}

MockKms is a mock KMS client

func BuildMockKmsSvc

func BuildMockKmsSvc(funcs []string) (mockSvc *MockKms)

BuildMockKmsSvc builds and returns a MockKms struct

Additionally, the appropriate calls to On and Return are made based on the strings passed in

func BuildMockKmsSvcAll

func BuildMockKmsSvcAll() (mockSvc *MockKms)

BuildKmsServiceSvcAll builds and returns a MockKms struct

Additionally, the appropriate calls to On and Return are made for all possible function calls

func BuildMockKmsSvcAllError

func BuildMockKmsSvcAllError() (mockSvc *MockKms)

BuildMockKmsSvcAllError builds and returns a MockKms struct with errors set

Additionally, the appropriate calls to On and Return are made for all possible function calls

func BuildMockKmsSvcError

func BuildMockKmsSvcError(funcs []string) (mockSvc *MockKms)

BuildMockKmsSvcError builds and returns a MockKms struct with errors set

Additionally, the appropriate calls to On and Return are made based on the strings passed in

func (*MockKms) DescribeKey

func (m *MockKms) DescribeKey(in *kms.DescribeKeyInput) (*kms.DescribeKeyOutput, error)

func (*MockKms) GetKeyPolicy

func (m *MockKms) GetKeyPolicy(in *kms.GetKeyPolicyInput) (*kms.GetKeyPolicyOutput, error)

func (*MockKms) GetKeyRotationStatus

func (m *MockKms) GetKeyRotationStatus(in *kms.GetKeyRotationStatusInput) (*kms.GetKeyRotationStatusOutput, error)

func (*MockKms) ListKeysPages added in v1.8.0

func (m *MockKms) ListKeysPages(
	in *kms.ListKeysInput,
	paginationFunction func(*kms.ListKeysOutput, bool) bool,
) error

func (*MockKms) ListResourceTags

func (m *MockKms) ListResourceTags(in *kms.ListResourceTagsInput) (*kms.ListResourceTagsOutput, error)

type MockLambda

type MockLambda struct {
	lambdaiface.LambdaAPI
	mock.Mock
}

MockLambda is a mock Lambda client

func BuildMockLambdaSvc

func BuildMockLambdaSvc(funcs []string) (mockSvc *MockLambda)

BuildMockLambdaSvc builds and returns a MockLambda struct

Additionally, the appropriate calls to On and Return are made based on the strings passed in

func BuildMockLambdaSvcAll

func BuildMockLambdaSvcAll() (mockSvc *MockLambda)

BuildLambdaServiceSvcAll builds and returns a MockLambda struct

Additionally, the appropriate calls to On and Return are made for all possible function calls

func BuildMockLambdaSvcAllError

func BuildMockLambdaSvcAllError() (mockSvc *MockLambda)

BuildMockLambdaSvcAllError builds and returns a MockLambda struct with errors set

Additionally, the appropriate calls to On and Return are made for all possible function calls

func BuildMockLambdaSvcError

func BuildMockLambdaSvcError(funcs []string) (mockSvc *MockLambda)

BuildMockLambdaSvcError builds and returns a MockLambda struct with errors set

Additionally, the appropriate calls to On and Return are made based on the strings passed in

func (*MockLambda) GetPolicy

func (*MockLambda) ListFunctionsPages

func (m *MockLambda) ListFunctionsPages(
	in *lambda.ListFunctionsInput,
	paginationFunction func(*lambda.ListFunctionsOutput, bool) bool,
) error

func (*MockLambda) ListTags

type MockRds

type MockRds struct {
	rdsiface.RDSAPI
	mock.Mock
}

MockRds is a mock RDS client

func BuildMockRdsSvc

func BuildMockRdsSvc(funcs []string) (mockSvc *MockRds)

BuildMockRdsSvc builds and returns a MockRds struct

Additionally, the appropriate calls to On and Return are made based on the strings passed in

func BuildMockRdsSvcAll

func BuildMockRdsSvcAll() (mockSvc *MockRds)

BuildRdsServiceSvcAll builds and returns a MockRds struct

Additionally, the appropriate calls to On and Return are made for all possible function calls

func BuildMockRdsSvcAllError

func BuildMockRdsSvcAllError() (mockSvc *MockRds)

BuildMockRdsSvcAllError builds and returns a MockRds struct with errors set

Additionally, the appropriate calls to On and Return are made for all possible function calls

func BuildMockRdsSvcError

func BuildMockRdsSvcError(funcs []string) (mockSvc *MockRds)

BuildMockRdsSvcError builds and returns a MockRds struct with errors set

Additionally, the appropriate calls to On and Return are made based on the strings passed in

func (*MockRds) DescribeDBInstancesPages

func (m *MockRds) DescribeDBInstancesPages(
	in *rds.DescribeDBInstancesInput,
	paginationFunction func(*rds.DescribeDBInstancesOutput, bool) bool,
) error

func (*MockRds) DescribeDBSnapshotsPages

func (m *MockRds) DescribeDBSnapshotsPages(
	in *rds.DescribeDBSnapshotsInput,
	paginationFunction func(*rds.DescribeDBSnapshotsOutput, bool) bool,
) error

func (*MockRds) ListTagsForResource

func (m *MockRds) ListTagsForResource(in *rds.ListTagsForResourceInput) (*rds.ListTagsForResourceOutput, error)

type MockRedshift

type MockRedshift struct {
	redshiftiface.RedshiftAPI
	mock.Mock
}

MockRedshift is a mock Redshift client

func BuildMockRedshiftSvc

func BuildMockRedshiftSvc(funcs []string) (mockSvc *MockRedshift)

BuildMockRedshiftSvc builds and returns a MockRedshift struct

Additionally, the appropriate calls to On and Return are made based on the strings passed in

func BuildMockRedshiftSvcAll

func BuildMockRedshiftSvcAll() (mockSvc *MockRedshift)

BuildRedshiftServiceSvcAll builds and returns a MockRedshift struct

Additionally, the appropriate calls to On and Return are made for all possible function calls

func BuildMockRedshiftSvcAllError

func BuildMockRedshiftSvcAllError() (mockSvc *MockRedshift)

BuildMockRedshiftSvcAllError builds and returns a MockRedshift struct with errors set

Additionally, the appropriate calls to On and Return are made for all possible function calls

func BuildMockRedshiftSvcError

func BuildMockRedshiftSvcError(funcs []string) (mockSvc *MockRedshift)

BuildMockRedshiftSvcError builds and returns a MockRedshift struct with errors set

Additionally, the appropriate calls to On and Return are made based on the strings passed in

func (*MockRedshift) DescribeClustersPages

func (m *MockRedshift) DescribeClustersPages(
	in *redshift.DescribeClustersInput,
	paginationFunction func(*redshift.DescribeClustersOutput, bool) bool,
) error

func (*MockRedshift) DescribeLoggingStatus

func (m *MockRedshift) DescribeLoggingStatus(in *redshift.DescribeLoggingStatusInput) (*redshift.LoggingStatus, error)

type MockS3

type MockS3 struct {
	s3iface.S3API
	mock.Mock
}

MockS3 is a mock S3 client.

func BuildMockS3Svc

func BuildMockS3Svc(funcs []string) (mockSvc *MockS3)

BuildMockS3Svc builds and returns a MockS3 struct

Additionally, the appropriate calls to On and Return are made based on the strings passed in

func BuildMockS3SvcAll

func BuildMockS3SvcAll() (mockSvc *MockS3)

BuildMockS3SvcAll builds and returns a MockS3 struct

Additionally, the appropriate calls to On and Return are made for all possible function calls

func BuildMockS3SvcAllError

func BuildMockS3SvcAllError() (mockSvc *MockS3)

BuildMockS3SvcAllError builds and returns a MockS3 struct with errors set

Additionally, the appropriate calls to On and Return are made for all possible function calls

func BuildMockS3SvcError

func BuildMockS3SvcError(funcs []string) (mockSvc *MockS3)

BuildMockS3SvcError builds and returns a MockS3 struct with errors set

Additionally, the appropriate calls to On and Return are made based on the strings passed in

func (*MockS3) GetBucketAcl

func (m *MockS3) GetBucketAcl(in *s3.GetBucketAclInput) (*s3.GetBucketAclOutput, error)

GetBucketAcl is a mock function to return fake S3 Bucket ACL data.

func (*MockS3) GetBucketEncryption

func (m *MockS3) GetBucketEncryption(in *s3.GetBucketEncryptionInput) (*s3.GetBucketEncryptionOutput, error)

GetBucketEncryption is a mock function to return fake S3 Bucket encryption data.

func (*MockS3) GetBucketLifecycleConfiguration

func (m *MockS3) GetBucketLifecycleConfiguration(
	in *s3.GetBucketLifecycleConfigurationInput) (*s3.GetBucketLifecycleConfigurationOutput, error)

GetBucketLifecycleConfiguration is a mock function to return fake S3 Bucket lifecycle configuration data.

func (*MockS3) GetBucketLocation

func (m *MockS3) GetBucketLocation(in *s3.GetBucketLocationInput) (*s3.GetBucketLocationOutput, error)

GetBucketLocation is a mock function to return fake S3 Bucket location data.

func (*MockS3) GetBucketLogging

func (m *MockS3) GetBucketLogging(in *s3.GetBucketLoggingInput) (*s3.GetBucketLoggingOutput, error)

GetBucketLogging is a mock function to return fake S3 Bucket Logging data.

func (*MockS3) GetBucketPolicy

func (m *MockS3) GetBucketPolicy(in *s3.GetBucketPolicyInput) (*s3.GetBucketPolicyOutput, error)

GetBucketPolicy is a mock function to return fake S3 Bucket Policy data.

func (*MockS3) GetBucketTagging

func (m *MockS3) GetBucketTagging(in *s3.GetBucketTaggingInput) (*s3.GetBucketTaggingOutput, error)

func (*MockS3) GetBucketVersioning

func (m *MockS3) GetBucketVersioning(in *s3.GetBucketVersioningInput) (*s3.GetBucketVersioningOutput, error)

GetBucketVersioning is a mock function to return fake S3 Bucket versioning data.

func (*MockS3) GetPublicAccessBlock

func (m *MockS3) GetPublicAccessBlock(in *s3.GetPublicAccessBlockInput) (*s3.GetPublicAccessBlockOutput, error)

GetPublicAccessBlock is a mock function to return fake S3 public access block data.

func (*MockS3) ListBuckets

func (m *MockS3) ListBuckets(in *s3.ListBucketsInput) (*s3.ListBucketsOutput, error)

ListBuckets is a mock function to return fake S3 bucket data

type MockSTS

type MockSTS struct {
	TestInput func(*sts.AssumeRoleInput)
	stsiface.STSAPI
	mock.Mock
}

MockSTS is a mock STS client.

func (*MockSTS) AssumeRole

func (s *MockSTS) AssumeRole(input *sts.AssumeRoleInput) (*sts.AssumeRoleOutput, error)

AssumeRole mocks a STS.AssumeRole function call. This is adopted from AWS' testing for the stscreds library: https://bit.ly/2ZOnVqg

func (*MockSTS) GetCallerIdentity

func (s *MockSTS) GetCallerIdentity(
	in *sts.GetCallerIdentityInput) (*sts.GetCallerIdentityOutput, error)

GetCallerIdentity is a mock function to return the caller identity.

type MockWaf

type MockWaf struct {
	wafiface.WAFAPI
	mock.Mock
}

MockWaf is a mock WAF client

func BuildMockWafSvc

func BuildMockWafSvc(funcs []string) (mockSvc *MockWaf)

BuildMockWafSvc builds and returns a MockWaf struct

Additionally, the appropriate calls to On and Return are made based on the strings passed in

func BuildMockWafSvcAll

func BuildMockWafSvcAll() (mockSvc *MockWaf)

BuildWafServiceSvcAll builds and returns a MockWaf struct

Additionally, the appropriate calls to On and Return are made for all possible function calls

func BuildMockWafSvcAllError

func BuildMockWafSvcAllError() (mockSvc *MockWaf)

BuildMockWafSvcAllError builds and returns a MockWaf struct with errors set

Additionally, the appropriate calls to On and Return are made for all possible function calls

func BuildMockWafSvcError

func BuildMockWafSvcError(funcs []string) (mockSvc *MockWaf)

BuildMockWafSvcError builds and returns a MockWaf struct with errors set

Additionally, the appropriate calls to On and Return are made based on the strings passed in

func (*MockWaf) GetRule

func (m *MockWaf) GetRule(in *waf.GetRuleInput) (*waf.GetRuleOutput, error)

func (*MockWaf) GetWebACL

func (m *MockWaf) GetWebACL(in *waf.GetWebACLInput) (*waf.GetWebACLOutput, error)

func (*MockWaf) ListTagsForResource

func (m *MockWaf) ListTagsForResource(in *waf.ListTagsForResourceInput) (*waf.ListTagsForResourceOutput, error)

func (*MockWaf) ListWebACLs

func (m *MockWaf) ListWebACLs(in *waf.ListWebACLsInput) (*waf.ListWebACLsOutput, error)

type MockWafRegional

type MockWafRegional struct {
	wafregionaliface.WAFRegionalAPI
	mock.Mock
}

MockWafRegional is a mock WAF regional client

func BuildMockWafRegionalSvc

func BuildMockWafRegionalSvc(funcs []string) (mockSvc *MockWafRegional)

BuildMockWafRegionalSvc builds and returns a MockWafRegional struct

Additionally, the appropriate calls to On and Return are made based on the strings passed in

func BuildMockWafRegionalSvcAll

func BuildMockWafRegionalSvcAll() (mockSvc *MockWafRegional)

BuildWafRegionalServiceSvcAll builds and returns a MockWafRegional struct

Additionally, the appropriate calls to On and Return are made for all possible function calls

func BuildMockWafRegionalSvcAllError

func BuildMockWafRegionalSvcAllError() (mockSvc *MockWafRegional)

BuildMockWafRegionalSvcAllError builds and returns a MockWafRegional struct with errors set

Additionally, the appropriate calls to On and Return are made for all possible function calls

func BuildMockWafRegionalSvcError

func BuildMockWafRegionalSvcError(funcs []string) (mockSvc *MockWafRegional)

BuildMockWafRegionalSvcError builds and returns a MockWafRegional struct with errors set

Additionally, the appropriate calls to On and Return are made based on the strings passed in

func (*MockWafRegional) GetRule

func (m *MockWafRegional) GetRule(in *waf.GetRuleInput) (*waf.GetRuleOutput, error)

func (*MockWafRegional) GetWebACL

func (*MockWafRegional) ListTagsForResource

func (*MockWafRegional) ListWebACLs

Jump to

Keyboard shortcuts

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