Documentation
¶
Index ¶
- func AssertS3BucketNotificationExists(t testing.TestingT, region string, bucketName string)
- func AssertS3BucketNotificationExistsE(t testing.TestingT, region string, bucketName string) error
- func ChangeMessageVisibility(t testing.TestingT, awsRegion string, queueURL string, receipt string, ...)
- func ChangeMessageVisibilityE(t testing.TestingT, awsRegion string, queueURL string, receipt string, ...) error
- func DeployUsingTerraform(t *testing.T, workingDir string, additionalRetryableErrors map[string]string)
- func DescribeSfnExecution(t testing.TestingT, awsRegion string, executionArn string) *sfn.DescribeExecutionOutput
- func DescribeSfnExecutionE(t testing.TestingT, awsRegion string, executionArn string) (*sfn.DescribeExecutionOutput, error)
- func DescribeStream(t testing.TestingT, region string, streamName string) *types.StreamDescription
- func DescribeStreamE(t testing.TestingT, region string, streamName string) (*types.StreamDescription, error)
- func FilterLogEvents(t testing.TestingT, awsRegion string, logGroupName string) []string
- func FilterLogEventsE(t testing.TestingT, awsRegion string, logGroupName string) ([]string, error)
- func ForwardingLogger(t *testing.T, targetLogger *loggers.Logger) *zap.Logger
- func GetAcmCertificateStatus(t testing.TestingT, awsRegion string, certArn string) types.CertificateStatus
- func GetAcmCertificateStatusE(t testing.TestingT, awsRegion string, certArn string) (types.CertificateStatus, error)
- func GetAlarmE(t testing.TestingT, awsRegion string, alarmName string, ...) (*cloudwatch.DescribeAlarmsOutput, error)
- func GetCompositeAlarm(t testing.TestingT, awsRegion string, alarmName string) *types.CompositeAlarm
- func GetCompositeAlarmE(t testing.TestingT, awsRegion string, alarmName string) (*types.CompositeAlarm, error)
- func GetDashboardBody(t testing.TestingT, awsRegion string, dashboardName string) *string
- func GetDashboardBodyE(t testing.TestingT, awsRegion string, dashboardName string) (*string, error)
- func GetDataProtectionPolicyDocument(t testing.TestingT, awsRegion string, logGroupName string) string
- func GetDataProtectionPolicyDocumentE(t testing.TestingT, awsRegion string, logGroupName string) (*string, error)
- func GetDistributionE(t testing.TestingT, region string, distributionId string) (*types.Distribution, error)
- func GetKmsAlias(t testing.TestingT, region string, aliasName string) types.AliasListEntry
- func GetKmsAliasE(t testing.TestingT, region string, aliasName string) (*types.AliasListEntry, error)
- func GetKmsKey(t testing.TestingT, region string, cmkID string) *types.KeyMetadata
- func GetKmsKeyE(t testing.TestingT, region string, cmkID string) (*types.KeyMetadata, error)
- func GetKmsKeyPolicy(t testing.TestingT, region string, cmkID string) string
- func GetKmsKeyPolicyE(t testing.TestingT, region string, cmkID string) (*string, error)
- func GetLogGroup(t testing.TestingT, awsRegion string, logGroupName string) *logtypes.LogGroup
- func GetLogGroupE(t testing.TestingT, awsRegion string, logGroupName string) (*logtypes.LogGroup, error)
- func GetMetricAlarm(t testing.TestingT, awsRegion string, alarmName string) *types.MetricAlarm
- func GetMetricAlarmE(t testing.TestingT, awsRegion string, alarmName string) (*types.MetricAlarm, error)
- func GetS3BucketNotificationE(t testing.TestingT, region string, bucketName string) (*s3.GetBucketNotificationConfigurationOutput, error)
- func GetStreamResourcePolicy(t testing.TestingT, region string, streamArn string) string
- func GetStreamResourcePolicyE(t testing.TestingT, region string, streamArn string) (*string, error)
- func InvokeFunctionWithParams(t testing.TestingT, region, functionName string, input *LambdaOptions) *terratestaws.LambdaOutput
- func InvokeFunctionWithParamsE(t testing.TestingT, region, functionName string, input *LambdaOptions) (*terratestaws.LambdaOutput, error)
- func LoadOutputAttribute(t *testing.T, terraformOptions *terraform.Options, key, attribute string) string
- func LoadSynthDependencies(t *testing.T, testFolder string, dependencies *map[string]string)
- func NewCloudFrontclient(t testing.TestingT) *cloudfront.Client
- func NewCloudFrontclientE(t testing.TestingT) (*cloudfront.Client, error)
- func NewCloudWatchClient(t testing.TestingT, region string) *cloudwatch.Client
- func NewCloudWatchClientE(t testing.TestingT, region string) (*cloudwatch.Client, error)
- func NewCloudWatchEventsClient(t testing.TestingT, region string) *cloudwatchevents.Client
- func NewCloudWatchEventsClientE(t testing.TestingT, region string) (*cloudwatchevents.Client, error)
- func NewEventBridgeClient(t testing.TestingT, region string) *eventbridge.Client
- func NewEventBridgeClientE(t testing.TestingT, region string) (*eventbridge.Client, error)
- func NewKinesisClient(t testing.TestingT, region string) *kinesis.Client
- func NewKinesisClientE(t testing.TestingT, region string) (*kinesis.Client, error)
- func NewSfnclient(t testing.TestingT, awsRegion string) *sfn.Client
- func NewSfnclientE(t testing.TestingT, awsRegion string) (*sfn.Client, error)
- func PrettyPrintBeforeAfter(before interface{}, after interface{}) (string, error)
- func PrettyPrintResourceChange(rc *tfjson.ResourceChange) (string, error)
- func PutEvents(t testing.TestingT, region string, entries []types.PutEventsRequestEntry)
- func PutEventsE(t testing.TestingT, region string, entries []types.PutEventsRequestEntry) error
- func SaveSynthDependencies(t *testing.T, testFolder string, dependencies *map[string]string)
- func SendMessageFifoToQueueWithDeduplicationId(t testing.TestingT, awsRegion string, queueURL string, message string, ...)
- func SendMessageToFifoQueueWithDeduplicationIdE(t testing.TestingT, awsRegion string, queueURL string, message string, ...) error
- func StartSfnExecution(t testing.TestingT, awsRegion string, stateMachineArn string, ...) *string
- func StartSfnExecutionE(t testing.TestingT, awsRegion string, stateMachineArn string, ...) (*string, error)
- func StopSfnExecution(t testing.TestingT, awsRegion string, executionArn string)
- func StopSfnExecutionE(t testing.TestingT, awsRegion string, executionArn string) error
- func SynthApp(t *testing.T, testApp, tfWorkingDir string, env map[string]string, ...)
- func TestCloudFrontFunction(t testing.TestingT, name string, stage string, event CloudFrontFunctionEvent, ...) error
- func TestCloudFrontFunctionWithCustomValidation(t testing.TestingT, name string, stage string, event CloudFrontFunctionEvent, ...) error
- func TestCloudFrontFunctionWithCustomValidationE(t testing.TestingT, name string, stage types.FunctionStage, ...) error
- func URLDecode(encoded string) (string, error)
- func UndeployUsingTerraform(t *testing.T, workingDir string)
- func UploadS3File(t testing.TestingT, awsRegion string, s3BucketName string, key string, ...)
- func UploadS3FileE(t testing.TestingT, awsRegion string, s3BucketName string, key string, ...) error
- func WaitForCertificateIssued(t testing.TestingT, certArn string, region string, maxRetries int, ...)
- func WaitForCertificateIssuedE(t testing.TestingT, certArn string, region string, maxRetries int, ...) error
- func WaitForDistributionDeployed(t testing.TestingT, region string, distributionId string, maxRetries int, ...)
- func WaitForDistributionStatus(t testing.TestingT, region string, distributionId string, status string, ...)
- func WaitForDistributionStatusE(t testing.TestingT, region string, distributionId string, status string, ...) error
- func WaitForLogEvents(t testing.TestingT, awsRegion string, logGroupName string, maxRetries int, ...) []string
- func WaitForLogEventsE(t testing.TestingT, awsRegion string, logGroupName string, maxRetries int, ...) ([]string, error)
- func WaitForStreamActive(t testing.TestingT, region string, streamName string, maxRetries int, ...)
- func WaitForStreamActiveE(t testing.TestingT, region string, streamName string, maxRetries int, ...) error
- func WaitForStreamStatus(t testing.TestingT, region string, streamName string, ...)
- func WaitForStreamStatusE(t testing.TestingT, region string, streamName string, ...) error
- type ActivityHandler
- func GetSfnActivity(t testing.TestingT, awsRegion string, activityArn string, workerName *string) ActivityHandler
- func GetSfnActivityE(t testing.TestingT, awsRegion string, activityArn string, workerName *string) (ActivityHandler, error)
- func NewActivityHandler(sfnClient *sfn.Client, input interface{}, taskToken *string) ActivityHandler
- type AttachedPermissionsBoundary
- type BucketNotificationNotEnabledError
- type CertificateNotIssuedError
- type CloudFrontFunctionEvent
- type CloudFrontFunctionValidationFailed
- type CloudFrontTestFunctionResult
- type CloudwatchEventsRuleInfo
- type Context
- type ForwardingCore
- type IamManagedPolicyNotFoundError
- type IamRoleNotFoundError
- type InlinePolicy
- type InvocationTypeOption
- type LambdaOptions
- type ManagedPolicy
- type MultiValue
- type MultiValueAttrs
- type QueueMessageResponse
- type Request
- type Response
- type ResponseCookie
- type ResponseCookieEntry
- type Role
- type SfnExecutionOutput
- type ValueEntry
- type ValueObject
- type Variables
- type Version
- type Viewer
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func AssertS3BucketNotificationExists ¶
AssertS3BucketNotificationExists checks if the given S3 bucket has a notification configuration and returns an error if it does not.
func AssertS3BucketNotificationExistsE ¶
AssertS3BucketVersioningExistsE checks if the given S3 bucket has a notification configuration and returns an error if it does not.
func ChangeMessageVisibility ¶
func DeployUsingTerraform ¶
func DescribeSfnExecution ¶
func DescribeSfnExecution(t testing.TestingT, awsRegion string, executionArn string) *sfn.DescribeExecutionOutput
DescribeSfnExecution returns the description of the specified execution. This will fail the test if there is an error.
func DescribeSfnExecutionE ¶
func DescribeSfnExecutionE(t testing.TestingT, awsRegion string, executionArn string) (*sfn.DescribeExecutionOutput, error)
DescribeSfnExecutionE returns the description of the specified execution.
func DescribeStream ¶
DescribeStream returns the description of a Kinesis stream.
func DescribeStreamE ¶
func DescribeStreamE(t testing.TestingT, region string, streamName string) (*types.StreamDescription, error)
DescribeStreamE returns the description of a Kinesis stream.
func FilterLogEvents ¶
GetCloudWatchLogEntries returns the CloudWatch log messages in the given region for the given log stream and log group.
func FilterLogEventsE ¶
GetCloudWatchLogEntriesE returns the CloudWatch log messages in the given region for the given log stream and log group.
func ForwardingLogger ¶
ForwardingLogger returns a zap logger that forwards all log messages to terratestLogger
func GetAcmCertificateStatus ¶
func GetAcmCertificateStatus(t testing.TestingT, awsRegion string, certArn string) types.CertificateStatus
Get Certificate Status
func GetAcmCertificateStatusE ¶
func GetAcmCertificateStatusE(t testing.TestingT, awsRegion string, certArn string) (types.CertificateStatus, error)
GetAcmCertificateStatusE gets the ACM certificate status for the given certificate ARN in the given region.
func GetAlarmE ¶
func GetAlarmE(t testing.TestingT, awsRegion string, alarmName string, alarmType types.AlarmType) (*cloudwatch.DescribeAlarmsOutput, error)
GetMetricAlarmE returns the details of the specified alarm.
func GetCompositeAlarm ¶
func GetCompositeAlarm(t testing.TestingT, awsRegion string, alarmName string) *types.CompositeAlarm
GetMetricAlarm returns the details of the specified metric alarm.
func GetCompositeAlarmE ¶
func GetCompositeAlarmE(t testing.TestingT, awsRegion string, alarmName string) (*types.CompositeAlarm, error)
GetMetricAlarmE returns the details of the specified alarm.
func GetDashboardBody ¶
GetDashboardBody returns the body of the specified dashboard.
func GetDashboardBodyE ¶
GetDashboardBodyE returns the body of the specified dashboard.
func GetDataProtectionPolicyDocument ¶
func GetDataProtectionPolicyDocument(t testing.TestingT, awsRegion string, logGroupName string) string
GetDataProtectionPolicyDocument returns the policy of the specified log group data protection policy.
func GetDataProtectionPolicyDocumentE ¶
func GetDataProtectionPolicyDocumentE(t testing.TestingT, awsRegion string, logGroupName string) (*string, error)
GetDataProtectionPolicyDocumentE returns the details of the specified log group data protection policy.
func GetDistributionE ¶ added in v0.0.10
func GetDistributionE(t testing.TestingT, region string, distributionId string) (*types.Distribution, error)
GetDistributionE returns the configuration of a CloudFront Distribution
func GetKmsAlias ¶
GetKmsAlias gets the KMS alias or panic if not found.
func GetKmsAliasE ¶
func GetKmsAliasE(t testing.TestingT, region string, aliasName string) (*types.AliasListEntry, error)
GetKmsAliasE gets the KMS alias
func GetKmsKeyE ¶
GetKmsKeyE gets the metadata for KMS Customer Master Key (CMK) in the given region with the given ID. The ID can be an alias, such as as "alias/my-cmk".
func GetKmsKeyPolicy ¶
GetKmsKeyPolicy gets the key policy document in JSON format.
func GetKmsKeyPolicyE ¶
GetKmsKeyPolicyE gets the key policy document in JSON format.
func GetLogGroup ¶
GetLogGroup returns the details of the specified log group.
func GetLogGroupE ¶
func GetLogGroupE(t testing.TestingT, awsRegion string, logGroupName string) (*logtypes.LogGroup, error)
GetLogGroupE returns the details of the specified log group.
func GetMetricAlarm ¶
GetMetricAlarm returns the details of the specified alarm.
func GetMetricAlarmE ¶
func GetMetricAlarmE(t testing.TestingT, awsRegion string, alarmName string) (*types.MetricAlarm, error)
GetMetricAlarmE returns the details of the specified composite alarm.
func GetS3BucketNotificationE ¶
func GetS3BucketNotificationE(t testing.TestingT, region string, bucketName string) (*s3.GetBucketNotificationConfigurationOutput, error)
GetS3BucketNotificationE fetches the given bucket's notification configuration
func GetStreamResourcePolicy ¶
GetStreamResourcePolicy returns the Kinesis stream resource policy as a JSON string
func GetStreamResourcePolicyE ¶
GetStreamResourcePolicy returns the Kinesis stream resource policy as a JSON string or an error
func InvokeFunctionWithParams ¶
func InvokeFunctionWithParams(t testing.TestingT, region, functionName string, input *LambdaOptions) *terratestaws.LambdaOutput
InvokeFunctionWithParams invokes a lambda function using parameters supplied in the LambdaOptions struct and returns values in a LambdaOutput struct. Checks for failure using "require".
func InvokeFunctionWithParamsE ¶
func InvokeFunctionWithParamsE(t testing.TestingT, region, functionName string, input *LambdaOptions) (*terratestaws.LambdaOutput, error)
InvokeFunctionWithParamsE invokes a lambda function using parameters supplied in the LambdaOptions struct. Returns the status code and payload in a LambdaOutput struct and the error. A non-nil error will either reflect a problem with the parameters supplied to this function or an error returned by the Lambda.
func LoadOutputAttribute ¶
func LoadOutputAttribute(t *testing.T, terraformOptions *terraform.Options, key, attribute string) string
LoadOutputAttribute loads the attribute of a output key from Terraform outputs and ensures it is not empty.
func LoadSynthDependencies ¶
LoadSynthDependencies reads a saved map of dependencies at synth time to the given path.
func NewCloudFrontclient ¶
func NewCloudFrontclient(t testing.TestingT) *cloudfront.Client
NewCloudFrontclient returns a client for CloudFront. This will fail the test and stop execution if there is an error.
func NewCloudFrontclientE ¶
func NewCloudFrontclientE(t testing.TestingT) (*cloudfront.Client, error)
NewCloudFrontclientE returns a client for CloudFront.
func NewCloudWatchClient ¶
func NewCloudWatchClient(t testing.TestingT, region string) *cloudwatch.Client
NewCloudWatchEventsClient creates a new CloudWatch Events client.
func NewCloudWatchClientE ¶
NewCloudWatchEventsClientE creates a new CloudWatch Logs client.
func NewCloudWatchEventsClient ¶
func NewCloudWatchEventsClient(t testing.TestingT, region string) *cloudwatchevents.Client
NewCloudWatchEventsClient creates a new CloudWatch Events client.
func NewCloudWatchEventsClientE ¶
func NewCloudWatchEventsClientE(t testing.TestingT, region string) (*cloudwatchevents.Client, error)
NewCloudWatchEventsClientE creates a new CloudWatch Logs client.
func NewEventBridgeClient ¶
func NewEventBridgeClient(t testing.TestingT, region string) *eventbridge.Client
NewEventBridgeClient creates an RDS client.
func NewEventBridgeClientE ¶
NewEventBridgeClientE creates an RDS client.
func NewKinesisClient ¶
NewKinesisClient creates a kinesis client.
func NewKinesisClientE ¶
NewKinesisClientE creates a kinesis client.
func NewSfnclient ¶
NewSfnclient returns a client for StepFunctions. This will fail the test if there is an error.
func NewSfnclientE ¶
NewSfnclientE returns a client for StepFunctions.
func PrettyPrintBeforeAfter ¶
func PrettyPrintResourceChange ¶
func PrettyPrintResourceChange(rc *tfjson.ResourceChange) (string, error)
func PutEvents ¶
func PutEvents(t testing.TestingT, region string, entries []types.PutEventsRequestEntry)
PutEvents sends custom events to Amazon EventBridge so that they can be matched to rules.
func PutEventsE ¶
PutEventsE sends custom events to Amazon EventBridge so that they can be matched to rules.
func SaveSynthDependencies ¶
SaveSynthDependencies serializes and saves map of dependencies at test time to the given path.
func SendMessageFifoToQueueWithDeduplicationId ¶
func SendMessageFifoToQueueWithDeduplicationId(t testing.TestingT, awsRegion string, queueURL string, message string, messageGroupID string, messageDeduplicationId string)
SendMessageToFifoQueue sends the given message to the FIFO SQS queue with the given URL.
func SendMessageToFifoQueueWithDeduplicationIdE ¶
func SendMessageToFifoQueueWithDeduplicationIdE(t testing.TestingT, awsRegion string, queueURL string, message string, messageGroupID string, messageDeduplicationId string) error
SendMessageToFifoQueueWithDeduplicationIdE sends the given message to the FIFO SQS queue with the given URL.
func StartSfnExecution ¶
func StartSfnExecution(t testing.TestingT, awsRegion string, stateMachineArn string, input interface{}) *string
StartSfnExecution starts a new execution of the specified state machine and returns the execution ARN. This will fail the test if there is an error.
func StartSfnExecutionE ¶
func StartSfnExecutionE(t testing.TestingT, awsRegion string, stateMachineArn string, input interface{}) (*string, error)
StartSfnExecutionE starts a new execution of the specified state machine and returns the execution ARN.
func StopSfnExecution ¶
StopSfnExecution stops the specified execution. This will fail the test if there is an error.
func StopSfnExecutionE ¶
StopSfnExecutionE stops the specified execution.
func SynthApp ¶
func SynthApp(t *testing.T, testApp, tfWorkingDir string, env map[string]string, additionalAppDirs ...string)
Synth app relative to the integration namespace
func TestCloudFrontFunction ¶
func TestCloudFrontFunction(t testing.TestingT, name string, stage string, event CloudFrontFunctionEvent, expectedError string, expectedOutput *map[string]interface{}) error
Tests a CloudFront function.
To test a function, you provide an event object that represents an HTTP request or response that your CloudFront distribution could receive in production. CloudFront runs the function, passing it the event object that you provided, and returns the function's result (the modified event object) in the response. The response also contains function logs and error messages, if any exist. For more information about testing functions, see Testing functionsin the Amazon CloudFront Developer Guide.
To test a function, you provide the function's name and stage (DEVELOPMENT or LIVE) along with the event object. To get the function's name and version, you can use ListFunctions and DescribeFunction.
func TestCloudFrontFunctionWithCustomValidation ¶
func TestCloudFrontFunctionWithCustomValidation(t testing.TestingT, name string, stage string, event CloudFrontFunctionEvent, validateResponse responseValidator) error
TestCloudFrontFunctionWithCustomValidation performs a Function test and validate the response. Fails the test if there is an error.
func TestCloudFrontFunctionWithCustomValidationE ¶
func TestCloudFrontFunctionWithCustomValidationE(t testing.TestingT, name string, stage types.FunctionStage, event CloudFrontFunctionEvent, validateResponse responseValidator) error
TestCloudFrontFunctionWithCustomValidationE performs a Function test and validate the response.
func UndeployUsingTerraform ¶
func UploadS3File ¶
func UploadS3File(t testing.TestingT, awsRegion string, s3BucketName string, key string, body string)
UploadS3File uploads a file to the given S3 bucket with the given key and body and fails the test if there is any error.
func UploadS3FileE ¶
func UploadS3FileE(t testing.TestingT, awsRegion string, s3BucketName string, key string, body string) error
UploadS3FileE uploads a file to the given S3 bucket with the given key and body and returns an error if there is any.
func WaitForCertificateIssued ¶
func WaitForCertificateIssued( t testing.TestingT, certArn string, region string, maxRetries int, sleepBetweenRetries time.Duration, )
WaitForCertificateIssued waits for the certificate to be issued
func WaitForCertificateIssuedE ¶
func WaitForCertificateIssuedE( t testing.TestingT, certArn string, region string, maxRetries int, sleepBetweenRetries time.Duration, ) error
WaitForCertificateIssuedE waits for the ACM Certificate to be issued
func WaitForDistributionDeployed ¶ added in v0.0.10
func WaitForDistributionDeployed(t testing.TestingT, region string, distributionId string, maxRetries int, sleepBetweenRetries time.Duration)
WaitForDistributionDeployed waits for a CloudFront distribution to be deployed.
func WaitForDistributionStatus ¶ added in v0.0.10
func WaitForDistributionStatus( t testing.TestingT, region string, distributionId string, status string, maxRetries int, sleepBetweenRetries time.Duration, )
WaitForDistributionStatus waits for a CloudFront distribution to have the specified status.
func WaitForDistributionStatusE ¶ added in v0.0.10
func WaitForDistributionStatusE( t testing.TestingT, region string, distributionId string, status string, maxRetries int, sleepBetweenRetries time.Duration, ) error
WaitForDistributionStatusE waits for a CloudFront distribution to have the specified status.
func WaitForLogEvents ¶
func WaitForLogEvents( t testing.TestingT, awsRegion string, logGroupName string, maxRetries int, sleepBetweenRetries time.Duration, ) []string
WaitForLogEvents waits for log events to appear in the given CloudWatch Log group in the given region
func WaitForLogEventsE ¶
func WaitForLogEventsE( t testing.TestingT, awsRegion string, logGroupName string, maxRetries int, sleepBetweenRetries time.Duration, ) ([]string, error)
WaitForLogEventsE waits for log events to appear in the given CloudWatch Log group in the given region
func WaitForStreamActive ¶
func WaitForStreamActive( t testing.TestingT, region string, streamName string, maxRetries int, sleepBetweenRetries time.Duration, )
WaitForStreamActive waits for a Kinesis stream to be active.
func WaitForStreamActiveE ¶
func WaitForStreamActiveE( t testing.TestingT, region string, streamName string, maxRetries int, sleepBetweenRetries time.Duration, ) error
WaitForStreamActiveE waits for a Kinesis stream to be active.
Types ¶
type ActivityHandler ¶
type ActivityHandler interface {
// Input returns the input data of the activity.
Input() interface{}
// SendSuccess sends a success message to the State Machine.
SendSuccess(output interface{}) error
// SendFailure sends a failure message to the State Machine.
SendFailure(errCode string, cause string) error
// SendHeartbeat sends a heartbeat message to the State Machine.
SendHeartbeat() error
}
func GetSfnActivity ¶
func GetSfnActivity(t testing.TestingT, awsRegion string, activityArn string, workerName *string) ActivityHandler
GetSfnActivity for a running Sate Machine. Used by workers to retrieve a task (with the specified activity ARN) which has been scheduled for execution by a running state machine.
func GetSfnActivityE ¶
func GetSfnActivityE(t testing.TestingT, awsRegion string, activityArn string, workerName *string) (ActivityHandler, error)
GetSfnActivityE for a running Sate Machine. Used by workers to retrieve a task (with the specified activity ARN) which has been scheduled for execution by a running state machine.
func NewActivityHandler ¶
func NewActivityHandler(sfnClient *sfn.Client, input interface{}, taskToken *string) ActivityHandler
type AttachedPermissionsBoundary ¶
type AttachedPermissionsBoundary struct {
PermissionsBoundaryArn string `json:"permissionsBoundaryArn"` // The ARN of the policy used to set the permissions boundary for the user or role.
PermissionsBoundaryType string `json:"permissionsBoundaryType"` // The permissions boundary usage type that indicates what type of IAM resource is used as the permissions boundary for an entity. This data type can only have a value of Policy.
}
type BucketNotificationNotEnabledError ¶
type BucketNotificationNotEnabledError struct {
// contains filtered or unexported fields
}
BucketNotificationNotEnabledError is returned when the S3 bucket notification is not enabled.
func NewBucketNotificationNotEnabledError ¶
func NewBucketNotificationNotEnabledError(region, bucketName string) BucketNotificationNotEnabledError
func (BucketNotificationNotEnabledError) Error ¶
func (err BucketNotificationNotEnabledError) Error() string
type CertificateNotIssuedError ¶
type CertificateNotIssuedError struct {
// contains filtered or unexported fields
}
CertificateNotIssuedError is returned when the ACM Certificate status is not issued.
func NewCertificateNotIssuedError ¶
func NewCertificateNotIssuedError(certArn string, currentStatus acmTypes.CertificateStatus) CertificateNotIssuedError
func (CertificateNotIssuedError) Error ¶
func (err CertificateNotIssuedError) Error() string
type CloudFrontFunctionEvent ¶
type CloudFrontFunctionEvent struct {
Version Version `json:"version"` // The version field contains a string that specifies the version of the CloudFront Functions event object. The current version is 1.0.
Context Context `json:"context"` // The context object contains contextual information about the event
Viewer Viewer `json:"viewer"`
Request *Request `json:"request,omitempty"`
Response *Response `json:"response,omitempty"`
}
CloudFrontFunctionEvent represents the event object that you provide to test a CloudFront function. https://docs.aws.amazon.com/AmazonCloudFront/latest/DeveloperGuide/functions-event-structure.html
func ReadCloudFrontEvent ¶
func ReadCloudFrontEvent(path string) (*CloudFrontFunctionEvent, error)
type CloudFrontFunctionValidationFailed ¶
CloudFrontFunctionValidationFailed is an error that occurs if response validation fails.
func (CloudFrontFunctionValidationFailed) Error ¶
func (err CloudFrontFunctionValidationFailed) Error() string
type CloudFrontTestFunctionResult ¶
type CloudFrontTestFunctionResult struct {
Utilization int // The amount of time that the function took to run as a percentage of the maximum allowed time.
ErrorMessage *string
// The event object returned by the function. For more information about the
// structure of the event object, see [Event object structure]in the Amazon CloudFront Developer Guide.
//
// [Event object structure]: https://docs.aws.amazon.com/AmazonCloudFront/latest/DeveloperGuide/functions-event-structure.html
Output map[string]interface{}
// Contains the log lines that the function wrote (if any) when running the test.
ExecutionLogs []string
}
func TestCloudFrontFunctionE ¶
func TestCloudFrontFunctionE(t testing.TestingT, name string, stage types.FunctionStage, event CloudFrontFunctionEvent) (*CloudFrontTestFunctionResult, error)
TestCloudFrontFunctionE performs a Function test and validates the response.
type CloudwatchEventsRuleInfo ¶
type CloudwatchEventsRuleInfo struct {
Name string // The name of the rule.
Description string // The description of the rule.
State eventtypes.RuleState // Specifies whether the rule is enabled or disabled.
EventPattern string // The event pattern.
ScheduleExpression string // The scheduling expression. For example, "cron(0 20 * * ? *)", "rate(5 minutes)".
}
func DescribeEventRule ¶
func DescribeEventRule(t testing.TestingT, awsRegion string, ruleName string) *CloudwatchEventsRuleInfo
DescribeEventRule returns the details of the specified rule.
func DescribeEventRuleE ¶
func DescribeEventRuleE(t testing.TestingT, awsRegion string, ruleName string) (*CloudwatchEventsRuleInfo, error)
DescribeEventRuleE returns the details of the specified rule.
type Context ¶
type Context struct {
DistributionDomainName string `json:"distributionDomainName"` // The CloudFront domain name (for example, d111111abcdef8.cloudfront.net) of the distribution that's associated with the event.
DistributionID string `json:"distributionId"`
EventType string `json:"eventType"`
RequestID string `json:"requestId"`
}
type ForwardingCore ¶
a simple Zap Logger which forwards all log messages to terratestLogger
func (*ForwardingCore) Check ¶
func (fc *ForwardingCore) Check(e zapcore.Entry, ce *zapcore.CheckedEntry) *zapcore.CheckedEntry
type IamManagedPolicyNotFoundError ¶
type IamManagedPolicyNotFoundError struct {
// contains filtered or unexported fields
}
IamManagedPolicyNotFoundError is returned when the IAM managed policy is not found.
func NewIamManagedPolicyNotFoundError ¶
func NewIamManagedPolicyNotFoundError(policyArn string) IamManagedPolicyNotFoundError
func (IamManagedPolicyNotFoundError) Error ¶
func (err IamManagedPolicyNotFoundError) Error() string
type IamRoleNotFoundError ¶
type IamRoleNotFoundError struct {
// contains filtered or unexported fields
}
IamRoleNotFoundError is returned when the IAM role is not found.
func NewIamRoleNotFoundError ¶
func NewIamRoleNotFoundError(roleName string) IamRoleNotFoundError
func (IamRoleNotFoundError) Error ¶
func (err IamRoleNotFoundError) Error() string
type InlinePolicy ¶
type InlinePolicy struct {
PolicyDocument string `json:"policyDocument"` // The policy document.
PolicyName string `json:"policyName"` // The name of the policy.
}
Contains decoded inline document and policy name
type InvocationTypeOption ¶
type InvocationTypeOption string
TODO: PR "Event" Invocation Type support to terratest upstream ref: https://github.com/gruntwork-io/terratest/pull/817
const ( InvocationTypeRequestResponse InvocationTypeOption = "RequestResponse" InvocationTypeDryRun InvocationTypeOption = "DryRun" InvocationTypeEvent InvocationTypeOption = "Event" )
func (*InvocationTypeOption) Value ¶
func (itype *InvocationTypeOption) Value() (string, error)
type LambdaOptions ¶
type LambdaOptions struct {
// InvocationType can be one of InvocationTypeOption values:
// * InvocationTypeRequestResponse (default) - Invoke the function
// synchronously. Keep the connection open until the function
// returns a response or times out.
// * InvocationTypeDryRun - Validate parameter values and verify
// that the user or role has permission to invoke the function.
InvocationType *InvocationTypeOption
// Lambda function input; will be converted to JSON.
Payload interface{}
}
LambdaOptions contains additional parameters for InvokeFunctionWithParams(). It contains a subset of the fields found in the lambda.InvokeInput struct.
type ManagedPolicy ¶
type ManagedPolicy struct {
Arn string `json:"arn"` // The Amazon Resource Name (ARN).
PolicyDocument string `json:"policyDocument"` // The policy document.
AttachmentCount int32 `json:"attachmentCount"` // The number of entities (users, groups, and roles) that the policy is attached to.
CreateDate time.Time `json:"createDate"` // The date and time, in ISO 8601 date-time format, when the policy was created.
DefaultVersionId string `json:"defaultVersionId"` // The identifier for the version of the policy that is set as the default version.
Description string `json:"description"` // A friendly description of the policy.
IsAttachable bool `json:"isAttachable"` // Specifies whether the policy can be attached to an IAM user, group, or role.
Path string `json:"path"` // The path to the policy.
PermissionsBoundaryUsageCount int32 `json:"permissionsBoundaryUsageCount"` // The number of entities (users and roles) for which the policy is used to set the permissions boundary.
PolicyId string `json:"policyId"` // The stable and unique string identifying the policy.
PolicyName string `json:"policyName"` // The friendly name (not ARN) identifying the policy.
Tags []types.Tag `json:"tags"` // A list of tags that are attached to the instance profile.
UpdateDate time.Time `json:"updateDate"` // The date and time, in ISO 8601 date-time format, when the policy was last updated.
}
Contains information about a managed policy.
func GetIamManagedPolicy ¶
func GetIamManagedPolicy(t testing.TestingT, awsRegion string, policyArn string) *ManagedPolicy
Get IAM Managed Policy, fail on error
func GetIamManagedPolicyE ¶
func GetIamManagedPolicyE(t testing.TestingT, awsRegion string, policyArn string) (*ManagedPolicy, error)
Get IAM Managed Policy, return result or error
type MultiValue ¶
type MultiValue struct {
Value string `json:"value"`
}
type MultiValueAttrs ¶
type QueueMessageResponse ¶
type QueueMessageResponse struct {
ReceiptHandle string
MessageBody string
ApproximateReceiveCount int64
SentTimestamp time.Time
Error error
}
QueueMessageResponse contains a queue message.
func WaitForQueueMessage ¶
func WaitForQueueMessage(t testing.TestingT, awsRegion string, queueURL string, timeout int) QueueMessageResponse
WaitForQueueMessage waits to receive a message from on the queueURL. Since the API only allows us to wait a max 20 seconds for a new message to arrive, we must loop TIMEOUT/20 number of times to be able to wait for a total of TIMEOUT seconds
type Request ¶
type Request struct {
Method string `json:"method"`
URI string `json:"uri"`
Querystring ValueObject `json:"querystring"`
Headers ValueObject `json:"headers"`
Cookies ValueObject `json:"cookies,omitempty"`
}
type Response ¶
type Response struct {
StatusCode int `json:"statusCode"`
StatusDescription *string `json:"statusDescription,omitempty"`
Headers *ValueObject `json:"headers,omitempty"`
Cookies *ResponseCookie `json:"cookies,omitempty"`
}
type ResponseCookie ¶
type ResponseCookie map[string]ResponseCookieEntry
type ResponseCookieEntry ¶
type ResponseCookieEntry struct {
Value string `json:"value"`
Attributes string `json:"attributes"`
MultiValue []MultiValueAttrs `json:"multiValue,omitempty"`
}
type Role ¶
type Role struct {
Arn string `json:"arn"` // The Amazon Resource Name (ARN) specifying the role.
AssumeRolePolicyDocument string `json:"assumeRolePolicyDocument"` // The policy that grants an entity permission to assume the role.
CreateDate time.Time `json:"createDate"` // The date and time, in ISO 8601 date-time format, when the role was created.
Description string `json:"description"` // A description of the role that you provide.
MaxSessionDuration int32 `json:"maxSessionDuration"` // The maximum session duration (in seconds) for the specified role.
Path string `json:"path"` // The path to the role.
PermissionsBoundary AttachedPermissionsBoundary `json:"permissionsBoundary"` // The ARN of the policy used to set the permissions boundary for the role.
RoleId string `json:"roleId"` // The stable and unique string identifying the role.
RoleLastUsed types.RoleLastUsed `json:"roleLastUsed"` // Contains information about the last time that an IAM role was used.
RoleName string `json:"roleName"` // The friendly name that identifies the role.
InlinePolicies []InlinePolicy `json:"inlinePolicies"` // The inline policies of the IAM role.
AttachedPolicyArns []string `json:"attachedPolicyArns"` // The Amazon Resource Names (ARNs) of the managed policies attached to the role.
Tags []types.Tag `json:"tags"` // A list of tags that are attached to the role.
}
IAM Role struct with Inline Policies and Attached Policy ARNs
func GetIamRole ¶
Get IAM Role with all inline policies and attached Policy ARNs, fail on error
type SfnExecutionOutput ¶
type SfnExecutionOutput struct {
// The current status of the execution.
Status types.ExecutionStatus
// The cause string if the state machine execution failed.
Cause string
// The error string if the state machine execution failed.
Error string
// The JSON output data of the execution. Length constraints apply to the payload
// size, and are expressed as bytes in UTF-8 encoding.
//
// This field is set only if the execution succeeds. If the execution fails, this
// field is the string Zero value ("").
Output string
}
ExecutionOutput contains the result of the SateMachine Execution.
func WaitForSfnExecutionStatus ¶
func WaitForSfnExecutionStatus( t testing.TestingT, awsRegion string, executionArn string, status types.ExecutionStatus, maxRetries int, sleepBetweenRetries time.Duration, ) *SfnExecutionOutput
WaitForSfnExecutionStatus waits for the specified execution to reach the desired status. This will fail the test if there is an error.
Executions of an EXPRESS state machine aren't supported by DescribeExecution unless a Map Run dispatched them.
func WaitForSfnExecutionStatusE ¶
func WaitForSfnExecutionStatusE( t testing.TestingT, awsRegion string, executionArn string, status types.ExecutionStatus, maxRetries int, sleepBetweenRetries time.Duration, ) (*SfnExecutionOutput, error)
WaitForSfnExecutionStatusE waits for the specified execution to reach the desired status. this will throw error on timeout or non-retryable Errors.
type ValueEntry ¶
type ValueEntry struct {
Value string `json:"value"`
MultiValue []MultiValue `json:"multiValue,omitempty"`
}
type ValueObject ¶
type ValueObject map[string]ValueEntry
type Version ¶
type Version string
const Version1_0 Version = "1.0"