Skip to content

Commit fd435ca

Browse files
brdasilvaBruno Silva
andauthored
Transformed cognito_options inner block into a dynamic block to avoid permission problems in AWS China (#63)
Co-authored-by: Bruno Silva <[email protected]>
1 parent c7f866b commit fd435ca

File tree

2 files changed

+26
-21
lines changed

2 files changed

+26
-21
lines changed

README.md

Lines changed: 18 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -312,22 +312,24 @@ Copyright © 2017-2020 [Cloud Posse, LLC](https://cpco.io/copyright)
312312

313313
See [LICENSE](LICENSE) for full details.
314314

315-
Licensed to the Apache Software Foundation (ASF) under one
316-
or more contributor license agreements. See the NOTICE file
317-
distributed with this work for additional information
318-
regarding copyright ownership. The ASF licenses this file
319-
to you under the Apache License, Version 2.0 (the
320-
"License"); you may not use this file except in compliance
321-
with the License. You may obtain a copy of the License at
322-
323-
https://www.apache.org/licenses/LICENSE-2.0
324-
325-
Unless required by applicable law or agreed to in writing,
326-
software distributed under the License is distributed on an
327-
"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
328-
KIND, either express or implied. See the License for the
329-
specific language governing permissions and limitations
330-
under the License.
315+
```text
316+
Licensed to the Apache Software Foundation (ASF) under one
317+
or more contributor license agreements. See the NOTICE file
318+
distributed with this work for additional information
319+
regarding copyright ownership. The ASF licenses this file
320+
to you under the Apache License, Version 2.0 (the
321+
"License"); you may not use this file except in compliance
322+
with the License. You may obtain a copy of the License at
323+
324+
https://www.apache.org/licenses/LICENSE-2.0
325+
326+
Unless required by applicable law or agreed to in writing,
327+
software distributed under the License is distributed on an
328+
"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
329+
KIND, either express or implied. See the License for the
330+
specific language governing permissions and limitations
331+
under the License.
332+
```
331333

332334

333335

main.tf

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -176,11 +176,14 @@ resource "aws_elasticsearch_domain" "default" {
176176
automated_snapshot_start_hour = var.automated_snapshot_start_hour
177177
}
178178

179-
cognito_options {
180-
enabled = var.cognito_authentication_enabled
181-
user_pool_id = var.cognito_user_pool_id
182-
identity_pool_id = var.cognito_identity_pool_id
183-
role_arn = var.cognito_iam_role_arn
179+
dynamic "cognito_options" {
180+
for_each = var.cognito_authentication_enabled ? [true] : []
181+
content {
182+
enabled = true
183+
user_pool_id = var.cognito_user_pool_id
184+
identity_pool_id = var.cognito_identity_pool_id
185+
role_arn = var.cognito_iam_role_arn
186+
}
184187
}
185188

186189
log_publishing_options {

0 commit comments

Comments
 (0)