10000 feat: Add `collection_name` to outputs by nacl30d · Pull Request #35 · terraform-aws-modules/terraform-aws-opensearch · GitHub
[go: up one dir, main page]

Skip to content
8000

feat: Add collection_name to outputs #35

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

Conversation

nacl30d
Copy link
Contributor
@nacl30d nacl30d commented Jan 25, 2025

Description

  • Add collection name to outputs

Motivation and Context

Sometimes the name of collection is needed. Data access policy rule is based on collection name not ID or ARN.
I know variable (locals) is helpful in most situations.
In my case, opensearch_collection and access_policy is defined another terraform project.
Outputting name of the collection is very useful.

Example

// aoss/main.tf

module "opensearch_collection" {
  create_access_policy = true
  // Create access policy for operation. Read and Write
}

output "opensearch_collection" {
  value = module.opensearch_collection
}
// ecs/main.tf

data "terraform_remote_state" "aoss" {}

resource "aws_opensearchserverless_access_policy" "ecs" {
  policy = jsonencode({
    Rules = [
      {
        Resource     = ["collection/${data.terraform_remote_state.aoss.opensearch_collection.name}"]
        ResourceType = "collection"
        Permission   = [] // Readonly
      }          
    ]
  })
}

Breaking Changes

There is no breaking changes. Just add new output to outputs.

How Has This Been Tested?

  • I have updated at least one of the examples/* to demonstrate and validate my change(s)
  • I have tested and validated these changes using one or more of the provided examples/* projects
  • I have executed pre-commit run -a on my pull request

@nacl30d nacl30d force-pushed the feature/add-collection-name-to-outputs branch from 92e0bc3 to 01a8265 Compare January 26, 2025 03:05
@bryantbiggs bryantbiggs changed the title feat(collection): Add collection_name to outputs feat: Add collection_name to outputs Jan 26, 2025
@bryantbiggs bryantbiggs merged commit 111032e into terraform-aws-modules:master Jan 26, 2025
9 checks passed
antonbabenko pushed a commit that referenced this pull request Jan 26, 2025
## [1.6.0](v1.5.0...v1.6.0) (2025-01-26)

### Features

* Add `collection_name` to outputs ([#35](#35)) ([111032e](111032e))
@antonbabenko
Copy link
Member

This PR is included in version 1.6.0 🎉

Copy link

I'm going to lock this pull request because it has been closed for 30 days ⏳. This helps our maintainers find and focus on the active issues. If you have found a problem that seems related to this change, please open a new issue and complete the issue template so we can capture all the details necessary to investigate further.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Feb 26, 2025
@nacl30d nacl30d deleted the feature/add-collection-name-to-outputs branch February 26, 2025 03:07
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants
0