network_interface#

Manage Ec2 Network Interfaces

async idem_aws.states.aws.ec2.network_interface.present(hub, ctx, *, name: str, subnet_id: str, resource_id: str = None, client_token: str = None, description: str = None, groups: ~typing.List[str] = None, interface_type: str = None, default_ipv6_address: str = None, primary_ip_address: str = None, private_ip_addresses: ~typing.List[str] = None, ipv4_address_count: int = None, ipv4_prefix_count: int = None, ipv4_prefixes: ~typing.List[str] = None, ipv6_addresses: ~typing.List[str] = None, ipv6_address_count: int = None, ipv6_prefix_count: int = None, ipv6_prefixes: ~typing.List[str] = None, tags: ~typing.Dict[str, str] = None, availability_zone: dict_tools.typing.Computed.<class 'str'> = None, mac_address: dict_tools.typing.Computed.<class 'str'> = None, outpost_arn: dict_tools.typing.Computed.<class 'str'> = None, owner_id: dict_tools.typing.Computed.<class 'str'> = None, private_dns_name: dict_tools.typing.Computed.<class 'str'> = None, requester_id: dict_tools.typing.Computed.<class 'str'> = None, requester_managed: dict_tools.typing.Computed.<class 'str'> = None, source_dest_check: dict_tools.typing.Computed.<class 'str'> = None, status: dict_tools.typing.Computed.<class 'str'> = None, vpc_id: dict_tools.typing.Computed.<class 'str'> = None, deny_all_igw_traffic: dict_tools.typing.Computed.<class 'bool'> = None, ipv6_native: dict_tools.typing.Computed.<class 'bool'> = None, allocation_id: dict_tools.typing.Computed.<class 'str'> = None, ip_owner_id: dict_tools.typing.Computed.<class 'str'> = None, public_dns_name: dict_tools.typing.Computed.<class 'str'> = None, public_ip: dict_tools.typing.Computed.<class 'str'> = None, customer_owned_ip: dict_tools.typing.Computed.<class 'str'> = None, carrier_ip: dict_tools.typing.Computed.<class 'str'> = None, attachment_id: dict_tools.typing.Computed.<class 'str'> = None, delete_on_termination: dict_tools.typing.Computed.<class 'bool'> = None, device_index: dict_tools.typing.Computed.<class 'int'> = None, network_card_index: dict_tools.typing.Computed.<class 'int'> = None, ena_srd_enabled: dict_tools.typing.Computed.<class 'bool'> = None, ena_srd_udp_enabled: dict_tools.typing.Computed.<class 'bool'> = None, **kwargs) Dict[str, Any][source]#

Creates a network interface in the specified subnet. The number of IP addresses you can assign to a network interface varies by instance type. For more information, see IP Addresses Per ENI Per Instance Type in the Amazon Virtual Private Cloud User Guide. For more information about network interfaces, see Elastic network interfaces in the Amazon Elastic Compute Cloud User Guide.

Parameters:
  • name (str) – An Idem name of the resource.

  • resource_id (str) – An identifier of the resource in the provider. Defaults to None.

  • client_token (str, Optional) – The idempotency token for the network interface.

  • description (str, Optional) – A description for the network interface. Defaults to None.

  • groups (List[str], Optional) – The IDs of one or more security groups. Defaults to None.

  • ipv6_addresses (List[str]], Optional) – The IPv6 addresses from the IPv6 CIDR block range of your subnet. Defaults to None.

  • default_ipv6_address (str, Optional) – The default IPv6 address.

  • primary_ip_address (str, Optional) – The primary private IPv4 address of the network interface. If you don’t specify an IPv4 address, Amazon EC2 selects one for you from the subnet’s IPv4 CIDR range. Defaults to None.

  • private_ip_addresses (List[str]], Optional) – The private IPv4 addresses. If you specify the private IPv4 addresses, you should also specify the primary private IPv4 address using the primary_ip_address property. If you only need a primary private IPv4 address, you can specify it using the primary_ip_address property and not use this property.

  • interface_type (str, Optional) – The type of network interface. The default is interface. The only supported values are efa and trunk. Defaults to None.

  • subnet_id (str) – The ID of the subnet to associate with the network interface.

  • tags (Dict[str, str], Optional) – The tags to apply to the resource. Defaults to None.

Returns:

Dict[str, Any]

Examples

default_vpc:
  exec.run:
    - path: aws.ec2.vpc.get
    - kwargs:
        filters:
          - name: is-default
            values:
              - "true"

default_subnet:
  exec.run:
    - path: aws.ec2.subnet.get
    - kwargs:
        filters:
          - name: vpc-id
            values:
              - ${exec:default_vpc:resource_id}

my_network_interface:
  aws.ec2.network_interface.present:
    - subnet_id: ${exec:default_subnet:resource_id}
async idem_aws.states.aws.ec2.network_interface.absent(hub, ctx, *, name: str, resource_id: str = None, client_token: str = None, **kwargs) Dict[str, Any][source]#

Deletes the specified network interface. You must detach the network interface before you can delete it.

Parameters:
  • name (str) –

  • resource. (An Idem name of the) –

  • resource_id (str, Optional) – The ID of the network interface.

  • client_token (str, Optional) – The idempotency token for the network interface.

Returns:

Dict[str, Any]

Examples

resource_is_absent:
  aws_auto.ec2.network_interface.absent:
    - name: value
    - resource_id: value
async idem_aws.states.aws.ec2.network_interface.describe(hub, ctx) Dict[str, Dict[str, Any]][source]#

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

Describes one or more of your network interfaces.

Returns:

Dict[str, Any]

Examples

$ idem describe aws_auto.ec2.network_interface