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

[WIP] Add tags to IAM Role Policy Attachment resource #663

Closed
Closed
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
8 changes: 7 additions & 1 deletion resources/iam-role-policy-attachments.go
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ type IAMRolePolicyAttachment struct {
policyArn string
policyName string
roleName string
roleTags []*iam.Tag
}

func init() {
Expand Down Expand Up @@ -50,6 +51,7 @@ func ListIAMRolePolicyAttachments(sess *session.Session) ([]Resource, error) {
policyArn: *pol.PolicyArn,
policyName: *pol.PolicyName,
roleName: *role.RoleName,
roleTags: *role.Tags
njtrettel marked this conversation as resolved.
Show resolved Hide resolved
})
}

Expand Down Expand Up @@ -92,10 +94,14 @@ func (e *IAMRolePolicyAttachment) Remove() error {
}

func (e *IAMRolePolicyAttachment) Properties() types.Properties {
return types.NewProperties().
properties := types.NewProperties().
Set("RoleName", e.roleName).
Set("PolicyName", e.policyName).
Set("PolicyArn", e.policyArn)
for _, tag := range e.roleTags {
properties.SetTagWithPrefix("roleTag", tag.Key, tag.Value)
}
return properties
}

func (e *IAMRolePolicyAttachment) String() string {
Expand Down