sqs

package
v0.22.0 Latest Latest
Warning

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

Go to latest
Published: Sep 17, 2020 License: MIT Imports: 19 Imported by: 0

Documentation

Index

Constants

View Source
const (
	ResourcePrimaryQueue   = "PrimaryQueue"
	ResourceSecondaryQueue = "SecondaryQueue"
)
View Source
const (
	OutputPrimaryQueueURL   = "PrimaryQueueURL"
	OutputPrimaryQueueARN   = "PrimaryQueueARN"
	OutputSecondaryQueueURL = "SecondaryQueueURL"
	OutputSecondaryQueueARN = "SecondaryQueueARN"
)
View Source
const (
	ResourceUser        = "IAMUser"
	ResourceAccessKey   = "IAMAccessKey"
	ResourcePolicy      = "IAMPolicy"
	ResourceCredentials = "BindingCredentials"
)
View Source
const (
	OutputCredentialsARN = "CredentialsARN"
)

Variables

View Source
var (

	// NoExistErrMatch is a string to match if stack does not exist
	NoExistErrMatch = "does not exist"
	// ErrStackNotFound returned when stack does not exist, or has been deleted
	ErrStackNotFound      = fmt.Errorf("cloudformation stack does not exist")
	ErrUpdateNotSupported = errors.New("Updating the SQS queue is currently not supported")
	// PollingInterval is the duration between calls to check state when waiting for apply/destroy to complete
	PollingInterval      = time.Second * 15
	ProvisionOperation   = "provision"
	DeprovisionOperation = "deprovision"
	UpdateOperation      = "update"
	BindOperation        = "bind"
	UnbindOperation      = "unbind"
)

Functions

func IsNotFoundError added in v0.18.0

func IsNotFoundError(err error) bool

func QueueTemplate added in v0.18.0

func QueueTemplate(params QueueParams) (*goformation.Template, error)

GetStackTemplate returns a cloudformation Template for provisioning an SQS queue

func UserTemplate added in v0.18.0

func UserTemplate(params UserParams) (*goformation.Template, error)

Types

type AssumeRolePolicyDocument added in v0.18.0

type AssumeRolePolicyDocument struct {
	Version   string
	Statement []AssumeRolePolicyStatement
}

type AssumeRolePolicyStatement added in v0.18.0

type AssumeRolePolicyStatement struct {
	Effect    string
	Principal PolicyPrincipal
	Action    []string
	Condition PolicyCondition `json:"Condition,omitempty"`
}

type Config

type Config struct {
	AWSRegion           string `json:"aws_region"`
	ResourcePrefix      string `json:"resource_prefix"`
	DeployEnvironment   string `json:"deploy_env"`
	Timeout             time.Duration
	PermissionsBoundary string `json:"permissions_boundary"`
}

func NewConfig added in v0.18.0

func NewConfig(configJSON []byte) (*Config, error)

type Credentials added in v0.19.0

type Credentials struct {
	AWSAccessKeyID     string `json:"aws_access_key_id"`
	AWSSecretAccessKey string `json:"aws_secret_access_key"`
	AWSRegion          string `json:"aws_region"`
	PrimaryQueueURL    string `json:"primary_queue_url"`
	SecondaryQueueURL  string `json:"secondary_queue_url"`
}

type PolicyCondition added in v0.18.0

type PolicyCondition struct {
	StringEquals map[string]string `json:"StringEquals,omitempty"`
}

type PolicyDocument added in v0.18.0

type PolicyDocument struct {
	Version   string
	Statement []PolicyStatement
}

func NewRolePolicyDocument added in v0.18.0

func NewRolePolicyDocument(resources, actions []string) PolicyDocument

type PolicyPrincipal added in v0.18.0

type PolicyPrincipal struct {
	AWS       []string `json:"AWS,omitempty"`
	Federated []string `json:"Federated,omitempty"`
}

type PolicyStatement added in v0.18.0

type PolicyStatement struct {
	Effect   string
	Action   []string
	Resource []string
}

type Provider added in v0.18.0

type Provider struct {
	Environment         string // Name of environment to tag resources with
	Client              Client // AWS SDK compatible client
	ResourcePrefix      string // AWS resources with be named with this prefix
	PermissionsBoundary string // IAM users created on bind will have this boundary
	Timeout             time.Duration
	Logger              lager.Logger
}

func (*Provider) Bind added in v0.18.0

func (s *Provider) Bind(ctx context.Context, bindData provideriface.BindData) (*domain.Binding, error)

func (*Provider) Deprovision added in v0.18.0

func (s *Provider) Deprovision(ctx context.Context, deprovisionData provideriface.DeprovisionData) (*domain.DeprovisionServiceSpec, error)

func (*Provider) GetBinding added in v0.18.0

func (s *Provider) GetBinding(ctx context.Context, getBindingData provideriface.GetBindData) (*domain.GetBindingSpec, error)

func (*Provider) LastBindingOperation added in v0.18.0

func (s *Provider) LastBindingOperation(ctx context.Context, lastBindingOperationData provideriface.LastBindingOperationData) (*domain.LastOperation, error)

func (*Provider) LastOperation added in v0.18.0

func (s *Provider) LastOperation(ctx context.Context, lastOperationData provideriface.LastOperationData) (*domain.LastOperation, error)

func (*Provider) Provision added in v0.18.0

func (*Provider) Unbind added in v0.18.0

func (s *Provider) Unbind(ctx context.Context, unbindData provideriface.UnbindData) (*domain.UnbindSpec, error)

func (*Provider) Update added in v0.18.0

type QueueParams added in v0.18.0

type QueueParams struct {
	// QueueName is the name of the aws queue resource
	QueueName string `json:"-"`
	// ContentBasedDeduplication For first-in-first-out (FIFO) queues,
	// specifies whether to enable content-based deduplication. During the
	// deduplication interval, Amazon SQS treats messages that are sent with
	// identical content as duplicates and delivers only one copy of the
	// message.
	ContentBasedDeduplication bool `json:"content_based_deduplication,omitempty"`
	// DelaySeconds The time in seconds for which the delivery of all messages
	// in the queue is delayed. You can specify an integer value of 0 to 900
	// (15 minutes).
	DelaySeconds int `json:"delay_seconds,omitempty"`
	// FifoQueue If set to true, creates a FIFO queue. If you don't specify
	// this property, Amazon SQS creates a standard queue.
	FifoQueue bool `json:"-"`
	// MaximumMessageSize is the limit of how many bytes that a message can
	// contain before Amazon SQS rejects it. You can specify an integer value
	// from 1,024 bytes (1 KiB) to 262,144 bytes (256 KiB). The default value
	// is 262,144 (256 KiB).
	MaximumMessageSize int `json:"maximum_message_size,omitempty"`
	// MessageRetentionPeriod The number of seconds
	// that Amazon SQS retains a message. You can
	// specify an integer value from 60 seconds (1
	// minute) to 1,209,600 seconds (14 days). The
	// default value is 345,600 seconds (4 days).
	MessageRetentionPeriod int `json:"message_retention_period,omitempty"`
	// ReceiveMessageWaitTimeSeconds Specifies the
	// duration, in seconds, that the ReceiveMessage
	// action call waits until a message is in the
	// queue in order to include it in the response,
	// rather than returning an empty response if a
	// message isn't yet available. You can specify an
	// integer from 1 to 20. Short polling is used as
	// the default or when you specify 0 for this
	// property.
	ReceiveMessageWaitTimeSeconds int `json:"receive_message_wait_time_seconds,omitempty"`
	// RedriveMaxReceiveCount  The number of times a
	// message is delivered to the source queue before
	// being moved to the dead-letter queue.
	RedriveMaxReceiveCount int `json:"redrive_max_receive_count,omitempty"`
	// VisibilityTimeout The length of time during
	// which a message will be unavailable after a
	// message is delivered from the queue. This blocks
	// other components from receiving the same message
	// and gives the initial component time to process
	// and delete the message from the queue.
	// Values must be from 0 to 43,200 seconds (12 hours). If you don't specify a value, AWS CloudFormation uses the default value of 30 seconds.
	VisibilityTimeout int `json:"visibility_timeout,omitempty"`
	// Tags are the AWS resource tags to attach to this queue.
	Tags map[string]string `json:"-"`
}

type UserParams added in v0.18.0

type UserParams struct {
	BindingID           string            `json:"-"`
	ResourcePrefix      string            `json:"-"`
	UserPath            string            `json:"-"`
	PrimaryQueueURL     string            `json:"-"`
	PrimaryQueueARN     string            `json:"-"`
	SecondaryQueueURL   string            `json:"-"`
	SecondaryQueueARN   string            `json:"-"`
	Tags                map[string]string `json:"-"`
	PermissionsBoundary string            `json:"-"`
}

Directories

Path Synopsis
Code generated by counterfeiter.
Code generated by counterfeiter.

Jump to

Keyboard shortcuts

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