gpt4 book ai didi

amazon-web-services - 如何解决 Terraform 资源错误 UnauthorizedOperation : This operation does not support shared VPCs

转载 作者:行者123 更新时间:2023-12-02 19:25:24 26 4
gpt4 key购买 nike

我正在运行 terraform .tf 脚本来创建 aws_vpc_endpoint

这是示例代码

resource "aws_vpc_endpoint" "NewVPCEndpoint" {..}

但是,在调用 terraform apply 时,我收到错误

Error creating VPC Endpoint: UnauthorizedOperation: This operation does not support shared VPCs.
status code: 403

我收到此错误的具体原因是什么?

我在不同的 VPC 中尝试了完全相同的 .tf 脚本,效果很好。这是VPC本身的设置吗?这究竟是什么设置?

对于 VPC 和子网,VPC/子网的先决属性/设置是什么

resource "aws_vpc_endpoint" "NewVPCEndpoint" 

要成功吗?

最佳答案

VPC 可以是 Shared VPC此时它将不支持部署 VPC 端点服务:

VPC sharing allows multiple AWS accounts to create their application resources, such as Amazon EC2 instances, Amazon Relational Database Service (RDS) databases, Amazon Redshift clusters, and AWS Lambda functions, into shared, centrally-managed Amazon Virtual Private Clouds (VPCs). In this model, the account that owns the VPC (owner) shares one or more subnets with other accounts (participants) that belong to the same organization from AWS Organizations. After a subnet is shared, the participants can view, create, modify, and delete their application resources in the subnets shared with them. Participants cannot view, modify, or delete resources that belong to other participants or the VPC owner.

修复方法是部署单独的 VPC(非共享)并设置与共享 VPC 的 VPC 对等互连。然后,您可以在非共享对等 VPC 中部署 VPC 端点服务,并从所有参与账户的共享 VPC 访问它。

关于amazon-web-services - 如何解决 Terraform 资源错误 UnauthorizedOperation : This operation does not support shared VPCs,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/62476538/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com