Class: Aws::IAM::Resource
- Inherits:
-
Object
- Object
- Aws::IAM::Resource
- Defined in:
- lib/aws-sdk-iam/customizations/resource.rb,
lib/aws-sdk-iam/resource.rb
Actions collapse
- #change_password(options = {}) ⇒ EmptyStructure
- #create_account_alias(options = {}) ⇒ EmptyStructure
- #create_account_password_policy(options = {}) ⇒ AccountPasswordPolicy
- #create_group(options = {}) ⇒ Group
- #create_instance_profile(options = {}) ⇒ InstanceProfile
- #create_policy(options = {}) ⇒ Policy
- #create_role(options = {}) ⇒ Role
- #create_saml_provider(options = {}) ⇒ SamlProvider
- #create_server_certificate(options = {}) ⇒ ServerCertificate
- #create_signing_certificate(options = {}) ⇒ SigningCertificate
- #create_user(options = {}) ⇒ User
- #create_virtual_mfa_device(options = {}) ⇒ VirtualMfaDevice
Associations collapse
- #account_password_policy ⇒ AccountPasswordPolicy
- #account_summary ⇒ AccountSummary
- #current_user ⇒ CurrentUser
- #group(name) ⇒ Group
- #groups(options = {}) ⇒ Group::Collection
- #instance_profile(name) ⇒ InstanceProfile
- #instance_profiles(options = {}) ⇒ InstanceProfile::Collection
- #policies(options = {}) ⇒ Policy::Collection
- #policy(arn) ⇒ Policy
- #role(name) ⇒ Role
- #roles(options = {}) ⇒ Role::Collection
- #saml_provider(arn) ⇒ SamlProvider
- #saml_providers(options = {}) ⇒ SamlProvider::Collection
- #server_certificate(name) ⇒ ServerCertificate
- #server_certificates(options = {}) ⇒ ServerCertificate::Collection
- #user(name) ⇒ User
- #users(options = {}) ⇒ User::Collection
- #virtual_mfa_device(serial_number) ⇒ VirtualMfaDevice
- #virtual_mfa_devices(options = {}) ⇒ VirtualMfaDevice::Collection
Instance Method Summary collapse
- #client ⇒ Client
-
#delete_account_alias ⇒ Seahorse::Client::Response, false
Returns the response from Client#delete_account_alias if an alias was deleted.
-
#initialize(options = {}) ⇒ Resource
constructor
A new instance of Resource.
Constructor Details
Instance Method Details
#account_password_policy ⇒ AccountPasswordPolicy
734 735 736 |
# File 'lib/aws-sdk-iam/resource.rb', line 734 def account_password_policy AccountPasswordPolicy.new(client: @client) end |
#account_summary ⇒ AccountSummary
739 740 741 |
# File 'lib/aws-sdk-iam/resource.rb', line 739 def account_summary AccountSummary.new(client: @client) end |
#change_password(options = {}) ⇒ EmptyStructure
50 51 52 53 |
# File 'lib/aws-sdk-iam/resource.rb', line 50 def change_password( = {}) resp = @client.change_password() resp.data end |
#create_account_alias(options = {}) ⇒ EmptyStructure
73 74 75 76 |
# File 'lib/aws-sdk-iam/resource.rb', line 73 def create_account_alias( = {}) resp = @client.create_account_alias() resp.data end |
#create_account_password_policy(options = {}) ⇒ AccountPasswordPolicy
163 164 165 166 |
# File 'lib/aws-sdk-iam/resource.rb', line 163 def create_account_password_policy( = {}) resp = @client.update_account_password_policy() AccountPasswordPolicy.new(client: @client) end |
#create_group(options = {}) ⇒ Group
208 209 210 211 212 213 214 215 |
# File 'lib/aws-sdk-iam/resource.rb', line 208 def create_group( = {}) resp = @client.create_group() Group.new( name: [:group_name], data: resp.data.group, client: @client ) end |
#create_instance_profile(options = {}) ⇒ InstanceProfile
254 255 256 257 258 259 260 261 |
# File 'lib/aws-sdk-iam/resource.rb', line 254 def create_instance_profile( = {}) resp = @client.create_instance_profile() InstanceProfile.new( name: [:instance_profile_name], data: resp.data.instance_profile, client: @client ) end |
#create_policy(options = {}) ⇒ Policy
332 333 334 335 336 337 338 |
# File 'lib/aws-sdk-iam/resource.rb', line 332 def create_policy( = {}) resp = @client.create_policy() Policy.new( arn: resp.data.policy.arn, client: @client ) end |
#create_role(options = {}) ⇒ Role
428 429 430 431 432 433 434 435 |
# File 'lib/aws-sdk-iam/resource.rb', line 428 def create_role( = {}) resp = @client.create_role() Role.new( name: [:role_name], data: resp.data.role, client: @client ) end |
#create_saml_provider(options = {}) ⇒ SamlProvider
470 471 472 473 474 475 476 |
# File 'lib/aws-sdk-iam/resource.rb', line 470 def create_saml_provider( = {}) resp = @client.create_saml_provider() SamlProvider.new( arn: resp.data.saml_provider_arn, client: @client ) end |
#create_server_certificate(options = {}) ⇒ ServerCertificate
579 580 581 582 583 584 585 |
# File 'lib/aws-sdk-iam/resource.rb', line 579 def create_server_certificate( = {}) resp = @client.upload_server_certificate() ServerCertificate.new( name: [:server_certificate_name], client: @client ) end |
#create_signing_certificate(options = {}) ⇒ SigningCertificate
624 625 626 627 628 629 630 631 |
# File 'lib/aws-sdk-iam/resource.rb', line 624 def create_signing_certificate( = {}) resp = @client.upload_signing_certificate() SigningCertificate.new( id: resp.data.certificate.certificate_id, data: resp.data.certificate, client: @client ) end |
#create_user(options = {}) ⇒ User
675 676 677 678 679 680 681 682 |
# File 'lib/aws-sdk-iam/resource.rb', line 675 def create_user( = {}) resp = @client.create_user() User.new( name: [:user_name], data: resp.data.user, client: @client ) end |
#create_virtual_mfa_device(options = {}) ⇒ VirtualMfaDevice
722 723 724 725 726 727 728 729 |
# File 'lib/aws-sdk-iam/resource.rb', line 722 def create_virtual_mfa_device( = {}) resp = @client.create_virtual_mfa_device() VirtualMfaDevice.new( serial_number: resp.data.virtual_mfa_device.serial_number, data: resp.data.virtual_mfa_device, client: @client ) end |
#current_user ⇒ CurrentUser
744 745 746 |
# File 'lib/aws-sdk-iam/resource.rb', line 744 def current_user CurrentUser.new(client: @client) end |
#delete_account_alias ⇒ Seahorse::Client::Response, false
Returns the response from Client#delete_account_alias if an alias was deleted. Returns ‘false` if this account had no alias to remove.
9 10 11 12 13 14 15 |
# File 'lib/aws-sdk-iam/customizations/resource.rb', line 9 def delete_account_alias if name = @client.list_account_aliases.account_aliases.first @client.delete_account_alias(account_alias: name) else false end end |
#group(name) ⇒ Group
750 751 752 753 754 755 |
# File 'lib/aws-sdk-iam/resource.rb', line 750 def group(name) Group.new( name: name, client: @client ) end |
#groups(options = {}) ⇒ Group::Collection
780 781 782 783 784 785 786 787 788 789 790 791 792 793 794 795 796 |
# File 'lib/aws-sdk-iam/resource.rb', line 780 def groups( = {}) batches = Enumerator.new do |y| resp = @client.list_groups() resp.each_page do |page| batch = [] page.data.groups.each do |g| batch << Group.new( name: g.group_name, data: g, client: @client ) end y.yield(batch) end end Group::Collection.new(batches) end |
#instance_profile(name) ⇒ InstanceProfile
800 801 802 803 804 805 |
# File 'lib/aws-sdk-iam/resource.rb', line 800 def instance_profile(name) InstanceProfile.new( name: name, client: @client ) end |
#instance_profiles(options = {}) ⇒ InstanceProfile::Collection
830 831 832 833 834 835 836 837 838 839 840 841 842 843 844 845 846 |
# File 'lib/aws-sdk-iam/resource.rb', line 830 def instance_profiles( = {}) batches = Enumerator.new do |y| resp = @client.list_instance_profiles() resp.each_page do |page| batch = [] page.data.instance_profiles.each do |i| batch << InstanceProfile.new( name: i.instance_profile_name, data: i, client: @client ) end y.yield(batch) end end InstanceProfile::Collection.new(batches) end |
#policies(options = {}) ⇒ Policy::Collection
897 898 899 900 901 902 903 904 905 906 907 908 909 910 911 912 913 |
# File 'lib/aws-sdk-iam/resource.rb', line 897 def policies( = {}) batches = Enumerator.new do |y| resp = @client.list_policies() resp.each_page do |page| batch = [] page.data.policies.each do |p| batch << Policy.new( arn: p.arn, data: p, client: @client ) end y.yield(batch) end end Policy::Collection.new(batches) end |
#policy(arn) ⇒ Policy
917 918 919 920 921 922 |
# File 'lib/aws-sdk-iam/resource.rb', line 917 def policy(arn) Policy.new( arn: arn, client: @client ) end |
#role(name) ⇒ Role
926 927 928 929 930 931 |
# File 'lib/aws-sdk-iam/resource.rb', line 926 def role(name) Role.new( name: name, client: @client ) end |
#roles(options = {}) ⇒ Role::Collection
956 957 958 959 960 961 962 963 964 965 966 967 968 969 970 971 972 |
# File 'lib/aws-sdk-iam/resource.rb', line 956 def roles( = {}) batches = Enumerator.new do |y| resp = @client.list_roles() resp.each_page do |page| batch = [] page.data.roles.each do |r| batch << Role.new( name: r.role_name, data: r, client: @client ) end y.yield(batch) end end Role::Collection.new(batches) end |
#saml_provider(arn) ⇒ SamlProvider
976 977 978 979 980 981 |
# File 'lib/aws-sdk-iam/resource.rb', line 976 def saml_provider(arn) SamlProvider.new( arn: arn, client: @client ) end |
#saml_providers(options = {}) ⇒ SamlProvider::Collection
988 989 990 991 992 993 994 995 996 997 998 999 1000 1001 |
# File 'lib/aws-sdk-iam/resource.rb', line 988 def saml_providers( = {}) batches = Enumerator.new do |y| batch = [] resp = @client.list_saml_providers() resp.data.saml_provider_list.each do |s| batch << SamlProvider.new( arn: s.arn, client: @client ) end y.yield(batch) end SamlProvider::Collection.new(batches) end |
#server_certificate(name) ⇒ ServerCertificate
1005 1006 1007 1008 1009 1010 |
# File 'lib/aws-sdk-iam/resource.rb', line 1005 def server_certificate(name) ServerCertificate.new( name: name, client: @client ) end |
#server_certificates(options = {}) ⇒ ServerCertificate::Collection
1035 1036 1037 1038 1039 1040 1041 1042 1043 1044 1045 1046 1047 1048 1049 1050 |
# File 'lib/aws-sdk-iam/resource.rb', line 1035 def server_certificates( = {}) batches = Enumerator.new do |y| resp = @client.list_server_certificates() resp.each_page do |page| batch = [] page.data..each do |s| batch << ServerCertificate.new( name: s.server_certificate_name, client: @client ) end y.yield(batch) end end ServerCertificate::Collection.new(batches) end |
#user(name) ⇒ User
1054 1055 1056 1057 1058 1059 |
# File 'lib/aws-sdk-iam/resource.rb', line 1054 def user(name) User.new( name: name, client: @client ) end |
#users(options = {}) ⇒ User::Collection
1084 1085 1086 1087 1088 1089 1090 1091 1092 1093 1094 1095 1096 1097 1098 1099 1100 |
# File 'lib/aws-sdk-iam/resource.rb', line 1084 def users( = {}) batches = Enumerator.new do |y| resp = @client.list_users() resp.each_page do |page| batch = [] page.data.users.each do |u| batch << User.new( name: u.user_name, data: u, client: @client ) end y.yield(batch) end end User::Collection.new(batches) end |
#virtual_mfa_device(serial_number) ⇒ VirtualMfaDevice
1104 1105 1106 1107 1108 1109 |
# File 'lib/aws-sdk-iam/resource.rb', line 1104 def virtual_mfa_device(serial_number) VirtualMfaDevice.new( serial_number: serial_number, client: @client ) end |
#virtual_mfa_devices(options = {}) ⇒ VirtualMfaDevice::Collection
1122 1123 1124 1125 1126 1127 1128 1129 1130 1131 1132 1133 1134 1135 1136 1137 1138 |
# File 'lib/aws-sdk-iam/resource.rb', line 1122 def virtual_mfa_devices( = {}) batches = Enumerator.new do |y| resp = @client.list_virtual_mfa_devices() resp.each_page do |page| batch = [] page.data.virtual_mfa_devices.each do |v| batch << VirtualMfaDevice.new( serial_number: v.serial_number, data: v, client: @client ) end y.yield(batch) end end VirtualMfaDevice::Collection.new(batches) end |