awslabs / awslabs/aws-deployment-framework
[Bug]: Pipeline targetting OU path wildcards fail
- Dominant language
- Python
- Stars
- 699
- Forks
- 235
- Avg merge
- 20h 53m
- Merged PRs (30d)
- 7
Description
### Is there an existing issue for this?
- [x] I have searched the existing issues
### Describe the bug
It appears the support for using OU wildcard that was merged in https://github.com/awslabs/aws-deployment-framework/pull/538 is broken or never worked fully?
### Expected Behavior
As per example in docs: https://github.com/awslabs/aws-deployment-framework/blame/325ae13fb83aad600d81494b8694362aae8f7e13/docs/user-guide.md#L377
### Current Behavior
This snippet:
```yaml
pipelines:
- name: testing
...
targets:
- path:
- /workloads/**/*
regions: [eu-north-1]
properties:
template_filename: template.json
```
results in step function error:
```json
{
"errorMessage": "Path /workloads/**/* failed to return a child OU at '**'",
"errorType": "ValueError",
"requestId": "95da7e76-048e-480a-b38f-c0dfc4249382",
"stackTrace": [
" File \"/var/task/generate_pipeline_inputs.py\", line 223, in lambda_handler\n pipeline_input_data = generate_pipeline_inputs(\n",
" File \"/var/task/generate_pipeline_inputs.py\", line 151, in generate_pipeline_inputs\n pipeline_target.fetch_accounts_for_target()\n",
" File \"/opt/python/target.py\", line 319, in fetch_accounts_for_target\n self._target_is_ou_path(\n",
" File \"/opt/python/target.py\", line 260, in _target_is_ou_path\n responses = self.organizations.get_accounts_in_path(\n",
" File \"/opt/python/organizations.py\", line 384, in get_accounts_in_path\n ou_id = self.ou_path_to_id(path) if not ou_id else ou_id\n",
" File \"/opt/python/organizations.py\", line 367, in ou_path_to_id\n raise ValueError(\n"
]
}
```
### Steps To Reproduce
See above.
### Possible Solution
_No response_
### Additional Information/Context
_No response_
### ADF Version
v4.0.0
### Contributing a fix?
- [ ] Yes, I am working on a fix to resolve this issue
Contributor guide
Research direction
Start with the failing path from the stack trace: generate_pipeline_inputs.py calls target.py, which uses organizations.py to resolve the OU path. Compare the wildcard example in docs/user-guide.md around line 377 with the path handling and reproduce it using the supplied pipeline YAML. Done means /workloads/**/* resolves successfully without the '**' child-OU error.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- aws, python
- Domain
- cloud, devops
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100