vpc_endpoint#

State module for managing EC2 VPc Endpoints.

async idem_aws.states.aws.ec2.vpc_endpoint.present(hub, ctx, name: str, vpc_id: str, service_name: str, resource_id: str = None, vpc_endpoint_type: str = None, policy_document: str = None, route_table_ids: List[str] = None, subnet_ids: List[str] = None, security_group_ids: List[str] = None, private_dns_enabled: bool = None, client_token: str = None, tags: Dict[str, Any] = None, timeout: Timeout = None) Dict[str, Any][source]#

Creates a VPC endpoint for a specified service.

An endpoint enables you to create a private connection between your VPC and the service. The service may be provided by Amazon Web Services, an Amazon Web Services Marketplace Partner, or another Amazon Web Services account. For more information, see VPC Endpoints in the Amazon Virtual Private Cloud User Guide. A gateway endpoint serves as a target for a route in your route table for traffic destined for the Amazon Web Service. You can specify an endpoint policy to attach to the endpoint, which will control access to the service from your VPC. You can also specify the VPC route tables that use the endpoint. An interface endpoint is a network interface in your subnet that serves as an endpoint for communicating with the specified service. You can specify the subnets in which to create an endpoint, and the security groups to associate with the endpoint network interface. A GatewayLoadBalancer endpoint is a network interface in your subnet that serves an endpoint for communicating with a Gateway Load Balancer that you’ve configured as a VPC endpoint service. Use DescribeVpcEndpointServices to get a list of supported services.

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

  • vpc_id (str) – AWS VPC ID.

  • resource_id (str, Optional) – AWS VPC Endpoint id.

  • service_name (str) – The service name. To get a list of available services, use the DescribeVpcEndpointServices request, or get the name from the service provider.

  • vpc_endpoint_type (str, Optional) – The type of endpoint. Default: Gateway. Defaults to Gateway.

  • policy_document (str, Optional) – (Interface and gateway endpoints) A policy to attach to the endpoint that controls access to the service. The policy must be in valid JSON format. If this parameter is not specified, we attach a default policy that allows full access to the service. Defaults to None.

  • route_table_ids (list, Optional) – (Gateway endpoint) One or more route table IDs. Defaults to None.

  • subnet_ids (list, Optional) – (Interface and Gateway Load Balancer endpoints) The ID of one or more subnets in which to create an endpoint network interface. For a Gateway Load Balancer endpoint, you can specify one subnet only. Defaults to None.

  • security_group_ids (list, Optional) – (Interface endpoint) The ID of one or more security groups to associate with the endpoint network interface. Defaults to None.

  • private_dns_enabled (bool, Optional) – (Interface endpoint) Indicates whether to associate a private hosted zone with the specified VPC. The private hosted zone contains a record set for the default public DNS name for the service for the Region (for example, kinesis.us-east-1.amazonaws.com), which resolves to the private IP addresses of the endpoint network interfaces in the VPC. This enables you to make requests to the default public DNS name for the service instead of the public DNS names that are automatically generated by the VPC endpoint service. To use a private hosted zone, you must set the following VPC attributes to true: enableDnsHostnames and enableDnsSupport. Use ModifyVpcAttribute to set the VPC attributes. Default: true. Defaults to None.

  • client_token (str, Optional) – Unique, case-sensitive identifier that you provide to ensure the idempotency of the request. Constraint: Maximum 64 ASCII characters. This field is autopopulated if not provided.

  • 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 endpoint. 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.

  • timeout (dict, Optional) –

    Timeout configuration for create/update of AWS VPC Endpoint.

    • create (dict):

      Timeout configuration for creating AWS VPC Endpoint

      • delay (int, Optional):

        The amount of time in seconds to wait between attempts.

      • max_attempts (int, Optional):

        Customized timeout configuration containing delay and max attempts.

    • update(dict, Optional):

      Timeout configuration for updating AWS VPC Endpoint

      • delay (int, Optional):

        The amount of time in seconds to wait between attempts.

      • max_attempts (int, Optional):

        Customized timeout configuration containing delay and max attempts.

Request Syntax:
[vpc_endpoint-id]:
  aws.ec2.vpc_endpoint.present:
    - vpc_id: 'string'
    - service_name: 'string'
    - resource_id: 'string'
    - vpc_endpoint_type: 'string'
    - policy_document: 'string'
    - route_table_ids:
      - 'string'
    - subnet_ids:
      - 'string'
    - security_group_ids:
      - 'string'
    - private_dns_enabled: 'Boolean'
    - client_token: 'string'
    - tag_specifications:
    - Key: 'string'
      Value: 'string'
Returns:

Dict[str, Any]

Examples

vpce-1231231234:
  aws.ec2.vpc_endpoint.present:
    - vpc_id: vpc-123123123
    - service_name: com.amazonaws.us-west-2.s3
    - resource_id: vpce-1231231234
    - vpc_endpoint_type: Interface
    - private_dns_enabled: False
async idem_aws.states.aws.ec2.vpc_endpoint.absent(hub, ctx, name: str, resource_id: str = None, timeout: Dict = None) Dict[str, Any][source]#

Deletes the specified VPC endpoint.

You can delete any of the following types of VPC endpoints. Gateway endpoint, Gateway Load Balancer endpoint, Interface endpoint.

The following rules apply when you delete a VPC endpoint:
  • When you delete a gateway endpoint, we delete the endpoint routes in the route tables that are associated with the endpoint.

  • When you delete a Gateway Load Balancer endpoint, we delete the endpoint network interfaces. You can only delete Gateway Load Balancer endpoints when the routes that are associated with the endpoint are deleted.

  • When you delete an interface endpoint, we delete the endpoint network interfaces.

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

  • resource_id (str, Optional) – An AWS vpc_endpoint resource_id to identify the resource.

  • timeout (dict, Optional) –

    Timeout configuration for deleting the endpoint.

    • delete (dict):

      Timeout configuration for deleting the endpoint.

      • delay:

        The amount of time in seconds to wait between attempts.

      • max_attempts:

        Customized timeout configuration containing delay and max attempts.

Request Syntax:
[vpc_endpoint-resource-id]:
  aws.ec2.vpc_endpoint.absent:
    - name: "string"
    - resource_id: "string"
Returns:

Dict[str, Any]

Examples

vpce-123123123:
  aws.ec2.vpc_endpoint.absent:
    - name: value
    - resource_id: vpce-123123123
async idem_aws.states.aws.ec2.vpc_endpoint.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 endpoints.

Returns:

Dict[str, Any]

Examples

$ idem describe aws.ec2.vpc_endpoint