Learn Idem

Learn Idem

Powered by Idem Project

aws.ec2.vpc

**Autogenerated function**

Deletes the specified VPC. You must detach or delete all gateways and resources that are associated with the VPC
before you can delete it. For example, you must terminate all instances running in the VPC, delete all security
groups associated with the VPC (except the default one), delete all route tables associated with the VPC (except
the default one), and so on.

Args:
    name(Text): The Idem name of the VPC.
    resource_id(Text, optional): AWS VPC ID. Idem automatically considers this resource being absent if this field is not specified.

Returns:
    Dict[str, Any]

Examples:

    .. code-block:: sls

        vpc-01234672f3336db8:
          aws.ec2.vpc.absent:
            - resource_id: value
**Autogenerated function**

Creates a VPC with the specified IPv4 CIDR block. The smallest VPC you can create uses a /28 netmask (16 IPv4
addresses), and the largest uses a /16 netmask (65,536 IPv4 addresses). For more information about how large to
make your VPC, see Your VPC and subnets in the Amazon Virtual Private Cloud User Guide. You can optionally
request an IPv6 CIDR block for the VPC. You can request an Amazon-provided IPv6 CIDR block from Amazon's pool of
IPv6 addresses, or an IPv6 CIDR block from an IPv6 address pool that you provisioned through bring your own IP
addresses (BYOIP). By default, each instance you launch in the VPC has the default DHCP options, which include
only a default DNS server that we provide (AmazonProvidedDNS). For more information, see DHCP options sets in
the Amazon Virtual Private Cloud User Guide. You can specify the instance tenancy value for the VPC when you
create it. You can't change this value for the VPC after you create it. For more information, see Dedicated
Instances in the Amazon Elastic Compute Cloud User Guide.

Args:
    name(Text): An Idem name of the resource.
    resource_id(Text): AWS VPC ID
    cidr_block_association_set(List, optional): Information about the IPv4 CIDR blocks associated with the VPC.
        Defaults to None.
        * CidrBlock (string) -- An IPv4 CIDR block to associate with the VPC.
        * Ipv4IpamPoolId (string) -- Associate a CIDR allocated from an IPv4 IPAM pool to a VPC.
        * Ipv4NetmaskLength (integer) -- The netmask length of the IPv4 CIDR you would like to associate from an Amazon VPC IP Address Manager (IPAM) pool.
    ipv6_cidr_block_association_set(List, optional): Information about the IPv6 CIDR blocks associated with the VPC.
        Defaults to None.
        * Ipv6CidrBlock (string) -- An IPv6 CIDR block from the IPv6 address pool. You must also specify Ipv6Pool in the request.
        * Ipv6IpamPoolId (string) -- Associates a CIDR allocated from an IPv6 IPAM pool to a VPC.
        * Ipv6NetmaskLength (integer) -- The netmask length of the IPv6 CIDR you would like to associate from an
            Amazon VPC IP Address Manager (IPAM) pool.
        * Ipv6CidrBlockNetworkBorderGroup (string) -- The name of the location from which we advertise the IPV6 CIDR
            block. Use this parameter to limit the CIDR block to this location. You must set AmazonProvidedIpv6CidrBlock
            to true to use this parameter. You can have one IPv6 CIDR block association per network border group.
        * AmazonProvidedIpv6CidrBlock (boolean) -- Requests an Amazon-provided IPv6 CIDR block with a /56 prefix
            length for the VPC. You cannot specify the range of IPv6 addresses, or the size of the CIDR block.
    instance_tenancy(Text, optional): The tenancy options for instances launched into the VPC. For default, instances are launched
        with shared tenancy by default. You can launch instances with any tenancy into a shared tenancy
        VPC. For dedicated, instances are launched as dedicated tenancy instances by default. You can
        only launch instances with a tenancy of dedicated or host into a dedicated tenancy VPC.
        Important: The host value cannot be used with this parameter. Use the default or dedicated
        values only. Default: default. Defaults to None.
    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 VPC.
        Each tag consists of a key name and an associated value. Defaults to None.
        * Key (str, optional): The key of the tag. Constraints: Tag keys are case-sensitive and accept a maximum of 127 Unicode
            characters. May not begin with aws:.
        * Value(str, optional): The value of the tag. Constraints: Tag values are case-sensitive and accept a maximum of 256
            Unicode characters.
    enable_dns_hostnames(bool, optional): Indicates whether the instances launched in the VPC get DNS hostnames. If enabled, instances
        in the VPC get DNS hostnames; otherwise, they do not. You cannot modify the DNS resolution and DNS hostnames attributes in the same request.
        Use separate requests for each attribute. You can only enable DNS hostnames if you've enabled DNS support.
    enable_dns_support(bool, optional): Indicates whether the DNS resolution is supported for the VPC. If enabled, queries to the Amazon provided
        DNS server at the 169.254.169.253 IP address, or the reserved IP address at the base of the VPC network range "plus two" succeed. If disabled,
        the Amazon provided DNS service in the VPC that resolves public DNS hostnames to IP addresses is not enabled. You cannot modify the DNS resolution
        and DNS hostnames attributes in the same request. Use separate requests for each attribute.

Request Syntax:
    [vpc-resource-id]:
      aws.ec2.vpc.present:
      - resource_id: 'string'
      - cidr_block_association_set:
        - CidrBlock: 'string'
          Ipv4IpamPoolId: 'string'
          Ipv4NetmaskLength: 'integer'
      - ipv6_cidr_block_association_set:
        - Ipv6CidrBlock: 'string'
          Ipv6IpamPoolId: 'string'
          Ipv6NetmaskLength: 'integer'
          Ipv6CidrBlockNetworkBorderGroup: 'string'
          AmazonProvidedIpv6CidrBlock: True|False
      - instance_tenancy: 'default'|'dedicated'|'host'
      - tags:
        - Key: 'string'
          Value: 'string'
      - enable_dns_support: 'Boolean'
      - enable_dns_hostnames: 'Boolean'

Returns:
    Dict[str, Any]

Examples:

    .. code-block:: sls

        vpc-01234672f3336db8:
          aws.ec2.vpc.present:
          - cidr_block_association_set:
            - CidrBlock: 10.1.150.0/28
          - instance_tenancy: default
          - enable_dns_support: True
          - enable_dns_hostnames: False
          - tags:
            - Key: Name
              Value: vpc-name
            - Key: vpc-tag-key-2
              Value: vpc-tag-value-2
Use an un-managed VPC as a data-source. Supply one of the inputs as the filter.

Full plugin documentation is available on the Idem documentation site - aws.ec2.vpc .

Last updated on 20 Sep 2022
 Edit on GitHub