{-# LANGUAGE DeriveGeneric #-} {-# LANGUAGE DuplicateRecordFields #-} {-# LANGUAGE NamedFieldPuns #-} {-# LANGUAGE OverloadedStrings #-} {-# LANGUAGE RecordWildCards #-} {-# LANGUAGE StrictData #-} {-# LANGUAGE NoImplicitPrelude #-} {-# OPTIONS_GHC -fno-warn-unused-imports #-} {-# OPTIONS_GHC -fno-warn-unused-matches #-} -- Derived from AWS service descriptions, licensed under Apache 2.0. -- | -- Module : Amazonka.EC2.Types.VpcEndpoint -- Copyright : (c) 2013-2023 Brendan Hay -- License : Mozilla Public License, v. 2.0. -- Maintainer : Brendan Hay -- Stability : auto-generated -- Portability : non-portable (GHC extensions) module Amazonka.EC2.Types.VpcEndpoint where import qualified Amazonka.Core as Core import qualified Amazonka.Core.Lens.Internal as Lens import qualified Amazonka.Data as Data import Amazonka.EC2.Internal import Amazonka.EC2.Types.DnsEntry import Amazonka.EC2.Types.DnsOptions import Amazonka.EC2.Types.IpAddressType import Amazonka.EC2.Types.LastError import Amazonka.EC2.Types.SecurityGroupIdentifier import Amazonka.EC2.Types.State import Amazonka.EC2.Types.Tag import Amazonka.EC2.Types.VpcEndpointType import qualified Amazonka.Prelude as Prelude -- | Describes a VPC endpoint. -- -- /See:/ 'newVpcEndpoint' smart constructor. data VpcEndpoint = VpcEndpoint' { -- | The date and time that the endpoint was created. creationTimestamp :: Prelude.Maybe Data.ISO8601, -- | (Interface endpoint) The DNS entries for the endpoint. dnsEntries :: Prelude.Maybe [DnsEntry], -- | The DNS options for the endpoint. dnsOptions :: Prelude.Maybe DnsOptions, -- | (Interface endpoint) Information about the security groups that are -- associated with the network interface. groups :: Prelude.Maybe [SecurityGroupIdentifier], -- | The IP address type for the endpoint. ipAddressType :: Prelude.Maybe IpAddressType, -- | The last error that occurred for endpoint. lastError :: Prelude.Maybe LastError, -- | (Interface endpoint) One or more network interfaces for the endpoint. networkInterfaceIds :: Prelude.Maybe [Prelude.Text], -- | The ID of the Amazon Web Services account that owns the endpoint. ownerId :: Prelude.Maybe Prelude.Text, -- | The policy document associated with the endpoint, if applicable. policyDocument :: Prelude.Maybe Prelude.Text, -- | (Interface endpoint) Indicates whether the VPC is associated with a -- private hosted zone. privateDnsEnabled :: Prelude.Maybe Prelude.Bool, -- | Indicates whether the endpoint is being managed by its service. requesterManaged :: Prelude.Maybe Prelude.Bool, -- | (Gateway endpoint) One or more route tables associated with the -- endpoint. routeTableIds :: Prelude.Maybe [Prelude.Text], -- | The name of the service to which the endpoint is associated. serviceName :: Prelude.Maybe Prelude.Text, -- | The state of the endpoint. state :: Prelude.Maybe State, -- | (Interface endpoint) The subnets for the endpoint. subnetIds :: Prelude.Maybe [Prelude.Text], -- | Any tags assigned to the endpoint. tags :: Prelude.Maybe [Tag], -- | The ID of the endpoint. vpcEndpointId :: Prelude.Maybe Prelude.Text, -- | The type of endpoint. vpcEndpointType :: Prelude.Maybe VpcEndpointType, -- | The ID of the VPC to which the endpoint is associated. vpcId :: Prelude.Maybe Prelude.Text } deriving (Prelude.Eq, Prelude.Read, Prelude.Show, Prelude.Generic) -- | -- Create a value of 'VpcEndpoint' with all optional fields omitted. -- -- Use or to modify other optional fields. -- -- The following record fields are available, with the corresponding lenses provided -- for backwards compatibility: -- -- 'creationTimestamp', 'vpcEndpoint_creationTimestamp' - The date and time that the endpoint was created. -- -- 'dnsEntries', 'vpcEndpoint_dnsEntries' - (Interface endpoint) The DNS entries for the endpoint. -- -- 'dnsOptions', 'vpcEndpoint_dnsOptions' - The DNS options for the endpoint. -- -- 'groups', 'vpcEndpoint_groups' - (Interface endpoint) Information about the security groups that are -- associated with the network interface. -- -- 'ipAddressType', 'vpcEndpoint_ipAddressType' - The IP address type for the endpoint. -- -- 'lastError', 'vpcEndpoint_lastError' - The last error that occurred for endpoint. -- -- 'networkInterfaceIds', 'vpcEndpoint_networkInterfaceIds' - (Interface endpoint) One or more network interfaces for the endpoint. -- -- 'ownerId', 'vpcEndpoint_ownerId' - The ID of the Amazon Web Services account that owns the endpoint. -- -- 'policyDocument', 'vpcEndpoint_policyDocument' - The policy document associated with the endpoint, if applicable. -- -- 'privateDnsEnabled', 'vpcEndpoint_privateDnsEnabled' - (Interface endpoint) Indicates whether the VPC is associated with a -- private hosted zone. -- -- 'requesterManaged', 'vpcEndpoint_requesterManaged' - Indicates whether the endpoint is being managed by its service. -- -- 'routeTableIds', 'vpcEndpoint_routeTableIds' - (Gateway endpoint) One or more route tables associated with the -- endpoint. -- -- 'serviceName', 'vpcEndpoint_serviceName' - The name of the service to which the endpoint is associated. -- -- 'state', 'vpcEndpoint_state' - The state of the endpoint. -- -- 'subnetIds', 'vpcEndpoint_subnetIds' - (Interface endpoint) The subnets for the endpoint. -- -- 'tags', 'vpcEndpoint_tags' - Any tags assigned to the endpoint. -- -- 'vpcEndpointId', 'vpcEndpoint_vpcEndpointId' - The ID of the endpoint. -- -- 'vpcEndpointType', 'vpcEndpoint_vpcEndpointType' - The type of endpoint. -- -- 'vpcId', 'vpcEndpoint_vpcId' - The ID of the VPC to which the endpoint is associated. newVpcEndpoint :: VpcEndpoint newVpcEndpoint = VpcEndpoint' { creationTimestamp = Prelude.Nothing, dnsEntries = Prelude.Nothing, dnsOptions = Prelude.Nothing, groups = Prelude.Nothing, ipAddressType = Prelude.Nothing, lastError = Prelude.Nothing, networkInterfaceIds = Prelude.Nothing, ownerId = Prelude.Nothing, policyDocument = Prelude.Nothing, privateDnsEnabled = Prelude.Nothing, requesterManaged = Prelude.Nothing, routeTableIds = Prelude.Nothing, serviceName = Prelude.Nothing, state = Prelude.Nothing, subnetIds = Prelude.Nothing, tags = Prelude.Nothing, vpcEndpointId = Prelude.Nothing, vpcEndpointType = Prelude.Nothing, vpcId = Prelude.Nothing } -- | The date and time that the endpoint was created. vpcEndpoint_creationTimestamp :: Lens.Lens' VpcEndpoint (Prelude.Maybe Prelude.UTCTime) vpcEndpoint_creationTimestamp = Lens.lens (\VpcEndpoint' {creationTimestamp} -> creationTimestamp) (\s@VpcEndpoint' {} a -> s {creationTimestamp = a} :: VpcEndpoint) Prelude.. Lens.mapping Data._Time -- | (Interface endpoint) The DNS entries for the endpoint. vpcEndpoint_dnsEntries :: Lens.Lens' VpcEndpoint (Prelude.Maybe [DnsEntry]) vpcEndpoint_dnsEntries = Lens.lens (\VpcEndpoint' {dnsEntries} -> dnsEntries) (\s@VpcEndpoint' {} a -> s {dnsEntries = a} :: VpcEndpoint) Prelude.. Lens.mapping Lens.coerced -- | The DNS options for the endpoint. vpcEndpoint_dnsOptions :: Lens.Lens' VpcEndpoint (Prelude.Maybe DnsOptions) vpcEndpoint_dnsOptions = Lens.lens (\VpcEndpoint' {dnsOptions} -> dnsOptions) (\s@VpcEndpoint' {} a -> s {dnsOptions = a} :: VpcEndpoint) -- | (Interface endpoint) Information about the security groups that are -- associated with the network interface. vpcEndpoint_groups :: Lens.Lens' VpcEndpoint (Prelude.Maybe [SecurityGroupIdentifier]) vpcEndpoint_groups = Lens.lens (\VpcEndpoint' {groups} -> groups) (\s@VpcEndpoint' {} a -> s {groups = a} :: VpcEndpoint) Prelude.. Lens.mapping Lens.coerced -- | The IP address type for the endpoint. vpcEndpoint_ipAddressType :: Lens.Lens' VpcEndpoint (Prelude.Maybe IpAddressType) vpcEndpoint_ipAddressType = Lens.lens (\VpcEndpoint' {ipAddressType} -> ipAddressType) (\s@VpcEndpoint' {} a -> s {ipAddressType = a} :: VpcEndpoint) -- | The last error that occurred for endpoint. vpcEndpoint_lastError :: Lens.Lens' VpcEndpoint (Prelude.Maybe LastError) vpcEndpoint_lastError = Lens.lens (\VpcEndpoint' {lastError} -> lastError) (\s@VpcEndpoint' {} a -> s {lastError = a} :: VpcEndpoint) -- | (Interface endpoint) One or more network interfaces for the endpoint. vpcEndpoint_networkInterfaceIds :: Lens.Lens' VpcEndpoint (Prelude.Maybe [Prelude.Text]) vpcEndpoint_networkInterfaceIds = Lens.lens (\VpcEndpoint' {networkInterfaceIds} -> networkInterfaceIds) (\s@VpcEndpoint' {} a -> s {networkInterfaceIds = a} :: VpcEndpoint) Prelude.. Lens.mapping Lens.coerced -- | The ID of the Amazon Web Services account that owns the endpoint. vpcEndpoint_ownerId :: Lens.Lens' VpcEndpoint (Prelude.Maybe Prelude.Text) vpcEndpoint_ownerId = Lens.lens (\VpcEndpoint' {ownerId} -> ownerId) (\s@VpcEndpoint' {} a -> s {ownerId = a} :: VpcEndpoint) -- | The policy document associated with the endpoint, if applicable. vpcEndpoint_policyDocument :: Lens.Lens' VpcEndpoint (Prelude.Maybe Prelude.Text) vpcEndpoint_policyDocument = Lens.lens (\VpcEndpoint' {policyDocument} -> policyDocument) (\s@VpcEndpoint' {} a -> s {policyDocument = a} :: VpcEndpoint) -- | (Interface endpoint) Indicates whether the VPC is associated with a -- private hosted zone. vpcEndpoint_privateDnsEnabled :: Lens.Lens' VpcEndpoint (Prelude.Maybe Prelude.Bool) vpcEndpoint_privateDnsEnabled = Lens.lens (\VpcEndpoint' {privateDnsEnabled} -> privateDnsEnabled) (\s@VpcEndpoint' {} a -> s {privateDnsEnabled = a} :: VpcEndpoint) -- | Indicates whether the endpoint is being managed by its service. vpcEndpoint_requesterManaged :: Lens.Lens' VpcEndpoint (Prelude.Maybe Prelude.Bool) vpcEndpoint_requesterManaged = Lens.lens (\VpcEndpoint' {requesterManaged} -> requesterManaged) (\s@VpcEndpoint' {} a -> s {requesterManaged = a} :: VpcEndpoint) -- | (Gateway endpoint) One or more route tables associated with the -- endpoint. vpcEndpoint_routeTableIds :: Lens.Lens' VpcEndpoint (Prelude.Maybe [Prelude.Text]) vpcEndpoint_routeTableIds = Lens.lens (\VpcEndpoint' {routeTableIds} -> routeTableIds) (\s@VpcEndpoint' {} a -> s {routeTableIds = a} :: VpcEndpoint) Prelude.. Lens.mapping Lens.coerced -- | The name of the service to which the endpoint is associated. vpcEndpoint_serviceName :: Lens.Lens' VpcEndpoint (Prelude.Maybe Prelude.Text) vpcEndpoint_serviceName = Lens.lens (\VpcEndpoint' {serviceName} -> serviceName) (\s@VpcEndpoint' {} a -> s {serviceName = a} :: VpcEndpoint) -- | The state of the endpoint. vpcEndpoint_state :: Lens.Lens' VpcEndpoint (Prelude.Maybe State) vpcEndpoint_state = Lens.lens (\VpcEndpoint' {state} -> state) (\s@VpcEndpoint' {} a -> s {state = a} :: VpcEndpoint) -- | (Interface endpoint) The subnets for the endpoint. vpcEndpoint_subnetIds :: Lens.Lens' VpcEndpoint (Prelude.Maybe [Prelude.Text]) vpcEndpoint_subnetIds = Lens.lens (\VpcEndpoint' {subnetIds} -> subnetIds) (\s@VpcEndpoint' {} a -> s {subnetIds = a} :: VpcEndpoint) Prelude.. Lens.mapping Lens.coerced -- | Any tags assigned to the endpoint. vpcEndpoint_tags :: Lens.Lens' VpcEndpoint (Prelude.Maybe [Tag]) vpcEndpoint_tags = Lens.lens (\VpcEndpoint' {tags} -> tags) (\s@VpcEndpoint' {} a -> s {tags = a} :: VpcEndpoint) Prelude.. Lens.mapping Lens.coerced -- | The ID of the endpoint. vpcEndpoint_vpcEndpointId :: Lens.Lens' VpcEndpoint (Prelude.Maybe Prelude.Text) vpcEndpoint_vpcEndpointId = Lens.lens (\VpcEndpoint' {vpcEndpointId} -> vpcEndpointId) (\s@VpcEndpoint' {} a -> s {vpcEndpointId = a} :: VpcEndpoint) -- | The type of endpoint. vpcEndpoint_vpcEndpointType :: Lens.Lens' VpcEndpoint (Prelude.Maybe VpcEndpointType) vpcEndpoint_vpcEndpointType = Lens.lens (\VpcEndpoint' {vpcEndpointType} -> vpcEndpointType) (\s@VpcEndpoint' {} a -> s {vpcEndpointType = a} :: VpcEndpoint) -- | The ID of the VPC to which the endpoint is associated. vpcEndpoint_vpcId :: Lens.Lens' VpcEndpoint (Prelude.Maybe Prelude.Text) vpcEndpoint_vpcId = Lens.lens (\VpcEndpoint' {vpcId} -> vpcId) (\s@VpcEndpoint' {} a -> s {vpcId = a} :: VpcEndpoint) instance Data.FromXML VpcEndpoint where parseXML x = VpcEndpoint' Prelude.<$> (x Data..@? "creationTimestamp") Prelude.<*> ( x Data..@? "dnsEntrySet" Core..!@ Prelude.mempty Prelude.>>= Core.may (Data.parseXMLList "item") ) Prelude.<*> (x Data..@? "dnsOptions") Prelude.<*> ( x Data..@? "groupSet" Core..!@ Prelude.mempty Prelude.>>= Core.may (Data.parseXMLList "item") ) Prelude.<*> (x Data..@? "ipAddressType") Prelude.<*> (x Data..@? "lastError") Prelude.<*> ( x Data..@? "networkInterfaceIdSet" Core..!@ Prelude.mempty Prelude.>>= Core.may (Data.parseXMLList "item") ) Prelude.<*> (x Data..@? "ownerId") Prelude.<*> (x Data..@? "policyDocument") Prelude.<*> (x Data..@? "privateDnsEnabled") Prelude.<*> (x Data..@? "requesterManaged") Prelude.<*> ( x Data..@? "routeTableIdSet" Core..!@ Prelude.mempty Prelude.>>= Core.may (Data.parseXMLList "item") ) Prelude.<*> (x Data..@? "serviceName") Prelude.<*> (x Data..@? "state") Prelude.<*> ( x Data..@? "subnetIdSet" Core..!@ Prelude.mempty Prelude.>>= Core.may (Data.parseXMLList "item") ) Prelude.<*> ( x Data..@? "tagSet" Core..!@ Prelude.mempty Prelude.>>= Core.may (Data.parseXMLList "item") ) Prelude.<*> (x Data..@? "vpcEndpointId") Prelude.<*> (x Data..@? "vpcEndpointType") Prelude.<*> (x Data..@? "vpcId") instance Prelude.Hashable VpcEndpoint where hashWithSalt _salt VpcEndpoint' {..} = _salt `Prelude.hashWithSalt` creationTimestamp `Prelude.hashWithSalt` dnsEntries `Prelude.hashWithSalt` dnsOptions `Prelude.hashWithSalt` groups `Prelude.hashWithSalt` ipAddressType `Prelude.hashWithSalt` lastError `Prelude.hashWithSalt` networkInterfaceIds `Prelude.hashWithSalt` ownerId `Prelude.hashWithSalt` policyDocument `Prelude.hashWithSalt` privateDnsEnabled `Prelude.hashWithSalt` requesterManaged `Prelude.hashWithSalt` routeTableIds `Prelude.hashWithSalt` serviceName `Prelude.hashWithSalt` state `Prelude.hashWithSalt` subnetIds `Prelude.hashWithSalt` tags `Prelude.hashWithSalt` vpcEndpointId `Prelude.hashWithSalt` vpcEndpointType `Prelude.hashWithSalt` vpcId instance Prelude.NFData VpcEndpoint where rnf VpcEndpoint' {..} = Prelude.rnf creationTimestamp `Prelude.seq` Prelude.rnf dnsEntries `Prelude.seq` Prelude.rnf dnsOptions `Prelude.seq` Prelude.rnf groups `Prelude.seq` Prelude.rnf ipAddressType `Prelude.seq` Prelude.rnf lastError `Prelude.seq` Prelude.rnf networkInterfaceIds `Prelude.seq` Prelude.rnf ownerId `Prelude.seq` Prelude.rnf policyDocument `Prelude.seq` Prelude.rnf privateDnsEnabled `Prelude.seq` Prelude.rnf requesterManaged `Prelude.seq` Prelude.rnf routeTableIds `Prelude.seq` Prelude.rnf serviceName `Prelude.seq` Prelude.rnf state `Prelude.seq` Prelude.rnf subnetIds `Prelude.seq` Prelude.rnf tags `Prelude.seq` Prelude.rnf vpcEndpointId `Prelude.seq` Prelude.rnf vpcEndpointType `Prelude.seq` Prelude.rnf vpcId