Documentation
¶
Overview ¶
Package arn provides a set of utilities for working with Amazon Resource Names (ARNs).
Index ¶
- Constants
- Variables
- func FilterKeyIDs(f FilterFunc, keyIDs []string) ([]string, error)
- func IsMrkArnEqual(key1, key2 string) bool
- func IsValidMrkArn(str string) (bool, error)
- func IsValidMrkIdentifier(str string) (bool, error)
- func KeyResourceEqual(key1, key2 string) (bool, error)
- func ValidateKeyArn(keyID string) error
- type FilterFunc
- type KeyArn
Constants ¶
const (
KeyResourceType = "key"
)
Variables ¶
var ErrMalformedArn = errors.New("malformed Key ARN")
ErrMalformedArn is returned when the ARN is malformed.
Functions ¶
func FilterKeyIDs ¶
func FilterKeyIDs(f FilterFunc, keyIDs []string) ([]string, error)
FilterKeyIDs filters a list of key IDs using the given filter function. It returns a list of key IDs that pass the filter.
func IsMrkArnEqual ¶
IsMrkArnEqual compares two MRK ARNs
Spec: aws-kms-mrk-match-for-decrypt
Given two KMS key arns, determines whether they refer to related KMS MRKs.
func IsValidMrkArn ¶
IsValidMrkArn checks if the given string can be a valid MRK ARN
Spec: aws-kms-key-arn
func IsValidMrkIdentifier ¶
IsValidMrkIdentifier checks if the given string can be a valid MRK identifier
Spec: aws-kms-key-arn
func KeyResourceEqual ¶
KeyResourceEqual checks if the given key ARNs refer to the same KMS MRK resourceID.
func ValidateKeyArn ¶
ValidateKeyArn validates the keyID as an ARN.
Types ¶
type FilterFunc ¶
FilterFunc is a function that filters a string.
Examples: IsValidMrkArn, IsValidMrkIdentifier
type KeyArn ¶
type KeyArn struct { Partition string // AWS partition, e.g. aws, aws-cn, aws-us-gov Service string // AWS service, kms Region string // AWS region, us-east-1, eu-west-1 Account string // AWS account ID, 12 digits ResourceType string // AWS resource type, either "key" or "alias" ResourceID string // AWS resource ID, resource ID or alias name }
KeyArn represents an AWS Key ARN.