Comments (5)
healthcheck.# is hardcoded to 1
I'll looking into it, whether hard-coding can be removed.
listeners/security groups/subnets don't include the references to the actual resources, just the .# attributes
I expect that terraform plan
complements actual resources (= array elements) in tfstate, if only there is a number of resources (.#
).
Actually it goes well with my environment.
@grosendorf Could you show me your Terraform version, tf and tfstate?
from terraforming.
@dtan4 using terraform v 0.6.0
Here's the output of terraforming elb --tfstate
:
"aws_elb.grid-env-chef-frontend": {
"type": "aws_elb",
"primary": {
"id": "grid-env-chef-frontend",
"attributes": {
"availability_zones.#": "3",
"connection_draining": "true",
"connection_draining_timeout": "400",
"cross_zone_load_balancing": "true",
"dns_name": "xxx",
"health_check.#": "1",
"id": "grid-env-chef-frontend",
"idle_timeout": "400",
"instances.#": "0",
"listener.#": "1",
"name": "grid-env-chef-frontend",
"security_groups.#": "1",
"source_security_group": "frontend",
"subnets.#": "3"
}
}
},
and here is what terraform outputs for the same resource:
"aws_elb.frontend": {
"type": "aws_elb",
"depends_on": [
"aws_security_group.frontend",
"aws_subnet.public",
"aws_subnet.public",
"aws_subnet.public"
],
"primary": {
"id": "grid-env-chef-frontend",
"attributes": {
"availability_zones.#": "0",
"connection_draining": "true",
"connection_draining_timeout": "400",
"cross_zone_load_balancing": "true",
"dns_name": "xxx",
"health_check.#": "1",
"health_check.1780658007.healthy_threshold": "2",
"health_check.1780658007.interval": "30",
"health_check.1780658007.target": "TCP:443",
"health_check.1780658007.timeout": "3",
"health_check.1780658007.unhealthy_threshold": "2",
"id": "grid-env-chef-frontend",
"idle_timeout": "400",
"instances.#": "0",
"internal": "false",
"listener.#": "1",
"listener.3989618417.instance_port": "443",
"listener.3989618417.instance_protocol": "http",
"listener.3989618417.lb_port": "443",
"listener.3989618417.lb_protocol": "http",
"listener.3989618417.ssl_certificate_id": "",
"name": "grid-env-chef-frontend",
"security_groups.#": "1",
"security_groups.1627594382": "sg-6f9c5b08",
"source_security_group": "frontend",
"subnets.#": "3",
"subnets.2307263590": "subnet-b52d409e",
"subnets.2790316720": "subnet-4f0a7216",
"subnets.2844051356": "subnet-733d1b04",
"tags.#": "0",
"zone_id": "Z3DZXE0Q79N41H"
}
}
}
and the .tf of the resource is as follows
resource "aws_elb" "frontend" {
name = "${var.project}-frontend"
subnets = [
"${aws_subnet.public.0.id}",
"${aws_subnet.public.1.id}",
"${aws_subnet.public.2.id}"
]
security_groups = ["${aws_security_group.frontend.id}"]
cross_zone_load_balancing = true
idle_timeout = 400
connection_draining = true
connection_draining_timeout = 400
listener {
instance_port = 443
instance_protocol = "http"
lb_port = 443
lb_protocol = "http"
}
health_check {
healthy_threshold = 2
unhealthy_threshold = 2
timeout = 3
target = "TCP:443"
interval = 30
}
}
I whipped up a PR last night that should fix this, I'll open it shortly once I update the unit tests.
Edit: Opened PR #91
from terraforming.
I tried again with the latest Terraforming (b59764c) and Terraform v0.6.0, it shows the unexpected diff...
But #91 works file, I just merged 👍
I'll continue to look into hard-coading of healthcheck.#
...
from terraforming.
@dtan4 I think the hardcoding of healthcheck.#
to 1 is actually okay for now, as AWS ELBs only support one healthcheck, although it might be worth changing to be future proof in case they decide to add support for multiple health checks.
from terraforming.
Actually API returns one healthcheck attribute per ELB as you say,
client.describe_load_balancers.load_balancer_descriptions[0]
=> #<struct Aws::ElasticLoadBalancing::Types::LoadBalancerDescription
load_balancer_name="foobar",
...
health_check=
#<struct Aws::ElasticLoadBalancing::Types::HealthCheck
target="HTTP:80/index.html",
interval=30,
timeout=5,
unhealthy_threshold=2,
healthy_threshold=10>,
...
created_time=2015-07-16 07:04:49 UTC,
scheme="internal">
so it seems to be good for now, and it cannot set the number over 2 because it is not an array.
However for the update of multiple healthcheck supports, I added a notification comment at 0044c90.
Thank you for your notice and investigation ❗
from terraforming.
Related Issues (20)
- Terraform plan is destroying the resources
- ruby: bad interpreter: No such file or directory HOT 9
- Tags incorrectly formatted when exporting EC2. HOT 2
- terraforming iamr state or resource does not generate role tags
- [Feature request] terraforming iamugm : aws_iam_user_group_membership
- bug on merging with exisitn terraform.tfstate file HOT 5
- reverse terraform aws_rds_cluster_parameter_group options
- terraforming iamrp does not generate aws_iam_role_policy_attachment
- no nat gateway when pulling routing for routes with nat gateways
- Terraforming ec2 throws error for missing volumes HOT 1
- 'tags' is now a map argument, not a block HOT 2
- Feature request: add aws_cognito_user_pool
- Missing a way to get elasticache replication groups
- feature request: add aws_launch_template
- Wow! HOT 2
- Support for SES
- Tags are adding in "tags {" format not in "tags = {"
- support ability to use aws_iam_policy_document instead of directly having a policy doc in the resource
- Has this been abandoned? HOT 1
- Support for CloudFront
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from terraforming.