小编dmn*_*972的帖子

terraform 验证错误:需要参数“区域”,但未设置

RDS为我的开发团队编写了一个自定义模块,用于部署RDS实例。我正在使用BitBucket源代码控制,并且我正在尝试集成一个BitBucket管道以terraform validate在我的.tf文件上运行以验证语法,然后再将其提供给开发人员使用。terraform init运行良好,但是当我运行时terraform validate出现以下错误:Error: Missing required argument. The argument "region" is required, but was not set.查看文档后,我很困惑,如果该命令实际上没有部署任何内容,为什么会检查已声明的提供程序?诚然,我是编写模块的新手。也许这不是我想要完成的正确命令?

Terraform version: v0.12.7

AWS Provider version: 2.24

bitbucket-pipelines.yml:

image: hashicorp/terraform:full

pipelines:
  branches:
    master:
    - step:
        script:
          - terraform version
          - terraform init
          - terraform validate
Run Code Online (Sandbox Code Playgroud)

Module tree:

??? CHANGELOG.md
??? README.md
??? bitbucket-pipelines.yml
??? main.tf
??? modules
?   ??? db_instance
?   ?   ??? README.md
?   ? …
Run Code Online (Sandbox Code Playgroud)

bitbucket continuous-deployment terraform terraform-provider-aws

9
推荐指数
2
解决办法
9169
查看次数

AWS S3 存储桶策略白名单

我有一个存储桶策略,可将我的 IP 范围列入 AWS 中的白名单。我有一个运行 Packer 构建作业的 EC2 服务器,它尝试从我的存储桶中提取一个对象,但我收到403 Forbidden错误消息,即使运行该作业的 EC2 服务器的 IP 显然在白名单范围内。即使我wget在该CIDR范围内的机器上运行,我也会遇到同样的错误。我很困惑为什么会发生这种情况。政策好像不错。下面是我的存储桶策略、我的服务器的 IP 和错误:

Bucket Policy:

{
    "Version": "2012-10-17",
    "Id": "S3PolicyId1",
    "Statement": [
        {
            "Sid": "IPAllow",
            "Effect": "Allow",
            "Principal": "*",
            "Action": "s3:GetObject",
            "Resource": [
                "arn:aws:s3:::xxxxxxx",
                "arn:aws:s3:::xxxxxxx/*"
            ],
            "Condition": {
                "IpAddress": {
                    "aws:SourceIp": [
                        "10.x.x.x/12"
                    ]
                }
            }
        }
    ]
}
Run Code Online (Sandbox Code Playgroud)

Server IP:

10.x.x.x/32
Run Code Online (Sandbox Code Playgroud)

Error:

ui,message,    amazon-ebs:     "msg": "Error downloading 
https://s3.amazonaws.com/xxxxx/yyyy.zip to C:\\temp\\xxx.zip Exception 
calling \"DownloadFile\" with \"2\" argument(s): \"The remote server 
returned …
Run Code Online (Sandbox Code Playgroud)

whitelist amazon-s3 amazon-web-services

1
推荐指数
1
解决办法
2383
查看次数