Documentation ¶
Overview ¶
Package postgresresource implements a custom resource for Postgres
Index ¶
Constants ¶
This section is empty.
Variables ¶
var ErrMasterArnUpdateNotSupported = errors.New("changing the MasterSecretArn for an update is not supported")
ErrMasterArnUpdateNotSupported is returned when the master arn is updated, which is not supported.
Functions ¶
Types ¶
type Handler ¶
type Handler struct {
// contains filtered or unexported fields
}
Handler handles custom resource requests for Fastly.
type Output ¶
type Output struct { // The allocated/assigned physical ID of the resource. If omitted for Create events, the event's RequestId // will be used. For Update, the current physical ID will be used. If a different value is returned, // CloudFormation will follow with a subsequent Delete for the previous ID (resource replacement). // For Delete, it will always return the current physical resource ID, and if the user returns a different one, // an error will occur. PhysicalResourceID string `json:"PhysicalResourceId"` // Resource attributes, which can later be retrieved through Fn::GetAtt on the custom resource object. Data map[string]any `json:"Data"` // Whether to mask the output of the custom resource when retrieved by using the Fn::GetAtt function. NoEcho bool `json:"NoEcho"` }
Output into the handler.
type SecretsManager ¶
type SecretsManager interface { GetSecretValue( ctx context.Context, params *secretsmanager.GetSecretValueInput, optFns ...func(*secretsmanager.Options), ) (*secretsmanager.GetSecretValueOutput, error) }
SecretsManager provides an interface for reading AWS secrets.
type TenantName ¶
type TenantName string
TenantName type provides ways to turn it into identifiers.
func TenantNameFromPhysicalResourceID ¶
func TenantNameFromPhysicalResourceID(prid string) TenantName
TenantNameFromPhysicalResourceID allows us to use the physical resource id as a storage medium of the main property we care about: the tenant name.
func (TenantName) ToDatabaseName ¶
func (n TenantName) ToDatabaseName() string
ToDatabaseName allows consistent database naming based on the tenant.
func (TenantName) ToDatabaseUser ¶
func (n TenantName) ToDatabaseUser() string
ToDatabaseUser allows consistent database naming based on the tenant.
func (TenantName) ToOutputData ¶
func (n TenantName) ToOutputData() map[string]any
ToOutputData consitently produces the output data from the tenant name.
func (TenantName) ToPhysicalResourceID ¶
func (n TenantName) ToPhysicalResourceID() string
ToPhysicalResourceID encodes the properties to physical resource id.
type TenantProperties ¶
type TenantProperties struct { // Name of the postgres Tenant and user that will be created Name TenantName `mapstructure:"Name" validate:"required,resource_ident"` // MasterSecretArn must provide the secret for the database's master user MasterSecretArn string `mapstructure:"MasterSecretArn" validate:"required"` }
TenantProperties that configure the custom resource.