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

(aws-appconfig-alpha): ConfigurationContent.fromFile() doesn't work for relative paths #26937

Closed
2 tasks
GarlicPunisher opened this issue Aug 30, 2023 · 2 comments · Fixed by #28191
Closed
2 tasks
Labels
@aws-cdk/aws-config Related to AWS Config effort/small Small work item – less than a day of effort feature-request A feature should be added or improved. p2

Comments

@GarlicPunisher
Copy link

Describe the feature

ConfigurationContent.fromFile() does not currently work for relative file paths. E.g. if my package structure is something like:

/lib/app.ts
/config/dummy-config.json

It would be useful if from in app.ts I could reference the config file by ConfigurationContent.fromFile(../config/dummy-config.json)

Use Case

My code package gets built in different environments, so the absolute path will not be static. Using a relative path would ensure that I can safely reference the config file I want to deploy to AppConfig.

Proposed Solution

No response

Other Information

No response

Acknowledgements

  • I may be able to implement this feature request
  • This feature might incur a breaking change

CDK version used

"@aws-cdk/aws-appconfig-alpha": "^2.93.0-alpha.0"

Environment details (OS name and version, etc.)

Amazon Linux 5.4.250-173.369.amzn2int.x86_64

@GarlicPunisher GarlicPunisher added feature-request A feature should be added or improved. needs-triage This issue or PR still needs to be triaged. labels Aug 30, 2023
@github-actions github-actions bot added the @aws-cdk/aws-config Related to AWS Config label Aug 30, 2023
@pahud
Copy link
Contributor

pahud commented Aug 30, 2023

Have you tried this?

ConfigurationContent.fromFile(path.join(__dirname, '../config/dummy-config.json'));

@pahud pahud added p2 effort/small Small work item – less than a day of effort and removed needs-triage This issue or PR still needs to be triaged. labels Aug 30, 2023
@mergify mergify bot closed this as completed in #28191 Dec 5, 2023
mergify bot pushed a commit that referenced this issue Dec 5, 2023
… config (#28191)

When importing a config from a file, you can now pass a relative path (`config.json`) instead of the absolute path (`/Users/..../config.json`).

Closes #26937.

----

*By submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license*
Copy link

github-actions bot commented Dec 5, 2023

⚠️COMMENT VISIBILITY WARNING⚠️

Comments on closed issues are hard for our team to see.
If you need more assistance, please either tag a team member or open a new issue that references this one.
If you wish to keep having a conversation with other community members under this issue feel free to do so.

chenjane-dev added a commit to chenjane-dev/aws-cdk that referenced this issue Dec 5, 2023
… config (aws#28191)

When importing a config from a file, you can now pass a relative path (`config.json`) instead of the absolute path (`/Users/..../config.json`).

Closes aws#26937.

----

*By submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license*
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
@aws-cdk/aws-config Related to AWS Config effort/small Small work item – less than a day of effort feature-request A feature should be added or improved. p2
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants