Skip to content

Commit

Permalink
r/aws_globalaccelerator_endpoint_group: Set 'client_ip_preservation_e…
Browse files Browse the repository at this point in the history
…nabled' to 'true' for EC2 instance endpoint test.
  • Loading branch information
ewbankkit committed Aug 21, 2020
1 parent 0c49a06 commit 4178c84
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 3 deletions.
13 changes: 11 additions & 2 deletions aws/resource_aws_globalaccelerator_endpoint_group_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -474,6 +474,14 @@ resource "aws_subnet" "test" {
}
}
resource "aws_internet_gateway" "test" {
vpc_id = aws_vpc.test.id
tags = {
Name = %[1]q
}
}
resource "aws_instance" "test" {
ami = data.aws_ami.amzn-ami-minimal-hvm-ebs.id
instance_type = data.aws_ec2_instance_type_offering.available.instance_type
Expand Down Expand Up @@ -504,8 +512,9 @@ resource "aws_globalaccelerator_endpoint_group" "test" {
listener_arn = aws_globalaccelerator_listener.test.id
endpoint_configuration {
endpoint_id = aws_instance.test.id
weight = 20
endpoint_id = aws_instance.test.id
weight = 20
client_ip_preservation_enabled = true
}
health_check_interval_seconds = 30
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ Terraform will only perform drift detection of its value when present in a confi

**endpoint_configuration** supports the following attributes:

* `client_ip_preservation_enabled` - (Optional) Indicates whether client IP address preservation is enabled for an Application Load Balancer endpoint. See the [AWS documentation](https://docs.aws.amazon.com/global-accelerator/latest/dg/preserve-client-ip-address.html) for more details.
* `client_ip_preservation_enabled` - (Optional) Indicates whether client IP address preservation is enabled for an Application Load Balancer endpoint. See the [AWS documentation](https://docs.aws.amazon.com/global-accelerator/latest/dg/preserve-client-ip-address.html) for more details. The default value is `false`.
**Note:** When client IP address preservation is enabled, the Global Accelerator service creates an EC2 Security Group in the VPC named `GlobalAccelerator` that must be deleted (potentially outside of Terraform) before the VPC will successfully delete. If this EC2 Security Group is not deleted, Terraform will retry the VPC deletion for a few minutes before reporting a `DependencyViolation` error. This cannot be resolved by re-running Terraform.
* `endpoint_id` - (Optional) An ID for the endpoint. If the endpoint is a Network Load Balancer or Application Load Balancer, this is the Amazon Resource Name (ARN) of the resource. If the endpoint is an Elastic IP address, this is the Elastic IP address allocation ID.
* `weight` - (Optional) The weight associated with the endpoint. When you add weights to endpoints, you configure AWS Global Accelerator to route traffic based on proportions that you specify.
Expand Down

0 comments on commit 4178c84

Please sign in to comment.