aws_opensearchservice: Grant permissions using access policy for principals that cannot have policies attached #29213
Labels
@aws-cdk/aws-opensearch
Related to the @aws-cdk/aws-opensearchservice package
feature-request
A feature should be added or improved.
p2
Describe the feature
We would like to be able to grant access to principals that cannot have policies attached by using the accesspolicies on OpenSearch
The current OpenSearch grantXYZ methods only works for adding permissions to a principal and not to add permissions to the access policy.
Use Case
We want to grant cross-account access to OpenSearch and want to use the Role.FromRoleArn in our stack and then use grantIndexWrite method to grant those principals access.
Proposed Solution
Use the access policy (resource policy) if the principal does not allow adding permissions (like an imported role or AccountPrincipal or similar)
Other Information
We can manually craft the access policy using the addAccessPolicies , but it's much more convenient and easier to understand if we can use the grantXYX methods.
More about OpenSearch Domain Access Policies (Resource Policies):
https://docs.aws.amazon.com/opensearch-service/latest/developerguide/ac.html#ac-types-resource
Acknowledgements
CDK version used
2.129.0
Environment details (OS name and version, etc.)
Windows 11
The text was updated successfully, but these errors were encountered: