aws-cloudformation / aws-cloudformation/cloudformation-coverage-roadmap

OpenSearch domain creation fails on missing CloudWatch policy

Open
#1,769 2 comments 0 reactions 0 assignees View on GitHub
bug
Dominant language
No language data
Stars
1.1k
Forks
62
PR merge metrics
No merged PRs in 30d

Description

### Name of the resource

AWS::CloudFormation::Stack

### Resource Name

_No response_

### Issue Description

We create CF stack for OpenSearch domain. In CF template we also specify CloudWatch `AWS::Logs::LogGroup` and `AWS::Logs::ResourcePolicy` granting access to it. However, `AWS::OpenSearchService::Domain` that should publish logs to that log group fails telling there is not LogGroup policy available.
When we delay creation of `AWS::OpenSearchService::Domain` for example by inserting creation of several ECR repositories (at least 3), the domain is successfully created.
Note: we specify `DependsOn` parameter for each resource to make sure resources are created in the right order.

### Expected Behavior

The OpenSearch Domain should be created according to CF template

### Observed Behavior

The OpenSearch Domain is not created unless its creation is delayed.

### Test Cases

Create a CF template containing `AWS::Logs::LogGroup`, `AWS::Logs::ResourcePolicy` and `AWS::OpenSearchService::Domain` using policy to log to log group. Run the template several times. The domain should always be created.

### Other Details

_No response_

Contributor guide

Open the contributing guide

Research direction

The report names no repository files, tests, or implementation entry points. Start by reproducing the CloudFormation template with AWS::Logs::LogGroup, AWS::Logs::ResourcePolicy, and AWS::OpenSearchService::Domain, then investigate the creation-order behavior; done means the domain is created reliably without an artificial delay.

Written by the indexing model from the issue text.

Assessment

Tech stack
aws
Domain
cloud, infrastructure
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.