org-formation / aws-resource-providers

A community driven repository where you can find AWS Resource Type Providers for different purposes (including org-formation ones).
MIT License
88 stars 21 forks source link

feat(community-organizations-policy): Organizations policy resource #28

Closed thomascollett closed 3 years ago

thomascollett commented 3 years ago

Issue #, if available: https://github.com/aws-cloudformation/aws-cloudformation-coverage-roadmap/issues/34 and https://github.com/aws-cloudformation/aws-cloudformation-coverage-roadmap/issues/35

Description of changes:

Adds a "Community::Organizations::Policy" resource provider which allows for the creation of 4 policy types attached to the root or the OU of AWS Organizations:

Example CloudFormation template is included as example.yml.

Create, update and delete are all supported. Attaching a policy to a different OU currently requires deletion and re-creation of the policy, but the the "update" lifecycle event can be extended to detach and reattach the policy if the target changes. It could also be possible to support a list of target OUs rather than just allowing a single one.

Note: This can only be run in us-east-1 as this is the region within which AWS Organizations allows API calls.

eduardomourar commented 3 years ago

another general request is to have some basic unit testing in place, otherwise maintaining a monorepo will become an impossible task.

eduardomourar commented 3 years ago

@thomascollett let me know if you need help on rebasing this branch and adding unit testing

thomascollett commented 3 years ago

@thomascollett let me know if you need help on rebasing this branch and adding unit testing

Thanks - feel free to make changes. It's full-throttle at work right now. I'll have chance to look at this again in the next 1-2 weeks hopefully and implement your recommendations.

eduardomourar commented 3 years ago

@thomascollett I have created this PR targeting your fork with most of my suggested changes.

eduardomourar commented 3 years ago

we need to add a new line for the policy resource in the main readme table