aws

package
v0.0.7 Latest Latest
Warning

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

Go to latest
Published: Nov 3, 2024 License: GPL-3.0 Imports: 47 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AssertS3BucketNotificationExists added in v0.0.6

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

AssertS3BucketNotificationExists checks if the given S3 bucket has a notification configuration and returns an error if it does not.

func AssertS3BucketNotificationExistsE added in v0.0.6

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

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

func ChangeMessageVisibility added in v0.0.5

func ChangeMessageVisibility(t testing.TestingT, awsRegion string, queueURL string, receipt string, timeoutSeconds int32)

func ChangeMessageVisibilityE added in v0.0.5

func ChangeMessageVisibilityE(t testing.TestingT, awsRegion string, queueURL string, receipt string, timeoutSeconds int32) error

func DeployUsingTerraform added in v0.0.7

func DeployUsingTerraform(t *testing.T, workingDir string, additionalRetryableErrors map[string]string)

func DescribeSfnExecution added in v0.0.7

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 added in v0.0.7

func DescribeSfnExecutionE(t testing.TestingT, awsRegion string, executionArn string) (*sfn.DescribeExecutionOutput, error)

DescribeSfnExecutionE returns the description of the specified execution.

func FilterLogEvents added in v0.0.6

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

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

func FilterLogEventsE added in v0.0.6

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

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

func ForwardingLogger

func ForwardingLogger(t *testing.T, targetLogger *loggers.Logger) *zap.Logger

ForwardingLogger returns a zap logger that forwards all log messages to terratestLogger

func GetAcmCertificateStatus added in v0.0.4

func GetAcmCertificateStatus(t testing.TestingT, awsRegion string, certArn string) types.CertificateStatus

Get Certificate Status

func GetAcmCertificateStatusE added in v0.0.4

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 GetS3BucketNotificationE added in v0.0.6

func GetS3BucketNotificationE(t testing.TestingT, region string, bucketName string) (*s3.GetBucketNotificationConfigurationOutput, error)

GetS3BucketNotificationE fetches the given bucket's notification configuration

func InvokeFunctionWithParams added in v0.0.6

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 added in v0.0.6

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 added in v0.0.7

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 added in v0.0.7

func LoadSynthDependencies(t *testing.T, testFolder string, dependencies *map[string]string)

LoadSynthDependencies reads a saved map of dependencies at synth time to the given path.

func NewCloudFrontclient added in v0.0.4

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 added in v0.0.4

func NewCloudFrontclientE(t testing.TestingT) (*cloudfront.Client, error)

NewCloudFrontclientE returns a client for CloudFront.

func NewCloudWatchEventsClient added in v0.0.6

func NewCloudWatchEventsClient(t testing.TestingT, region string) *cloudwatchevents.Client

NewCloudWatchEventsClient creates a new CloudWatch Events client.

func NewCloudWatchEventsClientE added in v0.0.6

func NewCloudWatchEventsClientE(t testing.TestingT, region string) (*cloudwatchevents.Client, error)

NewCloudWatchEventsClientE creates a new CloudWatch Logs client.

func NewSfnclient added in v0.0.7

func NewSfnclient(t testing.TestingT, awsRegion string) *sfn.Client

NewSfnclient returns a client for StepFunctions. This will fail the test if there is an error.

func NewSfnclientE added in v0.0.7

func NewSfnclientE(t testing.TestingT, awsRegion string) (*sfn.Client, error)

NewSfnclientE returns a client for StepFunctions.

func PrettyPrintBeforeAfter added in v0.0.4

func PrettyPrintBeforeAfter(before interface{}, after interface{}) (string, error)

func PrettyPrintResourceChange

func PrettyPrintResourceChange(rc *tfjson.ResourceChange) (string, error)

func SaveSynthDependencies added in v0.0.7

func SaveSynthDependencies(t *testing.T, testFolder string, dependencies *map[string]string)

SaveSynthDependencies serializes and saves map of dependencies at test time to the given path.

func SendMessageFifoToQueueWithDeduplicationId added in v0.0.5

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 added in v0.0.5

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 added in v0.0.7

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 added in v0.0.7

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 added in v0.0.7

func StopSfnExecution(t testing.TestingT, awsRegion string, executionArn string)

StopSfnExecution stops the specified execution. This will fail the test if there is an error.

func StopSfnExecutionE added in v0.0.7

func StopSfnExecutionE(t testing.TestingT, awsRegion string, executionArn string) error

StopSfnExecutionE stops the specified execution.

func SynthApp added in v0.0.7

func SynthApp(t *testing.T, testApp, tfWorkingDir string, env map[string]string, additionalAppDirs ...string)

Synth app relative to the integration namespace

func TestCloudFrontFunction added in v0.0.4

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 added in v0.0.4

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 added in v0.0.4

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 URLDecode added in v0.0.5

func URLDecode(encoded string) (string, error)

URLDecode decodes a URL-encoded string.

func UndeployUsingTerraform added in v0.0.7

func UndeployUsingTerraform(t *testing.T, workingDir string)

func UploadS3File added in v0.0.6

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 added in v0.0.6

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 added in v0.0.4

func WaitForCertificateIssued(
	t testing.TestingT,
	certArn string,
	region string,
	maxRetries int,
	sleepBetweenRetries time.Duration,
)

WaitForCertificateIssued waits for the certificate to be issued

func WaitForCertificateIssuedE added in v0.0.4

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 WaitForLogEvents added in v0.0.6

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 added in v0.0.6

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

Types

type ActivityHandler added in v0.0.7

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 added in v0.0.7

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 added in v0.0.7

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 added in v0.0.7

func NewActivityHandler(sfnClient *sfn.Client, input interface{}, taskToken *string) ActivityHandler

type AttachedPermissionsBoundary added in v0.0.5

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 added in v0.0.6

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

BucketNotificationNotEnabledError is returned when the S3 bucket notification is not enabled.

func NewBucketNotificationNotEnabledError added in v0.0.6

func NewBucketNotificationNotEnabledError(region, bucketName string) BucketNotificationNotEnabledError

func (BucketNotificationNotEnabledError) Error added in v0.0.6

type CertificateNotIssuedError added in v0.0.4

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

CertificateNotIssuedError is returned when the ACM Certificate status is not issued.

func NewCertificateNotIssuedError added in v0.0.4

func NewCertificateNotIssuedError(certArn string, currentStatus acmTypes.CertificateStatus) CertificateNotIssuedError

func (CertificateNotIssuedError) Error added in v0.0.4

func (err CertificateNotIssuedError) Error() string

type CloudFrontFunctionEvent added in v0.0.4

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 added in v0.0.4

func ReadCloudFrontEvent(path string) (*CloudFrontFunctionEvent, error)

type CloudFrontFunctionValidationFailed added in v0.0.4

type CloudFrontFunctionValidationFailed struct {
	FunctionName string
	Failures     error
}

CloudFrontFunctionValidationFailed is an error that occurs if response validation fails.

func (CloudFrontFunctionValidationFailed) Error added in v0.0.4

type CloudFrontTestFunctionResult added in v0.0.4

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 added in v0.0.4

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 added in v0.0.6

type CloudwatchEventsRuleInfo struct {
	Name               string          // The name of the rule.
	Description        string          // The description of the rule.
	State              types.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 added in v0.0.6

func DescribeEventRule(t testing.TestingT, awsRegion string, ruleName string) *CloudwatchEventsRuleInfo

DescribeEventRule returns the details of the specified rule.

func DescribeEventRuleE added in v0.0.6

func DescribeEventRuleE(t testing.TestingT, awsRegion string, ruleName string) (*CloudwatchEventsRuleInfo, error)

DescribeEventRuleE returns the details of the specified rule.

type Context added in v0.0.4

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

type ForwardingCore struct {
	zapcore.Core
	// contains filtered or unexported fields
}

a simple Zap Logger which forwards all log messages to terratestLogger

func (*ForwardingCore) Check

func (*ForwardingCore) Write

func (fc *ForwardingCore) Write(entry zapcore.Entry, fields []zapcore.Field) error

type IamManagedPolicyNotFoundError added in v0.0.5

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

IamManagedPolicyNotFoundError is returned when the IAM managed policy is not found.

func NewIamManagedPolicyNotFoundError added in v0.0.5

func NewIamManagedPolicyNotFoundError(policyArn string) IamManagedPolicyNotFoundError

func (IamManagedPolicyNotFoundError) Error added in v0.0.5

type IamRoleNotFoundError added in v0.0.5

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

IamRoleNotFoundError is returned when the IAM role is not found.

func NewIamRoleNotFoundError added in v0.0.5

func NewIamRoleNotFoundError(roleName string) IamRoleNotFoundError

func (IamRoleNotFoundError) Error added in v0.0.5

func (err IamRoleNotFoundError) Error() string

type InlinePolicy added in v0.0.5

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 added in v0.0.6

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 added in v0.0.6

func (itype *InvocationTypeOption) Value() (string, error)

type LambdaOptions added in v0.0.6

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 added in v0.0.5

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 added in v0.0.5

func GetIamManagedPolicy(t testing.TestingT, awsRegion string, policyArn string) *ManagedPolicy

Get IAM Managed Policy, fail on error

func GetIamManagedPolicyE added in v0.0.5

func GetIamManagedPolicyE(t testing.TestingT, awsRegion string, policyArn string) (*ManagedPolicy, error)

Get IAM Managed Policy, return result or error

type MultiValue added in v0.0.4

type MultiValue struct {
	Value string `json:"value"`
}

type MultiValueAttrs added in v0.0.4

type MultiValueAttrs struct {
	Value      string `json:"value"`
	Attributes string `json:"attributes"`
}

type QueueMessageResponse added in v0.0.5

type QueueMessageResponse struct {
	ReceiptHandle           string
	MessageBody             string
	ApproximateReceiveCount int64
	SentTimestamp           time.Time
	Error                   error
}

QueueMessageResponse contains a queue message.

func WaitForQueueMessage added in v0.0.5

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 added in v0.0.4

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 added in v0.0.4

type Response struct {
	StatusCode        int             `json:"statusCode"`
	StatusDescription *string         `json:"statusDescription,omitempty"`
	Headers           *ValueObject    `json:"headers,omitempty"`
	Cookies           *ResponseCookie `json:"cookies,omitempty"`
}

type ResponseCookie added in v0.0.4

type ResponseCookie map[string]ResponseCookieEntry

type ResponseCookieEntry added in v0.0.4

type ResponseCookieEntry struct {
	Value      string            `json:"value"`
	Attributes string            `json:"attributes"`
	MultiValue []MultiValueAttrs `json:"multiValue,omitempty"`
}

type Role added in v0.0.5

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 added in v0.0.5

func GetIamRole(t testing.TestingT, awsRegion string, roleName string) *Role

Get IAM Role with all inline policies and attached Policy ARNs, fail on error

func GetIamRoleE added in v0.0.5

func GetIamRoleE(t testing.TestingT, awsRegion string, roleName string) (*Role, error)

Get IAM Role with all inline policies and attached Policy ARNs, return result or error

type SfnExecutionOutput added in v0.0.7

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 added in v0.0.7

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 added in v0.0.7

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 added in v0.0.4

type ValueEntry struct {
	Value      string       `json:"value"`
	MultiValue []MultiValue `json:"multiValue,omitempty"`
}

type ValueObject added in v0.0.4

type ValueObject map[string]ValueEntry

type Variables

type Variables map[string]any

func (*Variables) Apply

func (p *Variables) Apply(contents string) (string, error)

apply the variables to the test app

type Version added in v0.0.4

type Version string
const Version1_0 Version = "1.0"

func (Version) MarshalJSON added in v0.0.4

func (v Version) MarshalJSON() ([]byte, error)

func (*Version) UnmarshalJSON added in v0.0.4

func (v *Version) UnmarshalJSON(data []byte) error

type Viewer added in v0.0.4

type Viewer struct {
	IP string `json:"ip"`
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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