rename aws load balancer policy resources
team redundancy team had a good run, but is over now
This commit is contained in:
parent
ecadf103cc
commit
57d3c722e2
|
@ -215,9 +215,9 @@ func Provider() terraform.ResourceProvider {
|
||||||
"aws_lambda_permission": resourceAwsLambdaPermission(),
|
"aws_lambda_permission": resourceAwsLambdaPermission(),
|
||||||
"aws_launch_configuration": resourceAwsLaunchConfiguration(),
|
"aws_launch_configuration": resourceAwsLaunchConfiguration(),
|
||||||
"aws_lb_cookie_stickiness_policy": resourceAwsLBCookieStickinessPolicy(),
|
"aws_lb_cookie_stickiness_policy": resourceAwsLBCookieStickinessPolicy(),
|
||||||
"aws_elb_load_balancer_policy": resourceAwsLoadBalancerPolicy(),
|
"aws_load_balancer_policy": resourceAwsLoadBalancerPolicy(),
|
||||||
"aws_elb_load_balancer_backend_server_policy": resourceAwsLoadBalancerBackendServerPolicies(),
|
"aws_load_balancer_backend_server_policy": resourceAwsLoadBalancerBackendServerPolicies(),
|
||||||
"aws_elb_load_balancer_listener_policy": resourceAwsLoadBalancerListenerPolicies(),
|
"aws_load_balancer_listener_policy": resourceAwsLoadBalancerListenerPolicies(),
|
||||||
"aws_main_route_table_association": resourceAwsMainRouteTableAssociation(),
|
"aws_main_route_table_association": resourceAwsMainRouteTableAssociation(),
|
||||||
"aws_nat_gateway": resourceAwsNatGateway(),
|
"aws_nat_gateway": resourceAwsNatGateway(),
|
||||||
"aws_network_acl": resourceAwsNetworkAcl(),
|
"aws_network_acl": resourceAwsNetworkAcl(),
|
||||||
|
|
|
@ -25,24 +25,24 @@ func TestAccAWSLoadBalancerBackendServerPolicy_basic(t *testing.T) {
|
||||||
resource.TestStep{
|
resource.TestStep{
|
||||||
Config: testAccAWSLoadBalancerBackendServerPolicyConfig_basic0,
|
Config: testAccAWSLoadBalancerBackendServerPolicyConfig_basic0,
|
||||||
Check: resource.ComposeTestCheckFunc(
|
Check: resource.ComposeTestCheckFunc(
|
||||||
testAccCheckAWSLoadBalancerPolicyState("aws_elb.test-lb", "aws_elb_load_balancer_policy.test-pubkey-policy0"),
|
testAccCheckAWSLoadBalancerPolicyState("aws_elb.test-lb", "aws_load_balancer_policy.test-pubkey-policy0"),
|
||||||
testAccCheckAWSLoadBalancerPolicyState("aws_elb.test-lb", "aws_elb_load_balancer_policy.test-backend-auth-policy0"),
|
testAccCheckAWSLoadBalancerPolicyState("aws_elb.test-lb", "aws_load_balancer_policy.test-backend-auth-policy0"),
|
||||||
testAccCheckAWSLoadBalancerBackendServerPolicyState("test-aws-elb-policies-lb", "test-backend-auth-policy0", true),
|
testAccCheckAWSLoadBalancerBackendServerPolicyState("test-aws-policies-lb", "test-backend-auth-policy0", true),
|
||||||
),
|
),
|
||||||
},
|
},
|
||||||
resource.TestStep{
|
resource.TestStep{
|
||||||
Config: testAccAWSLoadBalancerBackendServerPolicyConfig_basic1,
|
Config: testAccAWSLoadBalancerBackendServerPolicyConfig_basic1,
|
||||||
Check: resource.ComposeTestCheckFunc(
|
Check: resource.ComposeTestCheckFunc(
|
||||||
testAccCheckAWSLoadBalancerPolicyState("aws_elb.test-lb", "aws_elb_load_balancer_policy.test-pubkey-policy0"),
|
testAccCheckAWSLoadBalancerPolicyState("aws_elb.test-lb", "aws_load_balancer_policy.test-pubkey-policy0"),
|
||||||
testAccCheckAWSLoadBalancerPolicyState("aws_elb.test-lb", "aws_elb_load_balancer_policy.test-pubkey-policy1"),
|
testAccCheckAWSLoadBalancerPolicyState("aws_elb.test-lb", "aws_load_balancer_policy.test-pubkey-policy1"),
|
||||||
testAccCheckAWSLoadBalancerPolicyState("aws_elb.test-lb", "aws_elb_load_balancer_policy.test-backend-auth-policy0"),
|
testAccCheckAWSLoadBalancerPolicyState("aws_elb.test-lb", "aws_load_balancer_policy.test-backend-auth-policy0"),
|
||||||
testAccCheckAWSLoadBalancerBackendServerPolicyState("test-aws-elb-policies-lb", "test-backend-auth-policy0", true),
|
testAccCheckAWSLoadBalancerBackendServerPolicyState("test-aws-policies-lb", "test-backend-auth-policy0", true),
|
||||||
),
|
),
|
||||||
},
|
},
|
||||||
resource.TestStep{
|
resource.TestStep{
|
||||||
Config: testAccAWSLoadBalancerBackendServerPolicyConfig_basic2,
|
Config: testAccAWSLoadBalancerBackendServerPolicyConfig_basic2,
|
||||||
Check: resource.ComposeTestCheckFunc(
|
Check: resource.ComposeTestCheckFunc(
|
||||||
testAccCheckAWSLoadBalancerBackendServerPolicyState("test-aws-elb-policies-lb", "test-backend-auth-policy0", false),
|
testAccCheckAWSLoadBalancerBackendServerPolicyState("test-aws-policies-lb", "test-backend-auth-policy0", false),
|
||||||
),
|
),
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
@ -63,7 +63,7 @@ func testAccCheckAWSLoadBalancerBackendServerPolicyDestroy(s *terraform.State) e
|
||||||
|
|
||||||
for _, rs := range s.RootModule().Resources {
|
for _, rs := range s.RootModule().Resources {
|
||||||
switch {
|
switch {
|
||||||
case rs.Type == "aws_elb_load_balancer_policy":
|
case rs.Type == "aws_load_balancer_policy":
|
||||||
loadBalancerName, policyName := resourceAwsLoadBalancerBackendServerPoliciesParseId(rs.Primary.ID)
|
loadBalancerName, policyName := resourceAwsLoadBalancerBackendServerPoliciesParseId(rs.Primary.ID)
|
||||||
out, err := conn.DescribeLoadBalancerPolicies(
|
out, err := conn.DescribeLoadBalancerPolicies(
|
||||||
&elb.DescribeLoadBalancerPoliciesInput{
|
&elb.DescribeLoadBalancerPoliciesInput{
|
||||||
|
@ -79,7 +79,7 @@ func testAccCheckAWSLoadBalancerBackendServerPolicyDestroy(s *terraform.State) e
|
||||||
if len(out.PolicyDescriptions) > 0 {
|
if len(out.PolicyDescriptions) > 0 {
|
||||||
return fmt.Errorf("Policy still exists")
|
return fmt.Errorf("Policy still exists")
|
||||||
}
|
}
|
||||||
case rs.Type == "aws_elb_load_balancer_backend_policy":
|
case rs.Type == "aws_load_balancer_backend_policy":
|
||||||
loadBalancerName, policyName := resourceAwsLoadBalancerBackendServerPoliciesParseId(rs.Primary.ID)
|
loadBalancerName, policyName := resourceAwsLoadBalancerBackendServerPoliciesParseId(rs.Primary.ID)
|
||||||
out, err := conn.DescribeLoadBalancers(
|
out, err := conn.DescribeLoadBalancers(
|
||||||
&elb.DescribeLoadBalancersInput{
|
&elb.DescribeLoadBalancersInput{
|
||||||
|
@ -166,7 +166,7 @@ resource "aws_iam_server_certificate" "test-iam-cert0" {
|
||||||
}
|
}
|
||||||
|
|
||||||
resource "aws_elb" "test-lb" {
|
resource "aws_elb" "test-lb" {
|
||||||
name = "test-aws-elb-policies-lb"
|
name = "test-aws-policies-lb"
|
||||||
availability_zones = ["us-east-1a"]
|
availability_zones = ["us-east-1a"]
|
||||||
|
|
||||||
listener {
|
listener {
|
||||||
|
@ -182,7 +182,7 @@ resource "aws_elb" "test-lb" {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
resource "aws_elb_load_balancer_policy" "test-pubkey-policy0" {
|
resource "aws_load_balancer_policy" "test-pubkey-policy0" {
|
||||||
load_balancer_name = "${aws_elb.test-lb.name}"
|
load_balancer_name = "${aws_elb.test-lb.name}"
|
||||||
policy_name = "test-pubkey-policy0"
|
policy_name = "test-pubkey-policy0"
|
||||||
policy_type_name = "PublicKeyPolicyType"
|
policy_type_name = "PublicKeyPolicyType"
|
||||||
|
@ -192,21 +192,21 @@ resource "aws_elb_load_balancer_policy" "test-pubkey-policy0" {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
resource "aws_elb_load_balancer_policy" "test-backend-auth-policy0" {
|
resource "aws_load_balancer_policy" "test-backend-auth-policy0" {
|
||||||
load_balancer_name = "${aws_elb.test-lb.name}"
|
load_balancer_name = "${aws_elb.test-lb.name}"
|
||||||
policy_name = "test-backend-auth-policy0"
|
policy_name = "test-backend-auth-policy0"
|
||||||
policy_type_name = "BackendServerAuthenticationPolicyType"
|
policy_type_name = "BackendServerAuthenticationPolicyType"
|
||||||
policy_attribute = {
|
policy_attribute = {
|
||||||
name = "PublicKeyPolicyName"
|
name = "PublicKeyPolicyName"
|
||||||
value = "${aws_elb_load_balancer_policy.test-pubkey-policy0.policy_name}"
|
value = "${aws_load_balancer_policy.test-pubkey-policy0.policy_name}"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
resource "aws_elb_load_balancer_backend_server_policy" "test-backend-auth-policies-443" {
|
resource "aws_load_balancer_backend_server_policy" "test-backend-auth-policies-443" {
|
||||||
load_balancer_name = "${aws_elb.test-lb.name}"
|
load_balancer_name = "${aws_elb.test-lb.name}"
|
||||||
instance_port = 443
|
instance_port = 443
|
||||||
policy_names = [
|
policy_names = [
|
||||||
"${aws_elb_load_balancer_policy.test-backend-auth-policy0.policy_name}"
|
"${aws_load_balancer_policy.test-backend-auth-policy0.policy_name}"
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
`
|
`
|
||||||
|
@ -263,7 +263,7 @@ resource "aws_iam_server_certificate" "test-iam-cert0" {
|
||||||
}
|
}
|
||||||
|
|
||||||
resource "aws_elb" "test-lb" {
|
resource "aws_elb" "test-lb" {
|
||||||
name = "test-aws-elb-policies-lb"
|
name = "test-aws-policies-lb"
|
||||||
availability_zones = ["us-east-1a"]
|
availability_zones = ["us-east-1a"]
|
||||||
|
|
||||||
listener {
|
listener {
|
||||||
|
@ -279,7 +279,7 @@ resource "aws_elb" "test-lb" {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
resource "aws_elb_load_balancer_policy" "test-pubkey-policy0" {
|
resource "aws_load_balancer_policy" "test-pubkey-policy0" {
|
||||||
load_balancer_name = "${aws_elb.test-lb.name}"
|
load_balancer_name = "${aws_elb.test-lb.name}"
|
||||||
policy_name = "test-pubkey-policy0"
|
policy_name = "test-pubkey-policy0"
|
||||||
policy_type_name = "PublicKeyPolicyType"
|
policy_type_name = "PublicKeyPolicyType"
|
||||||
|
@ -289,7 +289,7 @@ resource "aws_elb_load_balancer_policy" "test-pubkey-policy0" {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
resource "aws_elb_load_balancer_policy" "test-pubkey-policy1" {
|
resource "aws_load_balancer_policy" "test-pubkey-policy1" {
|
||||||
load_balancer_name = "${aws_elb.test-lb.name}"
|
load_balancer_name = "${aws_elb.test-lb.name}"
|
||||||
policy_name = "test-pubkey-policy1"
|
policy_name = "test-pubkey-policy1"
|
||||||
policy_type_name = "PublicKeyPolicyType"
|
policy_type_name = "PublicKeyPolicyType"
|
||||||
|
@ -299,21 +299,21 @@ resource "aws_elb_load_balancer_policy" "test-pubkey-policy1" {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
resource "aws_elb_load_balancer_policy" "test-backend-auth-policy0" {
|
resource "aws_load_balancer_policy" "test-backend-auth-policy0" {
|
||||||
load_balancer_name = "${aws_elb.test-lb.name}"
|
load_balancer_name = "${aws_elb.test-lb.name}"
|
||||||
policy_name = "test-backend-auth-policy0"
|
policy_name = "test-backend-auth-policy0"
|
||||||
policy_type_name = "BackendServerAuthenticationPolicyType"
|
policy_type_name = "BackendServerAuthenticationPolicyType"
|
||||||
policy_attribute = {
|
policy_attribute = {
|
||||||
name = "PublicKeyPolicyName"
|
name = "PublicKeyPolicyName"
|
||||||
value = "${aws_elb_load_balancer_policy.test-pubkey-policy1.policy_name}"
|
value = "${aws_load_balancer_policy.test-pubkey-policy1.policy_name}"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
resource "aws_elb_load_balancer_backend_server_policy" "test-backend-auth-policies-443" {
|
resource "aws_load_balancer_backend_server_policy" "test-backend-auth-policies-443" {
|
||||||
load_balancer_name = "${aws_elb.test-lb.name}"
|
load_balancer_name = "${aws_elb.test-lb.name}"
|
||||||
instance_port = 443
|
instance_port = 443
|
||||||
policy_names = [
|
policy_names = [
|
||||||
"${aws_elb_load_balancer_policy.test-backend-auth-policy0.policy_name}"
|
"${aws_load_balancer_policy.test-backend-auth-policy0.policy_name}"
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
`
|
`
|
||||||
|
@ -370,7 +370,7 @@ resource "aws_iam_server_certificate" "test-iam-cert0" {
|
||||||
}
|
}
|
||||||
|
|
||||||
resource "aws_elb" "test-lb" {
|
resource "aws_elb" "test-lb" {
|
||||||
name = "test-aws-elb-policies-lb"
|
name = "test-aws-policies-lb"
|
||||||
availability_zones = ["us-east-1a"]
|
availability_zones = ["us-east-1a"]
|
||||||
|
|
||||||
listener {
|
listener {
|
|
@ -22,21 +22,21 @@ func TestAccAWSLoadBalancerListenerPolicy_basic(t *testing.T) {
|
||||||
resource.TestStep{
|
resource.TestStep{
|
||||||
Config: testAccAWSLoadBalancerListenerPolicyConfig_basic0,
|
Config: testAccAWSLoadBalancerListenerPolicyConfig_basic0,
|
||||||
Check: resource.ComposeTestCheckFunc(
|
Check: resource.ComposeTestCheckFunc(
|
||||||
testAccCheckAWSLoadBalancerPolicyState("aws_elb.test-lb", "aws_elb_load_balancer_policy.magic-cookie-sticky"),
|
testAccCheckAWSLoadBalancerPolicyState("aws_elb.test-lb", "aws_load_balancer_policy.magic-cookie-sticky"),
|
||||||
testAccCheckAWSLoadBalancerListenerPolicyState("test-aws-elb-policies-lb", int64(80), "magic-cookie-sticky-policy", true),
|
testAccCheckAWSLoadBalancerListenerPolicyState("test-aws-policies-lb", int64(80), "magic-cookie-sticky-policy", true),
|
||||||
),
|
),
|
||||||
},
|
},
|
||||||
resource.TestStep{
|
resource.TestStep{
|
||||||
Config: testAccAWSLoadBalancerListenerPolicyConfig_basic1,
|
Config: testAccAWSLoadBalancerListenerPolicyConfig_basic1,
|
||||||
Check: resource.ComposeTestCheckFunc(
|
Check: resource.ComposeTestCheckFunc(
|
||||||
testAccCheckAWSLoadBalancerPolicyState("aws_elb.test-lb", "aws_elb_load_balancer_policy.magic-cookie-sticky"),
|
testAccCheckAWSLoadBalancerPolicyState("aws_elb.test-lb", "aws_load_balancer_policy.magic-cookie-sticky"),
|
||||||
testAccCheckAWSLoadBalancerListenerPolicyState("test-aws-elb-policies-lb", int64(80), "magic-cookie-sticky-policy", true),
|
testAccCheckAWSLoadBalancerListenerPolicyState("test-aws-policies-lb", int64(80), "magic-cookie-sticky-policy", true),
|
||||||
),
|
),
|
||||||
},
|
},
|
||||||
resource.TestStep{
|
resource.TestStep{
|
||||||
Config: testAccAWSLoadBalancerListenerPolicyConfig_basic2,
|
Config: testAccAWSLoadBalancerListenerPolicyConfig_basic2,
|
||||||
Check: resource.ComposeTestCheckFunc(
|
Check: resource.ComposeTestCheckFunc(
|
||||||
testAccCheckAWSLoadBalancerListenerPolicyState("test-aws-elb-policies-lb", int64(80), "magic-cookie-sticky-policy", false),
|
testAccCheckAWSLoadBalancerListenerPolicyState("test-aws-policies-lb", int64(80), "magic-cookie-sticky-policy", false),
|
||||||
),
|
),
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
@ -57,7 +57,7 @@ func testAccCheckAWSLoadBalancerListenerPolicyDestroy(s *terraform.State) error
|
||||||
|
|
||||||
for _, rs := range s.RootModule().Resources {
|
for _, rs := range s.RootModule().Resources {
|
||||||
switch {
|
switch {
|
||||||
case rs.Type == "aws_elb_load_balancer_policy":
|
case rs.Type == "aws_load_balancer_policy":
|
||||||
loadBalancerName, policyName := resourceAwsLoadBalancerListenerPoliciesParseId(rs.Primary.ID)
|
loadBalancerName, policyName := resourceAwsLoadBalancerListenerPoliciesParseId(rs.Primary.ID)
|
||||||
out, err := conn.DescribeLoadBalancerPolicies(
|
out, err := conn.DescribeLoadBalancerPolicies(
|
||||||
&elb.DescribeLoadBalancerPoliciesInput{
|
&elb.DescribeLoadBalancerPoliciesInput{
|
||||||
|
@ -73,7 +73,7 @@ func testAccCheckAWSLoadBalancerListenerPolicyDestroy(s *terraform.State) error
|
||||||
if len(out.PolicyDescriptions) > 0 {
|
if len(out.PolicyDescriptions) > 0 {
|
||||||
return fmt.Errorf("Policy still exists")
|
return fmt.Errorf("Policy still exists")
|
||||||
}
|
}
|
||||||
case rs.Type == "aws_elb_load_listener_policy":
|
case rs.Type == "aws_load_listener_policy":
|
||||||
loadBalancerName, _ := resourceAwsLoadBalancerListenerPoliciesParseId(rs.Primary.ID)
|
loadBalancerName, _ := resourceAwsLoadBalancerListenerPoliciesParseId(rs.Primary.ID)
|
||||||
out, err := conn.DescribeLoadBalancers(
|
out, err := conn.DescribeLoadBalancers(
|
||||||
&elb.DescribeLoadBalancersInput{
|
&elb.DescribeLoadBalancersInput{
|
||||||
|
@ -144,7 +144,7 @@ func testAccCheckAWSLoadBalancerListenerPolicyState(loadBalancerName string, loa
|
||||||
|
|
||||||
const testAccAWSLoadBalancerListenerPolicyConfig_basic0 = `
|
const testAccAWSLoadBalancerListenerPolicyConfig_basic0 = `
|
||||||
resource "aws_elb" "test-lb" {
|
resource "aws_elb" "test-lb" {
|
||||||
name = "test-aws-elb-policies-lb"
|
name = "test-aws-policies-lb"
|
||||||
availability_zones = ["us-east-1a"]
|
availability_zones = ["us-east-1a"]
|
||||||
|
|
||||||
listener {
|
listener {
|
||||||
|
@ -159,7 +159,7 @@ resource "aws_elb" "test-lb" {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
resource "aws_elb_load_balancer_policy" "magic-cookie-sticky" {
|
resource "aws_load_balancer_policy" "magic-cookie-sticky" {
|
||||||
load_balancer_name = "${aws_elb.test-lb.name}"
|
load_balancer_name = "${aws_elb.test-lb.name}"
|
||||||
policy_name = "magic-cookie-sticky-policy"
|
policy_name = "magic-cookie-sticky-policy"
|
||||||
policy_type_name = "AppCookieStickinessPolicyType"
|
policy_type_name = "AppCookieStickinessPolicyType"
|
||||||
|
@ -169,18 +169,18 @@ resource "aws_elb_load_balancer_policy" "magic-cookie-sticky" {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
resource "aws_elb_load_balancer_listener_policy" "test-lb-listener-policies-80" {
|
resource "aws_load_balancer_listener_policy" "test-lb-listener-policies-80" {
|
||||||
load_balancer_name = "${aws_elb.test-lb.name}"
|
load_balancer_name = "${aws_elb.test-lb.name}"
|
||||||
load_balancer_port = 80
|
load_balancer_port = 80
|
||||||
policy_names = [
|
policy_names = [
|
||||||
"${aws_elb_load_balancer_policy.magic-cookie-sticky.policy_name}",
|
"${aws_load_balancer_policy.magic-cookie-sticky.policy_name}",
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
`
|
`
|
||||||
|
|
||||||
const testAccAWSLoadBalancerListenerPolicyConfig_basic1 = `
|
const testAccAWSLoadBalancerListenerPolicyConfig_basic1 = `
|
||||||
resource "aws_elb" "test-lb" {
|
resource "aws_elb" "test-lb" {
|
||||||
name = "test-aws-elb-policies-lb"
|
name = "test-aws-policies-lb"
|
||||||
availability_zones = ["us-east-1a"]
|
availability_zones = ["us-east-1a"]
|
||||||
|
|
||||||
listener {
|
listener {
|
||||||
|
@ -195,7 +195,7 @@ resource "aws_elb" "test-lb" {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
resource "aws_elb_load_balancer_policy" "magic-cookie-sticky" {
|
resource "aws_load_balancer_policy" "magic-cookie-sticky" {
|
||||||
load_balancer_name = "${aws_elb.test-lb.name}"
|
load_balancer_name = "${aws_elb.test-lb.name}"
|
||||||
policy_name = "magic-cookie-sticky-policy"
|
policy_name = "magic-cookie-sticky-policy"
|
||||||
policy_type_name = "AppCookieStickinessPolicyType"
|
policy_type_name = "AppCookieStickinessPolicyType"
|
||||||
|
@ -205,18 +205,18 @@ resource "aws_elb_load_balancer_policy" "magic-cookie-sticky" {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
resource "aws_elb_load_balancer_listener_policy" "test-lb-listener-policies-80" {
|
resource "aws_load_balancer_listener_policy" "test-lb-listener-policies-80" {
|
||||||
load_balancer_name = "${aws_elb.test-lb.name}"
|
load_balancer_name = "${aws_elb.test-lb.name}"
|
||||||
load_balancer_port = 80
|
load_balancer_port = 80
|
||||||
policy_names = [
|
policy_names = [
|
||||||
"${aws_elb_load_balancer_policy.magic-cookie-sticky.policy_name}"
|
"${aws_load_balancer_policy.magic-cookie-sticky.policy_name}"
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
`
|
`
|
||||||
|
|
||||||
const testAccAWSLoadBalancerListenerPolicyConfig_basic2 = `
|
const testAccAWSLoadBalancerListenerPolicyConfig_basic2 = `
|
||||||
resource "aws_elb" "test-lb" {
|
resource "aws_elb" "test-lb" {
|
||||||
name = "test-aws-elb-policies-lb"
|
name = "test-aws-policies-lb"
|
||||||
availability_zones = ["us-east-1a"]
|
availability_zones = ["us-east-1a"]
|
||||||
|
|
||||||
listener {
|
listener {
|
|
@ -23,7 +23,7 @@ func TestAccAWSLoadBalancerPolicy_basic(t *testing.T) {
|
||||||
resource.TestStep{
|
resource.TestStep{
|
||||||
Config: testAccAWSLoadBalancerPolicyConfig_basic,
|
Config: testAccAWSLoadBalancerPolicyConfig_basic,
|
||||||
Check: resource.ComposeTestCheckFunc(
|
Check: resource.ComposeTestCheckFunc(
|
||||||
testAccCheckAWSLoadBalancerPolicyState("aws_elb.test-lb", "aws_elb_load_balancer_policy.test-policy"),
|
testAccCheckAWSLoadBalancerPolicyState("aws_elb.test-lb", "aws_load_balancer_policy.test-policy"),
|
||||||
),
|
),
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
@ -39,13 +39,13 @@ func TestAccAWSLoadBalancerPolicy_updateWhileAssigned(t *testing.T) {
|
||||||
resource.TestStep{
|
resource.TestStep{
|
||||||
Config: testAccAWSLoadBalancerPolicyConfig_updateWhileAssigned0,
|
Config: testAccAWSLoadBalancerPolicyConfig_updateWhileAssigned0,
|
||||||
Check: resource.ComposeTestCheckFunc(
|
Check: resource.ComposeTestCheckFunc(
|
||||||
testAccCheckAWSLoadBalancerPolicyState("aws_elb.test-lb", "aws_elb_load_balancer_policy.test-policy"),
|
testAccCheckAWSLoadBalancerPolicyState("aws_elb.test-lb", "aws_load_balancer_policy.test-policy"),
|
||||||
),
|
),
|
||||||
},
|
},
|
||||||
resource.TestStep{
|
resource.TestStep{
|
||||||
Config: testAccAWSLoadBalancerPolicyConfig_updateWhileAssigned1,
|
Config: testAccAWSLoadBalancerPolicyConfig_updateWhileAssigned1,
|
||||||
Check: resource.ComposeTestCheckFunc(
|
Check: resource.ComposeTestCheckFunc(
|
||||||
testAccCheckAWSLoadBalancerPolicyState("aws_elb.test-lb", "aws_elb_load_balancer_policy.test-policy"),
|
testAccCheckAWSLoadBalancerPolicyState("aws_elb.test-lb", "aws_load_balancer_policy.test-policy"),
|
||||||
),
|
),
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
@ -56,7 +56,7 @@ func testAccCheckAWSLoadBalancerPolicyDestroy(s *terraform.State) error {
|
||||||
conn := testAccProvider.Meta().(*AWSClient).elbconn
|
conn := testAccProvider.Meta().(*AWSClient).elbconn
|
||||||
|
|
||||||
for _, rs := range s.RootModule().Resources {
|
for _, rs := range s.RootModule().Resources {
|
||||||
if rs.Type != "aws_elb_load_balancer_policy" {
|
if rs.Type != "aws_load_balancer_policy" {
|
||||||
continue
|
continue
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -141,7 +141,7 @@ func testAccCheckAWSLoadBalancerPolicyState(elbResource string, policyResource s
|
||||||
|
|
||||||
const testAccAWSLoadBalancerPolicyConfig_basic = `
|
const testAccAWSLoadBalancerPolicyConfig_basic = `
|
||||||
resource "aws_elb" "test-lb" {
|
resource "aws_elb" "test-lb" {
|
||||||
name = "test-aws-elb-policies-lb"
|
name = "test-aws-policies-lb"
|
||||||
availability_zones = ["us-east-1a"]
|
availability_zones = ["us-east-1a"]
|
||||||
|
|
||||||
listener {
|
listener {
|
||||||
|
@ -156,7 +156,7 @@ resource "aws_elb" "test-lb" {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
resource "aws_elb_load_balancer_policy" "test-policy" {
|
resource "aws_load_balancer_policy" "test-policy" {
|
||||||
load_balancer_name = "${aws_elb.test-lb.name}"
|
load_balancer_name = "${aws_elb.test-lb.name}"
|
||||||
policy_name = "test-policy-policy"
|
policy_name = "test-policy-policy"
|
||||||
policy_type_name = "AppCookieStickinessPolicyType"
|
policy_type_name = "AppCookieStickinessPolicyType"
|
||||||
|
@ -169,7 +169,7 @@ resource "aws_elb_load_balancer_policy" "test-policy" {
|
||||||
|
|
||||||
const testAccAWSLoadBalancerPolicyConfig_updateWhileAssigned0 = `
|
const testAccAWSLoadBalancerPolicyConfig_updateWhileAssigned0 = `
|
||||||
resource "aws_elb" "test-lb" {
|
resource "aws_elb" "test-lb" {
|
||||||
name = "test-aws-elb-policies-lb"
|
name = "test-aws-policies-lb"
|
||||||
availability_zones = ["us-east-1a"]
|
availability_zones = ["us-east-1a"]
|
||||||
|
|
||||||
listener {
|
listener {
|
||||||
|
@ -184,7 +184,7 @@ resource "aws_elb" "test-lb" {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
resource "aws_elb_load_balancer_policy" "test-policy" {
|
resource "aws_load_balancer_policy" "test-policy" {
|
||||||
load_balancer_name = "${aws_elb.test-lb.name}"
|
load_balancer_name = "${aws_elb.test-lb.name}"
|
||||||
policy_name = "test-policy-policy"
|
policy_name = "test-policy-policy"
|
||||||
policy_type_name = "AppCookieStickinessPolicyType"
|
policy_type_name = "AppCookieStickinessPolicyType"
|
||||||
|
@ -194,18 +194,18 @@ resource "aws_elb_load_balancer_policy" "test-policy" {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
resource "aws_elb_load_balancer_listener_policy" "test-lb-test-policy-80" {
|
resource "aws_load_balancer_listener_policy" "test-lb-test-policy-80" {
|
||||||
load_balancer_name = "${aws_elb.test-lb.name}"
|
load_balancer_name = "${aws_elb.test-lb.name}"
|
||||||
load_balancer_port = 80
|
load_balancer_port = 80
|
||||||
policy_names = [
|
policy_names = [
|
||||||
"${aws_elb_load_balancer_policy.test-policy.policy_name}"
|
"${aws_load_balancer_policy.test-policy.policy_name}"
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
`
|
`
|
||||||
|
|
||||||
const testAccAWSLoadBalancerPolicyConfig_updateWhileAssigned1 = `
|
const testAccAWSLoadBalancerPolicyConfig_updateWhileAssigned1 = `
|
||||||
resource "aws_elb" "test-lb" {
|
resource "aws_elb" "test-lb" {
|
||||||
name = "test-aws-elb-policies-lb"
|
name = "test-aws-policies-lb"
|
||||||
availability_zones = ["us-east-1a"]
|
availability_zones = ["us-east-1a"]
|
||||||
|
|
||||||
listener {
|
listener {
|
||||||
|
@ -220,7 +220,7 @@ resource "aws_elb" "test-lb" {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
resource "aws_elb_load_balancer_policy" "test-policy" {
|
resource "aws_load_balancer_policy" "test-policy" {
|
||||||
load_balancer_name = "${aws_elb.test-lb.name}"
|
load_balancer_name = "${aws_elb.test-lb.name}"
|
||||||
policy_name = "test-policy-policy"
|
policy_name = "test-policy-policy"
|
||||||
policy_type_name = "AppCookieStickinessPolicyType"
|
policy_type_name = "AppCookieStickinessPolicyType"
|
||||||
|
@ -230,11 +230,11 @@ resource "aws_elb_load_balancer_policy" "test-policy" {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
resource "aws_elb_load_balancer_listener_policy" "test-lb-test-policy-80" {
|
resource "aws_load_balancer_listener_policy" "test-lb-test-policy-80" {
|
||||||
load_balancer_name = "${aws_elb.test-lb.name}"
|
load_balancer_name = "${aws_elb.test-lb.name}"
|
||||||
load_balancer_port = 80
|
load_balancer_port = 80
|
||||||
policy_names = [
|
policy_names = [
|
||||||
"${aws_elb_load_balancer_policy.test-policy.policy_name}"
|
"${aws_load_balancer_policy.test-policy.policy_name}"
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
`
|
`
|
|
@ -1,7 +1,7 @@
|
||||||
---
|
---
|
||||||
layout: "aws"
|
layout: "aws"
|
||||||
page_title: "AWS: aws_elb_load_balancer_backend_server_policy"
|
page_title: "AWS: aws_load_balancer_backend_server_policy"
|
||||||
sidebar_current: "docs-aws-resource-elb-load-balancer-backend-server-policy"
|
sidebar_current: "docs-aws-resource-load-balancer-backend-server-policy"
|
||||||
description: |-
|
description: |-
|
||||||
Attaches a load balancer policy to an ELB backend server.
|
Attaches a load balancer policy to an ELB backend server.
|
||||||
---
|
---
|
||||||
|
@ -31,7 +31,7 @@ resource "aws_elb" "wu-tang" {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
resource "aws_elb_load_balancer_policy" "wu-tang-ca-pubkey-policy" {
|
resource "aws_load_balancer_policy" "wu-tang-ca-pubkey-policy" {
|
||||||
load_balancer_name = "${aws_elb.wu-tang.name}"
|
load_balancer_name = "${aws_elb.wu-tang.name}"
|
||||||
policy_name = "wu-tang-ca-pubkey-policy"
|
policy_name = "wu-tang-ca-pubkey-policy"
|
||||||
policy_type_name = "PublicKeyPolicyType"
|
policy_type_name = "PublicKeyPolicyType"
|
||||||
|
@ -41,21 +41,21 @@ resource "aws_elb_load_balancer_policy" "wu-tang-ca-pubkey-policy" {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
resource "aws_elb_load_balancer_policy" "wu-tang-root-ca-backend-auth-policy" {
|
resource "aws_load_balancer_policy" "wu-tang-root-ca-backend-auth-policy" {
|
||||||
load_balancer_name = "${aws_elb.wu-tang.name}"
|
load_balancer_name = "${aws_elb.wu-tang.name}"
|
||||||
policy_name = "wu-tang-root-ca-backend-auth-policy"
|
policy_name = "wu-tang-root-ca-backend-auth-policy"
|
||||||
policy_type_name = "BackendServerAuthenticationPolicyType"
|
policy_type_name = "BackendServerAuthenticationPolicyType"
|
||||||
policy_attribute = {
|
policy_attribute = {
|
||||||
name = "PublicKeyPolicyName"
|
name = "PublicKeyPolicyName"
|
||||||
value = "${aws_elb_load_balancer_policy.wu-tang-root-ca-pubkey-policy.policy_name}"
|
value = "${aws_load_balancer_policy.wu-tang-root-ca-pubkey-policy.policy_name}"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
resource "aws_elb_load_balancer_backend_server_policy" "wu-tang-backend-auth-policies-443" {
|
resource "aws_load_balancer_backend_server_policy" "wu-tang-backend-auth-policies-443" {
|
||||||
load_balancer_name = "${aws_elb.wu-tang.name}"
|
load_balancer_name = "${aws_elb.wu-tang.name}"
|
||||||
instance_port = 443
|
instance_port = 443
|
||||||
policy_names = [
|
policy_names = [
|
||||||
"${aws_elb_load_balancer_policy.wu-tang-root-ca-backend-auth-policy.policy_name}"
|
"${aws_load_balancer_policy.wu-tang-root-ca-backend-auth-policy.policy_name}"
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
```
|
```
|
|
@ -1,7 +1,7 @@
|
||||||
---
|
---
|
||||||
layout: "aws"
|
layout: "aws"
|
||||||
page_title: "AWS: aws_elb_load_balancer_listener_policy"
|
page_title: "AWS: aws_load_balancer_listener_policy"
|
||||||
sidebar_current: "docs-aws-resource-elb-load-balancer-listener-policy"
|
sidebar_current: "docs-aws-resource-load-balancer-listener-policy"
|
||||||
description: |-
|
description: |-
|
||||||
Attaches a load balancer policy to an ELB Listener.
|
Attaches a load balancer policy to an ELB Listener.
|
||||||
---
|
---
|
||||||
|
@ -31,7 +31,7 @@ resource "aws_elb" "wu-tang" {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
resource "aws_elb_load_balancer_policy" "wu-tang-ssl" {
|
resource "aws_load_balancer_policy" "wu-tang-ssl" {
|
||||||
load_balancer_name = "${aws_elb.wu-tang.name}"
|
load_balancer_name = "${aws_elb.wu-tang.name}"
|
||||||
policy_name = "wu-tang-ssl"
|
policy_name = "wu-tang-ssl"
|
||||||
policy_type_name = "SSLNegotiationPolicyType"
|
policy_type_name = "SSLNegotiationPolicyType"
|
||||||
|
@ -45,11 +45,11 @@ resource "aws_elb_load_balancer_policy" "wu-tang-ssl" {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
resource "aws_elb_load_balancer_listener_policy" "wu-tang-listener-policies-443" {
|
resource "aws_load_balancer_listener_policy" "wu-tang-listener-policies-443" {
|
||||||
load_balancer_name = "${aws_elb.wu-tang.name}"
|
load_balancer_name = "${aws_elb.wu-tang.name}"
|
||||||
load_balancer_port = 443
|
load_balancer_port = 443
|
||||||
policy_names = [
|
policy_names = [
|
||||||
"${aws_elb_load_balancer_policy.wu-tang-ssl.policy_name}"
|
"${aws_load_balancer_policy.wu-tang-ssl.policy_name}"
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
```
|
```
|
|
@ -1,7 +1,7 @@
|
||||||
---
|
---
|
||||||
layout: "aws"
|
layout: "aws"
|
||||||
page_title: "AWS: aws_elb_load_balancer_policy"
|
page_title: "AWS: aws_load_balancer_policy"
|
||||||
sidebar_current: "docs-aws-resource-elb-load-balancer-policy"
|
sidebar_current: "docs-aws-resource-load-balancer-policy"
|
||||||
description: |-
|
description: |-
|
||||||
Provides a load balancer policy, which can be attached to an ELB listener or backend server.
|
Provides a load balancer policy, which can be attached to an ELB listener or backend server.
|
||||||
---
|
---
|
||||||
|
@ -30,7 +30,7 @@ resource "aws_elb" "wu-tang" {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
resource "aws_elb_load_balancer_policy" "wu-tang-ca-pubkey-policy" {
|
resource "aws_load_balancer_policy" "wu-tang-ca-pubkey-policy" {
|
||||||
load_balancer_name = "${aws_elb.wu-tang.name}"
|
load_balancer_name = "${aws_elb.wu-tang.name}"
|
||||||
policy_name = "wu-tang-ca-pubkey-policy"
|
policy_name = "wu-tang-ca-pubkey-policy"
|
||||||
policy_type_name = "PublicKeyPolicyType"
|
policy_type_name = "PublicKeyPolicyType"
|
||||||
|
@ -40,17 +40,17 @@ resource "aws_elb_load_balancer_policy" "wu-tang-ca-pubkey-policy" {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
resource "aws_elb_load_balancer_policy" "wu-tang-root-ca-backend-auth-policy" {
|
resource "aws_load_balancer_policy" "wu-tang-root-ca-backend-auth-policy" {
|
||||||
load_balancer_name = "${aws_elb.wu-tang.name}"
|
load_balancer_name = "${aws_elb.wu-tang.name}"
|
||||||
policy_name = "wu-tang-root-ca-backend-auth-policy"
|
policy_name = "wu-tang-root-ca-backend-auth-policy"
|
||||||
policy_type_name = "BackendServerAuthenticationPolicyType"
|
policy_type_name = "BackendServerAuthenticationPolicyType"
|
||||||
policy_attribute = {
|
policy_attribute = {
|
||||||
name = "PublicKeyPolicyName"
|
name = "PublicKeyPolicyName"
|
||||||
value = "${aws_elb_load_balancer_policy.wu-tang-root-ca-pubkey-policy.policy_name}"
|
value = "${aws_load_balancer_policy.wu-tang-root-ca-pubkey-policy.policy_name}"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
resource "aws_elb_load_balancer_policy" "wu-tang-ssl" {
|
resource "aws_load_balancer_policy" "wu-tang-ssl" {
|
||||||
load_balancer_name = "${aws_elb.wu-tang.name}"
|
load_balancer_name = "${aws_elb.wu-tang.name}"
|
||||||
policy_name = "wu-tang-ssl"
|
policy_name = "wu-tang-ssl"
|
||||||
policy_type_name = "SSLNegotiationPolicyType"
|
policy_type_name = "SSLNegotiationPolicyType"
|
||||||
|
@ -64,19 +64,19 @@ resource "aws_elb_load_balancer_policy" "wu-tang-ssl" {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
resource "aws_elb_load_balancer_backend_server_policy" "wu-tang-backend-auth-policies-443" {
|
resource "aws_load_balancer_backend_server_policy" "wu-tang-backend-auth-policies-443" {
|
||||||
load_balancer_name = "${aws_elb.wu-tang.name}"
|
load_balancer_name = "${aws_elb.wu-tang.name}"
|
||||||
instance_port = 443
|
instance_port = 443
|
||||||
policy_names = [
|
policy_names = [
|
||||||
"${aws_elb_load_balancer_policy.wu-tang-root-ca-backend-auth-policy.policy_name}"
|
"${aws_load_balancer_policy.wu-tang-root-ca-backend-auth-policy.policy_name}"
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
|
|
||||||
resource "aws_elb_load_balancer_listener_policy" "wu-tang-listener-policies-443" {
|
resource "aws_load_balancer_listener_policy" "wu-tang-listener-policies-443" {
|
||||||
load_balancer_name = "${aws_elb.wu-tang.name}"
|
load_balancer_name = "${aws_elb.wu-tang.name}"
|
||||||
load_balancer_port = 443
|
load_balancer_port = 443
|
||||||
policy_names = [
|
policy_names = [
|
||||||
"${aws_elb_load_balancer_policy.wu-tang-ssl.policy_name}"
|
"${aws_load_balancer_policy.wu-tang-ssl.policy_name}"
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
```
|
```
|
Loading…
Reference in New Issue