Skip to content

feat: add inline policy document support to IAM role creation#39

Merged
Amertz08 merged 1 commit into
mainfrom
claude/inline-policy-support
May 14, 2026
Merged

feat: add inline policy document support to IAM role creation#39
Amertz08 merged 1 commit into
mainfrom
claude/inline-policy-support

Conversation

@Amertz08
Copy link
Copy Markdown
Owner

Summary

  • Added InlinePolicy type with Name and Document (JSON) fields to inputs.go
  • Added InlinePolicies []InlinePolicy to CreateIAMRoleInput — callers can now supply both managed policy ARNs and inline policy documents in a single activity call
  • CreateIAMRole calls PutRolePolicy for each inline policy after attaching managed policies
  • DeleteIAMRole now calls ListRolePolicies + DeleteRolePolicy to remove all inline policies before proceeding to managed policy detachment and role deletion (AWS requires a role to have no policies before it can be deleted)

Existing callers that don't set InlinePolicies are unaffected.

Test plan

  • go build ./... passes
  • Call CreateIAMRole with one InlinePolicies entry — inline policy appears on the role in the AWS console
  • Call DeleteIAMRole on a role with both managed and inline policies — all cleaned up, role deleted without error
  • SpinUpIAMWorkflow (no inline policies) continues to work unchanged

🤖 Generated with Claude Code

CreateIAMRole now accepts InlinePolicies []InlinePolicy and calls
PutRolePolicy for each entry after attaching managed policies.
DeleteIAMRole now lists and deletes all inline policies before
detaching managed policies and deleting the role, as AWS requires
a role to have no policies attached before deletion.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@Amertz08 Amertz08 merged commit 8ba82d0 into main May 14, 2026
2 checks passed
@Amertz08 Amertz08 deleted the claude/inline-policy-support branch May 15, 2026 02:37
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant