AO
Size: a a a
AO
AP
AO
AP
AP
AF
variable "http_ports" {
default = ["80", "443"]
}
...
resource "aws_security_group" "allow-web" {
name_prefix = "${var.environment}-webserver-security-group"
vpc_id = var.vpc_id
ingress {
protocol = "tcp"
from_port = "${element(var.http_ports, count.index)}"
to_port = "${element(var.http_ports, count.index)}"
cidr_blocks = [var.admin_cidr]
}
egress {
from_port = 0
to_port = 0
protocol = "-1"
cidr_blocks = ["0.0.0.0/0"]
)
}
S
AK
variable "http_ports" {
default = ["80", "443"]
}
...
resource "aws_security_group" "allow-web" {
name_prefix = "${var.environment}-webserver-security-group"
vpc_id = var.vpc_id
ingress {
protocol = "tcp"
from_port = "${element(var.http_ports, count.index)}"
to_port = "${element(var.http_ports, count.index)}"
cidr_blocks = [var.admin_cidr]
}
egress {
from_port = 0
to_port = 0
protocol = "-1"
cidr_blocks = ["0.0.0.0/0"]
)
}
AF
b
b
variable "http_ports" {
default = ["80", "443"]
}
...
resource "aws_security_group" "allow-web" {
name_prefix = "${var.environment}-webserver-security-group"
vpc_id = var.vpc_id
ingress {
protocol = "tcp"
from_port = "${element(var.http_ports, count.index)}"
to_port = "${element(var.http_ports, count.index)}"
cidr_blocks = [var.admin_cidr]
}
egress {
from_port = 0
to_port = 0
protocol = "-1"
cidr_blocks = ["0.0.0.0/0"]
)
}
resource "vsphere_virtual_machine" "vm" {
name = "${var.prefix}${var.name}-${count.index}"
count = "${var.instance_count}"
...
AA
2019-09-26T15:16:32.438+0300 [DEBUG] plugin.terraform-provider-aws_v2.29.0_x4: GET /arn%3Aaws%3As3%3A%3A%3Amy-bucket-name?policy= HTTP/1.1
2019-09-26T15:16:32.438+0300 [DEBUG] plugin.terraform-provider-aws_v2.29.0_x4: Host: s3.amazonaws.com
2019-09-26T15:16:32.438+0300 [DEBUG] plugin.terraform-provider-aws_v2.29.0_x4: User-Agent: aws-sdk-go/1.23.15 (go1.12.6; darwin; amd64) APN/1.0 HashiCorp/1.0 Terraform/0.12.7
2019-09-26T15:16:32.438+0300 [DEBUG] plugin.terraform-provider-aws_v2.29.0_x4: Authorization: AWS4-HMAC-SHA256 Credential=AKIASP2ZGEPXTIYDY5NT/20190926/us-east-1/s3/aws4_request, SignedHeaders=host;x-amz-content-sha256;x-amz-date, Signature=8b40037c2d62dee31b567aa8642f1ccf488488d427ea49dd88df191cf444d96a
2019-09-26T15:16:32.439+0300 [DEBUG] plugin.terraform-provider-aws_v2.29.0_x4: X-Amz-Content-Sha256: e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855
2019-09-26T15:16:32.439+0300 [DEBUG] plugin.terraform-provider-aws_v2.29.0_x4: X-Amz-Date: 20190926T121632Z
2019-09-26T15:16:32.439+0300 [DEBUG] plugin.terraform-provider-aws_v2.29.0_x4: Accept-Encoding: gzip
2019-09-26T15:16:32.439+0300 [DEBUG] plugin.terraform-provider-aws_v2.29.0_x4:
2019-09-26T15:16:32.439+0300 [DEBUG] plugin.terraform-provider-aws_v2.29.0_x4:
2019-09-26T15:16:32.439+0300 [DEBUG] plugin.terraform-provider-aws_v2.29.0_x4: -----------------------------------------------------
2019-09-26T15:16:32.957+0300 [DEBUG] plugin.terraform-provider-aws_v2.29.0_x4: 2019/09/26 15:16:32 [DEBUG] [aws-sdk-go] DEBUG: Response s3/GetBucketPolicy Details:
2019-09-26T15:16:32.957+0300 [DEBUG] plugin.terraform-provider-aws_v2.29.0_x4: ---[ RESPONSE ]--------------------------------------
2019-09-26T15:16:32.957+0300 [DEBUG] plugin.terraform-provider-aws_v2.29.0_x4: HTTP/1.1 400 Bad Request
2019-09-26T15:16:32.957+0300 [DEBUG] plugin.terraform-provider-aws_v2.29.0_x4: Connection: close
2019-09-26T15:16:32.957+0300 [DEBUG] plugin.terraform-provider-aws_v2.29.0_x4: Transfer-Encoding: chunked
2019-09-26T15:16:32.957+0300 [DEBUG] plugin.terraform-provider-aws_v2.29.0_x4: Content-Type: application/xml
2019-09-26T15:16:32.957+0300 [DEBUG] plugin.terraform-provider-aws_v2.29.0_x4: Date: Thu, 26 Sep 2019 12:16:32 GMT
2019-09-26T15:16:32.957+0300 [DEBUG] plugin.terraform-provider-aws_v2.29.0_x4: Server: AmazonS3
2019-09-26T15:16:32.957+0300 [DEBUG] plugin.terraform-provider-aws_v2.29.0_x4: X-Amz-Id-2: 4wu+TIgKdBW429fqBf30edjYxOMNBhpYzjlOKUBH6/0dOBgChHRpZqCcmoKY1qb37KH37dZ6UNc=
2019-09-26T15:16:32.957+0300 [DEBUG] plugin.terraform-provider-aws_v2.29.0_x4: X-Amz-Request-Id: 88505B9E848C0ED3
AA
A
variable "http_ports" {
default = ["80", "443"]
}
...
resource "aws_security_group" "allow-web" {
name_prefix = "${var.environment}-webserver-security-group"
vpc_id = var.vpc_id
ingress {
protocol = "tcp"
from_port = "${element(var.http_ports, count.index)}"
to_port = "${element(var.http_ports, count.index)}"
cidr_blocks = [var.admin_cidr]
}
egress {
from_port = 0
to_port = 0
protocol = "-1"
cidr_blocks = ["0.0.0.0/0"]
)
}
resource "aws_security_group" "my_webserver" {
name = "Dynamic Security Group"
dynamic "ingress" {
for_each = ["80", "443", "8080", "1541", "9092", "9093"]
content {
from_port = ingress.value
to_port = ingress.value
protocol = "tcp"
cidr_blocks = ["0.0.0.0/0"]
}
}
egress {
from_port = 0
to_port = 0
protocol = "-1"
cidr_blocks = ["0.0.0.0/0"]
}
}
AO
AN
НС
S
AO