From e57a1254546541ac821f1d9b8a2cab2379e7a66a Mon Sep 17 00:00:00 2001 From: home Date: Tue, 10 Mar 2015 06:51:03 +1000 Subject: [PATCH 1/9] Resource definitions for managed policies. --- .../resources/iam-2010-05-08.resources.json | 277 ++++++++++++++++++ 1 file changed, 277 insertions(+) diff --git a/boto3/data/resources/iam-2010-05-08.resources.json b/boto3/data/resources/iam-2010-05-08.resources.json index 04047bd707..823bda2906 100644 --- a/boto3/data/resources/iam-2010-05-08.resources.json +++ b/boto3/data/resources/iam-2010-05-08.resources.json @@ -72,6 +72,15 @@ "path": "Certificate" } }, + "CreatePolicy": { + "request": { "operation": "CreatePolicy" }, + "resource": { + "type": "Policy", + "identifiers": [ + { "target": "Arn", "source": "response", "path": "Policy.Arn" } + ] + } + }, "CreateUser": { "request": { "operation": "CreateUser" }, "resource": { @@ -128,6 +137,14 @@ ] } }, + "Policy": { + "resource": { + "type": "Policy", + "identifiers": [ + { "target": "PolicyArn", "source": "input" } + ] + } + }, "Role": { "resource": { "type": "Role", @@ -180,6 +197,16 @@ "path": "Groups[]" } }, + "Policies": { + "request": { "operation": "ListPolicies" }, + "resource": { + "type": "Policy", + "identifiers": [ + { "target": "Arn", "source": "response", "path": "Policies[].Arn" } + ], + "path": "Policies[]" + } + }, "InstanceProfiles": { "request": { "operation": "ListInstanceProfiles" }, "resource": { @@ -455,6 +482,14 @@ ] } }, + "AttachPolicy": { + "request": { + "operation": "AttachGroupPolicy", + "params": [ + { "target": "GroupName", "source": "identifier", "name": "Name" } + ] + } + }, "Create": { "request": { "operation": "CreateGroup", @@ -493,6 +528,14 @@ ] } }, + "DetachPolicy": { + "request": { + "operation": "DetachGroupPolicy", + "params": [ + { "target": "GroupName", "source": "identifier", "name": "Name" } + ] + } + }, "RemoveUser": { "request": { "operation": "RemoveUserFromGroup", @@ -528,6 +571,20 @@ } }, "hasMany": { + "AttachedPolicies": { + "request": { + "operation": "ListAttachedGroupPolicies", + "params": [ + { "target": "GroupName", "source": "identifier", "name": "Name" } + ] + }, + "resource": { + "type": "Policy", + "identifiers": [ + { "target": "Arn", "source": "response", "path": "AttachedPolicies[].PolicyArn" } + ] + } + }, "Policies": { "request": { "operation": "ListGroupPolicies", @@ -781,6 +838,166 @@ } } }, + "Policy": { + "identifiers": [ + { "name": "Arn", + "memberName": "PolicyArn" } + ], + "shape": "Policy", + "load": { + "request": { + "operation": "GetPolicy", + "params": [ + { "target": "PolicyArn", "source": "identifier", "name": "Arn" } + ] + }, + "path": "Policy" + }, + "actions": { + "Create": { + "request": { + "operation": "CreatePolicy" + } + }, + "CreateVersion": { + "request": { + "operation": "CreatePolicyVersion", + "params": [ + { "target": "PolicyArn", "source": "identifier", "name": "Arn" } + ] + }, + "resource": { + "type": "PolicyVersion", + "identifiers": [ + { "target": "Arn", "source": "identifier", "name": "Arn" }, + { "target": "VersionId", "source": "response", "path": "PolicyVersion.VersionId" } + ] + } + }, + "Delete": { + "request": { + "operation": "DeletePolicy", + "params": [ + { "target": "PolicyArn", "source": "identifier", "name": "Arn" } + ] + } + } + }, + "has": { + "DefaultVersion": { + "resource": { + "type": "PolicyVersion", + "identifiers": [ + { "target": "Arn", "source": "identifier", "name": "Arn" }, + { "target": "VersionId", "source": "data", "name": "DefaultVersionId", "path": "DefaultVersionId" } + ] + } + } + }, + "hasMany": { + "Versions": { + "request": { + "operation": "ListPolicyVersions", + "params": [ + { "target": "PolicyArn", "source": "identifier", "name": "Arn" } + ] + }, + "resource": { + "type": "PolicyVersion", + "identifiers": [ + { "target": "Arn", "source": "identifier", "name": "Arn" }, + { "target": "VersionId", "source": "response", "path": "Versions[].VersionId" } + ], + "path": "Versions[]" + } + }, + "AttachedGroups": { + "request": { + "operation": "ListEntitiesForPolicy", + "params": [ + { "target": "PolicyArn", "source": "identifier", "name": "Arn" }, + { "target": "EntityFilter", "source": "string", "value": "Group" } + ] + }, + "resource": { + "type": "Group", + "identifiers": [ + { "target": "Name", "source": "response", "path": "PolicyGroups[].GroupName" } + ] + }, + "path": "PolicyGroups[]" + }, + "AttachedRoles": { + "request": { + "operation": "ListEntitiesForPolicy", + "params": [ + { "target": "PolicyArn", "source": "identifier", "name": "Arn" }, + { "target": "EntityFilter", "source": "string", "value": "Role" } + ] + }, + "resource": { + "type": "Role", + "identifiers": [ + { "target": "Name", "source": "response", "path": "PolicyRoles[].RoleName" } + ] + }, + "path": "PolicyRoles[]" + }, + "AttachedUsers": { + "request": { + "operation": "ListEntitiesForPolicy", + "params": [ + { "target": "PolicyArn", "source": "identifier", "name": "Arn" }, + { "target": "EntityFilter", "source": "string", "value": "User" } + ] + }, + "resource": { + "type": "User", + "identifiers": [ + { "target": "Name", "source": "response", "path": "PolicyUsers[].UserName" } + ] + }, + "path": "PolicyUsers[]" + } + } + }, + "PolicyVersion": { + "identifiers": [ + { "name": "Arn" }, + { "name": "VersionId" } + ], + "shape": "PolicyVersion", + "load": { + "request": { + "operation": "GetPolicyVersion", + "params": [ + { "target": "PolicyArn", "source": "identifier", "name": "Arn" }, + { "target": "VersionId", "source": "identifier", "name": "VersionId" } + ] + }, + "path": "PolicyVersion" + }, + "actions": { + "Delete": { + "request": { + "operation": "DeletePolicyVersion", + "params": [ + { "target": "PolicyArn", "source": "identifier", "name": "Arn" }, + { "target": "VersionId", "source": "identifier", "name": "VersionId" } + ] + } + }, + "SetAsDefault": { + "request": { + "operation": "SetDefaultPolicyVersion", + "params": [ + { "target": "PolicyArn", "source": "identifier", "name": "Arn" }, + { "target": "VersionId", "source": "identifier", "name": "VersionId" } + ] + } + } + } + }, "Role": { "identifiers": [ { @@ -799,6 +1016,14 @@ "path": "Role" }, "actions": { + "AttachPolicy": { + "request": { + "operation": "AttachRolePolicy", + "params": [ + { "target": "RoleName", "source": "identifier", "name": "Name" } + ] + } + }, "Delete": { "request": { "operation": "DeleteRole", @@ -806,6 +1031,14 @@ { "target": "RoleName", "source": "identifier", "name": "Name" } ] } + }, + "DetachPolicy": { + "request": { + "operation": "DetachRolePolicy", + "params": [ + { "target": "RoleName", "source": "identifier", "name": "Name" } + ] + } } }, "has": { @@ -828,6 +1061,20 @@ } }, "hasMany": { + "AttachedPolicies": { + "request": { + "operation": "ListAttachedRolePolicies", + "params": [ + { "target": "RoleName", "source": "identifier", "name": "Name" } + ] + }, + "resource": { + "type": "Policy", + "identifiers": [ + { "target": "Arn", "source": "response", "path": "AttachedPolicies[].PolicyArn" } + ] + } + }, "InstanceProfiles": { "request": { "operation": "ListInstanceProfilesForRole", @@ -1065,6 +1312,14 @@ ] } }, + "AttachPolicy": { + "request": { + "operation": "AttachUserPolicy", + "params": [ + { "target": "UserName", "source": "identifier", "name": "Name" } + ] + } + }, "Create": { "request": { "operation": "CreateUser", @@ -1135,6 +1390,14 @@ ] } }, + "DetachPolicy": { + "request": { + "operation": "DetachUserPolicy", + "params": [ + { "target": "UserName", "source": "identifier", "name": "Name" } + ] + } + }, "EnableMfa": { "request": { "operation": "EnableMFADevice", @@ -1220,6 +1483,20 @@ } }, "hasMany": { + "AttachedPolicies": { + "request": { + "operation": "ListAttachedUserPolicies", + "params": [ + { "target": "UserName", "source": "identifier", "name": "Name" } + ] + }, + "resource": { + "type": "Policy", + "identifiers": [ + { "target": "Arn", "source": "response", "path": "AttachedPolicies[].PolicyArn" } + ] + } + }, "AccessKeys": { "request": { "operation": "ListAccessKeys", From d1301c84b3ca3eaec6fea4dda8d0d82f2ce2a36f Mon Sep 17 00:00:00 2001 From: home Date: Thu, 12 Mar 2015 19:41:23 +1000 Subject: [PATCH 2/9] Remove Policy create action. Add reverse attach/detach Group/Role/User actions for Policy. --- .../resources/iam-2010-05-08.resources.json | 47 ++++++++++++++++++- 1 file changed, 45 insertions(+), 2 deletions(-) diff --git a/boto3/data/resources/iam-2010-05-08.resources.json b/boto3/data/resources/iam-2010-05-08.resources.json index 823bda2906..e72c477185 100644 --- a/boto3/data/resources/iam-2010-05-08.resources.json +++ b/boto3/data/resources/iam-2010-05-08.resources.json @@ -854,9 +854,28 @@ "path": "Policy" }, "actions": { - "Create": { + "AttachGroup": { + "request": { + "operation": "AttachGroupPolicy", + "params": [ + { "target": "PolicyArn", "source": "identifier", "name": "Arn" } + ] + } + }, + "AttachRole": { + "request": { + "operation": "AttachRolePolicy", + "params": [ + { "target": "PolicyArn", "source": "identifier", "name": "Arn" } + ] + } + }, + "AttachUser": { "request": { - "operation": "CreatePolicy" + "operation": "AttachUserPolicy", + "params": [ + { "target": "PolicyArn", "source": "identifier", "name": "Arn" } + ] } }, "CreateVersion": { @@ -881,6 +900,30 @@ { "target": "PolicyArn", "source": "identifier", "name": "Arn" } ] } + }, + "DetachGroup": { + "request": { + "operation": "DetachGroupPolicy", + "params": [ + { "target": "PolicyArn", "source": "identifier", "name": "Arn" } + ] + } + }, + "DetachRole": { + "request": { + "operation": "DetachRolePolicy", + "params": [ + { "target": "PolicyArn", "source": "identifier", "name": "Arn" } + ] + } + }, + "DetachUser": { + "request": { + "operation": "DetachUserPolicy", + "params": [ + { "target": "PolicyArn", "source": "identifier", "name": "Arn" } + ] + } } }, "has": { From 1f21c9713ed5759841d583efaf875ac2ba766936 Mon Sep 17 00:00:00 2001 From: Garrett Heel Date: Tue, 17 Mar 2015 13:31:02 +1000 Subject: [PATCH 3/9] (IAM) Make User properties available via `CurrentUser` --- boto3/data/resources/iam-2010-05-08.resources.json | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/boto3/data/resources/iam-2010-05-08.resources.json b/boto3/data/resources/iam-2010-05-08.resources.json index e72c477185..0904f2a335 100644 --- a/boto3/data/resources/iam-2010-05-08.resources.json +++ b/boto3/data/resources/iam-2010-05-08.resources.json @@ -420,6 +420,13 @@ } }, "CurrentUser": { + "shape": "User", + "load": { + "request": { + "operation": "GetUser" + }, + "path": "User" + }, "hasMany": { "AccessKeys": { "request": { "operation": "ListAccessKeys" }, From 000c57981f1830dd1ae2fff3c181a3aa214a9659 Mon Sep 17 00:00:00 2001 From: "Daniel G. Taylor" Date: Fri, 20 Mar 2015 13:55:42 -0700 Subject: [PATCH 4/9] Add a User relationship to CurrentUser --- boto3/data/resources/iam-2010-05-08.resources.json | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/boto3/data/resources/iam-2010-05-08.resources.json b/boto3/data/resources/iam-2010-05-08.resources.json index 0904f2a335..330ae5f839 100644 --- a/boto3/data/resources/iam-2010-05-08.resources.json +++ b/boto3/data/resources/iam-2010-05-08.resources.json @@ -427,6 +427,16 @@ }, "path": "User" }, + "has": { + "User": { + "resource": { + "type": "User", + "identifiers": [ + { "target": "Name", "source": "data", "path": "UserName" } + ] + } + } + }, "hasMany": { "AccessKeys": { "request": { "operation": "ListAccessKeys" }, From 26a0adfc8ecc1930bff7130a908f0045f39d5bef Mon Sep 17 00:00:00 2001 From: "Daniel G. Taylor" Date: Fri, 20 Mar 2015 13:59:13 -0700 Subject: [PATCH 5/9] Update changelog --- CHANGELOG.rst | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/CHANGELOG.rst b/CHANGELOG.rst index e1fb01881c..ea2c48ff31 100644 --- a/CHANGELOG.rst +++ b/CHANGELOG.rst @@ -1,6 +1,15 @@ Changelog ========= +Unreleased +---------- + +* feature:Resources: Add a ``load`` operation and ``user`` reference + to AWS IAM's ``CurrentUser`` resource. + (`issue 72 `__, +* feature:Resources: Add resources for AWS IAM managed policies. + (`issue 71 `__) + 0.0.10 - 2015-03-05 ------------------- From 8aa7202e4c407b6e65f34a3c42f702963ee40f47 Mon Sep 17 00:00:00 2001 From: "Daniel G. Taylor" Date: Tue, 24 Mar 2015 10:37:09 -0700 Subject: [PATCH 6/9] Remove name attribute from data member source --- boto3/data/resources/iam-2010-05-08.resources.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/boto3/data/resources/iam-2010-05-08.resources.json b/boto3/data/resources/iam-2010-05-08.resources.json index 330ae5f839..4170235cbc 100644 --- a/boto3/data/resources/iam-2010-05-08.resources.json +++ b/boto3/data/resources/iam-2010-05-08.resources.json @@ -949,7 +949,7 @@ "type": "PolicyVersion", "identifiers": [ { "target": "Arn", "source": "identifier", "name": "Arn" }, - { "target": "VersionId", "source": "data", "name": "DefaultVersionId", "path": "DefaultVersionId" } + { "target": "VersionId", "source": "data", "path": "DefaultVersionId" } ] } } From 2e3d78ebe4074f7263e197d4194734f1d53dd1cd Mon Sep 17 00:00:00 2001 From: "Daniel G. Taylor" Date: Tue, 24 Mar 2015 13:51:42 -0700 Subject: [PATCH 7/9] Sync EC2 resource model --- CHANGELOG.rst | 2 + .../resources/ec2-2014-10-01.resources.json | 56 +++++++++++++++++++ 2 files changed, 58 insertions(+) diff --git a/CHANGELOG.rst b/CHANGELOG.rst index ea2c48ff31..d413b4aee6 100644 --- a/CHANGELOG.rst +++ b/CHANGELOG.rst @@ -4,6 +4,8 @@ Changelog Unreleased ---------- +* feature:Resources: Add Amazon EC2 support for ClassicLink actions + and add a delete action to EC2 ``Volume`` resources. * feature:Resources: Add a ``load`` operation and ``user`` reference to AWS IAM's ``CurrentUser`` resource. (`issue 72 `__, diff --git a/boto3/data/resources/ec2-2014-10-01.resources.json b/boto3/data/resources/ec2-2014-10-01.resources.json index 0d860e7747..933b89c339 100644 --- a/boto3/data/resources/ec2-2014-10-01.resources.json +++ b/boto3/data/resources/ec2-2014-10-01.resources.json @@ -601,6 +601,14 @@ ] } }, + "AttachClassicLinkVpc": { + "request": { + "operation": "AttachClassicLinkVpc", + "params": [ + { "target": "InstanceId", "source": "identifier", "name": "Id" } + ] + } + }, "ConsoleOutput": { "request": { "operation": "GetConsoleOutput", @@ -647,6 +655,14 @@ ] } }, + "DetachClassicLinkVpc": { + "request": { + "operation": "DetachClassicLinkVpc", + "params": [ + { "target": "InstanceId", "source": "identifier", "name": "Id" } + ] + } + }, "DetachVolume": { "request": { "operation": "DetachVolume", @@ -1769,6 +1785,14 @@ ] } }, + "Delete": { + "request": { + "operation": "DeleteVolume", + "params": [ + { "target": "VolumeId", "source": "identifier", "name": "Id" } + ] + } + }, "DescribeAttribute": { "request": { "operation": "DescribeVolumeAttribute", @@ -1855,6 +1879,14 @@ ] } }, + "AttachClassicLinkInstance": { + "request": { + "operation": "AttachClassicLinkVpc", + "params": [ + { "target": "VpcId", "source": "identifier", "name": "Id" } + ] + } + }, "AttachInternetGateway": { "request": { "operation": "AttachInternetGateway", @@ -1954,6 +1986,14 @@ ] } }, + "DetachClassicLinkInstance": { + "request": { + "operation": "DetachClassicLinkVpc", + "params": [ + { "target": "VpcId", "source": "identifier", "name": "Id" } + ] + } + }, "DetachInternetGateway": { "request": { "operation": "DetachInternetGateway", @@ -1962,6 +2002,22 @@ ] } }, + "DisableClassicLink": { + "request": { + "operation": "DisableVpcClassicLink", + "params": [ + { "target": "VpcId", "source": "identifier", "name": "Id" } + ] + } + }, + "EnableClassicLink": { + "request": { + "operation": "EnableVpcClassicLink", + "params": [ + { "target": "VpcId", "source": "identifier", "name": "Id" } + ] + } + }, "ModifyAttribute": { "request": { "operation": "ModifyVpcAttribute", From 3fbc895a9f317b71167dd174123cd3e53e82c090 Mon Sep 17 00:00:00 2001 From: "Daniel G. Taylor" Date: Tue, 24 Mar 2015 15:07:10 -0700 Subject: [PATCH 8/9] Update to Botocore 0.97.0 --- CHANGELOG.rst | 16 ++++++++++++++++ setup.py | 2 +- 2 files changed, 17 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.rst b/CHANGELOG.rst index d413b4aee6..e7ebc3da32 100644 --- a/CHANGELOG.rst +++ b/CHANGELOG.rst @@ -11,6 +11,22 @@ Unreleased (`issue 72 `__, * feature:Resources: Add resources for AWS IAM managed policies. (`issue 71 `__) +* feature:Botocore: Update to Botocore 0.97.0 + + * Add new Amazon EC2 waiters. + * Add support for Amazon S3 cross region replication. + * Fix an issue where empty config values could not be specified for + Amazon S3's bucket notifications. + (`botocore issue 495 `__) + * Update Amazon CloudWatch Logs to the latest API. + * Update Amazon Elastic Transcoder to the latest API. + * Update AWS CloudTrail to the latest API. + * Fix bug where explicitly passed ``profile_name`` will now override + any access and secret keys set in environment variables. + (`botocore issue 486 `__) + * Add ``endpoint_url`` to ``client.meta``. + * Better error messages for invalid regions. + * Fix creating clients with unicode service name. 0.0.10 - 2015-03-05 ------------------- diff --git a/setup.py b/setup.py index 6327aa92f3..e91b0fcd44 100644 --- a/setup.py +++ b/setup.py @@ -26,7 +26,7 @@ def get_version(): ] requires = [ - 'botocore==0.94.0', + 'botocore==0.97.0', 'bcdoc==0.12.2', 'jmespath==0.6.1', ] From c290e5610c88a831504344d6b8f7bf5be72ef1b9 Mon Sep 17 00:00:00 2001 From: "Daniel G. Taylor" Date: Tue, 24 Mar 2015 15:08:40 -0700 Subject: [PATCH 9/9] Version bump to 0.0.11 --- CHANGELOG.rst | 4 ++-- boto3/__init__.py | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/CHANGELOG.rst b/CHANGELOG.rst index e7ebc3da32..5f4ab3326a 100644 --- a/CHANGELOG.rst +++ b/CHANGELOG.rst @@ -1,8 +1,8 @@ Changelog ========= -Unreleased ----------- +0.0.11 - 2015-03-24 +------------------- * feature:Resources: Add Amazon EC2 support for ClassicLink actions and add a delete action to EC2 ``Volume`` resources. diff --git a/boto3/__init__.py b/boto3/__init__.py index d7c0c5eeda..4647ec4b7b 100644 --- a/boto3/__init__.py +++ b/boto3/__init__.py @@ -17,7 +17,7 @@ __author__ = 'Amazon Web Services' -__version__ = '0.0.10' +__version__ = '0.0.11' # The default Boto3 session; autoloaded when needed.