Documentation ¶
Index ¶
- Constants
- func NewTagParser() parser.TagParser
- func ParameterType(node *parser.StructNode) ssm.ParameterType
- type ParamTier
- type PmsTag
- type PmsTagStruct
- func (t *PmsTagStruct) DefaultAccountKey() bool
- func (t *PmsTagStruct) Description() string
- func (t *PmsTagStruct) FqName() string
- func (t *PmsTagStruct) GetKeyName() string
- func (t *PmsTagStruct) IsLocalKey() bool
- func (t *PmsTagStruct) Name() string
- func (t *PmsTagStruct) Overwrite() bool
- func (t *PmsTagStruct) Pattern() string
- func (t *PmsTagStruct) Prefix() string
- func (t *PmsTagStruct) Secure() bool
- func (t *PmsTagStruct) SsmTags() []ssm.Tag
- func (t *PmsTagStruct) SsmTier(defaultTier ssm.ParameterTier) ssm.ParameterTier
- func (t *PmsTagStruct) Tag() map[string]string
- func (t *PmsTagStruct) Tier() ParamTier
- type Serializer
- func (p *Serializer) Get(node *parser.StructNode, filter *support.FieldFilters) (map[string]support.FullNameField, error)
- func (p *Serializer) SeDefaultTier(tier ssm.ParameterTier) *Serializer
- func (p *Serializer) Upsert(node *parser.StructNode, filter *support.FieldFilters) map[string]support.FullNameField
Constants ¶
const ( // Std is the standard tier that allows one accouint to store // 10,000 parameters for free Std ParamTier = "std" // Adv allows for storage of up 8kb of data and uses different encryption algorithms // This is not a free tier and cost will incur Adv = "adv" // Eval is trying to evaluates each request to determine if the parameter is standard // or advanced. If the request doesn't include any options that require an advanced parameter, // the parameter is created in the standard-parameter tier. Eval = "eval" // Default is the default when noting is set and it will fall back on the set default in the serializer Default = "default" )
Variables ¶
This section is empty.
Functions ¶
func NewTagParser ¶
NewTagParser creates a new AWS parameter store tag parser.
func ParameterType ¶
func ParameterType(node *parser.StructNode) ssm.ParameterType
ParameterType gets the Parameter Store Parameter Type.
Types ¶
type ParamTier ¶
type ParamTier string
ParamTier specifies the parameter tier such as std, adv, or intelligent.
type PmsTag ¶
type PmsTag interface { parser.StructTag Prefix() string Overwrite() bool Name() string Tags() map[string]string FqName() string Secure() bool Description() string DefaultAccountKey() bool IsLocalKey() bool GetKeyName() string Tier() ParamTier SsmTier(defaultTier ssm.ParameterTier) ssm.ParameterTier Pattern() string SsmTags() []ssm.Tag }
PmsTag is a generic interface
type PmsTagStruct ¶
type PmsTagStruct struct { // Extend StructTagImpl parser.StructTagImpl }
PmsTagStruct is for AWS parameter store
func ToPmsTag ¶
func ToPmsTag(generictag *parser.StructNode) (*PmsTagStruct, bool)
ToPmsTag converts a StructTag into the PmsTag interface If fails, it return false.
func (*PmsTagStruct) DefaultAccountKey ¶
func (t *PmsTagStruct) DefaultAccountKey() bool
DefaultAccountKey is for determine if the backing key is the account default KMS key
func (*PmsTagStruct) Description ¶
func (t *PmsTagStruct) Description() string
Description returns a description describing the parameter (if any).
func (*PmsTagStruct) FqName ¶
func (t *PmsTagStruct) FqName() string
FqName is the full name including prefix
func (*PmsTagStruct) GetKeyName ¶
func (t *PmsTagStruct) GetKeyName() string
GetKeyName gets the keyname without namespaces for local, full for arn and default for such
func (*PmsTagStruct) IsLocalKey ¶
func (t *PmsTagStruct) IsLocalKey() bool
IsLocalKey returns true if the real arn to the key is registered in the encoder / decoder
func (*PmsTagStruct) Name ¶
func (t *PmsTagStruct) Name() string
Name returns the short name of the field
func (*PmsTagStruct) Overwrite ¶
func (t *PmsTagStruct) Overwrite() bool
Overwrite returns true (default) if it will overwrite parameter upon write
func (*PmsTagStruct) Pattern ¶
func (t *PmsTagStruct) Pattern() string
Pattern returns a optional regular expression to validate the parameter value.
func (*PmsTagStruct) Prefix ¶
func (t *PmsTagStruct) Prefix() string
Prefix returns the prefix if any
func (*PmsTagStruct) Secure ¶
func (t *PmsTagStruct) Secure() bool
Secure returns true if this entry is backed by a encryption key
func (*PmsTagStruct) SsmTags ¶
func (t *PmsTagStruct) SsmTags() []ssm.Tag
SsmTags Converts the StructTag.Tags into ssm version of Tags
func (*PmsTagStruct) SsmTier ¶
func (t *PmsTagStruct) SsmTier(defaultTier ssm.ParameterTier) ssm.ParameterTier
SsmTier returns the tier or a default specified in the in-param
func (*PmsTagStruct) Tag ¶
func (t *PmsTagStruct) Tag() map[string]string
Tag is set of name values that is part of the Tags for the parameter
func (*PmsTagStruct) Tier ¶
func (t *PmsTagStruct) Tier() ParamTier
Tier specifies the parameter tier it may be of std, adv, and eval (intelligent tiering). If nothing is specified Default is returned and it will use the serializer default tier.
type Serializer ¶
type Serializer struct {
// contains filtered or unexported fields
}
Serializer handles the parameter store communication
func New ¶
func New(service string) (*Serializer, error)
New creates a repository using the default AWS configuration
func NewFromConfig ¶
func NewFromConfig(config aws.Config, service string) *Serializer
NewFromConfig creates a repository using a existing configuration
func (*Serializer) Get ¶
func (p *Serializer) Get(node *parser.StructNode, filter *support.FieldFilters) (map[string]support.FullNameField, error)
Get parameters from the parameterstore and populates the node graph with values. Any fields that was not able to be set is reported in the FullNameField string map. FullNameField do not include those fields filtered out in exclusion filter.
func (*Serializer) SeDefaultTier ¶
func (p *Serializer) SeDefaultTier(tier ssm.ParameterTier) *Serializer
SeDefaultTier allows for change the tier. By default the serializer uses the standard tier.
func (*Serializer) Upsert ¶
func (p *Serializer) Upsert(node *parser.StructNode, filter *support.FieldFilters) map[string]support.FullNameField
Upsert stores the node values (after filter is applied). If any error occurs it will return that in the support.FullNameField.Error field. Thus it is possible to track which fields did not get written to the Parameter store and hence needs to be handeled.