Using vcapFile to create/update cf user-provided service
Nobody has claimed this yet.
Assessment
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Newbie friendliness
- 30/100
- Issue type
- Documentation
- Clarity
- Mostly clear
- Activity status
- Stale
- Tech stack
- node.js
- Domain
- cloud
Research direction
Start by comparing the vcap-local-env.json structure with the payload expected by cf update-user-provided-service -p. Review how cfenv.getAppEnv({ vcap: localVCAP }) consumes the file, then document a recommended way to share and update credentials without interactive entry. Done means the guidance covers both local reads and Cloud Foundry service updates.
Written by the indexing model from the issue text.
Description
Hi,
I'm using cfenv to handle my credentials. I setup a cf user-provided service within cf and added a local vcapFile for running the app locally.
This is how I read the credentials (locally and prod)
// read envs from file if running locally =========================
let localVCAP = null;
try {
localVCAP = require('./vcap-local-env.json');
} catch (error) {
// silently ignoring failure when running inside cloudfoundry
}
// include environment variables from vcap service
const appEnv = cfenv.getAppEnv({ vcap: localVCAP });
const cfEnv = appEnv.getService('credential-service-test-app').credentials;
That all works fine, the only issue I see is when updating the user-provided service. In order to be able to use the same code for reading the envs, my vcapFile looks like this:
{
"application": {
"port": 4002
},
"services": {
"credential-service-test-app": [
{
"credential-service-test-app",
"credentials": {
"SECRET_PWD":"<***>",
}
}
]
}
}
But this way I'm not able to use the file for updating the service with cf update-user-provided-service credential-service-test-app -p ./vcap-local-env.json, since it will nest the application/services within the cf services object.
I don't want to use the interactive cf update-user-provided-service credential-service-test-app -p command every time a change a parameter and having to add all params again.
What would be the recommend way of maintaining the user-provided service amongst several coders?
- Dominant language
- CoffeeScript
- Stars
- 74
- Forks
- 25
- PR merge metrics
- No merged PRs in 30d
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from cloudfoundry-community/node-cfenv
-
Difficulty 1/5 Under an hour Newbie friendliness 68/100
cloudfoundry-community/node-cfenv#2 · 2 comments ·
-
typescript problem Open
Difficulty 4/5 3-5 days Newbie friendliness 30/100
cloudfoundry-community/node-cfenv#26 · 8 comments · 6 reactions ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 45/100
cloudfoundry-community/node-cfenv#17 · 2 comments ·
-
Invalid PORT value Open
Difficulty 3/5 1-2 days Newbie friendliness 25/100
cloudfoundry-community/node-cfenv#13 · 8 comments · 1 reaction ·
-
Difficulty 5/5 Over a week Newbie friendliness 25/100
cloudfoundry-community/node-cfenv#12 · 4 comments ·
All issues in cloudfoundry-community/node-cfenv
Similar issues
-
Difficulty 2/5 1-3 hours Newbie friendliness 88/100
-
bug
Difficulty 2/5 1-3 hours Newbie friendliness 88/100
-
Difficulty 2/5 1-3 hours Newbie friendliness 84/100
-
level/task module/gcp type/bug
Difficulty 2/5 1-3 hours Newbie friendliness 85/100
-
bug needs-triage service/elbv2
Difficulty 2/5 1-3 hours Newbie friendliness 82/100
hashicorp/terraform-provider-aws#50100 · 1 comment ·