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

标签 amazon-web-services terraform amazon-vpc

我正在运行 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/

相关文章:

amazon-web-services - 将 AWS WAFv2 web acl 关联到 ApiGatewayV2

amazon-web-services - 如何使用亚马逊 MWS API 设置产品的最低和最高价格

amazon-web-services - 用于连接 AWS Cloudwatch 日志、Kinesis Firehose、S3 和 ElasticSearch 的 AWS IAM 策略

amazon-web-services - 在 CloudFormation 中,将子网 ID 存储在 Parameter Store 中

ruby - 在 AWS VPC 上部署应用程序

postgresql - Postgres "Materialized View"刷新为 ElasticSearch 文档更新的来源?

Terraform 部分远程后端不能包含插值?

go - Terraform 提供程序应如何处理服务器端应用的默认值?

amazon-web-services - 云形成 : unable to recreate EC2 instance with the same ElasticIp

linux - 亚马逊 Linux curl