How to use list_instance_profiles method in localstack

Best Python code snippet using localstack_python

aws_devicefarm_info.py

Source:aws_devicefarm_info.py Github

copy

Full Screen

...297 if client.can_paginate('list_instance_profiles'):298 paginator = client.get_paginator('list_instance_profiles')299 return paginator.paginate(), True300 else:301 return client.list_instance_profiles(), False302 elif module.params['list_jobs']:303 if client.can_paginate('list_jobs'):304 paginator = client.get_paginator('list_jobs')305 return paginator.paginate(306 arn=module.params['arn'],307 ), True308 else:309 return client.list_jobs(310 arn=module.params['arn'],311 ), False312 elif module.params['list_network_profiles']:313 if client.can_paginate('list_network_profiles'):314 paginator = client.get_paginator('list_network_profiles')315 return paginator.paginate(...

Full Screen

Full Screen

unused_ec2_iam_profiles.py

Source:unused_ec2_iam_profiles.py Github

copy

Full Screen

...14 ec2_instance_profile_re = '^arn:aws:iam::\d+:instance-profile\/.+-[A-Z0-9]{10,100}'15 instance_profile_arns = []16 while True:17 if marker:18 resp = IAM.list_instance_profiles(Marker=marker)19 else:20 resp = IAM.list_instance_profiles()21 if not resp['InstanceProfiles']:22 break23 for profile in resp['InstanceProfiles']:24 arn = profile['Arn']25 if re.match(ec2_instance_profile_re, arn):26 instance_profile_arns.append(profile['Arn'])27 if 'Marker' in resp.keys():28 marker = resp['Marker']29 else:30 break31 return instance_profile_arns32def list_attached_ec2_instance_profiles():33 """34 return a list of in-use instance profile arns...

Full Screen

Full Screen

instance_profile.py

Source:instance_profile.py Github

copy

Full Screen

1"""Resource for Instance Profiles"""2from typing import Type3from botocore.client import BaseClient4from altimeter.aws.resource.resource_spec import ListFromAWSResult5from altimeter.aws.resource.iam import IAMResourceSpec6from altimeter.aws.resource.iam.role import IAMRoleResourceSpec7from altimeter.core.graph.field.dict_field import AnonymousEmbeddedDictField8from altimeter.core.graph.field.list_field import AnonymousListField9from altimeter.core.graph.field.resource_link_field import ResourceLinkField10from altimeter.core.graph.field.scalar_field import ScalarField11from altimeter.core.graph.schema import Schema12class InstanceProfileResourceSpec(IAMResourceSpec):13 """Resource for Instance Profiles"""14 type_name = "instance-profile"15 schema = Schema(16 ScalarField("InstanceProfileName", alti_key="name"),17 AnonymousListField(18 "Roles",19 AnonymousEmbeddedDictField(20 ResourceLinkField(21 "Arn", IAMRoleResourceSpec, value_is_id=True, alti_key="attached_role"22 )23 ),24 ),25 )26 @classmethod27 def list_from_aws(28 cls: Type["InstanceProfileResourceSpec"], client: BaseClient, account_id: str, region: str29 ) -> ListFromAWSResult:30 """Return a dict of dicts of the format:31 {'instance_profile_1_arn': {instance_profile_1_dict},32 'instance_profile_2_arn': {instance_profile_2_dict},33 ...}34 Where the dicts represent results from list_instance_profiles."""35 paginator = client.get_paginator("list_instance_profiles")36 instance_profiles = {}37 for resp in paginator.paginate():38 for instance_profile in resp.get("InstanceProfiles", []):39 resource_arn = instance_profile["Arn"]40 instance_profiles[resource_arn] = instance_profile...

Full Screen

Full Screen

Automation Testing Tutorials

Learn to execute automation testing from scratch with LambdaTest Learning Hub. Right from setting up the prerequisites to run your first automation test, to following best practices and diving deeper into advanced test scenarios. LambdaTest Learning Hubs compile a list of step-by-step guides to help you be proficient with different test automation frameworks i.e. Selenium, Cypress, TestNG etc.

LambdaTest Learning Hubs:

YouTube

You could also refer to video tutorials over LambdaTest YouTube channel to get step by step demonstration from industry experts.

Run localstack automation tests on LambdaTest cloud grid

Perform automation testing on 3000+ real desktop and mobile devices online.

Try LambdaTest Now !!

Get 100 minutes of automation test minutes FREE!!

Next-Gen App & Browser Testing Cloud

Was this article helpful?

Helpful

NotHelpful