Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

MM-60336: Allow ability to create empty OS #874

Merged
merged 2 commits into from
Dec 30, 2024
Merged

MM-60336: Allow ability to create empty OS #874

merged 2 commits into from
Dec 30, 2024

Conversation

agnivade
Copy link
Member

@agnivade
Copy link
Member Author

This works, but I had to set EnableCloudwatchLogs to false. Any idea what's up with that? I kept running into some Terraform error.

Is 5cf2fc2 related somehow?

@fmartingr
Copy link
Contributor

This works, but I had to set EnableCloudwatchLogs to false. Any idea what's up with that? I kept running into some Terraform error.

Is 5cf2fc2 related somehow?

What was the error?

@agnivade
Copy link
Member Author

info  [2024-12-13 22:17:03.783 +05:30] ╷
│ Error: Missing resource instance key
│
│   on elasticsearch.tf line 130, in resource "aws_opensearch_domain" "es_server":
│  130:       cloudwatch_log_group_arn = aws_cloudwatch_log_group.es_log_group.arn
│
│ Because aws_cloudwatch_log_group.es_log_group has "count" set, its
│ attributes must be accessed on specific instances.
│
│ For example, to correlate with indices of a referring resource, use:
│     aws_cloudwatch_log_group.es_log_group[count.index]
╵ caller="terraform/engine.go:71"
Error: failed to create terraform env: exit status 1

Copy link
Member

@agarciamontoro agarciamontoro left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good to me, thanks :)

@agarciamontoro
Copy link
Member

@fmartingr, do we need aws_cloudwatch_log_group.es_log_group[count.index] in there, then? It makes sense

@fmartingr
Copy link
Contributor

@fmartingr, do we need aws_cloudwatch_log_group.es_log_group[count.index] in there, then? It makes sense

Since we only create one I think it should work with aws_cloudwatch_log_group.es_log_group[0]

@agarciamontoro
Copy link
Member

@fmartingr, it seems that in some cases (not sure what the necessary conditions are), count is resolved after the check on the number of elements done. We saw that in #819 as well. I'm not 100% sure this is the same error, though.

@fmartingr
Copy link
Contributor

@fmartingr, it seems that in some cases (not sure what the necessary conditions are), count is resolved after the check on the number of elements done. We saw that in #819 as well. I'm not 100% sure this is the same error, though.

The block using the aws_cloudwatch_log_group is not using count but for_each, so the count variable does not exist (we would use each instead). Since this was done in order to create one or none I'd say we can go with [0] unless we want to go with something fancier.

@agarciamontoro
Copy link
Member

@fmartingr, huh, then it must be another thing, sorry. But I'm still a bit worried about that error Agniva saw. Have you been able to reproduce it? Agniva's out this week.

@agnivade
Copy link
Member Author

I will retry with [0] and report back.

@agnivade
Copy link
Member Author

Setting 0 worked.

@agnivade agnivade added the 4: Reviews Complete All reviewers have approved the pull request label Dec 30, 2024
@agnivade agnivade merged commit cbc059e into master Dec 30, 2024
1 check passed
@agnivade agnivade deleted the emptyOS branch December 30, 2024 07:14
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
4: Reviews Complete All reviewers have approved the pull request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants