Skip to content

Commit

Permalink
fix(s3-access-grants-grant): pass account id to delete input
Browse files Browse the repository at this point in the history
  • Loading branch information
ekristen committed Jan 4, 2025
1 parent de5feb2 commit d1f2ccc
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions resources/s3-access-grants-grant.go
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,7 @@ func (l *S3AccessGrantsGrantLister) List(ctx context.Context, o interface{}) ([]
for _, p := range res.AccessGrantsList {
resources = append(resources, &S3AccessGrantsGrant{
svc: svc,
accountID: opts.AccountID,
ID: p.AccessGrantId,
GrantScope: p.GrantScope,
GranteeType: ptr.String(string(p.Grantee.GranteeType)),
Expand All @@ -61,6 +62,7 @@ func (l *S3AccessGrantsGrantLister) List(ctx context.Context, o interface{}) ([]

type S3AccessGrantsGrant struct {
svc *s3control.Client
accountID *string
ID *string `description:"The ID of the access grant."`
GrantScope *string `description:"The scope of the access grant."`
GranteeType *string `description:"The type of the grantee, (e.g. IAM)."`
Expand All @@ -70,6 +72,7 @@ type S3AccessGrantsGrant struct {

func (r *S3AccessGrantsGrant) Remove(ctx context.Context) error {
_, err := r.svc.DeleteAccessGrant(ctx, &s3control.DeleteAccessGrantInput{
AccountId: r.accountID,
AccessGrantId: r.ID,
})
return err
Expand Down

0 comments on commit d1f2ccc

Please sign in to comment.