【问题标题】:Subscribing to SNS topic with Terraform via HTTP inside VPC通过 VPC 内的 HTTP 使用 Terraform 订阅 SNS 主题
【发布时间】:2021-01-11 23:28:19
【问题描述】:

我有一个位于 VPC 内的 EB 实例。我不希望此实例可从外部访问,它还需要访问同一 VPC 内的 RDS 实例。

我想创建从 SNS 到此 EB 实例的订阅。

这是我想出的 Terraform:

resource "aws_sns_topic_subscription" "my_sub" {
  topic_arn              = aws_sns_topic.my_topic.arn
  protocol               = "http"
  endpoint               = "http://${aws_elastic_beanstalk_environment.my_eb_app.endpoint_url}/api/sns"
  endpoint_auto_confirms = true
}

但是,这失败了,因为它是一个内部端点:

Error: Error creating SNS topic: AuthorizationError: Not authorized to subscribe internal endpoints
    status code: 403, request id: xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxx

我应该如何解决这个问题?

【问题讨论】:

    标签: terraform amazon-sns amazon-vpc terraform-provider-aws


    【解决方案1】:

    显然没有办法公开端点。 人们建议改为订阅 SQS 队列并对其进行轮询。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 2012-09-30
      • 2020-07-23
      • 2015-05-29
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2021-03-14
      相关资源
      最近更新 更多