sqs

package
v0.34.0 Latest Latest
Warning

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

Go to latest
Published: Mar 22, 2024 License: MIT Imports: 19 Imported by: 0

Documentation

Index

Constants

View Source
const (
	TagCostAllocation = "chargeable_entity"
	TagEnvironment    = "Environment"
	TagName           = "Name"
	TagService        = "Service"
	TagServiceId      = "ServiceID"
)
View Source
const (
	ParamDelaySeconds                  = "DelaySeconds"
	ParamMaximumMessageSize            = "MaximumMessageSize"
	ParamMessageRetentionPeriod        = "MessageRetentionPeriod"
	ParamReceiveMessageWaitTimeSeconds = "ReceiveMessageWaitTimeSeconds"
	ParamRedriveMaxReceiveCount        = "RedriveMaxReceiveCount"
	ParamVisibilityTimeout             = "VisibilityTimeout"
)
View Source
const (
	ResourcePrimaryQueue   = "PrimaryQueue"
	ResourceSecondaryQueue = "SecondaryQueue"
)
View Source
const (
	OutputPrimaryQueueURL   = "PrimaryQueueURL"
	OutputPrimaryQueueARN   = "PrimaryQueueARN"
	OutputSecondaryQueueURL = "SecondaryQueueURL"
	OutputSecondaryQueueARN = "SecondaryQueueARN"
)
View Source
const (
	ExtFIFO     = ".fifo"
	ExtStandard = ""
)
View Source
const (
	ResourceUser        = "IAMUser"
	ResourceAccessKey   = "IAMAccessKey"
	ResourcePolicy      = "IAMPolicy"
	ResourceCredentials = "BindingCredentials"
)
View Source
const (
	ConditionShouldNotUseDLQ = "ShouldNotUseDLQ"
)
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")
	// ErrBindingDeadlineExeceeded indicates that syncronous binding took too long
	ErrBindingDeadlineExceeded = fmt.Errorf("timeout waiting for the binding stack to reach a success or failed state")
	// PollingInterval is the duration between calls to check state when waiting for stack status to complete
	PollingInterval      = time.Second * 5
	ProvisionOperation   = "provision"
	DeprovisionOperation = "deprovision"
	UpdateOperation      = "update"
	BindOperation        = "bind"
	UnbindOperation      = "unbind"
)

Functions

func IsNotFoundError added in v0.18.0

func IsNotFoundError(err error) bool

Types

type AccessPolicy added in v0.23.0

type AccessPolicy = string
const (
	AccessPolicyFull     AccessPolicy = "full"
	AccessPolicyProducer AccessPolicy = "producer"
	AccessPolicyConsumer AccessPolicy = "consumer"
)

type Config

type Config struct {
	AWSRegion         string `json:"aws_region"`
	ResourcePrefix    string `json:"resource_prefix"`
	DeployEnvironment string `json:"deploy_env"`
	Timeout           time.Duration
	// AdditionalUserPolicy is optionally the ARN of an IAM Policy that
	// will be attached to each IAM User created by the broker.  The
	// intended use case is, for example, to restrict all access to be
	// from a particular VPC, source IP, or via a particular VPC
	// Endpoint.
	AdditionalUserPolicy string `json:"additional_user_policy"`
	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 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
	AdditionalUserPolicy string // IAM users created on bind will have this policy attached
	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 {
	// 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"`
	// 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"`
}

QueueParams is the set of actual CloudFormation template parameters that can be passed to the stack. If it comes from user configuration such as:

cf create-service foo -c '{"my-config": "bar"}'`

then it should be in QueueParams so that CloudFormation can keep track of its value across updates.

func (*QueueParams) CreateParams added in v0.25.0

func (params *QueueParams) CreateParams() []*cloudformation.Parameter

CreateParams returns a set of cloudformation.Parameter suitable for passing to CreateStackWithContext().

func (*QueueParams) UpdateParams added in v0.25.0

func (params *QueueParams) UpdateParams() []*cloudformation.Parameter

UpdateParams returns a set of cloudformation.Parameter suitable for passing to UpdateStackWithContext(). In particular, if a parameter is nil, UpdateParams will return a cloudformation.Parameter with UsePreviousValue set to true.

type QueueTemplateBuilder added in v0.25.0

type QueueTemplateBuilder struct {
	QueueName string
	FIFOQueue bool
	Tags      map[string]string
}

A QueueTemplateBuilder is responsible for building the CloudFormation YAML template. You can configure it to control exactly how the template is built.

func (*QueueTemplateBuilder) Build added in v0.25.0

func (params *QueueTemplateBuilder) Build() (string, error)

Build returns a cloudformation Template for provisioning an SQS queue

func (*QueueTemplateBuilder) PrimaryQueueName added in v0.25.0

func (params *QueueTemplateBuilder) PrimaryQueueName() string

PrimaryQueueName builds the name for the primary queue

func (*QueueTemplateBuilder) SecondaryQueueName added in v0.25.0

func (params *QueueTemplateBuilder) SecondaryQueueName() string

SecondaryQueueName builds the name for the secondary queue

type UserTemplateBuilder added in v0.26.0

type UserTemplateBuilder 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:"-"`
	AdditionalUserPolicy string            `json:"-"`
	PermissionsBoundary  string            `json:"-"`
	AccessPolicy         AccessPolicy      `json:"access_policy"`
	AccessPolicyActions  []string
}

func (UserTemplateBuilder) Build added in v0.26.0

func (builder UserTemplateBuilder) Build() (string, error)

func (UserTemplateBuilder) CredentialsJSON added in v0.26.0

func (builder UserTemplateBuilder) CredentialsJSON() (string, error)

func (UserTemplateBuilder) GetAccessPolicy added in v0.26.0

func (builder UserTemplateBuilder) GetAccessPolicy() ([]string, error)

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