Skip to content

Commit d10575a

Browse files
authored
Added EIP for NAT instnaces (#77)
* Added EIP for NAT instnaces * Fix README
1 parent 90ca5cf commit d10575a

File tree

2 files changed

+109
-51
lines changed

2 files changed

+109
-51
lines changed

README.md

Lines changed: 92 additions & 50 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,43 @@
1-
<!-- This file was automatically generated by the `build-harness`. Make all changes to `README.yaml` and run `make readme` to rebuild this file. -->
1+
<!--
2+
3+
4+
5+
6+
7+
8+
9+
10+
11+
12+
13+
14+
15+
16+
** DO NOT EDIT THIS FILE
17+
**
18+
** This file was automatically generated by the `build-harness`.
19+
** 1) Make all changes to `README.yaml`
20+
** 2) Run `make init` (you only need to do this once)
21+
** 3) Run`make readme` to rebuild this file.
22+
**
23+
** (We maintain HUNDREDS of open source projects. This is how we maintain our sanity.)
24+
**
25+
26+
27+
28+
29+
30+
31+
32+
33+
34+
35+
36+
37+
38+
39+
40+
-->
241
[![README Header][readme_header_img]][readme_header_link]
342

443
[![Cloud Posse][logo]](https://cpco.io/homepage)
@@ -223,42 +262,47 @@ Check out these related projects.
223262

224263
## Help
225264

226-
**Got a question?**
265+
**Got a question?** We got answers.
227266

228267
File a GitHub [issue](https://github.com/cloudposse/terraform-aws-dynamic-subnets/issues), send us an [email][email] or join our [Slack Community][slack].
229268

230269
[![README Commercial Support][readme_commercial_support_img]][readme_commercial_support_link]
231270

232-
## Commercial Support
233-
234-
Work directly with our team of DevOps experts via email, slack, and video conferencing.
235-
236-
We provide [*commercial support*][commercial_support] for all of our [Open Source][github] projects. As a *Dedicated Support* customer, you have access to our team of subject matter experts at a fraction of the cost of a full-time engineer.
271+
## DevOps Accelerator for Startups
237272

238-
[![E-Mail](https://img.shields.io/badge/[email protected])][email]
239273

240-
- **Questions.** We'll use a Shared Slack channel between your team and ours.
241-
- **Troubleshooting.** We'll help you triage why things aren't working.
242-
- **Code Reviews.** We'll review your Pull Requests and provide constructive feedback.
243-
- **Bug Fixes.** We'll rapidly work to fix any bugs in our projects.
244-
- **Build New Terraform Modules.** We'll [develop original modules][module_development] to provision infrastructure.
245-
- **Cloud Architecture.** We'll assist with your cloud strategy and design.
246-
- **Implementation.** We'll provide hands-on support to implement our reference architectures.
274+
We are a [**DevOps Accelerator**][commercial_support]. We'll help you build your cloud infrastructure from the ground up so you can own it. Then we'll show you how to operate it and stick around for as long as you need us.
247275

276+
[![Learn More](https://img.shields.io/badge/learn%20more-success.svg?style=for-the-badge)][commercial_support]
248277

278+
Work directly with our team of DevOps experts via email, slack, and video conferencing.
249279

250-
## Terraform Module Development
251-
252-
Are you interested in custom Terraform module development? Submit your inquiry using [our form][module_development] today and we'll get back to you ASAP.
280+
We deliver 10x the value for a fraction of the cost of a full-time engineer. Our track record is not even funny. If you want things done right and you need it done FAST, then we're your best bet.
253281

282+
- **Reference Architecture.** You'll get everything you need from the ground up built using 100% infrastructure as code.
283+
- **Release Engineering.** You'll have end-to-end CI/CD with unlimited staging environments.
284+
- **Site Reliability Engineering.** You'll have total visibility into your apps and microservices.
285+
- **Security Baseline.** You'll have built-in governance with accountability and audit logs for all changes.
286+
- **GitOps.** You'll be able to operate your infrastructure via Pull Requests.
287+
- **Training.** You'll receive hands-on training so your team can operate what we build.
288+
- **Questions.** You'll have a direct line of communication between our teams via a Shared Slack channel.
289+
- **Troubleshooting.** You'll get help to triage when things aren't working.
290+
- **Code Reviews.** You'll receive constructive feedback on Pull Requests.
291+
- **Bug Fixes.** We'll rapidly work with you to fix any bugs in our projects.
254292

255293
## Slack Community
256294

257295
Join our [Open Source Community][slack] on Slack. It's **FREE** for everyone! Our "SweetOps" community is where you get to talk with others who share a similar vision for how to rollout and manage infrastructure. This is the best place to talk shop, ask questions, solicit feedback, and work together as a community to build totally *sweet* infrastructure.
258296

259297
## Newsletter
260298

261-
Signup for [our newsletter][newsletter] that covers everything on our technology radar. Receive updates on what we're up to on GitHub as well as awesome new projects we discover.
299+
Sign up for [our newsletter][newsletter] that covers everything on our technology radar. Receive updates on what we're up to on GitHub as well as awesome new projects we discover.
300+
301+
## Office Hours
302+
303+
[Join us every Wednesday via Zoom][office_hours] for our weekly "Lunch & Learn" sessions. It's **FREE** for everyone!
304+
305+
[![zoom](https://img.cloudposse.com/fit-in/200x200/https://cloudposse.com/wp-content/uploads/2019/08/Powered-by-Zoom.png")][office_hours]
262306

263307
## Contributing
264308

@@ -342,49 +386,47 @@ Check out [our other projects][github], [follow us on twitter][twitter], [apply
342386
|---|---|---|---|---|---|---|---|
343387

344388
[osterman_homepage]: https://github.com/osterman
345-
[osterman_avatar]: https://github.com/osterman.png?size=150
389+
[osterman_avatar]: https://img.cloudposse.com/150x150/https://github.com/osterman.png
346390
[aknysh_homepage]: https://github.com/aknysh
347-
[aknysh_avatar]: https://github.com/aknysh.png?size=150
391+
[aknysh_avatar]: https://img.cloudposse.com/150x150/https://github.com/aknysh.png
348392
[s2504s_homepage]: https://github.com/s2504s
349-
[s2504s_avatar]: https://github.com/s2504s.png?size=150
393+
[s2504s_avatar]: https://img.cloudposse.com/150x150/https://github.com/s2504s.png
350394
[SweetOps_homepage]: https://github.com/SweetOps
351-
[SweetOps_avatar]: https://github.com/SweetOps.png?size=150
395+
[SweetOps_avatar]: https://img.cloudposse.com/150x150/https://github.com/SweetOps.png
352396
[comeanother_homepage]: https://github.com/comeanother
353-
[comeanother_avatar]: https://github.com/comeanother.png?size=150
397+
[comeanother_avatar]: https://img.cloudposse.com/150x150/https://github.com/comeanother.png
354398
[dcowan-vestmark_homepage]: https://github.com/dcowan-vestmark
355-
[dcowan-vestmark_avatar]: https://github.com/dcowan-vestmark.png?size=150
399+
[dcowan-vestmark_avatar]: https://img.cloudposse.com/150x150/https://github.com/dcowan-vestmark.png
356400
[ivan-pinatti_homepage]: https://github.com/ivan-pinatti
357-
[ivan-pinatti_avatar]: https://github.com/ivan-pinatti.png?size=150
401+
[ivan-pinatti_avatar]: https://img.cloudposse.com/150x150/https://github.com/ivan-pinatti.png
358402
[osulli_homepage]: https://github.com/osulli
359-
[osulli_avatar]: https://github.com/osulli.png?size=150
360-
361-
403+
[osulli_avatar]: https://img.cloudposse.com/150x150/https://github.com/osulli.png
362404

363405
[![README Footer][readme_footer_img]][readme_footer_link]
364406
[![Beacon][beacon]][website]
365407

366408
[logo]: https://cloudposse.com/logo-300x69.svg
367-
[docs]: https://cpco.io/docs
368-
[website]: https://cpco.io/homepage
369-
[github]: https://cpco.io/github
370-
[jobs]: https://cpco.io/jobs
371-
[hire]: https://cpco.io/hire
372-
[slack]: https://cpco.io/slack
373-
[linkedin]: https://cpco.io/linkedin
374-
[twitter]: https://cpco.io/twitter
375-
[testimonial]: https://cpco.io/leave-testimonial
376-
[newsletter]: https://cpco.io/newsletter
377-
[email]: https://cpco.io/email
378-
[commercial_support]: https://cpco.io/commercial-support
379-
[we_love_open_source]: https://cpco.io/we-love-open-source
380-
[module_development]: https://cpco.io/module-development
381-
[terraform_modules]: https://cpco.io/terraform-modules
382-
[readme_header_img]: https://cloudposse.com/readme/header/img?repo=cloudposse/terraform-aws-dynamic-subnets
383-
[readme_header_link]: https://cloudposse.com/readme/header/link?repo=cloudposse/terraform-aws-dynamic-subnets
384-
[readme_footer_img]: https://cloudposse.com/readme/footer/img?repo=cloudposse/terraform-aws-dynamic-subnets
385-
[readme_footer_link]: https://cloudposse.com/readme/footer/link?repo=cloudposse/terraform-aws-dynamic-subnets
386-
[readme_commercial_support_img]: https://cloudposse.com/readme/commercial-support/img?repo=cloudposse/terraform-aws-dynamic-subnets
387-
[readme_commercial_support_link]: https://cloudposse.com/readme/commercial-support/link?repo=cloudposse/terraform-aws-dynamic-subnets
409+
[docs]: https://cpco.io/docs?utm_source=github&utm_medium=readme&utm_campaign=cloudposse/terraform-aws-dynamic-subnets&utm_content=docs
410+
[website]: https://cpco.io/homepage?utm_source=github&utm_medium=readme&utm_campaign=cloudposse/terraform-aws-dynamic-subnets&utm_content=website
411+
[github]: https://cpco.io/github?utm_source=github&utm_medium=readme&utm_campaign=cloudposse/terraform-aws-dynamic-subnets&utm_content=github
412+
[jobs]: https://cpco.io/jobs?utm_source=github&utm_medium=readme&utm_campaign=cloudposse/terraform-aws-dynamic-subnets&utm_content=jobs
413+
[hire]: https://cpco.io/hire?utm_source=github&utm_medium=readme&utm_campaign=cloudposse/terraform-aws-dynamic-subnets&utm_content=hire
414+
[slack]: https://cpco.io/slack?utm_source=github&utm_medium=readme&utm_campaign=cloudposse/terraform-aws-dynamic-subnets&utm_content=slack
415+
[linkedin]: https://cpco.io/linkedin?utm_source=github&utm_medium=readme&utm_campaign=cloudposse/terraform-aws-dynamic-subnets&utm_content=linkedin
416+
[twitter]: https://cpco.io/twitter?utm_source=github&utm_medium=readme&utm_campaign=cloudposse/terraform-aws-dynamic-subnets&utm_content=twitter
417+
[testimonial]: https://cpco.io/leave-testimonial?utm_source=github&utm_medium=readme&utm_campaign=cloudposse/terraform-aws-dynamic-subnets&utm_content=testimonial
418+
[office_hours]: https://cloudposse.com/office-hours?utm_source=github&utm_medium=readme&utm_campaign=cloudposse/terraform-aws-dynamic-subnets&utm_content=office_hours
419+
[newsletter]: https://cpco.io/newsletter?utm_source=github&utm_medium=readme&utm_campaign=cloudposse/terraform-aws-dynamic-subnets&utm_content=newsletter
420+
[email]: https://cpco.io/email?utm_source=github&utm_medium=readme&utm_campaign=cloudposse/terraform-aws-dynamic-subnets&utm_content=email
421+
[commercial_support]: https://cpco.io/commercial-support?utm_source=github&utm_medium=readme&utm_campaign=cloudposse/terraform-aws-dynamic-subnets&utm_content=commercial_support
422+
[we_love_open_source]: https://cpco.io/we-love-open-source?utm_source=github&utm_medium=readme&utm_campaign=cloudposse/terraform-aws-dynamic-subnets&utm_content=we_love_open_source
423+
[terraform_modules]: https://cpco.io/terraform-modules?utm_source=github&utm_medium=readme&utm_campaign=cloudposse/terraform-aws-dynamic-subnets&utm_content=terraform_modules
424+
[readme_header_img]: https://cloudposse.com/readme/header/img
425+
[readme_header_link]: https://cloudposse.com/readme/header/link?utm_source=github&utm_medium=readme&utm_campaign=cloudposse/terraform-aws-dynamic-subnets&utm_content=readme_header_link
426+
[readme_footer_img]: https://cloudposse.com/readme/footer/img
427+
[readme_footer_link]: https://cloudposse.com/readme/footer/link?utm_source=github&utm_medium=readme&utm_campaign=cloudposse/terraform-aws-dynamic-subnets&utm_content=readme_footer_link
428+
[readme_commercial_support_img]: https://cloudposse.com/readme/commercial-support/img
429+
[readme_commercial_support_link]: https://cloudposse.com/readme/commercial-support/link?utm_source=github&utm_medium=readme&utm_campaign=cloudposse/terraform-aws-dynamic-subnets&utm_content=readme_commercial_support_link
388430
[share_twitter]: https://twitter.com/intent/tweet/?text=terraform-aws-dynamic-subnets&url=https://github.com/cloudposse/terraform-aws-dynamic-subnets
389431
[share_linkedin]: https://www.linkedin.com/shareArticle?mini=true&title=terraform-aws-dynamic-subnets&url=https://github.com/cloudposse/terraform-aws-dynamic-subnets
390432
[share_reddit]: https://reddit.com/submit/?url=https://github.com/cloudposse/terraform-aws-dynamic-subnets

nat-instance.tf

Lines changed: 17 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -73,13 +73,29 @@ resource "aws_instance" "nat_instance" {
7373
# https://docs.aws.amazon.com/vpc/latest/userguide/VPC_NAT_Instance.html#EIP_Disable_SrcDestCheck
7474
source_dest_check = false
7575

76-
associate_public_ip_address = true
76+
associate_public_ip_address = false
7777

7878
lifecycle {
7979
create_before_destroy = true
8080
}
8181
}
8282

83+
resource "aws_eip" "nat_instance" {
84+
count = "${local.nat_instance_count}"
85+
vpc = true
86+
tags = "${merge(module.nat_instance_label.tags, map("Name",format("%s%s%s", module.nat_label.id, var.delimiter, replace(element(var.availability_zones, count.index),"-",var.delimiter))))}"
87+
88+
lifecycle {
89+
create_before_destroy = true
90+
}
91+
}
92+
93+
resource "aws_eip_association" "nat_instance" {
94+
count = "${local.nat_instance_count}"
95+
instance_id = "${element(aws_instance.nat_instance.*.id, count.index)}"
96+
allocation_id = "${element(aws_eip.nat_instance.*.id, count.index)}"
97+
}
98+
8399
resource "aws_route" "nat_instance" {
84100
count = "${local.nat_instance_count}"
85101
route_table_id = "${element(aws_route_table.private.*.id, count.index)}"

0 commit comments

Comments
 (0)