Skip to content

Commit

Permalink
Add ec2tags function
Browse files Browse the repository at this point in the history
  • Loading branch information
Suresh Kumar committed Aug 27, 2020
1 parent 4d6a1bc commit bace187
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions funcs/aws.go
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@ func CreateAWSFuncs(ctx context.Context) map[string]interface{} {
f["ec2meta"] = ns.EC2Meta
f["ec2dynamic"] = ns.EC2Dynamic
f["ec2tag"] = ns.EC2Tag
f["ec2tags"] = ns.EC2Tags
f["ec2region"] = ns.EC2Region
return f
}
Expand Down Expand Up @@ -86,6 +87,12 @@ func (a *Funcs) EC2Tag(tag string, def ...string) (string, error) {
return a.info.Tag(tag, def...)
}

// EC2Tag -
func (a *Funcs) EC2Tags() (map[string]string, error) {
a.infoInit.Do(a.initInfo)
return a.info.Tags()
}

// KMSEncrypt -
func (a *Funcs) KMSEncrypt(keyID, plaintext interface{}) (string, error) {
a.kmsInit.Do(a.initKMS)
Expand Down

0 comments on commit bace187

Please sign in to comment.