Documentation ¶
Index ¶
- Constants
- Variables
- func IsNotFoundError(err error) bool
- type AccessPolicy
- type Client
- type Config
- type Credentials
- type Provider
- func (s *Provider) Bind(ctx context.Context, bindData provideriface.BindData) (*domain.Binding, error)
- func (s *Provider) Deprovision(ctx context.Context, deprovisionData provideriface.DeprovisionData) (*domain.DeprovisionServiceSpec, error)
- func (s *Provider) GetBinding(ctx context.Context, getBindingData provideriface.GetBindData) (*domain.GetBindingSpec, error)
- func (s *Provider) LastBindingOperation(ctx context.Context, ...) (*domain.LastOperation, error)
- func (s *Provider) LastOperation(ctx context.Context, lastOperationData provideriface.LastOperationData) (*domain.LastOperation, error)
- func (s *Provider) Provision(ctx context.Context, provisionData provideriface.ProvisionData) (*domain.ProvisionedServiceSpec, error)
- func (s *Provider) Unbind(ctx context.Context, unbindData provideriface.UnbindData) (*domain.UnbindSpec, error)
- func (s *Provider) Update(ctx context.Context, updateData provideriface.UpdateData) (*domain.UpdateServiceSpec, error)
- type QueueParams
- type QueueTemplateBuilder
- type UserTemplateBuilder
Constants ¶
const ( TagCostAllocation = "chargeable_entity" TagEnvironment = "Environment" TagName = "Name" TagService = "Service" TagServiceId = "ServiceID" )
const ( ParamDelaySeconds = "DelaySeconds" ParamMaximumMessageSize = "MaximumMessageSize" ParamMessageRetentionPeriod = "MessageRetentionPeriod" ParamReceiveMessageWaitTimeSeconds = "ReceiveMessageWaitTimeSeconds" ParamRedriveMaxReceiveCount = "RedriveMaxReceiveCount" ParamVisibilityTimeout = "VisibilityTimeout" )
const ( ResourcePrimaryQueue = "PrimaryQueue" ResourceSecondaryQueue = "SecondaryQueue" )
const ( OutputPrimaryQueueURL = "PrimaryQueueURL" OutputPrimaryQueueARN = "PrimaryQueueARN" OutputSecondaryQueueURL = "SecondaryQueueURL" OutputSecondaryQueueARN = "SecondaryQueueARN" )
const ( ExtFIFO = ".fifo" ExtStandard = "" )
const ( ResourceUser = "IAMUser" ResourceAccessKey = "IAMAccessKey" ResourcePolicy = "IAMPolicy" ResourceCredentials = "BindingCredentials" )
const (
ConditionShouldNotUseDLQ = "ShouldNotUseDLQ"
)
const (
OutputCredentialsARN = "CredentialsARN"
)
Variables ¶
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
Types ¶
type AccessPolicy ¶ added in v0.23.0
type AccessPolicy = string
const ( AccessPolicyFull AccessPolicy = "full" AccessPolicyProducer AccessPolicy = "producer" AccessPolicyConsumer AccessPolicy = "consumer" )
type Client ¶
type Client interface { DescribeStacksWithContext(aws.Context, *cloudformation.DescribeStacksInput, ...request.Option) (*cloudformation.DescribeStacksOutput, error) CreateStackWithContext(aws.Context, *cloudformation.CreateStackInput, ...request.Option) (*cloudformation.CreateStackOutput, error) UpdateStackWithContext(aws.Context, *cloudformation.UpdateStackInput, ...request.Option) (*cloudformation.UpdateStackOutput, error) DeleteStackWithContext(aws.Context, *cloudformation.DeleteStackInput, ...request.Option) (*cloudformation.DeleteStackOutput, error) GetSecretValueWithContext(aws.Context, *secretsmanager.GetSecretValueInput, ...request.Option) (*secretsmanager.GetSecretValueOutput, error) }
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"` }
type Credentials ¶ added in v0.19.0
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) 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 (s *Provider) Provision(ctx context.Context, provisionData provideriface.ProvisionData) (*domain.ProvisionedServiceSpec, error)
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
func (s *Provider) Update(ctx context.Context, updateData provideriface.UpdateData) (*domain.UpdateServiceSpec, error)
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
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)