问题描述
我正在使用terraform创建aws sftp服务器,并尝试使用IP whitelisting保护我的服务器。
Terraform aws_transfer_server
命令目前仅支持endpoint_types,例如PUBLIC或VPC_ENDPOINT。因此,我使用null_resource
执行aws命令以在创建sftp服务器后更新它。地形片段如下:
resource "null_resource" "update_sftp_server" {
provisioner "local-exec" {
command = <<EOF
aws transfer update-server --server-id ${aws_transfer_server.sftp.id} --endpoint-type VPC --endpoint-details SubnetIds="${join("\",\"",var.subnet_ids)}",AddressAllocationIds="${join("\",toset(aws_eip.nlb.*.id))}",VPCEndpointID="${aws_vpc_endpoint.transfer.id}",VpcId="${var.vpc_id}"
EOF
}
depends_on = [aws_transfer_server.sftp,aws_vpc_endpoint.transfer]
}
这将执行以下aws命令
aws transfer update-server --server-id s-######## --endpoint-type VPC --endpoint-details SubnetIds="subnet-#####","subnet-#####",AddressAllocationIds="eipalloc-######","eipalloc-######",VPCEndpointID="vpce-#######",VpcId="vpc-#####"
但是我收到如下错误:
usage: aws [options] <command> <subcommand> [<subcommand> ...] [parameters]
To see help text,you can run:
aws help
aws <command> help
aws <command> <subcommand> help
Unknown options: AddressAllocationIds=eipalloc-######,eipalloc-######,VPCEndpointID=vpce-######,VpcId=vpc-######,subnet-######
有人可以帮助我知道为什么引发此错误吗?我的环境详细信息如下:
Terraform v0.12.28
provider.aws v3.0.0
provider.null v2.1.2
aws-cli/2.0.33 Python/3.7.7 Windows/10 botocore/2.0.0dev37
解决方法
暂无找到可以解决该程序问题的有效方法,小编努力寻找整理中!
如果你已经找到好的解决方法,欢迎将解决方案带上本链接一起发送给小编。
小编邮箱:dio#foxmail.com (将#修改为@)