vpc_peering_connection#

State module for managing EC2 VPC Peering Connection.

async idem_aws.states.aws.ec2.vpc_peering_connection.present(hub, ctx, name: str, resource_id: str = None, peer_owner_id: str = None, peer_vpc_id: str = None, vpc_id: str = None, peer_region: str = None, tags: Dict[str, str] = None, status: str = None) Dict[str, Any][source]#

Requests to create or update a VPC peering connection.

Requests a VPC peering connection between two VPCs: a requester VPC that you own and an accepter VPC with which to create the connection. The accepter VPC can belong to another Amazon Web Services account and can be in a different Region to the requester VPC. The requester VPC and accepter VPC cannot have overlapping CIDR blocks. Limitations and rules apply to a VPC peering connection. For more information, see the limitations section in the VPC Peering Guide. The owner of the accepter VPC must accept the peering request to activate the peering connection. The VPC peering connection request expires after 7 days, after which it cannot be accepted or rejected. If you create a VPC peering connection request between VPCs with overlapping CIDR blocks, the VPC peering connection has a status of failed.

NOTE: These parameters - peer_owner_id, peer_vpc_id, vpc_id, peer_region can’t be updated for a given VPC peering connection. Only tags and status can be updated for a VPC peering connection In case of an update attempt of the previously mentioned four parameters, where resource_id is passed for an existing connection, they will be ignored.

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

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

  • peer_owner_id (str, Optional) – The Amazon Web Services account ID of the owner of the accepter VPC. Default: Your Amazon Web Services account ID. Defaults to None.

  • peer_vpc_id (str, Optional) – The ID of the VPC with which you are creating the VPC peering connection. You must specify this parameter in the request. Defaults to None.

  • vpc_id (str, Optional) – The ID of the requester VPC. You must specify this parameter in the request. Defaults to None.

  • peer_region (str, Optional) – The Region code for the accepter VPC, if the accepter VPC is located in a Region other than the Region in which you make the request. Default: The Region in which you make the request. Defaults to None.

  • tags (Dict, Optional) – Dict in the format of {tag-key: tag-value} The tags to assign to the peering connection. Each tag consists of a key name and an associated value. Defaults to None.

  • status – (str, Optional) The desired status for the VPC peering connection, but in practice, an update will be attempted only if this status is set to “active”.

Request Syntax:
[vpc-peering-connection-id]:
  aws.ec2.vpc_peering_connection.present:
  - resource_id: "string"
  - name: "string"
  - peer_owner_id: "string"
  - peer_region: "string"
  - peer_vpc_id: "string"
  - vpc_id: "string"
  - tags: "Dict"
  - status: "string"
Returns:

Dict[str, Any]

Examples

resource_is_present:
  aws.ec2.vpc_peering_connection.present:
    - resource_id: pcx-ae89ce9b
    - name: pcx-ae89ce9b
    - peer_owner_id: '000000000000'
    - peer_region: us-west-2
    - peer_vpc_id: vpc-98c058ae
    - vpc_id: vpc-2c90d746
    - status: active
    - tags:
        first_key: first_value
        second_key: second_value
        third_key: third_value
        fourth_key: fourth_value
async idem_aws.states.aws.ec2.vpc_peering_connection.absent(hub, ctx, name: str, resource_id: str = None) Dict[str, Any][source]#

Deletes a VPC peering connection.

Either the owner of the requester VPC or the owner of the accepter VPC can delete the VPC peering connection if it’s in the active state. The owner of the requester VPC can delete a VPC peering connection in the pending-acceptance state. You cannot delete a VPC peering connection that’s in the failed state.

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

  • resource_id (str, Optional) – An identifier of the resource in the provider.

Request Syntax:
[vpc-peering-connection-id]:
  aws.ec2.vpc_peering_connection.absent:
  - resource_id: "string"
  - name: "string"
Returns:

Dict[str, Any]

Examples

resource_is_absent:
  aws.ec2.vpc_peering_connection.absent:
    - name: value
    - resource_id: value
async idem_aws.states.aws.ec2.vpc_peering_connection.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 VPC peering connections.

Returns:

Dict[str, Any]

Examples

$ idem describe aws.ec2.vpc_peering_connection