Skip to content

Commit 710883b

Browse files
iponweb-github-adminikochnevIlyaKochnevmaximmi
authored
Fix service role creation and mark name as mandatory (#46)
* Fix service role creation and mark name as mandatory * count fix * Update docs/terraform.md Co-Authored-By: Maxim Mironenko <simixido@gmail.com> * fix readme Co-authored-by: ikochnev <ikochnev@iponweb.net> Co-authored-by: IlyaKochnev <58564259+IlyaKochnev@users.noreply.github.com> Co-authored-by: Maxim Mironenko <simixido@gmail.com> Co-authored-by: Maxim Mironenko <maxim@cloudposse.com>
1 parent 94fecf7 commit 710883b

File tree

2 files changed

+8
-2
lines changed

2 files changed

+8
-2
lines changed

README.md

+5
Original file line numberDiff line numberDiff line change
@@ -255,6 +255,10 @@ We deliver 10x the value for a fraction of the cost of a full-time engineer. Our
255255

256256
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.
257257

258+
## Discourse Forums
259+
260+
Participate in our [Discourse Forums][discourse]. Here you'll find answers to commonly asked questions. Most questions will be related to the enormous number of projects we support on our GitHub. Come here to collaborate on answers, find solutions, and get ideas about the products and services we value. It only takes a minute to get started! Just sign in with SSO using your GitHub account.
261+
258262
## Newsletter
259263

260264
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.
@@ -370,6 +374,7 @@ Check out [our other projects][github], [follow us on twitter][twitter], [apply
370374
[testimonial]: https://cpco.io/leave-testimonial?utm_source=github&utm_medium=readme&utm_campaign=cloudposse/terraform-aws-elasticsearch&utm_content=testimonial
371375
[office_hours]: https://cloudposse.com/office-hours?utm_source=github&utm_medium=readme&utm_campaign=cloudposse/terraform-aws-elasticsearch&utm_content=office_hours
372376
[newsletter]: https://cpco.io/newsletter?utm_source=github&utm_medium=readme&utm_campaign=cloudposse/terraform-aws-elasticsearch&utm_content=newsletter
377+
[discourse]: https://ask.sweetops.com/?utm_source=github&utm_medium=readme&utm_campaign=cloudposse/terraform-aws-elasticsearch&utm_content=discourse
373378
[email]: https://cpco.io/email?utm_source=github&utm_medium=readme&utm_campaign=cloudposse/terraform-aws-elasticsearch&utm_content=email
374379
[commercial_support]: https://cpco.io/commercial-support?utm_source=github&utm_medium=readme&utm_campaign=cloudposse/terraform-aws-elasticsearch&utm_content=commercial_support
375380
[we_love_open_source]: https://cpco.io/we-love-open-source?utm_source=github&utm_medium=readme&utm_campaign=cloudposse/terraform-aws-elasticsearch&utm_content=we_love_open_source

main.tf

+3-2
Original file line numberDiff line numberDiff line change
@@ -66,13 +66,14 @@ resource "aws_security_group_rule" "egress" {
6666
}
6767

6868
data "aws_iam_role" "default" {
69-
count = var.enabled ? 1 : 0
69+
count = var.enabled && var.create_iam_service_linked_role == 0 ? 1 : 0
7070
name = "AWSServiceRoleForAmazonElasticsearchService"
71+
7172
}
7273

7374
# https://github.com/terraform-providers/terraform-provider-aws/issues/5218
7475
resource "aws_iam_service_linked_role" "default" {
75-
count = var.enabled && length(data.aws_iam_role.default.*.id) == 0 ? 1 : 0
76+
count = var.enabled && var.create_iam_service_linked_role && length(data.aws_iam_role.default.*.id) == 0 ? 1 : 0
7677
aws_service_name = "es.amazonaws.com"
7778
description = "AWSServiceRoleForAmazonElasticsearchService Service-Linked Role"
7879
}

0 commit comments

Comments
 (0)