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

SSM Parameter to hold Slack channel #2

Open
hlascelles opened this issue Jun 7, 2023 · 2 comments
Open

SSM Parameter to hold Slack channel #2

hlascelles opened this issue Jun 7, 2023 · 2 comments

Comments

@hlascelles
Copy link

We would like to hold the Slack webhook URL in a secure SSM parameter so it isn't in source control.

Looks like we can pass a value into Lambda using that:

const lambdaFunction = new lambda.Function(this, 'LogHandler', {
  environment: {
    SLACK_INCOMING_WEBHOOK_URL: ssmParameter.stringValue,
  },
});

Would you accept a PR for that if you agree?

@acomagu
Copy link
Member

acomagu commented Jun 28, 2023

Hi, I understand the needs to use SSM parameter and would be happy to see a PR!

I have a question: if we specify as you wrote, would the actual value be visible in the environment variables section of the Lambda console?(or masked?)

I don't have experience with SSM so I need to learn the best practice around that. Thank you!

@hlascelles
Copy link
Author

Ha, me neither! Reading this article it appears that using native "SSM->ENV" is not sufficient as it would mean anyone updating the stack would need access to the SSM (I think). I guess it should be done by reading the SSM "live" in the JS code.

As he says:

But, personally I still think you should:

fetch SSM parameter values at runtime
cache these values, and hot-swap when source values change

I will look at a PR when I get the chance 👍

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants