-
Notifications
You must be signed in to change notification settings - Fork 1.4k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add AWS::Organizations support (#2102)
- Loading branch information
Showing
2 changed files
with
73 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,57 @@ | ||
# Copyright (c) 2012-2022, Mark Peek <mark@peek.org> | ||
# All rights reserved. | ||
# | ||
# See LICENSE file for full license. | ||
# | ||
# *** Do not modify - this file is autogenerated *** | ||
|
||
|
||
from . import AWSObject, PropsDictType, Tags | ||
from .validators.organizations import validate_policy_type | ||
|
||
|
||
class Account(AWSObject): | ||
""" | ||
`Account <http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-organizations-account.html>`__ | ||
""" | ||
|
||
resource_type = "AWS::Organizations::Account" | ||
|
||
props: PropsDictType = { | ||
"AccountName": (str, True), | ||
"Email": (str, True), | ||
"ParentIds": ([str], False), | ||
"RoleName": (str, False), | ||
"Tags": (Tags, False), | ||
} | ||
|
||
|
||
class OrganizationalUnit(AWSObject): | ||
""" | ||
`OrganizationalUnit <http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-organizations-organizationalunit.html>`__ | ||
""" | ||
|
||
resource_type = "AWS::Organizations::OrganizationalUnit" | ||
|
||
props: PropsDictType = { | ||
"Name": (str, True), | ||
"ParentId": (str, True), | ||
"Tags": (Tags, False), | ||
} | ||
|
||
|
||
class Policy(AWSObject): | ||
""" | ||
`Policy <http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-organizations-policy.html>`__ | ||
""" | ||
|
||
resource_type = "AWS::Organizations::Policy" | ||
|
||
props: PropsDictType = { | ||
"Content": (str, True), | ||
"Description": (str, False), | ||
"Name": (str, True), | ||
"Tags": (Tags, False), | ||
"TargetIds": ([str], False), | ||
"Type": (validate_policy_type, True), | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
# Copyright (c) 2012-2022, Mark Peek <mark@peek.org> | ||
# All rights reserved. | ||
# | ||
# See LICENSE file for full license. | ||
|
||
|
||
def validate_policy_type(policy_type): | ||
valid_types = [ | ||
"AISERVICES_OPT_OUT_POLICY", | ||
"BACKUP_POLICY", | ||
"SERVICE_CONTROL_POLICY", | ||
"TAG_POLICY", | ||
] | ||
if policy_type not in valid_types: | ||
raise ValueError("Type must be one of: %s" % ", ".join(valid_types)) | ||
return policy_type |