Skip to content
This repository has been archived by the owner on Oct 15, 2024. It is now read-only.

feat: Adding tag properties to EC2DefaultSecurityGroupRule resource #936

Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Next Next commit
feat: Adding tag properties to EC2DefaultSecurityGroupRule resource
  • Loading branch information
gdbranco committed Feb 14, 2023
commit 6e795b24cf907d568ed9686da8884bffa036b8df
5 changes: 5 additions & 0 deletions resources/ec2-default-security-group-rules.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ type EC2DefaultSecurityGroupRule struct {
id *string
groupId *string
isEgress *bool
tags []*ec2.Tag
}

func init() {
Expand Down Expand Up @@ -62,6 +63,7 @@ func ListEC2SecurityGroupRules(sess *session.Session) ([]Resource, error) {
id: rule.SecurityGroupRuleId,
groupId: rule.GroupId,
isEgress: rule.IsEgress,
tags: rule.Tags,
})
}
return !lastPage
Expand Down Expand Up @@ -103,6 +105,9 @@ func (r *EC2DefaultSecurityGroupRule) Remove() error {

func (r *EC2DefaultSecurityGroupRule) Properties() types.Properties {
properties := types.NewProperties()
for _, tagValue := range r.tags {
properties.SetTag(tagValue.Key, tagValue.Value)
}
properties.Set("SecurityGroupId", r.groupId)
return properties
}
Expand Down