本文為英文版的機器翻譯版本,如內容有任何歧義或不一致之處,概以英文版為準。
連線至 EventBridge 中的私有 APIs
您可以建立與私有 HTTPS 端點的連線,以提供對 VPCs 或內部部署中資源的安全point-to-point網路存取,而不必周遊公有網際網路。例如,您可以建立連線來存取 Amazon Elastic Load Balancer 後方的 HTTPS 應用程式。
EventBridge 會使用在 VPC Lattice 中建立的資源組態來建立與私有 HTTPS 端點的連線。資源組態是一種邏輯物件,可識別資源並指定存取資源的方式和人員。若要在 EventBridge 中建立私有 API 的連線,您可以指定私有 API 的資源組態。如需詳細資訊,請參閱《Amazon VPC Lattice 使用者指南》中的 VPC Lattice 中的資源組態。
然後EventBridge 會建立資源關聯,讓 EventBridge 能夠存取私有 API。如需詳細資訊,請參閱《Amazon VPC Lattice 使用者指南》中的管理資源關聯。
雖然 EventBridge 會管理資源關聯,但它會使用您的登入資料建立關聯,因此您可以保持資源關聯操作的可見性。
您可以建立存取其他 AWS 帳戶中私有 APIs的連線。如需詳細資訊,請參閱跨帳戶私有 APIs。
連線至私有 APIs許可
下列政策範例包含建立私有 API 連線所需的最低許可。
{ "Version": "2012-10-17", "Statement": [ { "Action": [ "vpc-lattice:CreateServiceNetworkResourceAssociation", "vpc-lattice:GetResourceConfiguration", "vpc-lattice:AssociateViaAWSService-EventsAndStates", "events:CreateConnection" ], "Resource": [ "*" ], "Effect": "Allow" } ] }
下列政策範例包含更新私有 API 連線所需的最低許可。
{ "Version": "2012-10-17", "Statement": [ { "Action": [ "vpc-lattice:CreateServiceNetworkResourceAssociation", "vpc-lattice:GetResourceConfiguration", "vpc-lattice:AssociateViaAWSService-EventsAndStates", "events:UpdateConnection" ], "Resource": [ "*" ], "Effect": "Allow" } ] }
監控私有 APIs連線的建立
當您建立私有 API 的連線時,會產生下列日誌:
在建立連線的帳戶中, AWS CloudTrail 會記錄CreateServiceNetworkResourceAssociation
事件。
在此日誌中, sourceIPAddress
、 userAgent
和 serviceNetworkIdentifier
會設定為 EventBridge 服務主體 events.amazonaws.com
。
{ "eventTime": "2024-11-21T00:00:00Z", "eventSource": "vpc-lattice.amazonaws.com", "eventName": "CreateServiceNetworkResourceAssociation", "awsRegion": "
region
", "sourceIPAddress": "events.amazonaws.com", "userAgent": "events.amazonaws.com", "requestParameters": { "x-amzn-vpc-lattice-association-source-arn": "***", "x-amzn-vpc-lattice-service-network-identifier": "***", "clientToken": "token
", "serviceNetworkIdentifier": "events.amazonaws.com", "resourceConfigurationIdentifier": "arn:partition
:vpc-lattice:region
:account-id
:resourceconfiguration/resource-configuration-id
", "tags": { "ManagedByServiceAWSEventBridge": "account-id
:connection-name
" } }
在包含私有 API 的 帳戶中, 會 AWS CloudTrail 記錄CreateServiceNetworkResourceAssociationBySharee
事件。
此日誌包含:
callerAccountId
:建立連線 AWS 的帳戶accountId
:包含私有 API AWS 的帳戶。resource-configuration-arn
:私有 API 的 VPC Lattice 資源組態。
{ "eventTime": "2024-11-21T06:31:42Z", "eventSource": "vpc-lattice.amazonaws.com", "eventName": "CreateServiceNetworkResourceAssociationBySharee", "awsRegion": "
region
", "sourceIPAddress": "vpc-lattice.amazonaws.com", "userAgent": "user-agent
", "additionalEventData": { "callerAccountId": "consumer-account-id
" }, "resources": [ { "accountId": "provider-account-id
", "type": "AWS::VpcLattice::ServiceNetworkResourceAssociation", "ARN": "resource-configuration-arn
" } ] }
在與私有 APIs的跨帳戶連線中,包含連線的帳戶將不會收到 AWS CloudTrail 或 VPC Lattice 日誌,以叫用私有 API。
管理連線的服務網路資源關聯
當您為要連線的私有 API 指定 VPC Lattice 資源組態時,EventBridge 會透過在 VPC Lattice 資源組態與 EventBridge 服務擁有的 VPC Lattice 服務網路之間建立資源關聯來啟用連線。雖然 EventBridge 會管理資源關聯,但它會使用您的登入資料建立關聯,因此您可以保持資源關聯的可見性。這表示您可以列出和描述資源關聯。
使用 describe-connection 傳回包含資源組態和資源關聯的 Amazon Resource Name (ARNs) 的連線描述。
您無法刪除由 EventBridge 建立的資源關聯。如果您刪除連線,EventBridge 會刪除任何對應的資源關聯。
如需詳細資訊,請參閱《Amazon VPC Lattice 使用者指南》中的管理資源關聯。
連線至內部部署私有 APIs
使用透過 AWS PrivateLink 和 VPC Lattice 存取 VPC 資源,您可以連線至內部部署私有 APIs。若要這麼做,您必須在 VPC 和內部部署環境之間設定網路路由。例如,您可以使用 AWS Direct Connect或 AWS Site-to-Site VPN 來建立此類路由。
區域可用性
EventBridge 支援連線至下列 AWS 區域中APIs:
歐洲 (斯德哥爾摩)
亞太區域 (孟買)
Europe (Paris)
美國東部 (俄亥俄)
歐洲 (愛爾蘭)
歐洲 (法蘭克福)
南美洲 (聖保羅)
亞太區域 (香港)
美國東部 (維吉尼亞北部)
歐洲 (倫敦)
亞太區域 (東京)
美國西部 (奧勒岡)
美國西部 (加利佛尼亞北部)
亞太區域 (新加坡)
亞太區域 (悉尼)