instance_profile#

Autogenerated using pop-create-idem

hub.exec.boto3.client.iam.create_instance_profile hub.exec.boto3.client.iam.delete_instance_profile hub.exec.boto3.client.iam.get_instance_profile hub.exec.boto3.client.iam.list_instance_profiles hub.exec.boto3.client.iam.tag_instance_profile hub.exec.boto3.client.iam.untag_instance_profile resource = await hub.tool.boto3.resource.create(ctx, “iam”, “InstanceProfile”, name) hub.tool.boto3.resource.exec(resource, add_role, *args, **kwargs) hub.tool.boto3.resource.exec(resource, delete, *args, **kwargs) hub.tool.boto3.resource.exec(resource, remove_role, *args, **kwargs)

async idem_aws.states.aws.iam.instance_profile.present(hub, ctx, name: str, resource_id: str = None, path: str = None, roles: List = None, tags: Dict[str, Any] = None) Dict[str, Any][source]#

Autogenerated function

Creates a new instance profile. For information about instance profiles, see Using roles for applications on

Amazon EC2 in the IAM User Guide, and Instance profiles in the Amazon EC2 User Guide. For information about the number of instance profiles you can create, see IAM object quotas in the IAM User Guide. Tags can be set on a newly created instance profile, or updated on an existing one. Roles are set and updated as a day-2 operation.

Parameters:
  • name (str) – AWS Instance Profile Name.

  • resource_id (str, Optional) – AWS Instance Profile Name.

  • path (str, Optional) – The path to the instance profile.

  • roles (str, Optional) – A list with up to one role name. Instance profile can be associated with a single role.

  • tags (Dict or List, Optional) –

    Dict in the format of {tag-key: tag-value} or List of tags in the format of [{“Key”: tag-key, “Value”: tag-value}] to associate with the IAM instance profile. Each tag consists of a key name and an associated value. Defaults to None. * (Key): The key name that can be used to look up or retrieve the associated value. For example,

    Department or Cost Center are common choices.

    • (Value): The value associated with this tag. For example, tags with a key name of Department could have

      values such as Human Resources, Accounting, and Support. Tags with a key name of Cost Center might have values that consist of the number associated with the different cost centers in your company. Typically, many resources have tags with the same key name but with different values. Amazon Web Services always interprets the tag Value as a single string. If you need to store an array, you can store comma-separated values in the string. However, you must interpret the value in your code.

Returns:

Dict[str, Any]

Request Syntax:
[iam-instance-profile-name]:
aws.iam.instance_profile.present:
  • name: ‘string’

  • resource_id: ‘string’

  • path: ‘string’

  • roles: - RoleName: ‘string’

  • Tags: - Key: ‘string’

    Value: ‘string’

Example


inst-profile-1:

aws.iam.instance_profile.present: - name: inst-profile-1 - path: /aws-service-inst-profile/ - roles:

  • RoleName: role-1

  • Tags: - Key: test-1

    Value: test-1-val

async idem_aws.states.aws.iam.instance_profile.absent(hub, ctx, name: str, resource_id: str = None) Dict[str, Any][source]#

Autogenerated function

Deletes the specified instance profile. The instance profile must not have an associated role. Make sure that you do not have any Amazon EC2 instances running with the instance profile you are about to delete. Deleting a role or instance profile that is associated with a running instance will break any applications running on the instance. For more information about instance profiles, see About instance profiles.

Parameters:
  • name (str) – AWS Instance Profile Name.

  • resource_id (str, Optional) – AWS Instance Profile Name. If not specified, Idem will use “name” parameter to identify the role policy on AWS.

Returns:

Dict[str, Any]

Request Syntax:
[iam-instance-profile-name]:
aws.iam.instance_profile.present:
  • name: ‘string’

Examples

instance-profile-test:
  aws.iam.instance_profile.absent:
    - name: instance-profile-test
async idem_aws.states.aws.iam.instance_profile.describe(hub, ctx) Dict[str, Dict[str, Any]][source]#

Autogenerated function

Describe the resource in a way that can be recreated/managed with the corresponding “present” function

Lists the instance profiles that have the specified path prefix. If there are none, the operation returns an empty list. For more information about instance profiles, see About instance profiles. IAM resource-listing operations return a subset of the available attributes for the resource. For example, this operation does not return tags, even though they are an attribute of the returned object. To view all of the information for an instance profile, see GetInstanceProfile. You can paginate the results using the MaxItems and Marker parameters.

Returns:

Dict[str, Any]

Examples

$ idem describe aws.iam.instance_profile