Documentation ¶
Index ¶
- Constants
- Variables
- func AWSCurrentAccountId(t *testing.T) string
- func Boolptr(in bool) *bool
- func Clean(dir string)
- func Cleanup(t *testing.T, options *terraform.Options)
- func CreateRole(t *testing.T) string
- func CreateSecurityGroup(t *testing.T, region, vpc string) string
- func DeleteRole(t *testing.T, name string)
- func DeleteSecurityGroup(t *testing.T, region, id string)
- func Destroy(t *testing.T, options *terraform.Options, retries ...int)
- func EnvVar(name string) string
- func Int64ptr(in int64) *int64
- func ListEnvVar(name string) []string
- func Options(region string, vars map[string]interface{}) *terraform.Options
- func RandomString(chars string, length int) string
- func Run(t *testing.T, options *terraform.Options)
- func S3SimulateRequest(t *testing.T, region, action, bucketArn, bucketPolicy string, ...) *iam.EvaluationResult
- func Strptr(in string) *string
- func UniqueId() string
- type S3BucketPolicy
- type Test
- type TestMode
Constants ¶
View Source
const ( //EnvVPCID is a premade test vpc EnvVPCID = "VPC_ID" // EnvDatabaseSubnetGroup is a collection of database subnets EnvDatabaseSubnetGroup = "DATABASE_SUBNET_GROUP" // EnvPrivateSubnets is a comma separated list of private subnets EnvPrivateSubnets = "PRIVATE_SUBNETS" // EnvVPCCIDRBlock is the premate test vpc CIDR block EnvVPCCIDRBlock = "VPC_CIDR_BLOCK" // EnvRoute53ZoneID is the premade test route53 zone EnvRoute53ZoneID = "ROUTE53_ZONE_ID" // EnvRoute53ZoneName is the premate test route53 zone EnvRoute53ZoneName = "ROUTE53_ZONE_NAME" // EnvWildcardCertARN is a premade test ACM cert EnvWildcardCertARN = "WILDCARD_CERT_ARN" // EnvWildcardCloudfrontCertARN is a premate test ACM cert in us-east-1 EnvWildcardCloudfrontCertARN = "CLOUDFRONT_WILDCARD_CERT_ARN" // EnvAccountID is the aws account id EnvAccountID = "ACCOUNT_ID" // EnvAWSProfile is the aws profile EnvAWSProfile = "AWS_PROFILE" )
View Source
const ( // IAMRegion IAM is allegedly hosted in us-east-1, so use this region for IAM related things IAMRegion = "us-east-1" DefaultRegion = "us-west-2" )
View Source
const Alpha = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz"
View Source
const AlphaNum = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789"
Variables ¶
View Source
var UserArn = "arn:aws:iam::119435350371:user/ci/cztack-ci"
Functions ¶
func AWSCurrentAccountId ¶
func CreateRole ¶
CreateRole will create a new role with a random name and path and return the name.
func CreateSecurityGroup ¶ added in v0.14.0
func DeleteRole ¶
func DeleteSecurityGroup ¶ added in v0.14.0
func ListEnvVar ¶ added in v0.14.0
func RandomString ¶ added in v0.14.0
func S3SimulateRequest ¶ added in v0.35.0
func S3SimulateRequest(t *testing.T, region, action, bucketArn, bucketPolicy string, secureTransport bool) *iam.EvaluationResult
S3S3SimulateRequest uses the IAM policy simulator to run end-to-end tests on permissions
func UniqueId ¶ added in v0.14.0
func UniqueId() string
UniqueId returns a unique (ish) id we can attach to resources and tfstate files so they don't conflict with each other Uses base 62 to generate a 6 character string that's unlikely to collide with the handful of tests we run in parallel. Based on code here: http://stackoverflow.com/a/9543797/483528
Types ¶
type S3BucketPolicy ¶ added in v0.35.0
type S3BucketPolicy struct { Statement []struct { Sid string Effect string Principal string Action string Resource []string Condition map[string]map[string]string } }
func UnmarshalS3BucketPolicy ¶ added in v0.35.0
func UnmarshalS3BucketPolicy(in string) (*S3BucketPolicy, error)
UnmarshalS3BucketPolicy will parse an s3 bucket policy and return as a go struct. Only parts that have been used are supported so far
Click to show internal directories.
Click to hide internal directories.